Commit a0a488ed authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Apply new design to files page

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 5313c388
...@@ -47,6 +47,7 @@ v 8.1.0 (unreleased) ...@@ -47,6 +47,7 @@ v 8.1.0 (unreleased)
- Persist filters when sorting on admin user page (Jerry Lukins) - Persist filters when sorting on admin user page (Jerry Lukins)
- Add spellcheck=false to certain input fields - Add spellcheck=false to certain input fields
- Invalidate stored service password if the endpoint URL is changed - Invalidate stored service password if the endpoint URL is changed
- Apply new design for Files page
v 8.0.4 v 8.0.4
- Fix Message-ID header to be RFC 2111-compliant to prevent e-mails being dropped (Stan Hu) - Fix Message-ID header to be RFC 2111-compliant to prevent e-mails being dropped (Stan Hu)
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
# #
# ### Example Markup # ### Example Markup
# #
# <div id="tree-content-holder"> # <div id="blob-content-holder">
# <div class="file-content"> # <div class="file-content">
# <div class="line-numbers"> # <div class="line-numbers">
# <a href="#L1" id="L1" data-line-number="1">1</a> # <a href="#L1" id="L1" data-line-number="1">1</a>
...@@ -53,7 +53,7 @@ class @LineHighlighter ...@@ -53,7 +53,7 @@ class @LineHighlighter
$.scrollTo("#L#{range[0]}", offset: -150) $.scrollTo("#L#{range[0]}", offset: -150)
bindEvents: -> bindEvents: ->
$('#tree-content-holder').on 'mousedown', 'a[data-line-number]', @clickHandler $('#blob-content-holder').on 'mousedown', 'a[data-line-number]', @clickHandler
# While it may seem odd to bind to the mousedown event and then throw away # While it may seem odd to bind to the mousedown event and then throw away
# the click event, there is a method to our madness. # the click event, there is a method to our madness.
...@@ -62,7 +62,7 @@ class @LineHighlighter ...@@ -62,7 +62,7 @@ class @LineHighlighter
# active state even when the event is cancelled, resulting in an ugly border # active state even when the event is cancelled, resulting in an ugly border
# around the link and/or a persisted underline text decoration. # around the link and/or a persisted underline text decoration.
$('#tree-content-holder').on 'click', 'a[data-line-number]', (event) -> $('#blob-content-holder').on 'click', 'a[data-line-number]', (event) ->
event.preventDefault() event.preventDefault()
clickHandler: (event) => clickHandler: (event) =>
......
...@@ -28,7 +28,7 @@ table { ...@@ -28,7 +28,7 @@ table {
border-bottom: 1px solid $border-color !important; border-bottom: 1px solid $border-color !important;
} }
td { td {
border-color: #F1F1F1 !important; border-color: $table-border-color !important;
border-bottom: 1px solid; border-bottom: 1px solid;
} }
} }
......
...@@ -156,3 +156,5 @@ $nav-link-padding: 13px $gl-padding; ...@@ -156,3 +156,5 @@ $nav-link-padding: 13px $gl-padding;
$pre-bg: #f8fafc !default; $pre-bg: #f8fafc !default;
$pre-color: $gl-gray !default; $pre-color: $gl-gray !default;
$pre-border-color: #e7e9ed; $pre-border-color: #e7e9ed;
$table-bg-accent: $background-color;
...@@ -16,6 +16,7 @@ $avatar_radius: 50%; ...@@ -16,6 +16,7 @@ $avatar_radius: 50%;
$code_font_size: 13px; $code_font_size: 13px;
$code_line_height: 1.5; $code_line_height: 1.5;
$border-color: #dce0e6; $border-color: #dce0e6;
$table-border-color: #eef0f2;
$background-color: #F7F8FA; $background-color: #F7F8FA;
$header-height: 58px; $header-height: 58px;
$fixed-layout-width: 1200px; $fixed-layout-width: 1200px;
......
.tree-holder { .tree-holder {
.tree-content-holder { .tree-table-holder {
float: left; margin-left: -$gl-padding;
width: 100%; margin-right: -$gl-padding;
} }
.tree_progress { .tree_progress {
...@@ -13,10 +13,15 @@ ...@@ -13,10 +13,15 @@
} }
.tree-table { .tree-table {
@extend .table; margin-bottom: 0;
@include border-radius(0);
tr { tr {
> td, > th {
padding: 10px $gl-padding;
line-height: 32px;
border-color: $table-border-color !important;
}
&:hover { &:hover {
td { td {
background: $hover; background: $hover;
...@@ -27,9 +32,9 @@ ...@@ -27,9 +32,9 @@
} }
&.selected { &.selected {
td { td {
background: $background-color; background: $gray-dark;
border-top: 1px solid #EEE; border-top: 1px solid $border-gray-dark;
border-bottom: 1px solid #EEE; border-bottom: 1px solid $border-gray-dark;
} }
} }
} }
...@@ -85,19 +90,6 @@ ...@@ -85,19 +90,6 @@
margin-right: 15px; margin-right: 15px;
} }
.readme-holder {
margin: 0 auto;
.readme-file-title {
font-size: 14px;
font-weight: bold;
margin-bottom: 20px;
color: #777;
border-bottom: 1px solid #DDD;
padding: 10px 0;
}
}
.blob-commit-info { .blob-commit-info {
list-style: none; list-style: none;
margin: 0; margin: 0;
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
- blob_commit = @repository.last_commit_for_path(@commit.id, blob.path) - blob_commit = @repository.last_commit_for_path(@commit.id, blob.path)
= render blob_commit, project: @project = render blob_commit, project: @project
%div#tree-content-holder.tree-content-holder %div#blob-content-holder.blob-content-holder
%article.file-holder %article.file-holder
.file-title .file-title
= blob_icon blob.mode, blob.name = blob_icon blob.mode, blob.name
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
- split_button = split_button || false - split_button = split_button || false
- if split_button == true - if split_button == true
%span.btn-group{class: btn_class} %span.btn-group{class: btn_class}
= link_to archive_namespace_project_repository_path(@project.namespace, @project, ref: ref, format: 'zip'), class: 'btn col-xs-10', rel: 'nofollow' do = link_to archive_namespace_project_repository_path(@project.namespace, @project, ref: ref, format: 'zip'), class: 'btn btn-success col-xs-10', rel: 'nofollow' do
%i.fa.fa-download %i.fa.fa-download
%span Download zip %span Download zip
%a.col-xs-2.btn.dropdown-toggle{ 'data-toggle' => 'dropdown' } %a.col-xs-2.btn.btn-success.dropdown-toggle{ 'data-toggle' => 'dropdown' }
%span.caret %span.caret
%span.sr-only %span.sr-only
Select Archive Format Select Archive Format
......
%article.readme-holder#README %article.file-holder.readme-holder#README
= link_to '#README' do .file-title
%h4.readme-file-title = link_to '#README' do
%i.fa.fa-file %strong
= readme.name %i.fa.fa-file
.wiki = readme.name
.file-content.wiki
= render_readme(readme) = render_readme(readme)
%ul.breadcrumb.repo-breadcrumb .gray-content-block
%li %ul.breadcrumb.repo-breadcrumb
= link_to namespace_project_tree_path(@project.namespace, @project, @ref) do
= @project.path
- tree_breadcrumbs(tree, 6) do |title, path|
%li %li
- if path = link_to namespace_project_tree_path(@project.namespace, @project, @ref) do
= link_to truncate(title, length: 40), namespace_project_tree_path(@project.namespace, @project, path) = @project.path
- else - tree_breadcrumbs(tree, 6) do |title, path|
= link_to title, '#' %li
- if allowed_tree_edit? - if path
%li = link_to truncate(title, length: 40), namespace_project_tree_path(@project.namespace, @project, path)
%span.dropdown - else
%a.dropdown-toggle.btn.btn-xs.add-to-tree{href: '#', "data-toggle" => "dropdown"} = link_to title, '#'
= icon('plus') - if allowed_tree_edit?
%ul.dropdown-menu %li
%li %span.dropdown
= link_to namespace_project_new_blob_path(@project.namespace, @project, @id), title: 'Create file', id: 'new-file-link' do %a.dropdown-toggle.btn.add-to-tree{href: '#', "data-toggle" => "dropdown"}
= icon('pencil fw') = icon('plus')
Create file %ul.dropdown-menu
%li %li
= link_to '#modal-upload-blob', { 'data-target' => '#modal-upload-blob', 'data-toggle' => 'modal'} do = link_to namespace_project_new_blob_path(@project.namespace, @project, @id), title: 'Create file', id: 'new-file-link' do
= icon('file fw') = icon('pencil fw')
Upload file Create file
%li.divider %li
%li = link_to '#modal-upload-blob', { 'data-target' => '#modal-upload-blob', 'data-toggle' => 'modal'} do
= link_to '#modal-create-new-dir', { 'data-target' => '#modal-create-new-dir', 'data-toggle' => 'modal'} do = icon('file fw')
= icon('folder fw') Upload file
New directory %li.divider
%li
= link_to '#modal-create-new-dir', { 'data-target' => '#modal-create-new-dir', 'data-toggle' => 'modal'} do
= icon('folder fw')
New directory
%div#tree-content-holder.tree-content-holder.prepend-top-20 %div#tree-content-holder.tree-content-holder
%table#tree-slider{class: "table_#{@hex_path} tree-table" } .tree-table-holder
%thead %table.table#tree-slider{class: "table_#{@hex_path} tree-table table-striped" }
%tr %thead
%th Name %tr
%th Last Update %th Name
%th.hidden-xs %th Last Update
.pull-left Last Commit %th.hidden-xs
.last-commit.hidden-sm.pull-left .pull-left Last Commit
&nbsp; .last-commit.hidden-sm.pull-left
%i.fa.fa-angle-right &nbsp;
&nbsp; %i.fa.fa-angle-right
%small.light &nbsp;
= link_to @commit.short_id, namespace_project_commit_path(@project.namespace, @project, @commit) %small.light
&ndash; = link_to @commit.short_id, namespace_project_commit_path(@project.namespace, @project, @commit)
= truncate(@commit.title, length: 50) &ndash;
= link_to 'History', namespace_project_commits_path(@project.namespace, @project, @id), class: 'pull-right' = truncate(@commit.title, length: 50)
= link_to 'History', namespace_project_commits_path(@project.namespace, @project, @id), class: 'pull-right'
- if @path.present? - if @path.present?
%tr.tree-item %tr.tree-item
%td.tree-item-file-name %td.tree-item-file-name
= link_to "..", namespace_project_tree_path(@project.namespace, @project, up_dir_path), class: 'prepend-left-10' = link_to "..", namespace_project_tree_path(@project.namespace, @project, up_dir_path), class: 'prepend-left-10'
%td %td
%td.hidden-xs %td.hidden-xs
= render_tree(tree) = render_tree(tree)
- if tree.readme - if tree.readme
= render "projects/tree/readme", readme: tree.readme = render "projects/tree/readme", readme: tree.readme
......
#tree-content-holder #blob-content-holder
.file-content .file-content
.line-numbers .line-numbers
- 1.upto(25) do |i| - 1.upto(25) do |i|
......
...@@ -39,7 +39,7 @@ describe 'LineHighlighter', -> ...@@ -39,7 +39,7 @@ describe 'LineHighlighter', ->
expect(spy).toHaveBeenPrevented() expect(spy).toHaveBeenPrevented()
it 'handles garbage input from the hash', -> it 'handles garbage input from the hash', ->
func = -> new LineHighlighter('#tree-content-holder') func = -> new LineHighlighter('#blob-content-holder')
expect(func).not.toThrow() expect(func).not.toThrow()
describe '#clickHandler', -> describe '#clickHandler', ->
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment