diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index b88025272d43f18fbea0c4bf397537517e31bb97..8b76fe5a0fb8cee1bbb0ce35a11a8a934fe1df8b 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -622,10 +622,6 @@ li.note { margin-right:5px; margin-top: 2px; @include border-radius(4px); - &.critical { - background: #EAA; - border:1px solid #B88; - } &.today{ background: #ADA; border:1px solid #8B8; @@ -664,14 +660,6 @@ li.note { } } - &.critical { - background: #FEE; - border-color:#ECC; - .icon { - background: #EAA; - border:1px solid #B88; - } - } &.today{ background: #EFE; border-color:#CEC; diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 35a30ca080787e146a0379cb74fe3b55b85ead49..e095c4dd510d8fb85c08d35d68f911f1bd6ecd34 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -140,7 +140,7 @@ class IssuesController < ApplicationController @issues = @issues.where(:assignee_id => params[:assignee_id]) if params[:assignee_id].present? @issues = @issues.where(:milestone_id => params[:milestone_id]) if params[:milestone_id].present? @issues = @issues.tagged_with(params[:label_name]) if params[:label_name].present? - @issues = @issues.includes(:author, :project).order("critical, updated_at") + @issues = @issues.includes(:author, :project).order("updated_at") @issues end end diff --git a/app/controllers/merge_requests_controller.rb b/app/controllers/merge_requests_controller.rb index b0d122b55dbb19f4d06588d95315ea789958db12..b8643dcec0290c599f286d5c953763375000dcd7 100644 --- a/app/controllers/merge_requests_controller.rb +++ b/app/controllers/merge_requests_controller.rb @@ -30,7 +30,7 @@ class MergeRequestsController < ApplicationController else @merge_requests.opened end.page(params[:page]).per(20) - @merge_requests = @merge_requests.includes(:author, :project).order("created_at desc") + @merge_requests = @merge_requests.includes(:author, :project).order("closed, created_at desc") end def show diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 148048a9698366e0a5edd12ffd1004590ac54a34..0982aaccc2e9db5613fd9c4927a3f86d2f025622 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -28,7 +28,6 @@ module IssuesHelper def issue_css_classes issue classes = "issue" - classes << " critical" if issue.critical classes << " closed" if issue.closed classes << " today" if issue.today? classes diff --git a/app/models/issue.rb b/app/models/issue.rb index c961bbe2eeebd53bb734e28f453aec945c28cabe..7f935900911f48a39d51ff18531dc371f8034dd2 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -33,9 +33,6 @@ class Issue < ActiveRecord::Base validates :description, :length => { :within => 0..2000 } - scope :critical, where(:critical => true) - scope :non_critical, where(:critical => false) - scope :opened, where(:closed => false) scope :closed, where(:closed => true) scope :assigned, lambda { |u| where(:assignee_id => u.id)} diff --git a/app/models/project.rb b/app/models/project.rb index 9a4da1973de20d4e46304847a2e4bcc67505f736..5611eb608f669498a9c5ff858b86b18f0422a60c 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -13,7 +13,7 @@ class Project < ActiveRecord::Base has_many :users, :through => :users_projects has_many :events, :dependent => :destroy has_many :merge_requests, :dependent => :destroy - has_many :issues, :dependent => :destroy, :order => "position" + has_many :issues, :dependent => :destroy, :order => "closed, position" has_many :milestones, :dependent => :destroy has_many :users_projects, :dependent => :destroy has_many :notes, :dependent => :destroy diff --git a/app/views/dashboard/issues.html.haml b/app/views/dashboard/issues.html.haml index c9cc048c6677f40375af5b49af05f3f6ed848bde..6f623b21a588ac49a522819ad1b133b6bc49c1d0 100644 --- a/app/views/dashboard/issues.html.haml +++ b/app/views/dashboard/issues.html.haml @@ -3,15 +3,6 @@ %small (assigned to you) %small.right #{@issues.total_count} issues -%br -.issues_legend - .list_legend - .icon.critical - .text Critical - - .list_legend - .icon.today - .text Today .clearfix - if @issues.any? - @issues.group_by(&:project).each do |group| diff --git a/app/views/issues/_form.html.haml b/app/views/issues/_form.html.haml index 94a621c2d262c0211968f645bc596ca6b751f422..4f6f839666187ac0196daafb02a5289b841ba4a3 100644 --- a/app/views/issues/_form.html.haml +++ b/app/views/issues/_form.html.haml @@ -9,37 +9,37 @@ .issue_form_box .issue_title .clearfix - = f.label :title, "Issue Subject *" + = f.label :title do + %strong= "Subject *" .input = f.text_field :title, :maxlength => 255, :class => "xxlarge" .issue_middle_block .issue_assignee - = f.label :assignee_id, "Assign to" - .input= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Assign to user" }) + = f.label :assignee_id do + %i.icon-user + Assign to + .input= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select a user" }) .issue_milestone - = f.label :milestone_id + = f.label :milestone_id do + %i.icon-time + Milestone .input= f.select(:milestone_id, @project.milestones.active.all.collect {|p| [ p.title, p.id ] }, { :include_blank => "Select milestone" }) .issue_description .clearfix - = f.label :critical, "Critical" - .input= f.check_box :critical + = f.label :label_list do + %i.icon-tag + Labels + .input + = f.text_field :label_list, :maxlength => 2000, :class => "xxlarge" + %p.hint Separate with comma. - - unless @issue.new_record? - .clearfix - = f.label :closed - .input= f.check_box :closed .clearfix - = f.label :description, "Issue Details" + = f.label :description, "Details" .input = f.text_area :description, :maxlength => 2000, :class => "xxlarge", :rows => 14 %p.hint Markdown is enabled. - .clearfix - = f.label :label_list, "Labels" - .input - = f.text_field :label_list, :maxlength => 2000, :class => "xxlarge" - %p.hint Separate with comma. .actions - if @issue.new_record? diff --git a/app/views/issues/_issues.html.haml b/app/views/issues/_issues.html.haml index e1d0be087135ca3332c83ed482c96f4a42d9316e..a20df176afc43ff287c6fe5983bce3d408ae1967 100644 --- a/app/views/issues/_issues.html.haml +++ b/app/views/issues/_issues.html.haml @@ -1,7 +1,4 @@ -- @issues.select(&:critical).each do |issue| - = render(:partial => 'issues/show', :locals => {:issue => issue}) - -- @issues.reject(&:critical).each do |issue| +- @issues.each do |issue| = render(:partial => 'issues/show', :locals => {:issue => issue}) - if @issues.present? diff --git a/app/views/issues/index.html.haml b/app/views/issues/index.html.haml index ebe432bc7a82714071ca734aa2b8446866244b15..e3480f6af44fb4ce95d2b090f5096455ae766a15 100644 --- a/app/views/issues/index.html.haml +++ b/app/views/issues/index.html.haml @@ -13,22 +13,7 @@ = hidden_field_tag :status, params[:f] = search_field_tag :issue_search, nil, { :placeholder => 'Search', :class => 'issue_search span3 right neib' } - %br - - .issues_legend - .list_legend - .icon.today - .text Today - - .list_legend - .icon.critical - .text Critical - - .list_legend - .icon.closed - .text Closed .clearfix - %div#issues-table-holder.ui-box .title .left diff --git a/db/migrate/20120627145613_remove_critical_from_issue.rb b/db/migrate/20120627145613_remove_critical_from_issue.rb new file mode 100644 index 0000000000000000000000000000000000000000..f8d0797197b745c12eb1ab2dbedc3e120d6b4de3 --- /dev/null +++ b/db/migrate/20120627145613_remove_critical_from_issue.rb @@ -0,0 +1,9 @@ +class RemoveCriticalFromIssue < ActiveRecord::Migration + def up + remove_column :issues, :critical + end + + def down + add_column :issues, :critical, :boolean, :null => true, :default => false + end +end diff --git a/db/schema.rb b/db/schema.rb index 59098d7ccc19087c8cf07530c9e125f39120faed..7ce89c6be8f45fcb2c8402ac9836e87b8bd5ef4d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20120413135904) do +ActiveRecord::Schema.define(:version => 20120627145613) do create_table "events", :force => true do |t| t.string "target_type" @@ -34,7 +34,6 @@ ActiveRecord::Schema.define(:version => 20120413135904) do t.datetime "updated_at", :null => false t.boolean "closed", :default => false, :null => false t.integer "position", :default => 0 - t.boolean "critical", :default => false, :null => false t.string "branch_name" t.text "description" t.integer "milestone_id"