Commit 0499759204449a78ead1950c06fbab4dacfa84f2

Authored by Dmitriy Zaporozhets
1 parent 31a9d653

issues & fixed layout

app/assets/stylesheets/projects.css.scss
... ... @@ -163,10 +163,6 @@ table.round-borders {
163 163 padding:20px;
164 164 }
165 165  
166   -//body {
167   - //background: #eaeaea;
168   -//}
169   -
170 166 a {
171 167 color: #111;
172 168 }
... ... @@ -232,43 +228,15 @@ input.ssh_project_url {
232 228 text-align:center;
233 229 }
234 230  
235   -.day-commits-table li.commit {
236   - cursor:pointer;
237   -
238   - &:hover {
239   - @include hover-color;
240   - }
241   -}
242   -
243   -/*
244   -#FFF6BF
245   -#FFD324
246   -*/
247   -#tree-slider tr.tree-item {
248   - cursor:pointer;
249   -
250   - &:hover {
251   - @include hover-color;
252   - td {
253   - @include hover-color;
254   - }
255   - }
256   -}
257 231 #projects-list .project {
258 232 height:50px;
259 233 }
260 234  
  235 +#tree-slider .tree-item,
261 236 #projects-list .project,
262 237 #snippets-table .snippet,
263 238 #issues-table .issue{
264 239 cursor:pointer;
265   -
266   - &:hover {
267   - @include hover-color;
268   - td {
269   - @include hover-color;
270   - }
271   - }
272 240 }
273 241  
274 242 .clear {
... ... @@ -563,6 +531,7 @@ input.ssh_project_url {
563 531 @include round-borders-all(4px);
564 532 padding:2px 4px;
565 533 border:none;
  534 + text-shadow:none;
566 535  
567 536 &.high {
568 537 background: #D12F19;
... ... @@ -687,6 +656,13 @@ table.highlighttable pre{
687 656 width:200px;
688 657 }
689 658  
  659 +.issues_filter {
  660 + margin-top:10px;
  661 + .left {
  662 + margin-right:15px;
  663 + }
  664 +}
  665 +
690 666 body.project-page #notes-list .note {padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;}
691 667 body.project-page #notes-list .note {padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;}
692 668 body.project-page #notes-list .note img{float: left; margin-right: 10px;}
... ...
app/controllers/application_controller.rb
... ... @@ -82,6 +82,12 @@ class ApplicationController < ActionController::Base
82 82 elsif params[:view_style] == "fluid"
83 83 cookies[:view_style] = ""
84 84 end
  85 +
  86 + @view_mode = if cookies[:view_style] == "collapsed"
  87 + :fixed
  88 + else
  89 + :fluid
  90 + end
85 91 end
86 92  
87 93 def respond_with_notes
... ...
app/views/issues/_show.html.haml
... ... @@ -4,10 +4,11 @@
4 4 = image_tag "move.png" , :class => [:handle, :left]
5 5 %td
6 6 = image_tag gravatar_icon(issue.assignee.email), :class => "left", :width => 40, :style => "padding:0 5px;"
7   - = truncate issue.assignee.name, :lenght => 20
  7 + = issue.assignee.name
8 8 %td ##{issue.id}
9 9 %td
10   - = truncate(html_escape(issue.title), :length => 60)
  10 + = truncate(html_escape(issue.title), :length => 200)
  11 + %br
11 12 %br
12 13 - if issue.critical
13 14 %span.tag.high critical
... ... @@ -27,7 +28,8 @@
27 28 - else
28 29 = check_box_tag "closed", 1, issue.closed, :disabled => true
29 30 %td
30   - - if can?(current_user, :admin_issue, @project) || issue.author == current_user
31   - = link_to 'Edit', edit_project_issue_path(@project, issue), :class => "lbutton positive", :remote => true
32   - - if can?(current_user, :admin_issue, @project) || issue.author == current_user
33   - = link_to 'Destroy', [@project, issue], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "lbutton delete-issue negative", :id => "destroy_issue_#{issue.id}"
  31 + - if @view_mode == :fluid
  32 + - if can?(current_user, :admin_issue, @project) || issue.author == current_user
  33 + = link_to 'Edit', edit_project_issue_path(@project, issue), :class => "lbutton positive", :remote => true
  34 + - if can?(current_user, :admin_issue, @project) || issue.author == current_user
  35 + = link_to 'Destroy', [@project, issue], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "lbutton delete-issue negative", :id => "destroy_issue_#{issue.id}"
... ...
app/views/issues/index.html.haml
... ... @@ -7,18 +7,18 @@
7 7 = hidden_field_tag :project_id, @project.id, { :id => 'project_id' }
8 8 = search_field_tag :issue_search, nil, { :placeholder => 'Search', :class => 'issue_search' }
9 9  
10   - .right
  10 + .right.issues_filter
11 11 = form_tag project_issues_path(@project), :method => :get do
12   - .span-2
  12 + .left
13 13 = radio_button_tag :f, 0, (params[:f] || "0") == "0", :onclick => "this.form.submit()", :id => "open_issues", :class => "status"
14 14 = label_tag "open_issues","Open"
15   - .span-2
  15 + .left
16 16 = radio_button_tag :f, 2, params[:f] == "2", :onclick => "this.form.submit()", :id => "closed_issues", :class => "status"
17 17 = label_tag "closed_issues","Closed"
18   - .span-2
  18 + .left
19 19 = radio_button_tag :f, 3, params[:f] == "3", :onclick => "this.form.submit()", :id => "my_issues", :class => "status"
20 20 = label_tag "my_issues","To Me"
21   - .span-2
  21 + .left
22 22 = radio_button_tag :f, 1, params[:f] == "1", :onclick => "this.form.submit()", :id => "all_issues", :class => "status"
23 23 = label_tag "all_issues","All"
24 24  
... ...
app/views/issues/show.html.haml
1 1 %h2
2   - = "Issue ##{@issue.id} - #{html_escape(@issue.title)}"
  2 + %strong
  3 + Issue
  4 + = "##{@issue.id}"
  5 + –
  6 + = html_escape(@issue.title)
3 7 .left.width-65p
4 8 .issue_notes= render "notes/notes"
5 9  
... ... @@ -9,14 +13,6 @@
9 13 .span-8
10 14 %table.round-borders
11 15 %tr
12   - %td Title:
13   - %td
14   - = truncate html_escape(@issue.title)
15   - %tr
16   - %td Project
17   - %td
18   - %strong= @issue.project.name
19   - %tr
20 16 %td Author:
21 17 %td
22 18 = image_tag gravatar_icon(@issue.author.email), :class => "left", :width => 40, :style => "padding:0 5px;"
... ... @@ -39,7 +35,7 @@
39 35 %tr
40 36 %td Closed?
41 37 %td
42   - - if can? current_user, :write_issue, @project
  38 + - if can? current_user, :write_issue, @issue
43 39 = form_for([@project, @issue]) do |f|
44 40 = f.check_box :closed, :onclick => "$(this).parent().submit();"
45 41 = hidden_field_tag :status_only, true
... ... @@ -47,8 +43,9 @@
47 43 = check_box_tag "closed", 1, @issue.closed, :disabled => true
48 44  
49 45  
50   - - if can?(current_user, :admin_issue, @issue)
  46 + - if can?(current_user, :write_issue, @issue)
51 47 .clear
52   - = link_to 'Edit', edit_project_issue_path(@project, @issue), :class => "lbutton positive", :remote => true
53   - .right= link_to 'Destroy', [@project, @issue], :confirm => 'Are you sure?', :method => :delete, :class => "lbutton delete-issue negative", :id => "destroy_issue_#{@issue.id}"
  48 + %br
  49 + = link_to 'Edit', edit_project_issue_path(@project, @issue), :class => "lbutton positive", :remote => true
  50 + .right= link_to 'Destroy', [@project, @issue], :confirm => 'Are you sure?', :method => :delete, :class => "lbutton delete-issue negative", :id => "destroy_issue_#{@issue.id}"
54 51 .clear
... ...
spec/requests/commits_notes_spec.rb
... ... @@ -12,7 +12,6 @@ describe "Issues" do
12 12 describe "add new note", :js => true do
13 13 before do
14 14 visit project_commit_path(project, commit)
15   - click_link "Comments" # notes tab
16 15 fill_in "note_note", :with => "I commented this commit"
17 16 click_button "Add note"
18 17 end
... ...