From f9528bfb86817efa4af6eaab464936abb3f44ecb Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 8 Jan 2013 08:14:05 +0300 Subject: [PATCH] a bit of restyling for issues and merge request lists --- app/assets/images/download.png | Bin 674 -> 0 bytes app/assets/stylesheets/common.scss | 32 +----- .../stylesheets/gitlab_bootstrap/buttons.scss | 4 + app/assets/stylesheets/sections/issues.scss | 2 +- .../stylesheets/sections/merge_requests.scss | 2 +- app/assets/stylesheets/sections/notes.scss | 2 +- app/views/issues/_filter.html.haml | 1 - app/views/issues/_issues.html.haml | 10 +- app/views/issues/_show.html.haml | 9 +- app/views/issues/show.html.haml | 2 +- app/views/merge_requests/_filter.html.haml | 20 ++++ app/views/merge_requests/index.html.haml | 54 ++++------ app/views/protected_branches/index.html.haml | 99 +++++++++--------- app/views/repositories/_branch.html.haml | 2 +- ...nches_head.html.haml => _filter.html.haml} | 7 +- app/views/repositories/branches.html.haml | 27 ++--- app/views/repositories/show.html.haml | 23 ++-- app/views/repositories/tags.html.haml | 2 +- app/views/tree/blob/_download.html.haml | 6 +- 19 files changed, 149 insertions(+), 155 deletions(-) delete mode 100644 app/assets/images/download.png create mode 100644 app/views/merge_requests/_filter.html.haml rename app/views/repositories/{_branches_head.html.haml => _filter.html.haml} (73%) diff --git a/app/assets/images/download.png b/app/assets/images/download.png deleted file mode 100644 index 5791e723de9063bc7f28764d14c987c2cd277188..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 674 zcmV;T0$u%yP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iyf3 z6$}*e?zEKv00JUOL_t(|+U=XcZNo4OMSltpq5*PfCx}lydjSFN2D#_b9x^~TaFGSt z4eAN%0vf<0I1{87p)i8jkz`SlZSs`BfWZGmQlt!TE|&||Y!6tutsX!&^x$wfV7J== z0P4E_|2<}>c1xa5QmD}7)$0J7o1F%hjTcLH!Oj3i&hJ5k@pf4<@$T7R; zmxO; zlaYGplSaT&#d8Xn09f+wa|GN2u=L#@1+WJ3oB|Ah0WbgtzyKHk17H9QV8u3gBXnxF zKL8$6bJ*bxbn^^6xkNw?pqcpwH(G~%3P_>OGl$Rt$h8i)8qkB#E>XNu5!8zmdeOO9 zE`|E_b_(dl@|i#=O~qRsgEN6pN})c;`Tz}~OjLYjE8eLQl0tnY2%(Zfy#(t7HR)6! ze7lOD)Cy||`ve-DBHAnc%K#8cb{P!CU~%UK@`0PzI*>RUWT1W-+ol@#iYBBV&J#5_-spHmv0C;&VTPYrd) zNqQ+d5kljm(TNIR!UWmrihri|FUYmH issue.id, class: "selected_issue", disabled: !can?(current_user, :modify_issue, issue) .right - - issue.labels.each do |label| - %span.label.label-tag.grouped - %i.icon-tag - = label.name - if issue.notes.any? %span.btn.small.disabled.grouped %i.icon-comment @@ -36,3 +32,8 @@ - if issue.votes_count > 0 = render 'votes/votes_inline', votable: issue + %span + - issue.labels.each do |label| + %span.label + %i.icon-tag + = label.name diff --git a/app/views/issues/show.html.haml b/app/views/issues/show.html.haml index 544817192ab..b96af36fcc0 100644 --- a/app/views/issues/show.html.haml +++ b/app/views/issues/show.html.haml @@ -44,7 +44,7 @@ .right - @issue.labels.each do |label| - %span + %span.label %i.icon-tag = label.name   diff --git a/app/views/merge_requests/_filter.html.haml b/app/views/merge_requests/_filter.html.haml new file mode 100644 index 00000000000..86148fbcfee --- /dev/null +++ b/app/views/merge_requests/_filter.html.haml @@ -0,0 +1,20 @@ += form_tag project_issues_path(@project), method: 'get' do + %fieldset + %ul.nav.nav-pills.nav-stacked + %li{class: ("active" if (params[:f] == 'open' || !params[:f]))} + = link_to project_merge_requests_path(@project, f: 'open', milestone_id: params[:milestone_id]) do + Open + %li{class: ("active" if params[:f] == "closed")} + = link_to project_merge_requests_path(@project, f: "closed", milestone_id: params[:milestone_id]) do + Closed + %li{class: ("active" if params[:f] == 'assigned-to-me')} + = link_to project_merge_requests_path(@project, f: 'assigned-to-me', milestone_id: params[:milestone_id]) do + Assigned To Me + %li{class: ("active" if params[:f] == 'all')} + = link_to project_merge_requests_path(@project, f: 'all', milestone_id: params[:milestone_id]) do + All + + %fieldset + %hr + = link_to "Reset", project_merge_requests_path(@project), class: 'btn right' + diff --git a/app/views/merge_requests/index.html.haml b/app/views/merge_requests/index.html.haml index c80c034e513..43651a5ca15 100644 --- a/app/views/merge_requests/index.html.haml +++ b/app/views/merge_requests/index.html.haml @@ -8,40 +8,28 @@ %br -.ui-box - .title - .left - %ul.nav.nav-pills - %li{class: ("active" if (params[:f] == 'open' || !params[:f]))} - = link_to project_merge_requests_path(@project, f: 'open', milestone_id: params[:milestone_id]) do - Open - %li{class: ("active" if params[:f] == "closed")} - = link_to project_merge_requests_path(@project, f: "closed", milestone_id: params[:milestone_id]) do - Closed - %li{class: ("active" if params[:f] == 'assigned-to-me')} - = link_to project_merge_requests_path(@project, f: 'assigned-to-me', milestone_id: params[:milestone_id]) do - To Me - %li{class: ("active" if params[:f] == 'all')} - = link_to project_merge_requests_path(@project, f: 'all', milestone_id: params[:milestone_id]) do - All - .right - = form_tag project_merge_requests_path(@project), id: "merge_requests_search_form", method: :get, class: :right do - = select_tag(:assignee_id, options_from_collection_for_select([unassigned_filter] + @project.users.all, "id", "name", params[:assignee_id]), prompt: "Assignee") - = select_tag(:milestone_id, options_from_collection_for_select([unassigned_filter] + @project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), prompt: "Milestone") - = hidden_field_tag :f, params[:f] - .clearfix +.row + .span3 + = render 'filter', entity: 'issue' + .span9 + .ui-box + .title + = form_tag project_merge_requests_path(@project), id: "merge_requests_search_form", method: :get, class: :left do + = select_tag(:assignee_id, options_from_collection_for_select([unassigned_filter] + @project.users.all, "id", "name", params[:assignee_id]), prompt: "Assignee") + = select_tag(:milestone_id, options_from_collection_for_select([unassigned_filter] + @project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), prompt: "Milestone") + = hidden_field_tag :f, params[:f] + .clearfix - %ul.well-list - = render @merge_requests - - if @merge_requests.blank? - %li - %h4.nothing_here_message Nothing to show here - - if @merge_requests.present? - %li.bottom - .row - .span7= paginate @merge_requests, theme: "gitlab" - .span4.right - %span.cgray.right #{@merge_requests.total_count} merge requests for this filter + %ul.well-list + = render @merge_requests + - if @merge_requests.blank? + %li + %h4.nothing_here_message Nothing to show here + - if @merge_requests.present? + %li.bottom + .left= paginate @merge_requests, theme: "gitlab" + .right + %span.cgray.right #{@merge_requests.total_count} merge requests for this filter :javascript $(merge_requestsPage); diff --git a/app/views/protected_branches/index.html.haml b/app/views/protected_branches/index.html.haml index 098f8d55bb3..c1ecceda435 100644 --- a/app/views/protected_branches/index.html.haml +++ b/app/views/protected_branches/index.html.haml @@ -1,51 +1,54 @@ -= render "repositories/branches_head" += render "commits/head" +.row + .span3 + = render "repositories/filter" + .span9 + .alert + %p Protected branches designed to prevent push for all except #{link_to "masters", help_permissions_path, class: "vlink"}. + %p This ability allows: + %ul + %li keep stable branches secured + %li forced code review before merge to protected branches + %p Read more about project permissions #{link_to "here", help_permissions_path, class: "vlink"} -.alert - %p Protected branches designed to prevent push for all except #{link_to "masters", help_permissions_path, class: "vlink"}. - %p This ability allows: - %ul - %li keep stable branches secured - %li forced code review before merge to protected branches - %p Read more about project permissions #{link_to "here", help_permissions_path, class: "vlink"} + - if can? current_user, :admin_project, @project + = form_for [@project, @protected_branch] do |f| + -if @protected_branch.errors.any? + .alert-message.block-message.error + %ul + - @protected_branch.errors.full_messages.each do |msg| + %li= msg -- if can? current_user, :admin_project, @project - = form_for [@project, @protected_branch] do |f| - -if @protected_branch.errors.any? - .alert-message.block-message.error - %ul - - @protected_branch.errors.full_messages.each do |msg| - %li= msg + .entry.clearfix + = f.label :name, "Branch" + .span3 + = f.select(:name, @project.open_branches.map { |br| [br.name, br.name] } , {include_blank: "Select branch"}, {class: "chosen span3"}) +   + = f.submit 'Protect', class: "primary btn" - .entry.clearfix - = f.label :name, "Branch" - .span3 - = f.select(:name, @project.open_branches.map { |br| [br.name, br.name] } , {include_blank: "Select branch"}, {class: "chosen span3"}) -   - = f.submit 'Protect', class: "primary btn" - -- unless @branches.empty? - %table - %thead - %tr - %th Name - %th Last commit - %th - %tbody - - @branches.each do |branch| - %tr - %td - = link_to project_commits_path(@project, branch.name) do - %strong= branch.name - - if @project.root_ref?(branch.name) - %span.label default - %td - - if branch.commit - = link_to project_commit_path(@project, branch.commit.id) do - = truncate branch.commit.id.to_s, length: 10 - = time_ago_in_words(branch.commit.committed_date) - ago - - else - (branch was removed from repository) - %td - - if can? current_user, :admin_project, @project - = link_to 'Unprotect', [@project, branch], confirm: 'Are you sure?', method: :delete, class: "danger btn small" + - unless @branches.empty? + %table + %thead + %tr + %th Name + %th Last commit + %th + %tbody + - @branches.each do |branch| + %tr + %td + = link_to project_commits_path(@project, branch.name) do + %strong= branch.name + - if @project.root_ref?(branch.name) + %span.label default + %td + - if branch.commit + = link_to project_commit_path(@project, branch.commit.id) do + = truncate branch.commit.id.to_s, length: 10 + = time_ago_in_words(branch.commit.committed_date) + ago + - else + (branch was removed from repository) + %td + - if can? current_user, :admin_project, @project + = link_to 'Unprotect', [@project, branch], confirm: 'Are you sure?', method: :delete, class: "danger btn small" diff --git a/app/views/repositories/_branch.html.haml b/app/views/repositories/_branch.html.haml index 74f742687b1..a6faa5fd633 100644 --- a/app/views/repositories/_branch.html.haml +++ b/app/views/repositories/_branch.html.haml @@ -22,6 +22,6 @@ %td - if can? current_user, :download_code, @project = link_to archive_project_repository_path(@project, ref: branch.name) do - %i.icon-download + %i.icon-download-alt Download diff --git a/app/views/repositories/_branches_head.html.haml b/app/views/repositories/_filter.html.haml similarity index 73% rename from app/views/repositories/_branches_head.html.haml rename to app/views/repositories/_filter.html.haml index 8f3e1ba3f81..e718d48190a 100644 --- a/app/views/repositories/_branches_head.html.haml +++ b/app/views/repositories/_filter.html.haml @@ -1,10 +1,9 @@ -= render "commits/head" -%ul.nav.nav-pills +%ul.nav.nav-pills.nav-stacked = nav_link(path: 'repositories#show') do = link_to 'Recent', project_repository_path(@project) = nav_link(path: 'protected_branches#index') do = link_to project_protected_branches_path(@project) do - %i.icon-lock Protected + %i.icon-lock = nav_link(path: 'repositories#branches') do - = link_to 'All', branches_project_repository_path(@project) + = link_to 'All branches', branches_project_repository_path(@project) diff --git a/app/views/repositories/branches.html.haml b/app/views/repositories/branches.html.haml index 4c246c69d7c..14b5082e44e 100644 --- a/app/views/repositories/branches.html.haml +++ b/app/views/repositories/branches.html.haml @@ -1,12 +1,15 @@ -= render "repositories/branches_head" -- unless @branches.empty? - %table - %thead - %tr - %th Name - %th Last commit - %th - - %tbody - - @branches.each do |branch| - = render "repositories/branch", branch: branch += render "commits/head" +.row + .span3 + = render "filter" + .span9 + - unless @branches.empty? + %table + %thead + %tr + %th Name + %th Last commit + %th + %tbody + - @branches.each do |branch| + = render "repositories/branch", branch: branch diff --git a/app/views/repositories/show.html.haml b/app/views/repositories/show.html.haml index fd0abac8414..e58e16f8bf1 100644 --- a/app/views/repositories/show.html.haml +++ b/app/views/repositories/show.html.haml @@ -1,11 +1,14 @@ -= render "branches_head" - -%table - %thead - %tr - %th Name - %th Last commit - %th - - @activities.each do |update| - = render "repositories/branch", branch: update.head += render "commits/head" +.row + .span3 + = render "filter" + .span9 + %table + %thead + %tr + %th Name + %th Last commit + %th + - @activities.each do |update| + = render "repositories/branch", branch: update.head diff --git a/app/views/repositories/tags.html.haml b/app/views/repositories/tags.html.haml index 8e52ad1b47d..d4b8bbe10d4 100644 --- a/app/views/repositories/tags.html.haml +++ b/app/views/repositories/tags.html.haml @@ -26,7 +26,7 @@ %td - if can? current_user, :download_code, @project = link_to archive_project_repository_path(@project, ref: tag.name) do - %i.icon-download + %i.icon-download-alt Download - else diff --git a/app/views/tree/blob/_download.html.haml b/app/views/tree/blob/_download.html.haml index c307622995b..864c209db76 100644 --- a/app/views/tree/blob/_download.html.haml +++ b/app/views/tree/blob/_download.html.haml @@ -2,7 +2,7 @@ %center = link_to project_blob_path(@project, @id) do %div.padded - %br - = image_tag "download.png", width: 64 - %h3 + %h4 + %i.icon-download-alt + %br Download (#{number_to_human_size blob.size})