Commit 793db070f0fe61c05359f34b34af0dd6f91d129a

Authored by Dmitriy Zaporozhets
1 parent 51558bd5

Restyled projects list on dashboard

app/assets/stylesheets/sections/projects.scss
... ... @@ -14,6 +14,32 @@
14 14 text-shadow: 0 1px 1px #fff;
15 15 padding: 2px 10px;
16 16 }
  17 + ul {
  18 + li {
  19 + padding:0;
  20 + a {
  21 + display:block;
  22 + .project_name {
  23 + color:#4fa2bd;
  24 + font-size:14px;
  25 + line-height:18px;
  26 + }
  27 + .arrow {
  28 + float:right;
  29 + padding:10px;
  30 + margin:0;
  31 + }
  32 + .last_activity {
  33 + padding-top:5px;
  34 + display:block;
  35 + span, strong {
  36 + font-size:12px;
  37 + color:#666;
  38 + }
  39 + }
  40 + }
  41 + }
  42 + }
17 43 @extend .leftbar;
18 44 @extend .ui-box;
19 45 }
... ... @@ -39,7 +65,7 @@
39 65 }
40 66 }
41 67 .adv_settings {
42   - h6 { margin-left:40px; }
  68 + h6 { margin-left:40px; }
43 69 }
44 70 }
45 71  
... ...
app/helpers/application_helper.rb
... ... @@ -78,16 +78,16 @@ module ApplicationHelper
78 78 end
79 79  
80 80 def show_last_push_widget?(event)
81   - event &&
  81 + event &&
82 82 event.last_push_to_non_root? &&
83 83 !event.rm_ref? &&
84   - event.project &&
  84 + event.project &&
85 85 event.project.merge_requests_enabled
86 86 end
87 87  
88 88 def tab_class(tab_key)
89 89 active = case tab_key
90   -
  90 +
91 91 # Project Area
92 92 when :wall; wall_tab?
93 93 when :wiki; controller.controller_name == "wikis"
... ... @@ -126,4 +126,13 @@ module ApplicationHelper
126 126 def hexdigest(string)
127 127 Digest::SHA1.hexdigest string
128 128 end
  129 +
  130 + def project_last_activity project
  131 + activity = project.last_activity
  132 + if activity && activity.created_at
  133 + time_ago_in_words(activity.created_at) + " ago"
  134 + else
  135 + "Never"
  136 + end
  137 + end
129 138 end
... ...
app/views/dashboard/index.html.haml
... ... @@ -19,13 +19,16 @@
19 19 = link_to new_project_path, class: "btn very_small info" do
20 20 %i.icon-plus
21 21 New Project
22   - - @projects.each do |project|
23   - = link_to project_path(project), class: dom_class(project) do
24   - %h4
25   - %span.ico.project
26   - = truncate(project.name, length: 25)
27   - %span.right
28   - →
  22 + %ul.unstyled
  23 + - @projects.each do |project|
  24 + %li.wll
  25 + = link_to project_path(project), class: dom_class(project) do
  26 + %strong.project_name= truncate(project.name, length: 25)
  27 + %span.arrow
  28 + →
  29 + %span.last_activity
  30 + %strong Last activity:
  31 + %span= project_last_activity(project)
29 32 .bottom= paginate @projects, theme: "gitlab"
30 33  
31 34 %hr
... ...