BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
ebec90a0
Commit
ebec90a0
authored
Jun 29, 2017
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds back button.
parent
6190c39e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
13 deletions
+18
-13
repo_helper.js
app/assets/javascripts/repo/repo_helper.js
+2
-0
repo_prev_directory.js
app/assets/javascripts/repo/repo_prev_directory.js
+2
-2
repo_sidebar.js
app/assets/javascripts/repo/repo_sidebar.js
+8
-6
repo_store.js
app/assets/javascripts/repo/repo_store.js
+1
-0
_tree_content.html.haml
app/views/projects/tree/_tree_content.html.haml
+5
-5
No files found.
app/assets/javascripts/repo/repo_helper.js
View file @
ebec90a0
...
...
@@ -46,6 +46,7 @@ let RepoHelper = {
// it's a blob
const
parentURL
=
this
.
blobURLtoParent
(
Service
.
url
);
Store
.
blobRaw
=
data
.
plain
;
Store
.
prevURL
=
this
.
blobURLtoParent
(
parentURL
);
Service
.
getContent
(
parentURL
)
.
then
((
response
)
=>
{
Store
.
files
=
this
.
dataToListOfFiles
(
response
.
data
);
...
...
@@ -56,6 +57,7 @@ let RepoHelper = {
}
else
{
// it's a tree
Store
.
files
=
this
.
dataToListOfFiles
(
data
);
Store
.
prevURL
=
this
.
blobURLtoParent
(
Service
.
url
);
}
})
.
catch
((
response
)
=>
{
...
...
app/assets/javascripts/repo/repo_prev_directory.js
View file @
ebec90a0
...
...
@@ -2,17 +2,17 @@ let RepoPreviousDirectory = {
template
:
`
<tr>
<td colspan='3'>
<a
href='#' @click.prevent='linkClicked("prev"
)'>..</a>
<a
:href='prevurl' @click.prevent='linkClicked(prevurl
)'>..</a>
</td>
</tr>
`
,
props
:
{
name
:
'repo-previous-directory'
,
prevurl
:
String
},
methods
:
{
linkClicked
(
file
)
{
console
.
log
(
this
.
isTree
)
this
.
$emit
(
'linkclicked'
,
file
);
}
}
...
...
app/assets/javascripts/repo/repo_sidebar.js
View file @
ebec90a0
...
...
@@ -37,14 +37,16 @@ export default class RepoSidebar {
},
linkClicked
(
file
)
{
if
(
file
===
'prev'
){
let
url
=
''
;
if
(
typeof
file
===
'string'
){
// go back
url
=
file
;
}
else
{
Service
.
url
=
file
.
url
;
Helper
.
getContent
();
Helper
.
toURL
(
file
.
url
);
url
=
file
.
url
;
}
Service
.
url
=
url
;
Helper
.
getContent
();
Helper
.
toURL
(
url
);
}
},
});
...
...
app/assets/javascripts/repo/repo_store.js
View file @
ebec90a0
...
...
@@ -3,6 +3,7 @@ let RepoStore = {
editor
:
''
,
sidebar
:
''
,
isTree
:
false
,
prevURL
:
''
,
trees
:
[],
blobs
:
[],
submodules
:
[],
...
...
app/views/projects/tree/_tree_content.html.haml
View file @
ebec90a0
.tree-content-holder
%header
Project
#sidebar
.isworking
{
":class"
=>
"{'sidebar-mini' : !isTree}"
}
<
#sidebar
{
":class"
=>
"{'sidebar-mini' : !isTree}"
}
<
%table
.table
%thead
{
"v-if"
=>
"isTree"
}
%th
%th
{
"v-if"
=>
"isTree"
}
Name
%th
{
"v-else"
}
Project
%th
{
"v-if"
=>
"isTree"
}
Last
Commit
%th
{
"v-if"
=>
"isTree"
}
Last
Update
%tr
{
is:
"repo-previous-directory"
}
%tr
{
is:
"repo-previous-directory"
,
":prevurl"
=>
"prevURL"
,
"@linkclicked"
=>
"linkClicked"
}
%tr
{
is:
"repo-file"
,
"v-for"
=>
"file in files"
,
":key"
=>
"file.id"
,
":file"
=>
"file"
,
"@linkclicked"
=>
"linkClicked(file)"
,
":is-tree"
=>
"isTree"
}
#ide
{
data:
{
url:
repo_url
},
style:
"height:400px;"
}
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment