Commit 81da8e46 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Remove button for empty repo. Last push on dashboard. Better notes count indicator for issues

parent 6f2c1932
...@@ -114,9 +114,17 @@ a:focus { ...@@ -114,9 +114,17 @@ a:focus {
margin-top:10px; margin-top:10px;
} }
.prepend-top-20 {
margin-top:20px;
}
.padded { .padded {
padding:20px; padding:20px;
} }
.ipadded {
padding:20px !important;
}
.no-borders { .no-borders {
border:none; border:none;
} }
...@@ -861,14 +869,7 @@ p.time { ...@@ -861,14 +869,7 @@ p.time {
border:none; border:none;
&:hover { &:hover {
background:none; background:none;
h4 { color:#2FA0BB; }
h4 {
color:#2FA0BB;
.arrow {
background:#2FA0BB;
color:#fff;
}
}
} }
h4 { h4 {
......
...@@ -13,6 +13,7 @@ class DashboardController < ApplicationController ...@@ -13,6 +13,7 @@ class DashboardController < ApplicationController
@issues = @issues.includes(:author, :project) @issues = @issues.includes(:author, :project)
@events = Event.where(:project_id => @projects.map(&:id)).recent.limit(20) @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 end
# Get authored or assigned open merge requests # Get authored or assigned open merge requests
......
...@@ -15,6 +15,7 @@ class Event < ActiveRecord::Base ...@@ -15,6 +15,7 @@ class Event < ActiveRecord::Base
serialize :data serialize :data
scope :recent, order("created_at DESC") scope :recent, order("created_at DESC")
scope :code_push, where(:action => Pushed)
def self.determine_action(record) def self.determine_action(record)
if [Issue, MergeRequest].include? record.class if [Issue, MergeRequest].include? record.class
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
= link_to project do = link_to project do
%h4 %h4
%span.ico.project %span.ico.project
= project.name = truncate project.name, :length => 30
%small %small
last activity at last activity at
= project.last_activity_date.stamp("Aug 25, 2011") = project.last_activity_date.stamp("Aug 25, 2011")
......
...@@ -20,17 +20,26 @@ ...@@ -20,17 +20,26 @@
.row .row
.dashboard_block .dashboard_block
.row .row
.span10= render "dashboard/projects_feed", :projects => @active_projects .span4
.span4.right %div.prettyprint.ipadded
- if current_user.can_create_project? %h1
.alert-message.block-message.warning = pluralize current_user.projects.count, "project", "projects"
You can create up to - if current_user.can_create_project?
= current_user.projects_limit %hr
projects. Click on link below to add a new one %div
.link_holder You can create up to
= link_to new_project_path, :class => "" do = current_user.projects_limit
New Project » 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? - if @merge_requests.any?
%div.dashboard_category %div.dashboard_category
......
%li.wll{ :id => dom_id(issue), :class => "issue #{issue.critical ? "critical" : ""}", :url => project_issue_path(issue.project, issue) } %li.wll{ :id => dom_id(issue), :class => "issue #{issue.critical ? "critical" : ""}", :url => project_issue_path(issue.project, issue) }
.right .right
- if issue.notes.any?
%span.btn.small.disabled.padded= pluralize issue.notes.count, 'note'
- if can? current_user, :modify_issue, issue - if can? current_user, :modify_issue, issue
- if issue.closed - 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 - 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 = 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" = image_tag gravatar_icon(issue.assignee_email), :class => "avatar"
%span.update-author %span.update-author
...@@ -14,8 +16,6 @@ ...@@ -14,8 +16,6 @@
%span.label.important critical %span.label.important critical
- if issue.today? - if issue.today?
%span.label.success today %span.label.success today
- if issue.notes.any?
%span.pretty_label= pluralize issue.notes.count, 'note'
- if issue.upvotes > 0 - if issue.upvotes > 0
%span.label.success= "+#{issue.upvotes}" %span.label.success= "+#{issue.upvotes}"
......
...@@ -38,3 +38,7 @@ ...@@ -38,3 +38,7 @@
"git remote add origin #{@project.url_to_repo}", "git remote add origin #{@project.url_to_repo}",
"git push -u origin master"].join("\n") "git push -u origin master"].join("\n")
= raw bash_lexer.highlight(exist_repo_setup_str) = 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"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment