From 793db070f0fe61c05359f34b34af0dd6f91d129a Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 30 Aug 2012 08:13:36 +0300 Subject: [PATCH] Restyled projects list on dashboard --- app/assets/stylesheets/sections/projects.scss | 28 ++++++++++++++++++- app/helpers/application_helper.rb | 15 ++++++++-- app/views/dashboard/index.html.haml | 17 ++++++----- 3 files changed, 49 insertions(+), 11 deletions(-) diff --git a/app/assets/stylesheets/sections/projects.scss b/app/assets/stylesheets/sections/projects.scss index 7aa400297c8..3d5aa80b34e 100644 --- a/app/assets/stylesheets/sections/projects.scss +++ b/app/assets/stylesheets/sections/projects.scss @@ -14,6 +14,32 @@ text-shadow: 0 1px 1px #fff; padding: 2px 10px; } + ul { + li { + padding:0; + a { + display:block; + .project_name { + color:#4fa2bd; + font-size:14px; + line-height:18px; + } + .arrow { + float:right; + padding:10px; + margin:0; + } + .last_activity { + padding-top:5px; + display:block; + span, strong { + font-size:12px; + color:#666; + } + } + } + } + } @extend .leftbar; @extend .ui-box; } @@ -39,7 +65,7 @@ } } .adv_settings { - h6 { margin-left:40px; } + h6 { margin-left:40px; } } } diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 38191f55571..3dafb7534c3 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -78,16 +78,16 @@ module ApplicationHelper end def show_last_push_widget?(event) - event && + event && event.last_push_to_non_root? && !event.rm_ref? && - event.project && + event.project && event.project.merge_requests_enabled end def tab_class(tab_key) active = case tab_key - + # Project Area when :wall; wall_tab? when :wiki; controller.controller_name == "wikis" @@ -126,4 +126,13 @@ module ApplicationHelper def hexdigest(string) Digest::SHA1.hexdigest string end + + def project_last_activity project + activity = project.last_activity + if activity && activity.created_at + time_ago_in_words(activity.created_at) + " ago" + else + "Never" + end + end end diff --git a/app/views/dashboard/index.html.haml b/app/views/dashboard/index.html.haml index ba7d019cb63..e13640fb835 100644 --- a/app/views/dashboard/index.html.haml +++ b/app/views/dashboard/index.html.haml @@ -19,13 +19,16 @@ = link_to new_project_path, class: "btn very_small info" do %i.icon-plus New Project - - @projects.each do |project| - = link_to project_path(project), class: dom_class(project) do - %h4 - %span.ico.project - = truncate(project.name, length: 25) - %span.right - → + %ul.unstyled + - @projects.each do |project| + %li.wll + = link_to project_path(project), class: dom_class(project) do + %strong.project_name= truncate(project.name, length: 25) + %span.arrow + → + %span.last_activity + %strong Last activity: + %span= project_last_activity(project) .bottom= paginate @projects, theme: "gitlab" %hr