diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index d6750d3a9dfb506f900a3ef69509e29ea2ca3321..33a1f3427eea5adc70d48d0b6689bb0af0f58d08 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -114,9 +114,17 @@ a:focus { margin-top:10px; } +.prepend-top-20 { + margin-top:20px; +} + .padded { padding:20px; } + +.ipadded { + padding:20px !important; +} .no-borders { border:none; } @@ -861,14 +869,7 @@ p.time { border:none; &:hover { background:none; - - h4 { - color:#2FA0BB; - .arrow { - background:#2FA0BB; - color:#fff; - } - } + h4 { color:#2FA0BB; } } h4 { diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index f6b09e2343051ca948ab95d19c056a13887b414f..da75465ea32c534b4fbb4334d580ef83e7c055b7 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -13,6 +13,7 @@ class DashboardController < ApplicationController @issues = @issues.includes(:author, :project) @events = Event.where(:project_id => @projects.map(&:id)).recent.limit(20) + @last_push = Event.where(:project_id => @projects.map(&:id)).recent.code_push.limit(1).first end # Get authored or assigned open merge requests diff --git a/app/models/event.rb b/app/models/event.rb index c8af9363133342b27a047027d30ee666a59d8cfb..adc558b6d3af75727c91522e3bf73fa925a362c2 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -15,6 +15,7 @@ class Event < ActiveRecord::Base serialize :data scope :recent, order("created_at DESC") + scope :code_push, where(:action => Pushed) def self.determine_action(record) if [Issue, MergeRequest].include? record.class diff --git a/app/views/dashboard/_projects_feed.html.haml b/app/views/dashboard/_projects_feed.html.haml index 611541478412b7e2a4611ee42dc65c9fcf31ac84..e3f61e66ae8cd4adda7133030dba9422e1e642e7 100644 --- a/app/views/dashboard/_projects_feed.html.haml +++ b/app/views/dashboard/_projects_feed.html.haml @@ -3,7 +3,7 @@ = link_to project do %h4 %span.ico.project - = project.name + = truncate project.name, :length => 30 %small last activity at = project.last_activity_date.stamp("Aug 25, 2011") diff --git a/app/views/dashboard/index.html.haml b/app/views/dashboard/index.html.haml index b20fafca75c6991eba8de8a43d476c556b6eb4f2..39b05d0c6ead23752c171dd5b018e7f80700d6d7 100644 --- a/app/views/dashboard/index.html.haml +++ b/app/views/dashboard/index.html.haml @@ -20,17 +20,26 @@ .row .dashboard_block .row - .span10= render "dashboard/projects_feed", :projects => @active_projects - .span4.right - - if current_user.can_create_project? - .alert-message.block-message.warning - You can create up to - = current_user.projects_limit - projects. Click on link below to add a new one - .link_holder - = link_to new_project_path, :class => "" do - New Project » - + .span4 + %div.prettyprint.ipadded + %h1 + = pluralize current_user.projects.count, "project", "projects" + - if current_user.can_create_project? + %hr + %div + You can create up to + = current_user.projects_limit + projects. Click on button below to add a new one + .link_holder + %br + = link_to new_project_path, :class => "btn" do + New Project » + .span10.right= render "dashboard/projects_feed", :projects => @active_projects + - if @last_push + .ui-box.padded.prepend-top-20 + %h5 + %small Latest push was to the #{@last_push.branch_name} branch of #{@last_push.project.name}: + %ul.unstyled= render @last_push - if @merge_requests.any? %div.dashboard_category diff --git a/app/views/issues/_show.html.haml b/app/views/issues/_show.html.haml index 78d50340cb703bc6dc4b6e6e1bd0f5e6e1946a7a..b2cf54d10d4151308544ea59d5a3af3ecba6b1f6 100644 --- a/app/views/issues/_show.html.haml +++ b/app/views/issues/_show.html.haml @@ -1,10 +1,12 @@ %li.wll{ :id => dom_id(issue), :class => "issue #{issue.critical ? "critical" : ""}", :url => project_issue_path(issue.project, issue) } .right + - if issue.notes.any? + %span.btn.small.disabled.padded= pluralize issue.notes.count, 'note' - if can? current_user, :modify_issue, issue - if issue.closed - = link_to 'Reopen', project_issue_path(issue.project, issue, :issue => {:closed => false }, :status_only => true), :method => :put, :class => "btn small", :remote => true + = link_to 'Reopen', project_issue_path(issue.project, issue, :issue => {:closed => false }, :status_only => true), :method => :put, :class => "btn small padded", :remote => true - else - = link_to 'Resolve', project_issue_path(issue.project, issue, :issue => {:closed => true }, :status_only => true), :method => :put, :class => "success btn small", :remote => true + = link_to 'Resolve', project_issue_path(issue.project, issue, :issue => {:closed => true }, :status_only => true), :method => :put, :class => "success btn small padded", :remote => true = link_to 'Edit', edit_project_issue_path(issue.project, issue), :class => "btn small edit-issue-link", :remote => true = image_tag gravatar_icon(issue.assignee_email), :class => "avatar" %span.update-author @@ -14,8 +16,6 @@ %span.label.important critical - if issue.today? %span.label.success today - - if issue.notes.any? - %span.pretty_label= pluralize issue.notes.count, 'note' - if issue.upvotes > 0 %span.label.success= "+#{issue.upvotes}" diff --git a/app/views/projects/empty.html.haml b/app/views/projects/empty.html.haml index 3fb81370853465dc569c1153758bdfadd9c41e6e..249442c15b5de30da50dc4b00fca8bd94c707143 100644 --- a/app/views/projects/empty.html.haml +++ b/app/views/projects/empty.html.haml @@ -38,3 +38,7 @@ "git remote add origin #{@project.url_to_repo}", "git push -u origin master"].join("\n") = raw bash_lexer.highlight(exist_repo_setup_str) + + - if can? current_user, :admin_project, @project + .alert-message.block-message.error.prepend-top-20 + = link_to 'Remove project', @project, :confirm => 'Are you sure?', :method => :delete, :class => "btn danger"