From 664afebbe9e62f13074c999d84674a0e37fa8cc2 Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Date: Fri, 3 Jun 2016 09:53:04 -0600 Subject: Start styling sub nav --- app/assets/stylesheets/framework/nav.scss | 21 ++++++++++++ app/views/projects/commits/_head.html.haml | 39 +++++++++++----------- app/views/projects/commits/show.html.haml | 53 ++++++++++++++++-------------- app/views/projects/tree/show.html.haml | 19 ++++++----- 4 files changed, 80 insertions(+), 52 deletions(-) diff --git a/app/assets/stylesheets/framework/nav.scss b/app/assets/stylesheets/framework/nav.scss index 7eb7a8e4544..6d44ee6c269 100644 --- a/app/assets/stylesheets/framework/nav.scss +++ b/app/assets/stylesheets/framework/nav.scss @@ -67,6 +67,27 @@ color: #78a; } } + + &.sub-nav { + background-color: $background-color; + + .container-fluid { + background-color: $background-color; + } + + li { + + a { + margin: 0; + padding: 11px 10px 9px; + } + + &.active a { + border-bottom: none; + color: $link-underline-blue; + } + } + } } .top-area { diff --git a/app/views/projects/commits/_head.html.haml b/app/views/projects/commits/_head.html.haml index 1c136133ab0..73af27a8a37 100644 --- a/app/views/projects/commits/_head.html.haml +++ b/app/views/projects/commits/_head.html.haml @@ -1,24 +1,25 @@ -%ul.nav-links - = nav_link(controller: %w(tree blob blame edit_tree new_tree find_file)) do - = link_to project_files_path(@project) do - Files +%ul.nav-links.sub-nav + %div{ class: (container_class) } + = nav_link(controller: %w(tree blob blame edit_tree new_tree find_file)) do + = link_to project_files_path(@project) do + Files - = nav_link(controller: [:commit, :commits]) do - = link_to namespace_project_commits_path(@project.namespace, @project, current_ref) do - Commits + = nav_link(controller: [:commit, :commits]) do + = link_to namespace_project_commits_path(@project.namespace, @project, current_ref) do + Commits - = nav_link(controller: %w(network)) do - = link_to namespace_project_network_path(@project.namespace, @project, current_ref) do - Network + = nav_link(controller: %w(network)) do + = link_to namespace_project_network_path(@project.namespace, @project, current_ref) do + Network - = nav_link(controller: :compare) do - = link_to namespace_project_compare_index_path(@project.namespace, @project, from: @repository.root_ref, to: current_ref) do - Compare + = nav_link(controller: :compare) do + = link_to namespace_project_compare_index_path(@project.namespace, @project, from: @repository.root_ref, to: current_ref) do + Compare - = nav_link(html_options: {class: branches_tab_class}) do - = link_to namespace_project_branches_path(@project.namespace, @project) do - Branches + = nav_link(html_options: {class: branches_tab_class}) do + = link_to namespace_project_branches_path(@project.namespace, @project) do + Branches - = nav_link(controller: [:tags, :releases]) do - = link_to namespace_project_tags_path(@project.namespace, @project) do - Tags + = nav_link(controller: [:tags, :releases]) do + = link_to namespace_project_tags_path(@project.namespace, @project) do + Tags diff --git a/app/views/projects/commits/show.html.haml b/app/views/projects/commits/show.html.haml index 2c21923ed4f..288a912f409 100644 --- a/app/views/projects/commits/show.html.haml +++ b/app/views/projects/commits/show.html.haml @@ -1,3 +1,5 @@ +- @no_container = true + - page_title "Commits", @ref = content_for :meta_tags do - if current_user @@ -5,37 +7,38 @@ = render "head" -.row-content-block.second-block - .tree-ref-holder - = render 'shared/ref_switcher', destination: 'commits' +%div{ class: (container_class) } + .row-content-block.second-block + .tree-ref-holder + = render 'shared/ref_switcher', destination: 'commits' + + .block-controls.hidden-xs.hidden-sm + - if @merge_request.present? + .control + = link_to "View Open Merge Request", namespace_project_merge_request_path(@project.namespace, @project, @merge_request), class: 'btn' + - elsif create_mr_button?(@repository.root_ref, @ref) + .control + = link_to create_mr_path(@repository.root_ref, @ref), class: 'btn btn-success' do + = icon('plus') + Create Merge Request - .block-controls.hidden-xs.hidden-sm - - if @merge_request.present? - .control - = link_to "View Open Merge Request", namespace_project_merge_request_path(@project.namespace, @project, @merge_request), class: 'btn' - - elsif create_mr_button?(@repository.root_ref, @ref) .control - = link_to create_mr_path(@repository.root_ref, @ref), class: 'btn btn-success' do - = icon('plus') - Create Merge Request + = form_tag(namespace_project_commits_path(@project.namespace, @project, @id), method: :get, class: 'pull-left commits-search-form') do + = search_field_tag :search, params[:search], { placeholder: 'Filter by commit message', id: 'commits-search', class: 'form-control search-text-input', spellcheck: false } - .control - = form_tag(namespace_project_commits_path(@project.namespace, @project, @id), method: :get, class: 'pull-left commits-search-form') do - = search_field_tag :search, params[:search], { placeholder: 'Filter by commit message', id: 'commits-search', class: 'form-control search-text-input', spellcheck: false } - - - if current_user && current_user.private_token - .control - = link_to namespace_project_commits_path(@project.namespace, @project, @ref, {format: :atom, private_token: current_user.private_token}), title: "Commits Feed", class: 'btn' do - = icon("rss") + - if current_user && current_user.private_token + .control + = link_to namespace_project_commits_path(@project.namespace, @project, @ref, {format: :atom, private_token: current_user.private_token}), title: "Commits Feed", class: 'btn' do + = icon("rss") - %ul.breadcrumb.repo-breadcrumb - = commits_breadcrumbs + %ul.breadcrumb.repo-breadcrumb + = commits_breadcrumbs -%div{id: dom_id(@project)} - #commits-list.content_list= render "commits", project: @project -.clear -= spinner + %div{id: dom_id(@project)} + #commits-list.content_list= render "commits", project: @project + .clear + = spinner :javascript CommitsList.init(#{@limit}); diff --git a/app/views/projects/tree/show.html.haml b/app/views/projects/tree/show.html.haml index 59f60c4687c..2abcfcdd7b2 100644 --- a/app/views/projects/tree/show.html.haml +++ b/app/views/projects/tree/show.html.haml @@ -1,3 +1,5 @@ +- @no_container = true + - page_title @path.presence || "Files", @ref = content_for :meta_tags do - if current_user @@ -5,13 +7,14 @@ = render 'projects/last_push' = render "projects/commits/head" -.tree-controls - = render 'projects/find_file_link' - - if can? current_user, :download_code, @project - = render 'projects/repositories/download_archive', ref: @ref, btn_class: 'hidden-xs hidden-sm btn-grouped', split_button: true +%div{ class: (container_class) } + .tree-controls + = render 'projects/find_file_link' + - if can? current_user, :download_code, @project + = render 'projects/repositories/download_archive', ref: @ref, btn_class: 'hidden-xs hidden-sm btn-grouped', split_button: true -#tree-holder.tree-holder.clearfix - .nav-block - = render 'projects/tree/tree_header', tree: @tree + #tree-holder.tree-holder.clearfix + .nav-block + = render 'projects/tree/tree_header', tree: @tree - = render 'projects/tree/tree_content', tree: @tree + = render 'projects/tree/tree_content', tree: @tree -- cgit v1.2.1