Commit 1724f45f46dcf278abb76fe92ef2c8648f5ea21f

Authored by Dmitriy Zaporozhets
1 parent de05a598

Remove unused styles. Restyled Issues a bit

app/assets/javascripts/issues.js
@@ -11,7 +11,7 @@ function initIssuesSearch() { @@ -11,7 +11,7 @@ function initIssuesSearch() {
11 last_terms = terms; 11 last_terms = terms;
12 12
13 if (terms.length >= 2 || terms.length == 0) { 13 if (terms.length >= 2 || terms.length == 0) {
14 - $.get(href, { 'f': status, 'terms': terms, 'milestone_id': milestone_id }, function(response) { 14 + $.get(href, { 'status': status, 'terms': terms, 'milestone_id': milestone_id }, function(response) {
15 $('#issues-table').html(response); 15 $('#issues-table').html(response);
16 }); 16 });
17 } 17 }
app/assets/stylesheets/gitlab_bootstrap/common.scss
@@ -17,20 +17,42 @@ @@ -17,20 +17,42 @@
17 .padded { padding:20px } 17 .padded { padding:20px }
18 .ipadded { padding:20px!important } 18 .ipadded { padding:20px!important }
19 .lborder { border-left:1px solid #eee } 19 .lborder { border-left:1px solid #eee }
20 -.no-padding { padding:0 !important; }  
21 -.underlined { border-bottom: 1px solid #CCC; }  
22 -.no-borders { border: none; }  
23 -.vlink { color: $link_color !important; }  
24 .underlined_link { text-decoration: underline; } 20 .underlined_link { text-decoration: underline; }
25 -.borders { border: 1px solid #ccc; @include shade; }  
26 .hint { font-style: italic; color: #999; } 21 .hint { font-style: italic; color: #999; }
27 .light { color: #888 } 22 .light { color: #888 }
28 .tiny { font-weight: normal } 23 .tiny { font-weight: normal }
29 24
30 /** PILLS & TABS**/ 25 /** PILLS & TABS**/
31 -.nav-pills a:hover { background-color: #888; }  
32 -.nav-pills .active a { background-color: $style_color; } 26 +.nav-pills {
  27 + .active a {
  28 + }
  29 +
  30 + > li > a {
  31 + @include border-radius(0);
  32 + }
  33 + &.nav-stacked {
  34 + > li > a {
  35 + border-left: 4px solid #EEE;
  36 + padding: 12px;
  37 + }
  38 + > .active > a {
  39 + border-color: #29B;
  40 + border-radius: 0;
  41 + background: #F1F1F1;
  42 + color: $style_color;
  43 + font-weight: bold;
  44 + }
  45 + }
  46 +}
  47 +
33 .nav-pills > .active > a > i[class^="icon-"] { background: inherit; } 48 .nav-pills > .active > a > i[class^="icon-"] { background: inherit; }
  49 +
  50 +
  51 +
  52 +/**
  53 + * nav-tabs
  54 + *
  55 + */
34 .nav-tabs > li > a, .nav-pills > li > a { color: $style_color; } 56 .nav-tabs > li > a, .nav-pills > li > a { color: $style_color; }
35 .nav.nav-tabs { 57 .nav.nav-tabs {
36 li { 58 li {
app/assets/stylesheets/sections/issues.scss
@@ -54,10 +54,11 @@ input.check_all_issues { @@ -54,10 +54,11 @@ input.check_all_issues {
54 } 54 }
55 } 55 }
56 56
57 -@media (min-width: 800px) { .issues_filters select { width: 160px; } }  
58 -@media (min-width: 1000px) { .issues_filters select { width: 200px; } } 57 +@media (min-width: 800px) { .issues_filters select { width: 160px; } }
59 @media (min-width: 1200px) { .issues_filters select { width: 220px; } } 58 @media (min-width: 1200px) { .issues_filters select { width: 220px; } }
60 59
  60 +@media (min-width: 800px) { .issues_bulk_update select { width: 120px; } }
  61 +@media (min-width: 1200px) { .issues_bulk_update select { width: 160px; } }
61 62
62 #issues-table-holder { 63 #issues-table-holder {
63 .issues_filters { 64 .issues_filters {
@@ -68,6 +69,7 @@ input.check_all_issues { @@ -68,6 +69,7 @@ input.check_all_issues {
68 form { 69 form {
69 float:left; 70 float:left;
70 } 71 }
  72 +
71 .update_selected_issues { 73 .update_selected_issues {
72 position: relative; 74 position: relative;
73 top:5px; 75 top:5px;
app/contexts/issues_list_context.rb
@@ -4,7 +4,7 @@ class IssuesListContext < BaseContext @@ -4,7 +4,7 @@ class IssuesListContext < BaseContext
4 attr_accessor :issues 4 attr_accessor :issues
5 5
6 def execute 6 def execute
7 - @issues = case params[:f] 7 + @issues = case params[:status]
8 when issues_filter[:all] then @project.issues 8 when issues_filter[:all] then @project.issues
9 when issues_filter[:closed] then @project.issues.closed 9 when issues_filter[:closed] then @project.issues.closed
10 when issues_filter[:to_me] then @project.issues.opened.assigned(current_user) 10 when issues_filter[:to_me] then @project.issues.opened.assigned(current_user)
app/views/issues/_filter.html.haml 0 → 100644
@@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
  1 += form_tag project_issues_path(@project), method: 'get' do
  2 + %fieldset
  3 + %legend Status:
  4 + %ul.nav.nav-pills.nav-stacked
  5 + %li{class: ("active" if !params[:status])}
  6 + = link_to project_issues_path(@project, status: nil) do
  7 + Open
  8 + %li{class: ("active" if params[:status] == 'to_me')}
  9 + = link_to project_issues_path(@project, status: 'to_me') do
  10 + Assigned To Me
  11 + %li{class: ("active" if params[:status] == 'closed')}
  12 + = link_to project_issues_path(@project, status: 'closed') do
  13 + Closed
  14 + %li{class: ("active" if params[:status] == 'all')}
  15 + = link_to project_issues_path(@project, status: 'all') do
  16 + All
  17 +
  18 + %fieldset
  19 + %hr
  20 + = link_to "Reset", project_issues_path(@project), class: 'btn right'
  21 +
app/views/issues/index.html.haml
@@ -2,61 +2,47 @@ @@ -2,61 +2,47 @@
2 .issues_content 2 .issues_content
3 %h3.page_title 3 %h3.page_title
4 Issues 4 Issues
5 - %small (<span class=issue_counter>#{@issues.total_count}</span>) 5 + %span (<span class=issue_counter>#{@issues.total_count}</span>)
6 .right 6 .right
7 .span5 7 .span5
8 - if can? current_user, :write_issue, @project 8 - if can? current_user, :write_issue, @project
9 - = link_to new_project_issue_path(@project, issue: { assignee_id: params[:assignee_id], milestone_id: params[:milestone_id]}), class: "right btn", title: "New Issue", id: "new_issue_link" do 9 + = link_to new_project_issue_path(@project, issue: { assignee_id: params[:assignee_id], milestone_id: params[:milestone_id]}), class: "right btn primary", title: "New Issue", id: "new_issue_link" do
10 %i.icon-plus 10 %i.icon-plus
11 New Issue 11 New Issue
12 = form_tag search_project_issues_path(@project), method: :get, remote: true, id: "issue_search_form", class: :right do 12 = form_tag search_project_issues_path(@project), method: :get, remote: true, id: "issue_search_form", class: :right do
13 = hidden_field_tag :project_id, @project.id, { id: 'project_id' } 13 = hidden_field_tag :project_id, @project.id, { id: 'project_id' }
14 - = hidden_field_tag :status, params[:f] 14 + = hidden_field_tag :status, params[:status]
15 = search_field_tag :issue_search, nil, { placeholder: 'Search', class: 'issue_search span3 right neib search-text-input' } 15 = search_field_tag :issue_search, nil, { placeholder: 'Search', class: 'issue_search span3 right neib search-text-input' }
16 16
17 .clearfix 17 .clearfix
18 18
19 - %div#issues-table-holder.ui-box  
20 - .title  
21 - = check_box_tag "check_all_issues", nil, false, class: "check_all_issues left"  
22 -  
23 -  
24 - .issues_bulk_update.hide  
25 - = form_tag bulk_update_project_issues_path(@project), method: :post do  
26 - %span.update_issues_text Update selected issues with &nbsp;  
27 - .left  
28 - = select_tag('update[status]', options_for_select(['open', 'closed']), prompt: "Status")  
29 - = select_tag('update[assignee_id]', options_from_collection_for_select(@project.users.all, "id", "name", params[:assignee_id]), prompt: "Assignee")  
30 - = select_tag('update[milestone_id]', options_from_collection_for_select(issues_active_milestones, "id", "title", params[:milestone_id]), prompt: "Milestone")  
31 - = hidden_field_tag 'update[issues_ids]', []  
32 - = hidden_field_tag :f, params[:f]  
33 - = button_tag "Save", class: "btn update_selected_issues btn-small save-btn"  
34 - .issues_filters  
35 - .left  
36 - %ul.nav.nav-pills.left  
37 - %li{class: ("active" if (params[:f] == issues_filter[:open] || !params[:f]))}  
38 - = link_to project_issues_path(@project, f: issues_filter[:open], milestone_id: params[:milestone_id]) do  
39 - Open  
40 - %li{class: ("active" if params[:f] == issues_filter[:closed])}  
41 - = link_to project_issues_path(@project, f: issues_filter[:closed], milestone_id: params[:milestone_id]) do  
42 - Closed  
43 - %li{class: ("active" if params[:f] == issues_filter[:to_me])}  
44 - = link_to project_issues_path(@project, f: issues_filter[:to_me], milestone_id: params[:milestone_id]) do  
45 - To Me  
46 - %li{class: ("active" if params[:f] == issues_filter[:all])}  
47 - = link_to project_issues_path(@project, f: issues_filter[:all], milestone_id: params[:milestone_id]) do  
48 - All  
49 -  
50 - .right  
51 - = form_tag project_issues_path(@project), method: :get, class: :right do  
52 - = select_tag(:label_name, options_for_select(issue_tags, params[:label_name]), prompt: "Labels")  
53 - = select_tag(:assignee_id, options_from_collection_for_select([unassigned_filter] + @project.users.all, "id", "name", params[:assignee_id]), prompt: "Assignee")  
54 - = select_tag(:milestone_id, options_from_collection_for_select([unassigned_filter] + issues_active_milestones, "id", "title", params[:milestone_id]), prompt: "Milestone")  
55 - = hidden_field_tag :f, params[:f] 19 +.row
  20 + .span3
  21 + = render 'filter', entity: 'issue'
  22 + .span9
  23 + %div#issues-table-holder.ui-box
  24 + .title
  25 + = check_box_tag "check_all_issues", nil, false, class: "check_all_issues left"
56 .clearfix 26 .clearfix
  27 + .issues_bulk_update.hide
  28 + = form_tag bulk_update_project_issues_path(@project), method: :post do
  29 + %span.update_issues_text Update selected issues with &nbsp;
  30 + .left
  31 + = select_tag('update[status]', options_for_select(['open', 'closed']), prompt: "Status")
  32 + = select_tag('update[assignee_id]', options_from_collection_for_select(@project.users.all, "id", "name", params[:assignee_id]), prompt: "Assignee")
  33 + = select_tag('update[milestone_id]', options_from_collection_for_select(issues_active_milestones, "id", "title", params[:milestone_id]), prompt: "Milestone")
  34 + = hidden_field_tag 'update[issues_ids]', []
  35 + = hidden_field_tag :status, params[:status]
  36 + = button_tag "Save", class: "btn update_selected_issues btn-small save-btn"
  37 + .issues_filters
  38 + = form_tag project_issues_path(@project), method: :get do
  39 + = select_tag(:label_name, options_for_select(issue_tags, params[:label_name]), prompt: "Labels")
  40 + = select_tag(:assignee_id, options_from_collection_for_select([unassigned_filter] + @project.users.all, "id", "name", params[:assignee_id]), prompt: "Assignee")
  41 + = select_tag(:milestone_id, options_from_collection_for_select([unassigned_filter] + issues_active_milestones, "id", "title", params[:milestone_id]), prompt: "Milestone")
  42 + = hidden_field_tag :status, params[:status]
57 43
58 - %ul#issues-table.well-list.issues_table  
59 - = render "issues" 44 + %ul#issues-table.well-list.issues_table
  45 + = render "issues"
60 46
61 :javascript 47 :javascript
62 $(function(){ 48 $(function(){
app/views/merge_requests/index.html.haml
  1 +- if can? current_user, :write_issue, @project
  2 + = link_to new_project_merge_request_path(@project), class: "right btn primary", title: "New Merge Request" do
  3 + %i.icon-plus
  4 + New Merge Request
1 %h3.page_title 5 %h3.page_title
2 Merge Requests 6 Merge Requests
3 - - if can? current_user, :write_issue, @project  
4 - = link_to new_project_merge_request_path(@project), class: "right btn", title: "New Merge Request" do  
5 - New Merge Request  
6 7
7 %br 8 %br
8 9