Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
39eaac5a
Commit
39eaac5a
authored
Jun 22, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '25102-files-view-button' into 'master'
File view buttons Closes #25102 See merge request !12111
parents
8cc9ab50
a8b16226
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
166 additions
and
108 deletions
+166
-108
app/assets/stylesheets/pages/projects.scss
app/assets/stylesheets/pages/projects.scss
+1
-1
app/assets/stylesheets/pages/tree.scss
app/assets/stylesheets/pages/tree.scss
+68
-17
app/views/projects/_find_file_link.html.haml
app/views/projects/_find_file_link.html.haml
+1
-1
app/views/projects/blob/_breadcrumb.html.haml
app/views/projects/blob/_breadcrumb.html.haml
+18
-17
app/views/projects/tree/_tree_header.html.haml
app/views/projects/tree/_tree_header.html.haml
+74
-72
changelogs/unreleased/25102-files-view-button.yml
changelogs/unreleased/25102-files-view-button.yml
+4
-0
No files found.
app/assets/stylesheets/pages/projects.scss
View file @
39eaac5a
...
@@ -380,7 +380,7 @@ a.deploy-project-label {
...
@@ -380,7 +380,7 @@ a.deploy-project-label {
padding
:
0
;
padding
:
0
;
background
:
transparent
;
background
:
transparent
;
border
:
none
;
border
:
none
;
line-height
:
3
6
px
;
line-height
:
3
4
px
;
margin
:
0
;
margin
:
0
;
>
li
+
li
:
:
before
{
>
li
+
li
:
:
before
{
...
...
app/assets/stylesheets/pages/tree.scss
View file @
39eaac5a
.tree-holder
{
.tree-holder
{
>
.nav-block
{
.nav-block
{
margin
:
11px
0
;
margin
:
10px
0
;
@media
(
min-width
:
$screen-sm-min
)
{
display
:
flex
;
.tree-ref-container
{
flex
:
1
;
}
.tree-controls
{
text-align
:
right
;
.btn-group
{
margin-left
:
10px
;
}
}
.tree-ref-holder
{
float
:
left
;
margin-right
:
15px
;
}
.repo-breadcrumb
{
li
:last-of-type
{
position
:
relative
;
}
}
.add-to-tree-dropdown
{
position
:
absolute
;
left
:
18px
;
}
}
}
@media
(
max-width
:
$screen-xs-max
)
{
.repo-breadcrumb
{
margin-top
:
10px
;
position
:
relative
;
.dropdown-menu
{
min-width
:
100%
;
width
:
100%
;
left
:
inherit
;
right
:
0
;
}
}
.add-to-tree-dropdown
{
position
:
absolute
;
left
:
0
;
right
:
0
;
}
.tree-controls
{
margin-bottom
:
10px
;
.btn
,
.dropdown
,
.btn-group
{
width
:
100%
;
}
.btn
{
margin
:
10px
0
0
;
}
}
}
}
.file-finder
{
.file-finder
{
...
@@ -131,11 +197,6 @@
...
@@ -131,11 +197,6 @@
}
}
}
}
.tree-ref-holder
{
float
:
left
;
margin-right
:
15px
;
}
.blob-commit-info
{
.blob-commit-info
{
list-style
:
none
;
list-style
:
none
;
margin
:
0
;
margin
:
0
;
...
@@ -159,16 +220,6 @@
...
@@ -159,16 +220,6 @@
color
:
$md-link-color
;
color
:
$md-link-color
;
}
}
.tree-controls
{
float
:
right
;
position
:
relative
;
z-index
:
2
;
.project-action-button
{
margin-left
:
$btn-side-margin
;
}
}
.repo-charts
{
.repo-charts
{
.sub-header
{
.sub-header
{
margin
:
20px
0
;
margin
:
20px
0
;
...
...
app/views/projects/_find_file_link.html.haml
View file @
39eaac5a
=
link_to
namespace_project_find_file_path
(
@project
.
namespace
,
@project
,
@ref
),
class:
'btn
btn-grouped
shortcuts-find-file'
,
rel:
'nofollow'
do
=
link_to
namespace_project_find_file_path
(
@project
.
namespace
,
@project
,
@ref
),
class:
'btn shortcuts-find-file'
,
rel:
'nofollow'
do
=
icon
(
'search'
)
=
icon
(
'search'
)
%span
=
_
(
'Find file'
)
%span
=
_
(
'Find file'
)
app/views/projects/blob/_breadcrumb.html.haml
View file @
39eaac5a
-
blame
=
local_assigns
.
fetch
(
:blame
,
false
)
-
blame
=
local_assigns
.
fetch
(
:blame
,
false
)
.nav-block
.nav-block
.tree-ref-container
.tree-ref-holder
=
render
'shared/ref_switcher'
,
destination:
'blob'
,
path:
@path
%ul
.breadcrumb.repo-breadcrumb
%li
=
link_to
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
@ref
)
do
=
@project
.
path
-
path_breadcrumbs
do
|
title
,
path
|
-
title
=
truncate
(
title
,
length:
40
)
%li
-
if
path
==
@path
=
link_to
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
tree_join
(
@ref
,
path
))
do
%strong
=
title
-
else
=
link_to
title
,
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
tree_join
(
@ref
,
path
))
.tree-controls
.tree-controls
=
render
'projects/find_file_link'
=
render
'projects/find_file_link'
.btn-group
.prepend-left-10
{
role:
"group"
}
<
.btn-group
{
role:
"group"
}
<
-# only show normal/blame view links for text files
-# only show normal/blame view links for text files
-
if
blob
.
readable_text?
-
if
blob
.
readable_text?
-
if
blame
-
if
blame
...
@@ -18,19 +35,3 @@
...
@@ -18,19 +35,3 @@
=
link_to
'Permalink'
,
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
=
link_to
'Permalink'
,
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
tree_join
(
@commit
.
sha
,
@path
)),
class:
'btn js-data-file-blob-permalink-url'
tree_join
(
@commit
.
sha
,
@path
)),
class:
'btn js-data-file-blob-permalink-url'
.tree-ref-holder
=
render
'shared/ref_switcher'
,
destination:
'blob'
,
path:
@path
%ul
.breadcrumb.repo-breadcrumb
%li
=
link_to
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
@ref
)
do
=
@project
.
path
-
path_breadcrumbs
do
|
title
,
path
|
-
title
=
truncate
(
title
,
length:
40
)
%li
-
if
path
==
@path
=
link_to
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
tree_join
(
@ref
,
path
))
do
%strong
=
title
-
else
=
link_to
title
,
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
tree_join
(
@ref
,
path
))
app/views/projects/tree/_tree_header.html.haml
View file @
39eaac5a
.tree-controls
.tree-ref-container
=
render
'projects/find_file_link'
.tree-ref-holder
=
render
'shared/ref_switcher'
,
destination:
'tree'
,
path:
@path
=
link_to
s_
(
'Commits|History'
),
namespace_project_commits_path
(
@project
.
namespace
,
@project
,
@id
),
class:
'btn btn-grouped'
=
render
'projects/buttons/download'
,
project:
@project
,
ref:
@ref
.tree-ref-holder
%ul
.breadcrumb.repo-breadcrumb
=
render
'shared/ref_switcher'
,
destination:
'tree'
,
path:
@path
%ul
.breadcrumb.repo-breadcrumb
%li
=
link_to
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
@ref
)
do
=
@project
.
path
-
path_breadcrumbs
do
|
title
,
path
|
%li
%li
=
link_to
truncate
(
title
,
length:
40
),
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
tree_join
(
@ref
,
path
))
=
link_to
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
@ref
)
do
=
@project
.
path
-
path_breadcrumbs
do
|
title
,
path
|
%li
=
link_to
truncate
(
title
,
length:
40
),
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
tree_join
(
@ref
,
path
))
-
if
current_user
-
if
current_user
%li
%li
-
if
!
on_top_of_branch?
-
if
!
on_top_of_branch?
%span
.btn.add-to-tree.disabled.has-tooltip
{
title:
_
(
"You can only add files when you are on a branch"
),
data:
{
container:
'body'
}
}
%span
.btn.add-to-tree.disabled.has-tooltip
{
title:
_
(
"You can only add files when you are on a branch"
),
data:
{
container:
'body'
}
}
=
icon
(
'plus'
)
-
else
%span
.dropdown
%a
.dropdown-toggle.btn.add-to-tree
{
href:
'#'
,
"data-toggle"
=>
"dropdown"
}
=
icon
(
'plus'
)
=
icon
(
'plus'
)
%ul
.dropdown-menu
-
else
-
if
can_edit_tree?
%span
.dropdown
%li
%a
.dropdown-toggle.btn.add-to-tree
{
href:
'#'
,
"data-toggle"
=>
"dropdown"
,
"data-target"
=>
".add-to-tree-dropdown"
}
=
link_to
namespace_project_new_blob_path
(
@project
.
namespace
,
@project
,
@id
)
do
=
icon
(
'plus'
)
=
icon
(
'pencil fw'
)
.add-to-tree-dropdown
#{
_
(
'New file'
)
}
%ul
.dropdown-menu
%li
-
if
can_edit_tree?
=
link_to
'#modal-upload-blob'
,
{
'data-target'
=>
'#modal-upload-blob'
,
'data-toggle'
=>
'modal'
}
do
%li
=
icon
(
'file fw'
)
=
link_to
namespace_project_new_blob_path
(
@project
.
namespace
,
@project
,
@id
)
do
#{
_
(
'Upload file'
)
}
=
icon
(
'pencil fw'
)
%li
#{
_
(
'New file'
)
}
=
link_to
'#modal-create-new-dir'
,
{
'data-target'
=>
'#modal-create-new-dir'
,
'data-toggle'
=>
'modal'
}
do
%li
=
icon
(
'folder fw'
)
=
link_to
'#modal-upload-blob'
,
{
'data-target'
=>
'#modal-upload-blob'
,
'data-toggle'
=>
'modal'
}
do
#{
_
(
'New directory'
)
}
=
icon
(
'file fw'
)
-
elsif
can?
(
current_user
,
:fork_project
,
@project
)
#{
_
(
'Upload file'
)
}
%li
%li
-
continue_params
=
{
to:
namespace_project_new_blob_path
(
@project
.
namespace
,
@project
,
@id
),
=
link_to
'#modal-create-new-dir'
,
{
'data-target'
=>
'#modal-create-new-dir'
,
'data-toggle'
=>
'modal'
}
do
notice:
edit_in_new_fork_notice
,
=
icon
(
'folder fw'
)
notice_now:
edit_in_new_fork_notice_now
}
#{
_
(
'New directory'
)
}
-
fork_path
=
namespace_project_forks_path
(
@project
.
namespace
,
@project
,
namespace_key:
current_user
.
namespace
.
id
,
-
elsif
can?
(
current_user
,
:fork_project
,
@project
)
continue:
continue_params
)
%li
=
link_to
fork_path
,
method: :post
do
-
continue_params
=
{
to:
namespace_project_new_blob_path
(
@project
.
namespace
,
@project
,
@id
),
=
icon
(
'pencil fw'
)
notice:
edit_in_new_fork_notice
,
#{
_
(
'New file'
)
}
notice_now:
edit_in_new_fork_notice_now
}
-
fork_path
=
namespace_project_forks_path
(
@project
.
namespace
,
@project
,
namespace_key:
current_user
.
namespace
.
id
,
continue:
continue_params
)
=
link_to
fork_path
,
method: :post
do
=
icon
(
'pencil fw'
)
#{
_
(
'New file'
)
}
%li
-
continue_params
=
{
to:
request
.
fullpath
,
notice:
edit_in_new_fork_notice
+
" Try to upload a file again."
,
notice_now:
edit_in_new_fork_notice_now
}
-
fork_path
=
namespace_project_forks_path
(
@project
.
namespace
,
@project
,
namespace_key:
current_user
.
namespace
.
id
,
continue:
continue_params
)
=
link_to
fork_path
,
method: :post
do
=
icon
(
'file fw'
)
#{
_
(
'Upload file'
)
}
%li
-
continue_params
=
{
to:
request
.
fullpath
,
notice:
edit_in_new_fork_notice
+
" Try to create a new directory again."
,
notice_now:
edit_in_new_fork_notice_now
}
-
fork_path
=
namespace_project_forks_path
(
@project
.
namespace
,
@project
,
namespace_key:
current_user
.
namespace
.
id
,
continue:
continue_params
)
=
link_to
fork_path
,
method: :post
do
=
icon
(
'folder fw'
)
#{
_
(
'New directory'
)
}
%li
.divider
%li
%li
-
continue_params
=
{
to:
request
.
fullpath
,
=
link_to
new_namespace_project_branch_path
(
@project
.
namespace
,
@project
)
do
notice:
edit_in_new_fork_notice
+
" Try to upload a file again."
,
=
icon
(
'code-fork fw'
)
notice_now:
edit_in_new_fork_notice_now
}
#{
_
(
'New branch'
)
}
-
fork_path
=
namespace_project_forks_path
(
@project
.
namespace
,
@project
,
namespace_key:
current_user
.
namespace
.
id
,
continue:
continue_params
)
=
link_to
fork_path
,
method: :post
do
=
icon
(
'file fw'
)
#{
_
(
'Upload file'
)
}
%li
%li
-
continue_params
=
{
to:
request
.
fullpath
,
=
link_to
new_namespace_project_tag_path
(
@project
.
namespace
,
@project
)
do
notice:
edit_in_new_fork_notice
+
" Try to create a new directory again."
,
=
icon
(
'tags fw'
)
notice_now:
edit_in_new_fork_notice_now
}
#{
_
(
'New tag'
)
}
-
fork_path
=
namespace_project_forks_path
(
@project
.
namespace
,
@project
,
namespace_key:
current_user
.
namespace
.
id
,
continue:
continue_params
)
.tree-controls
=
link_to
fork_path
,
method: :post
do
=
render
'projects/find_file_link'
=
icon
(
'folder fw'
)
#{
_
(
'New directory'
)
}
%li
.divider
=
link_to
s_
(
'Commits|History'
),
namespace_project_commits_path
(
@project
.
namespace
,
@project
,
@id
),
class:
'btn'
%li
=
link_to
new_namespace_project_branch_path
(
@project
.
namespace
,
@project
)
do
=
render
'projects/buttons/download'
,
project:
@project
,
ref:
@ref
=
icon
(
'code-fork fw'
)
#{
_
(
'New branch'
)
}
%li
=
link_to
new_namespace_project_tag_path
(
@project
.
namespace
,
@project
)
do
=
icon
(
'tags fw'
)
#{
_
(
'New tag'
)
}
changelogs/unreleased/25102-files-view-button.yml
0 → 100644
View file @
39eaac5a
---
title
:
Fix mobile view of files view buttons
merge_request
:
author
:
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