Commit e0da2c35 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'ui-improvements' into 'master'

Ui improvements

* fix project home page when activity set as default
* style commits, branches and tags pages to new style
* render flash message outside of content block
* style group pages

See merge request !1255
parents 954dd7ce 2b319895
...@@ -169,7 +169,7 @@ ...@@ -169,7 +169,7 @@
padding: 0px; padding: 0px;
list-style: none; list-style: none;
li { > li {
padding: 10px 0; padding: 10px 0;
border-bottom: 1px solid #EEE; border-bottom: 1px solid #EEE;
overflow: hidden; overflow: hidden;
......
...@@ -27,6 +27,11 @@ ...@@ -27,6 +27,11 @@
border-bottom: 1px solid #e7e9ed; border-bottom: 1px solid #e7e9ed;
color: $gl-gray; color: $gl-gray;
&.second-block {
margin-top: -1px;
margin-bottom: 0;
}
&.footer-block { &.footer-block {
margin-top: 0; margin-top: 0;
margin-bottom: -$gl-padding; margin-bottom: -$gl-padding;
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
/** COMMON CLASSES **/ /** COMMON CLASSES **/
.prepend-top-10 { margin-top:10px } .prepend-top-10 { margin-top:10px }
.prepend-top-default { margin-top: $gl-padding; }
.prepend-top-20 { margin-top:20px } .prepend-top-20 { margin-top:20px }
.prepend-left-10 { margin-left:10px } .prepend-left-10 { margin-left:10px }
.prepend-left-20 { margin-left:20px } .prepend-left-20 { margin-left:20px }
......
...@@ -105,7 +105,7 @@ ul.content-list { ...@@ -105,7 +105,7 @@ ul.content-list {
margin: 0; margin: 0;
padding: 0; padding: 0;
li { > li {
padding: $gl-padding; padding: $gl-padding;
border-color: #f1f2f4; border-color: #f1f2f4;
margin-left: -$gl-padding; margin-left: -$gl-padding;
......
...@@ -193,8 +193,9 @@ ul.nav.nav-projects-tabs { ...@@ -193,8 +193,9 @@ ul.nav.nav-projects-tabs {
.breadcrumb.repo-breadcrumb { .breadcrumb.repo-breadcrumb {
padding: 0; padding: 0;
line-height: 42px; line-height: 42px;
background: white; background: transparent;
border: none; border: none;
margin: 0;
> li + li:before { > li + li:before {
padding: 0 3px; padding: 0 3px;
...@@ -331,3 +332,9 @@ pre.light-well { ...@@ -331,3 +332,9 @@ pre.light-well {
padding: 10px 15px; padding: 10px 15px;
margin: 0; margin: 0;
} }
.project-show-activity {
.activity-filter-block {
margin-top: -1px;
}
}
...@@ -30,4 +30,13 @@ module GroupsHelper ...@@ -30,4 +30,13 @@ module GroupsHelper
image_path('no_group_avatar.png') image_path('no_group_avatar.png')
end end
end end
def group_title(group, name, url)
content_tag :span do
link_to(
simple_sanitize(group.name), group_path(group)
) + ' · '.html_safe +
link_to(simple_sanitize(name), url)
end
end
end end
- page_title "Issues" - page_title "Issues"
- header_title group_title(@group, "Issues", issues_group_path(@group))
= content_for :meta_tags do = content_for :meta_tags do
- if current_user - if current_user
= auto_discovery_link_tag(:atom, issues_group_url(@group, format: :atom, private_token: current_user.private_token), title: "#{@group.name} issues") = auto_discovery_link_tag(:atom, issues_group_url(@group, format: :atom, private_token: current_user.private_token), title: "#{@group.name} issues")
%h3.page-title
Issues
%p.light
Only issues from
%strong #{@group.name}
group are listed here.
- if current_user
To see all issues you should visit #{link_to 'dashboard', issues_dashboard_path} page.
%hr
.append-bottom-20 = render 'shared/issuable/filter', type: :issues
.gray-content-block.second-block
.pull-right .pull-right
- if current_user - if current_user
.hidden-xs.pull-left .hidden-xs.pull-left
= link_to issues_group_url(@group, format: :atom, private_token: current_user.private_token), class: 'btn' do = link_to issues_group_url(@group, format: :atom, private_token: current_user.private_token) do
%i.fa.fa-rss %i.fa.fa-rss
%div
Only issues from
%strong #{@group.name}
group are listed here.
- if current_user
To see all issues you should visit #{link_to 'dashboard', issues_dashboard_path} page.
= render 'shared/issuable/filter', type: :issues .prepend-top-default
= render 'shared/issues' = render 'shared/issues'
- page_title "Merge Requests" - page_title "Merge Requests"
%h3.page-title - header_title group_title(@group, "Merge Requests", merge_requests_group_path(@group))
Merge Requests
%p.light = render 'shared/issuable/filter', type: :merge_requests
.gray-content-block.second-block
%div
Only merge requests from Only merge requests from
%strong #{@group.name} %strong #{@group.name}
group are listed here. group are listed here.
- if current_user - if current_user
To see all merge requests you should visit #{link_to 'dashboard', merge_requests_dashboard_path} page. To see all merge requests you should visit #{link_to 'dashboard', merge_requests_dashboard_path} page.
%hr .prepend-top-default
.append-bottom-20 = render 'shared/merge_requests'
= render 'shared/issuable/filter', type: :merge_requests
= render 'shared/merge_requests'
- page_title "Milestones" - page_title "Milestones"
%h3.page-title - header_title group_title(@group, "Milestones", group_milestones_path(@group))
Milestones
%span.pull-right #{@group_milestones.count} milestones
%p.light = render 'shared/milestones_filter'
.gray-content-block
Only milestones from Only milestones from
%strong #{@group.name} %strong #{@group.name}
group are listed here. group are listed here.
%hr
= render 'shared/milestones_filter'
.milestones .milestones
.panel.panel-default %ul.content-list
%ul.well-list
- if @group_milestones.blank? - if @group_milestones.blank?
%li %li
.nothing-here-block No milestones to show .nothing-here-block No milestones to show
......
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
.username .username
= current_user.username = current_user.username
.content-wrapper .content-wrapper
= render "layouts/flash"
%div{ class: fluid_layout ? "container-fluid" : "container-fluid container-limited" } %div{ class: fluid_layout ? "container-fluid" : "container-fluid container-limited" }
.content .content
= render "layouts/flash"
.clearfix .clearfix
= yield = yield
- page_title @group.name - page_title @group.name
- header_title @group.name, group_path(@group) - unless @header_title
- header_title @group.name, group_path(@group)
- sidebar "group" unless sidebar - sidebar "group" unless sidebar
= render template: "layouts/application" = render template: "layouts/application"
= render 'projects/last_push' = render 'projects/last_push'
.gray-content-block .gray-content-block.activity-filter-block
- if current_user - if current_user
%ul.nav.nav-pills.event_filter.pull-right %ul.nav.nav-pills.event_filter.pull-right
%li %li
......
- commit = @repository.commit(branch.target) - commit = @repository.commit(branch.target)
%li(class="js-branch-#{branch.name}") %li(class="js-branch-#{branch.name}")
%h4 %div
= link_to namespace_project_tree_path(@project.namespace, @project, branch.name) do = link_to namespace_project_tree_path(@project.namespace, @project, branch.name) do
%strong.str-truncated= branch.name %strong.str-truncated= branch.name
 
- if branch.name == @repository.root_ref - if branch.name == @repository.root_ref
%span.label.label-info default %span.label.label-primary default
- elsif @repository.merged_to_root_ref? branch.name - elsif @repository.merged_to_root_ref? branch.name
%span.label.label-primary.has_tooltip(title="Merged into #{@repository.root_ref}") %span.label.label-info.has_tooltip(title="Merged into #{@repository.root_ref}")
%i.fa.fa-check
merged merged
- if @project.protected_branch? branch.name - if @project.protected_branch? branch.name
%span.label.label-success %span.label.label-success
%i.fa.fa-lock %i.fa.fa-lock
protected protected
.pull-right .controls.hidden-xs
- if create_mr_button?(@repository.root_ref, branch.name) - if create_mr_button?(@repository.root_ref, branch.name)
= link_to create_mr_path(@repository.root_ref, branch.name), class: 'btn btn-grouped btn-xs' do = link_to create_mr_path(@repository.root_ref, branch.name), class: 'btn btn-grouped btn-xs' do
= icon('plus') = icon('plus')
...@@ -30,8 +30,7 @@ ...@@ -30,8 +30,7 @@
= icon("trash-o") = icon("trash-o")
- if commit - if commit
%ul.list-unstyled = render 'projects/branches/commit', commit: commit, project: @project
= render 'projects/commits/inline_commit', commit: commit, project: @project
- else - else
%p %p
Cant find HEAD commit for this branch Cant find HEAD commit for this branch
.branch-commit.light
= link_to commit.short_id, namespace_project_commit_path(project.namespace, project, commit), class: "commit_short_id"
·
%span.str-truncated
= link_to_gfm commit.title, namespace_project_commit_path(project.namespace, project, commit.id), class: "commit-row-message"
·
#{time_ago_with_tooltip(commit.committed_date)}
- page_title "Branches" - page_title "Branches"
= render "projects/commits/head" = render "projects/commits/head"
%h3.page-title .gray-content-block
Branches
.pull-right .pull-right
- if can? current_user, :push_code, @project - if can? current_user, :push_code, @project
= link_to new_namespace_project_branch_path(@project.namespace, @project), class: 'btn btn-create' do = link_to new_namespace_project_branch_path(@project.namespace, @project), class: 'btn btn-create' do
...@@ -24,9 +23,10 @@ ...@@ -24,9 +23,10 @@
= sort_title_recently_updated = sort_title_recently_updated
= link_to namespace_project_branches_path(sort: 'last_updated') do = link_to namespace_project_branches_path(sort: 'last_updated') do
= sort_title_oldest_updated = sort_title_oldest_updated
%hr .oneline
Protected branches can be managed in project settings
- unless @branches.empty? - unless @branches.empty?
%ul.bordered-list.top-list.all-branches %ul.content-list.all-branches
- @branches.each do |branch| - @branches.each do |branch|
= render "projects/branches/branch", branch: branch = render "projects/branches/branch", branch: branch
= paginate @branches, theme: 'gitlab' = paginate @branches, theme: 'gitlab'
%ul.nav.nav-tabs %ul.center-top-menu
= nav_link(controller: [:commit, :commits]) do = nav_link(controller: [:commit, :commits]) do
= link_to namespace_project_commits_path(@project.namespace, @project, @ref || @repository.root_ref) do = link_to namespace_project_commits_path(@project.namespace, @project, @ref || @repository.root_ref) do
= icon("history")
Commits Commits
%span.badge= number_with_delimiter(@repository.commit_count) %span.badge= number_with_delimiter(@repository.commit_count)
= nav_link(controller: :compare) do = nav_link(controller: :compare) do
= link_to namespace_project_compare_index_path(@project.namespace, @project, from: @repository.root_ref, to: @ref || @repository.root_ref) do = link_to namespace_project_compare_index_path(@project.namespace, @project, from: @repository.root_ref, to: @ref || @repository.root_ref) do
= icon("exchange")
Compare Compare
= nav_link(html_options: {class: branches_tab_class}) do = nav_link(html_options: {class: branches_tab_class}) do
= link_to namespace_project_branches_path(@project.namespace, @project) do = link_to namespace_project_branches_path(@project.namespace, @project) do
= icon("code-fork")
Branches Branches
%span.badge.js-totalbranch-count= @repository.branches.size %span.badge.js-totalbranch-count= @repository.branches.size
= nav_link(controller: :tags) do = nav_link(controller: :tags) do
= link_to namespace_project_tags_path(@project.namespace, @project) do = link_to namespace_project_tags_path(@project.namespace, @project) do
= icon("tags")
Tags Tags
%span.badge.js-totaltags-count= @repository.tags.length %span.badge.js-totaltags-count= @repository.tags.length
...@@ -5,10 +5,11 @@ ...@@ -5,10 +5,11 @@
= render "head" = render "head"
.tree-ref-holder .gray-content-block
.tree-ref-holder
= render 'shared/ref_switcher', destination: 'commits' = render 'shared/ref_switcher', destination: 'commits'
.commits-feed-holder.hidden-xs.hidden-sm .commits-feed-holder.hidden-xs.hidden-sm
- if create_mr_button?(@repository.root_ref, @ref) - if create_mr_button?(@repository.root_ref, @ref)
= link_to create_mr_path(@repository.root_ref, @ref), class: 'btn btn-success' do = link_to create_mr_path(@repository.root_ref, @ref), class: 'btn btn-success' do
= icon('plus') = icon('plus')
...@@ -19,7 +20,7 @@ ...@@ -19,7 +20,7 @@
= icon("rss") = icon("rss")
%ul.breadcrumb.repo-breadcrumb %ul.breadcrumb.repo-breadcrumb
= commits_breadcrumbs = commits_breadcrumbs
%div{id: dom_id(@project)} %div{id: dom_id(@project)}
......
= form_tag namespace_project_compare_index_path(@project.namespace, @project), method: :post, class: 'form-inline js-requires-input' do = form_tag namespace_project_compare_index_path(@project.namespace, @project), method: :post, class: 'form-inline js-requires-input' do
.clearfix.append-bottom-20 .clearfix
- if params[:to] && params[:from] - if params[:to] && params[:from]
= link_to 'switch', {from: params[:to], to: params[:from]}, {class: 'commits-compare-switch has_tooltip', title: 'Switch base of comparison'} = link_to 'switch', {from: params[:to], to: params[:from]}, {class: 'commits-compare-switch has_tooltip', title: 'Switch base of comparison'}
.form-group .form-group
......
- page_title "Compare" - page_title "Compare"
= render "projects/commits/head" = render "projects/commits/head"
%h3.page-title .gray-content-block
Compare View
%p.slead
Compare branches, tags or commit ranges. Compare branches, tags or commit ranges.
%br %br
Fill input field with commit id like Fill input field with commit id like
...@@ -14,4 +12,5 @@ ...@@ -14,4 +12,5 @@
%br %br
Changes are shown <b>from</b> the version in the first field <b>to</b> the version in the second field. Changes are shown <b>from</b> the version in the first field <b>to</b> the version in the second field.
= render "form" .prepend-top-20
= render "form"
- page_title "#{params[:from]}...#{params[:to]}" - page_title "#{params[:from]}...#{params[:to]}"
= render "projects/commits/head" = render "projects/commits/head"
%h3.page-title
Compare View
= render "form" .gray-content-block
= render "form"
- if @commits.present? - if @commits.present?
.prepend-top-20
= render "projects/commits/commit_list" = render "projects/commits/commit_list"
= render "projects/diffs/diffs", diffs: @diffs, project: @project = render "projects/diffs/diffs", diffs: @diffs, project: @project
- else - else
.light-well .light-well.prepend-top-20
.center .center
%h4 %h4
There isn't anything to compare. There isn't anything to compare.
......
- page_title "Milestones" - page_title "Milestones"
.pull-right = render 'shared/milestones_filter'
.gray-content-block
.pull-right
- if can? current_user, :admin_milestone, @project - if can? current_user, :admin_milestone, @project
= link_to new_namespace_project_milestone_path(@project.namespace, @project), class: "pull-right btn btn-new", title: "New Milestone" do = link_to new_namespace_project_milestone_path(@project.namespace, @project), class: "pull-right btn btn-new", title: "New Milestone" do
%i.fa.fa-plus %i.fa.fa-plus
New Milestone New Milestone
= render 'shared/milestones_filter' .oneline
Milestone allows you to group issues and set due date for it
.milestones .milestones
.panel.panel-default %ul.content-list
%ul.well-list
= render @milestones = render @milestones
- if @milestones.blank? - if @milestones.blank?
......
...@@ -65,8 +65,10 @@ ...@@ -65,8 +65,10 @@
%section %section
- if prefer_readme? - if prefer_readme?
.project-show-readme
= render 'projects/readme' = render 'projects/readme'
- else - else
.project-show-activity
= render 'projects/activity' = render 'projects/activity'
......
- commit = @repository.commit(tag.target) - commit = @repository.commit(tag.target)
%li %li
%h4 %div
= link_to namespace_project_commits_path(@project.namespace, @project, tag.name), class: "" do = link_to namespace_project_commits_path(@project.namespace, @project, tag.name), class: "" do
%strong
%i.fa.fa-tag %i.fa.fa-tag
= tag.name = tag.name
- if tag.message.present? - if tag.message.present?
&nbsp; &nbsp;
= strip_gpg_signature(tag.message) = strip_gpg_signature(tag.message)
.pull-right .controls
- if can? current_user, :download_code, @project - if can? current_user, :download_code, @project
= render 'projects/repositories/download_archive', ref: tag.name, btn_class: 'btn-grouped btn-group-xs' = render 'projects/repositories/download_archive', ref: tag.name, btn_class: 'btn-grouped btn-group-xs'
- if can?(current_user, :admin_project, @project) - if can?(current_user, :admin_project, @project)
...@@ -15,8 +16,7 @@ ...@@ -15,8 +16,7 @@
%i.fa.fa-trash-o %i.fa.fa-trash-o
- if commit - if commit
%ul.list-unstyled = render 'projects/branches/commit', commit: commit, project: @project
= render 'projects/commits/inline_commit', commit: commit, project: @project
- else - else
%p %p
Cant find HEAD commit for this tag Cant find HEAD commit for this tag
- page_title "Tags" - page_title "Tags"
= render "projects/commits/head" = render "projects/commits/head"
%h3.page-title .gray-content-block
Git Tags
- if can? current_user, :push_code, @project - if can? current_user, :push_code, @project
.pull-right .pull-right
= link_to new_namespace_project_tag_path(@project.namespace, @project), class: 'btn btn-create new-tag-btn' do = link_to new_namespace_project_tag_path(@project.namespace, @project), class: 'btn btn-create new-tag-btn' do
%i.fa.fa-add-sign %i.fa.fa-add-sign
New tag New tag
.oneline
%p.light
Tags give the ability to mark specific points in history as being important Tags give the ability to mark specific points in history as being important
%hr
.tags .tags
- unless @tags.empty? - unless @tags.empty?
%ul.bordered-list %ul.content-list
- @tags.each do |tag| - @tags.each do |tag|
= render 'tag', tag: @repository.find_tag(tag) = render 'tag', tag: @repository.find_tag(tag)
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
%small %small
%i.fa.fa-plus %i.fa.fa-plus
%div#tree-content-holder.tree-content-holder %div#tree-content-holder.tree-content-holder.prepend-top-20
%table#tree-slider{class: "table_#{@hex_path} tree-table" } %table#tree-slider{class: "table_#{@hex_path} tree-table" }
%thead %thead
%tr %tr
......
...@@ -52,7 +52,6 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps ...@@ -52,7 +52,6 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
end end
step 'I see compared refs' do step 'I see compared refs' do
expect(page).to have_content "Compare View"
expect(page).to have_content "Commits (1)" expect(page).to have_content "Commits (1)"
expect(page).to have_content "Showing 2 changed files" expect(page).to have_content "Showing 2 changed files"
end end
......
...@@ -6,7 +6,7 @@ module SharedActiveTab ...@@ -6,7 +6,7 @@ module SharedActiveTab
end end
def ensure_active_sub_tab(content) def ensure_active_sub_tab(content)
expect(find('div.content ul.nav-tabs li.active')).to have_content(content) expect(find('div.content ul.center-top-menu li.active')).to have_content(content)
end end
def ensure_active_sub_nav(content) def ensure_active_sub_nav(content)
...@@ -18,7 +18,7 @@ module SharedActiveTab ...@@ -18,7 +18,7 @@ module SharedActiveTab
end end
step 'no other sub tabs should be active' do step 'no other sub tabs should be active' do
expect(page).to have_selector('div.content ul.nav-tabs li.active', count: 1) expect(page).to have_selector('div.content ul.center-top-menu li.active', count: 1)
end end
step 'no other sub navs should be active' do step 'no other sub navs should be active' do
......
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