diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index d6750d3a..33a1f342 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 f6b09e23..da75465e 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 c8af9363..adc558b6 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 61154147..e3f61e66 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 b20fafca..39b05d0c 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 78d50340..b2cf54d1 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 3fb81370..249442c1 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"