Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-03-23 00:28:02 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-03-23 00:28:02 +0400
commit81da8e46f24913ccf42d3e2644962cbcbc0f9c2e (patch)
tree682ef5480670bc40599dfd44ccdb877e9ba876f8
parent6f2c19320464c928e3dae0373a7af315bf5fb043 (diff)
Remove button for empty repo. Last push on dashboard. Better notes count indicator for issues
-rw-r--r--app/assets/stylesheets/common.scss17
-rw-r--r--app/controllers/dashboard_controller.rb1
-rw-r--r--app/models/event.rb1
-rw-r--r--app/views/dashboard/_projects_feed.html.haml2
-rw-r--r--app/views/dashboard/index.html.haml31
-rw-r--r--app/views/issues/_show.html.haml8
-rw-r--r--app/views/projects/empty.html.haml4
7 files changed, 40 insertions, 24 deletions
diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss
index d6750d3a9df..33a1f3427ee 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 f6b09e23430..da75465ea32 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 c8af9363133..adc558b6d3a 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 61154147841..e3f61e66ae8 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 b20fafca75c..39b05d0c6ea 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 78d50340cb7..b2cf54d10d4 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 3fb81370853..249442c15b5 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"