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 {
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 {
......
......@@ -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
......
......@@ -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
......
......@@ -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")
......
......@@ -20,17 +20,26 @@
.row
.dashboard_block
.row
.span10= render "dashboard/projects_feed", :projects => @active_projects
.span4.right
.span4
%div.prettyprint.ipadded
%h1
= pluralize current_user.projects.count, "project", "projects"
- if current_user.can_create_project?
.alert-message.block-message.warning
%hr
%div
You can create up to
= current_user.projects_limit
projects. Click on link below to add a new one
projects. Click on button below to add a new one
.link_holder
= link_to new_project_path, :class => "" do
%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
......
%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}"
......
......@@ -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"
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