Commit 8652cd89897e324b9cb0974a61ff045e68d5c97e

Authored by Dmitriy Zaporozhets
1 parent b1d89f73

Preparing 591 for merge. Restyled issues & merge requests. Fixed issue edit.

app/assets/stylesheets/common.scss
@@ -294,13 +294,7 @@ nav.main_menu { @@ -294,13 +294,7 @@ nav.main_menu {
294 @include shade; 294 @include shade;
295 .count { 295 .count {
296 margin-left:3px; 296 margin-left:3px;
297 - color: #332;  
298 - background: white;  
299 - padding: 1px 6px 2px;  
300 - font-weight: bold;  
301 - -webkit-border-radius: 9px;  
302 - -moz-border-radius: 9px;  
303 - border-radius: 9px; 297 + color: #aaa;
304 } 298 }
305 .label { 299 .label {
306 background:$hover; 300 background:$hover;
@@ -351,8 +345,8 @@ nav.main_menu { @@ -351,8 +345,8 @@ nav.main_menu {
351 345
352 img.avatar { 346 img.avatar {
353 float:left; 347 float:left;
354 - margin-right:10px;  
355 - width:35px; 348 + margin-right:15px;
  349 + width:40px;
356 -webkit-border-radius: 4px; 350 -webkit-border-radius: 4px;
357 -moz-border-radius: 4px; 351 -moz-border-radius: 4px;
358 border-radius: 4px; 352 border-radius: 4px;
@@ -378,7 +372,7 @@ img.lil_av { @@ -378,7 +372,7 @@ img.lil_av {
378 372
379 .wll { 373 .wll {
380 background-color: #FFF; 374 background-color: #FFF;
381 - padding: 6px 10px; 375 + padding: 10px 5px;
382 min-height: 20px; 376 min-height: 20px;
383 border-bottom: 1px solid #eee; 377 border-bottom: 1px solid #eee;
384 border-bottom: 1px solid rgba(0, 0, 0, 0.05); 378 border-bottom: 1px solid rgba(0, 0, 0, 0.05);
@@ -1004,21 +998,8 @@ p.time { @@ -1004,21 +998,8 @@ p.time {
1004 margin: 2px; 998 margin: 2px;
1005 } 999 }
1006 1000
1007 -/* Issues Changed */  
1008 -/* Could probably rewrite this, a bit sloppy */  
1009 -.well {  
1010 - .issue_status.span2 {  
1011 - width:116px;  
1012 -  
1013 - .alert-message {  
1014 - width:34px;  
1015 - margin: 0 0 0 auto;  
1016 -  
1017 - .error {  
1018 - width: 40px;  
1019 - }  
1020 - }  
1021 - } 1001 +/* Fix for readme code (stopped it from being yellow) */
  1002 +.readme {
1022 pre { 1003 pre {
1023 background: white !important; 1004 background: white !important;
1024 1005
@@ -1028,8 +1009,13 @@ p.time { @@ -1028,8 +1009,13 @@ p.time {
1028 } 1009 }
1029 } 1010 }
1030 1011
1031 -/* Fix for readme code (stopped it from being yellow) */  
1032 -.readme { 1012 +.issue_box,
  1013 +.merge_request_box{
  1014 + @extend .padded;
  1015 + @extend .borders;
  1016 + @extend .prepend-top-20;
  1017 + @extend .append-bottom-20;
  1018 +
1033 pre { 1019 pre {
1034 background: white !important; 1020 background: white !important;
1035 1021
@@ -1089,7 +1075,7 @@ p.time { @@ -1089,7 +1075,7 @@ p.time {
1089 } 1075 }
1090 } 1076 }
1091 1077
1092 -.issue_notes { 1078 +.new_note {
1093 .input-file { 1079 .input-file {
1094 font: 500px monospace; 1080 font: 500px monospace;
1095 opacity:0; 1081 opacity:0;
@@ -1135,4 +1121,4 @@ li.note { @@ -1135,4 +1121,4 @@ li.note {
1135 background:url("icon-attachment.png") no-repeat left center; 1121 background:url("icon-attachment.png") no-repeat left center;
1136 } 1122 }
1137 } 1123 }
1138 -}  
1139 \ No newline at end of file 1124 \ No newline at end of file
  1125 +}
app/assets/stylesheets/tree.scss
@@ -175,5 +175,6 @@ @@ -175,5 +175,6 @@
175 float: left; 175 float: left;
176 position: relative; 176 position: relative;
177 left: -10px; 177 left: -10px;
  178 + padding:0;
178 } 179 }
179 } 180 }
app/controllers/issues_controller.rb
@@ -80,7 +80,13 @@ class IssuesController < ApplicationController @@ -80,7 +80,13 @@ class IssuesController < ApplicationController
80 80
81 respond_to do |format| 81 respond_to do |format|
82 format.js 82 format.js
83 - format.html { redirect_to [@project, @issue]} 83 + format.html do
  84 + if @issue.valid?
  85 + redirect_to [@project, @issue]
  86 + else
  87 + render :edit
  88 + end
  89 + end
84 end 90 end
85 end 91 end
86 92
app/models/issue.rb
@@ -26,7 +26,6 @@ class Issue < ActiveRecord::Base @@ -26,7 +26,6 @@ class Issue < ActiveRecord::Base
26 :length => { :within => 0..255 } 26 :length => { :within => 0..255 }
27 27
28 validates :description, 28 validates :description,
29 - :presence => true,  
30 :length => { :within => 0..2000 } 29 :length => { :within => 0..2000 }
31 30
32 scope :critical, where(:critical => true) 31 scope :critical, where(:critical => true)
app/views/issues/_form.html.haml
@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
10 10
11 .clearfix 11 .clearfix
12 = f.label :title, "Issue Subject" 12 = f.label :title, "Issue Subject"
13 - .input= f.text_field :title, :maxlength => 255 13 + .input= f.text_field :title, :maxlength => 255, :class => "xxlarge"
14 14
15 .clearfix 15 .clearfix
16 = f.label :description, "Issue Details" 16 = f.label :description, "Issue Details"
app/views/issues/show.html.haml
1 -.back_link  
2 -= link_to project_issues_path(@project) do  
3 - ← To issues list  
4 -  
5 %h3 1 %h3
6 - #{@issue.title} 2 + Issue ##{@issue.id}
7 %small 3 %small
8 created at 4 created at
9 = @issue.created_at.stamp("Aug 21, 2011") 5 = @issue.created_at.stamp("Aug 21, 2011")
@@ -22,32 +18,35 @@ @@ -22,32 +18,35 @@
22 - if @issue.upvotes > 0 18 - if @issue.upvotes > 0
23 .upvotes#upvotes= "+#{pluralize @issue.upvotes, 'upvote'}" 19 .upvotes#upvotes= "+#{pluralize @issue.upvotes, 'upvote'}"
24 20
  21 +.back_link
  22 + = link_to project_issues_path(@project) do
  23 + ← To issues list
25 24
26 -%hr  
27 -  
28 -  
29 -%div.well  
30 - %div.row  
31 - %div.issue_meta.span13  
32 - %cite.cgray Created by  
33 - = image_tag gravatar_icon(@issue.author_email), :width => 16, :class => "lil_av"  
34 - %strong.author= link_to_issue_author(@issue)  
35 -  
36 - %cite.cgray and currently assigned to  
37 - = image_tag gravatar_icon(@issue.assignee_email), :width => 16, :class => "lil_av"  
38 - %strong.author= link_to_issue_assignee(@issue)  
39 -  
40 - %div.issue_status.span2 25 +.issue_box
  26 + .merge_request_status_holder
  27 + %h5
41 - if @issue.closed 28 - if @issue.closed
42 - .alert-message.error Closed 29 + .alert-message.error.status_info Closed
43 - else 30 - else
44 - .alert-message.success Open 31 + .alert-message.success.status_info Open
  32 + = @issue.title
45 33
46 %hr 34 %hr
47 -  
48 %div 35 %div
49 - - if @project.description.present?  
50 - = markdown @issue.description 36 + %div.row
  37 + %div.issue_meta.span13
  38 + %cite.cgray Created by
  39 + = image_tag gravatar_icon(@issue.author_email), :width => 16, :class => "lil_av"
  40 + %strong.author= link_to_issue_author(@issue)
  41 +
  42 + %cite.cgray and currently assigned to
  43 + = image_tag gravatar_icon(@issue.assignee_email), :width => 16, :class => "lil_av"
  44 + %strong.author= link_to_issue_assignee(@issue)
  45 +
  46 + %div
  47 + - if @issue.description
  48 + %hr
  49 + = markdown @issue.description
51 50
52 51
53 .issue_notes#notes= render "notes/notes", :tid => @issue.id, :tt => "issue" 52 .issue_notes#notes= render "notes/notes", :tid => @issue.id, :tt => "issue"
app/views/merge_requests/show.html.haml
@@ -16,50 +16,49 @@ @@ -16,50 +16,49 @@
16 = link_to edit_project_merge_request_path(@project, @merge_request), :class => "btn" do 16 = link_to edit_project_merge_request_path(@project, @merge_request), :class => "btn" do
17 Edit 17 Edit
18 18
  19 + %br
  20 + %small= link_to "Show how to merge", "#", :class => "vlink how_to_merge_link", :title => "How To Merge"
19 %br 21 %br
20 - if @merge_request.upvotes > 0 22 - if @merge_request.upvotes > 0
21 .upvotes#upvotes= "+#{pluralize @merge_request.upvotes, 'upvote'}" 23 .upvotes#upvotes= "+#{pluralize @merge_request.upvotes, 'upvote'}"
22 24
  25 += render "merge_requests/how_to_merge"
23 .back_link 26 .back_link
24 = link_to project_merge_requests_path(@project) do 27 = link_to project_merge_requests_path(@project) do
25 ← To merge requests 28 ← To merge requests
26 29
27 30
28 -%hr  
29 -.merge_request_status_holder  
30 - - if @merge_request.closed  
31 - %h5  
32 - .alert-message.error.status_info Closed  
33 - - if @merge_request.merged?  
34 - %span  
35 - Merged by #{@merge_request.merge_event.author_name}  
36 - %small #{time_ago_in_words(@merge_request.merge_event.created_at)} ago.  
37 - - elsif @merge_request.closed_event  
38 - %span  
39 - Closed by #{@merge_request.closed_event.author_name}  
40 - %small #{time_ago_in_words(@merge_request.closed_event.created_at)} ago.  
41 - %br  
42 - - else  
43 - %h5  
44 - .alert-message.success.status_info Open  
45 - = link_to "How to merge", "#", :class => "vlink how_to_merge_link", :title => "How To Merge" 31 +.merge_request_box
  32 + .merge_request_status_holder
  33 + - if @merge_request.closed
  34 + %h5
  35 + .alert-message.error.status_info Closed
  36 + - if @merge_request.merged?
  37 + %span
  38 + Merged by #{@merge_request.merge_event.author_name}
  39 + %small #{time_ago_in_words(@merge_request.merge_event.created_at)} ago.
  40 + - elsif @merge_request.closed_event
  41 + %span
  42 + Closed by #{@merge_request.closed_event.author_name}
  43 + %small #{time_ago_in_words(@merge_request.closed_event.created_at)} ago.
  44 + %br
  45 + - else
  46 + %h5
  47 + .alert-message.success.status_info Open
  48 + = @merge_request.title
46 49
47 -= render "merge_requests/how_to_merge"  
48 50
49 -%div.well.prettyprint  
50 %div 51 %div
51 - %cite.cgray Created by  
52 - = image_tag gravatar_icon(@merge_request.author_email), :width => 16, :class => "lil_av"  
53 - %strong.author= link_to_merge_request_author(@merge_request)  
54 -  
55 - %cite.cgray and currently assigned to  
56 - = image_tag gravatar_icon(@merge_request.assignee_email), :width => 16, :class => "lil_av"  
57 - %strong.author= link_to_merge_request_assignee(@merge_request) 52 + %div
  53 + %cite.cgray Created by
  54 + = image_tag gravatar_icon(@merge_request.author_email), :width => 16, :class => "lil_av"
  55 + %strong.author= link_to_merge_request_author(@merge_request)
  56 +
  57 + %cite.cgray and currently assigned to
  58 + = image_tag gravatar_icon(@merge_request.assignee_email), :width => 16, :class => "lil_av"
  59 + %strong.author= link_to_merge_request_assignee(@merge_request)
58 60
59 - %hr  
60 -  
61 61
62 - %div= simple_format @merge_request.title  
63 62
64 = render "merge_requests/commits" 63 = render "merge_requests/commits"
65 64
app/views/notes/_form.html.haml
@@ -25,9 +25,9 @@ @@ -25,9 +25,9 @@
25 .span8 25 .span8
26 %h5 Attachment: 26 %h5 Attachment:
27 .clearfix 27 .clearfix
28 - .attachments.breadcrumb 28 + .attachments.entry
29 %div.file_name File name... 29 %div.file_name File name...
30 - %button.file_upload.btn.primary Upload File 30 + %button.file_upload.btn.primary.small Upload File
31 .input= f.file_field :attachment, :class => "input-file" 31 .input= f.file_field :attachment, :class => "input-file"
32 %span Any file less then 10 MB 32 %span Any file less then 10 MB
33 33
@@ -27,7 +27,6 @@ ActiveRecord::Schema.define(:version => 20120323221339) do @@ -27,7 +27,6 @@ ActiveRecord::Schema.define(:version => 20120323221339) do
27 27
28 create_table "issues", :force => true do |t| 28 create_table "issues", :force => true do |t|
29 t.string "title" 29 t.string "title"
30 - t.text "description"  
31 t.integer "assignee_id" 30 t.integer "assignee_id"
32 t.integer "author_id" 31 t.integer "author_id"
33 t.integer "project_id" 32 t.integer "project_id"
@@ -37,6 +36,7 @@ ActiveRecord::Schema.define(:version => 20120323221339) do @@ -37,6 +36,7 @@ ActiveRecord::Schema.define(:version => 20120323221339) do
37 t.integer "position", :default => 0 36 t.integer "position", :default => 0
38 t.boolean "critical", :default => false, :null => false 37 t.boolean "critical", :default => false, :null => false
39 t.string "branch_name" 38 t.string "branch_name"
  39 + t.text "description"
40 end 40 end
41 41
42 add_index "issues", ["project_id"], :name => "index_issues_on_project_id" 42 add_index "issues", ["project_id"], :name => "index_issues_on_project_id"