Commit 793db070f0fe61c05359f34b34af0dd6f91d129a
1 parent
51558bd5
Exists in
master
and in
4 other branches
Restyled projects list on dashboard
Showing
3 changed files
with
49 additions
and
11 deletions
Show diff stats
app/assets/stylesheets/sections/projects.scss
| @@ -14,6 +14,32 @@ | @@ -14,6 +14,32 @@ | ||
| 14 | text-shadow: 0 1px 1px #fff; | 14 | text-shadow: 0 1px 1px #fff; |
| 15 | padding: 2px 10px; | 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 | @extend .leftbar; | 43 | @extend .leftbar; |
| 18 | @extend .ui-box; | 44 | @extend .ui-box; |
| 19 | } | 45 | } |
| @@ -39,7 +65,7 @@ | @@ -39,7 +65,7 @@ | ||
| 39 | } | 65 | } |
| 40 | } | 66 | } |
| 41 | .adv_settings { | 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,16 +78,16 @@ module ApplicationHelper | ||
| 78 | end | 78 | end |
| 79 | 79 | ||
| 80 | def show_last_push_widget?(event) | 80 | def show_last_push_widget?(event) |
| 81 | - event && | 81 | + event && |
| 82 | event.last_push_to_non_root? && | 82 | event.last_push_to_non_root? && |
| 83 | !event.rm_ref? && | 83 | !event.rm_ref? && |
| 84 | - event.project && | 84 | + event.project && |
| 85 | event.project.merge_requests_enabled | 85 | event.project.merge_requests_enabled |
| 86 | end | 86 | end |
| 87 | 87 | ||
| 88 | def tab_class(tab_key) | 88 | def tab_class(tab_key) |
| 89 | active = case tab_key | 89 | active = case tab_key |
| 90 | - | 90 | + |
| 91 | # Project Area | 91 | # Project Area |
| 92 | when :wall; wall_tab? | 92 | when :wall; wall_tab? |
| 93 | when :wiki; controller.controller_name == "wikis" | 93 | when :wiki; controller.controller_name == "wikis" |
| @@ -126,4 +126,13 @@ module ApplicationHelper | @@ -126,4 +126,13 @@ module ApplicationHelper | ||
| 126 | def hexdigest(string) | 126 | def hexdigest(string) |
| 127 | Digest::SHA1.hexdigest string | 127 | Digest::SHA1.hexdigest string |
| 128 | end | 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 | end | 138 | end |
app/views/dashboard/index.html.haml
| @@ -19,13 +19,16 @@ | @@ -19,13 +19,16 @@ | ||
| 19 | = link_to new_project_path, class: "btn very_small info" do | 19 | = link_to new_project_path, class: "btn very_small info" do |
| 20 | %i.icon-plus | 20 | %i.icon-plus |
| 21 | New Project | 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 | .bottom= paginate @projects, theme: "gitlab" | 32 | .bottom= paginate @projects, theme: "gitlab" |
| 30 | 33 | ||
| 31 | %hr | 34 | %hr |