diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 03bfd1852a2fa08590f89e512bb9a4727440c481..c0ead28ee49ddb9fc6798a025de19576ce6fe809 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -3,7 +3,7 @@ a { color: $link_color; &:hover { text-decoration:none; - color: $style_color; + color: $blue_link; } &.btn { @@ -838,12 +838,19 @@ p.time { width:840px; margin:auto; - .wll { - padding:5px; - margin-top:5px; + .dash_project_item { + margin-bottom:10px; border:none; &:hover { background:none; + + h4 { + color:#2FA0BB; + .arrow { + background:#2FA0BB; + color:#fff; + } + } } h4 { @@ -988,3 +995,14 @@ p.time { .merge_request_status_holder { margin-bottom:20px; } + +.arrow{ + float: right; + background: #E3E5EA; + padding: 10px; + border-radius: 5px; + text-shadow: none; + color: #999; + line-height: 16px; + font-weight:bold; +} diff --git a/app/assets/stylesheets/main.scss b/app/assets/stylesheets/main.scss index 5881880982ac39e044756bb962990472f0fb97e4..10388bcf223b9462fa67a5b5a24aee33b48ce261 100644 --- a/app/assets/stylesheets/main.scss +++ b/app/assets/stylesheets/main.scss @@ -15,7 +15,7 @@ $app_padding:20px; $bg_color: #FFF; $styled_border_color: #2FA0BB; $color: "#4BB8D2"; -$blue_link: "#2fa0bb"; +$blue_link: #2fa0bb; /** Style colors **/ diff --git a/app/assets/stylesheets/ui_basic.scss b/app/assets/stylesheets/ui_basic.scss index 64347525099d5c3d8158c9001c69829cdbb2bbcf..a1e6133d4f3bfd249b4184c7d68770aded48e2c1 100644 --- a/app/assets/stylesheets/ui_basic.scss +++ b/app/assets/stylesheets/ui_basic.scss @@ -17,7 +17,7 @@ color: $link_color; &:hover { text-decoration:none; - color: $style_color; + color: $blue_link; } } diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index f6b09e2343051ca948ab95d19c056a13887b414f..e098f571913542cf4734b37644d142b7118b86d7 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -34,4 +34,9 @@ class DashboardController < ApplicationController format.atom { render :layout => false } end end + + def activities + @projects = current_user.projects.all + @events = Event.where(:project_id => @projects.map(&:id)).recent.limit(40) + end end diff --git a/app/views/dashboard/_events_feed.html.haml b/app/views/dashboard/_events_feed.html.haml deleted file mode 100644 index 976597531df8e19b074b03b0b18d4755e691ecf5..0000000000000000000000000000000000000000 --- a/app/views/dashboard/_events_feed.html.haml +++ /dev/null @@ -1,2 +0,0 @@ -= render @events - diff --git a/app/views/dashboard/_issues_feed.html.haml b/app/views/dashboard/_issues_feed.html.haml index 5c0e05ef0a561f2c1d6aadc4138fd16df4430958..f867b3589cdc7e0d1160692760a4074734f7a9e8 100644 --- a/app/views/dashboard/_issues_feed.html.haml +++ b/app/views/dashboard/_issues_feed.html.haml @@ -3,8 +3,10 @@ = link_to [issue.project, issue] do %p %strong - %span.label= issue.project.name + %span.pretty_label= issue.project.name – Issue # = issue.id = truncate issue.title, :length => 50 + %span.right.cgray + = issue.updated_at.stamp("Aug 21, 2011") diff --git a/app/views/dashboard/_merge_requests_feed.html.haml b/app/views/dashboard/_merge_requests_feed.html.haml index db1ebd32a6396a838919eee719f173363c9dbff7..7fb7998d537a430394cdd65bc2b32d2b07be5648 100644 --- a/app/views/dashboard/_merge_requests_feed.html.haml +++ b/app/views/dashboard/_merge_requests_feed.html.haml @@ -3,8 +3,9 @@ = link_to [merge_request.project, merge_request] do %p %strong - %span.label= merge_request.project.name + %span.pretty_label= merge_request.project.name – - Merge Request # - = merge_request.id + Merge Request ##{merge_request.id} = truncate merge_request.title, :length => 50 + %span.right.cgray + = merge_request.updated_at.stamp("Aug 21, 2011") diff --git a/app/views/dashboard/_projects_feed.html.haml b/app/views/dashboard/_projects_feed.html.haml index 5f146d4981703abb4aebca138df918ad1940dd43..611541478412b7e2a4611ee42dc65c9fcf31ac84 100644 --- a/app/views/dashboard/_projects_feed.html.haml +++ b/app/views/dashboard/_projects_feed.html.haml @@ -1,5 +1,5 @@ - projects.first(5).each do |project| - .wll + %div.dash_project_item = link_to project do %h4 %span.ico.project @@ -7,3 +7,5 @@ %small last activity at = project.last_activity_date.stamp("Aug 25, 2011") + %span.right.arrow + → diff --git a/app/views/dashboard/activities.html.haml b/app/views/dashboard/activities.html.haml new file mode 100644 index 0000000000000000000000000000000000000000..2b96acc60ec7fa0d6e81a7af3eafc71779da031a --- /dev/null +++ b/app/views/dashboard/activities.html.haml @@ -0,0 +1,10 @@ +- if @events.any? + %div.dashboard_category + %h3 + %span.ico.activities + = link_to "Activities" , "#activities", :id => "activities" + + %hr + = render @events +- else + %h3 Nothing here diff --git a/app/views/dashboard/index.html.haml b/app/views/dashboard/index.html.haml index 5dde57e8a2203ec1f14077cc159b5b3b83544ae2..895c47124f0418743745696a4077ae3603bae210 100644 --- a/app/views/dashboard/index.html.haml +++ b/app/views/dashboard/index.html.haml @@ -62,7 +62,10 @@ %h3 %span.ico.activities = link_to "Activities" , "#activities", :id => "activities" + %strong.right + = link_to dashboard_activities_path do + Visit activities page → %hr .row - .dashboard_block= render "dashboard/events_feed" + .dashboard_block= render @events diff --git a/app/views/layouts/_app_menu.html.haml b/app/views/layouts/_app_menu.html.haml index e6a6ebf06129f6b8c8ad32ed241f2b7c8d710529..b96bdacc38563267af5cd15fc5c33dccba4d0206 100644 --- a/app/views/layouts/_app_menu.html.haml +++ b/app/views/layouts/_app_menu.html.haml @@ -1,11 +1,12 @@ %nav.main_menu = render "layouts/const_menu_links" = link_to "Projects", projects_path, :class => "#{"current" if current_page?(projects_path)}" - = link_to "Search", search_path, :class => "#{"current" if current_page?(search_path)}" + = link_to "Activities", dashboard_activities_path, :class => "#{"current" if current_page?(dashboard_activities_path)}" = link_to dashboard_issues_path, :class => "#{"current" if current_page?(dashboard_issues_path)}", :id => "issues_slide" do Issues %span.count= current_user.assigned_issues.opened.count = link_to dashboard_merge_requests_path, :class => "#{"current" if current_page?(dashboard_merge_requests_path)}", :id => "merge_requests_slide" do Requests %span.count= current_user.cared_merge_requests.count + = link_to "Search", search_path, :class => "#{"current" if current_page?(search_path)}" = link_to "Help", help_path, :class => "#{"current" if controller.controller_name == "help"}" diff --git a/app/views/profile/password.html.haml b/app/views/profile/password.html.haml index dc1f221435efbab89e2a686e7830ffde11000252..350d6801fd3a33ed861ec0274ce8f5f90bd9df21 100644 --- a/app/views/profile/password.html.haml +++ b/app/views/profile/password.html.haml @@ -1,42 +1,46 @@ -%h3 Password -%hr -= form_for @user, :url => profile_password_path, :method => :put do |f| - .data - .alert-message.block-message.warning - %p After successfull password update you will be redirected to login page where you should login with new password - -if @user.errors.any? - .alert-message.block-message.error - %ul - - @user.errors.full_messages.each do |msg| - %li= msg +.row + .span8 + %h3 Password + %hr + = form_for @user, :url => profile_password_path, :method => :put do |f| + .data + .alert-message.block-message.warning + %p After successfull password update you will be redirected to login page where you should login with new password + -if @user.errors.any? + .alert-message.block-message.error + %ul + - @user.errors.full_messages.each do |msg| + %li= msg + + .clearfix + = f.label :password + .input= f.password_field :password + .clearfix + = f.label :password_confirmation + .input= f.password_field :password_confirmation + .actions + = f.submit 'Save', :class => "btn" - .clearfix - = f.label :password - .input= f.password_field :password - .clearfix - = f.label :password_confirmation - .input= f.password_field :password_confirmation - .actions - = f.submit 'Save', :class => "btn" - -%h3 - Private token - %span.cred.right - keep it in secret! -%hr -= form_for @user, :url => profile_reset_private_token_path, :method => :put do |f| - .data - %p Private token used to access application resources without authentication. - %p For example its required to access commits feed. + .span7.right + %h3 + Private token + %span.cred.right + keep it in secret! %hr - %p.cgray - - if current_user.private_token - = text_field_tag "token", current_user.private_token - - else - You don`t have one yet. Click generate to fix it. - .actions - - if current_user.private_token - = f.submit 'Reset', :confirm => "Are you sure?", :class => "btn" - - else - = f.submit 'Generate', :class => "btn" + = form_for @user, :url => profile_reset_private_token_path, :method => :put do |f| + .data + .alert-message.block-message.warning + %p Private token used to access application resources without authentication. + %hr + %p * required for rss feed + %p.cgray + - if current_user.private_token + = text_field_tag "token", current_user.private_token + - else + You don`t have one yet. Click generate to fix it. + .actions + - if current_user.private_token + = f.submit 'Reset', :confirm => "Are you sure?", :class => "btn" + - else + = f.submit 'Generate', :class => "btn" diff --git a/app/views/projects/_show.html.haml b/app/views/projects/_show.html.haml index 5d30b75bb645c58c58ee781cfa36c028532e19e2..edb9c1cefe6f43386d1104c0605e36626b45d700 100644 --- a/app/views/projects/_show.html.haml +++ b/app/views/projects/_show.html.haml @@ -1,4 +1,4 @@ -%h4.title +%h5.title = @project.name %br %div diff --git a/app/views/projects/empty.html.haml b/app/views/projects/empty.html.haml index 5088c2e72977204d87197daa14875eda5564591c..3fb81370853465dc569c1153758bdfadd9c41e6e 100644 --- a/app/views/projects/empty.html.haml +++ b/app/views/projects/empty.html.haml @@ -6,7 +6,7 @@ %li Visit profile → keys and add public key of every machine you want to use for work with gitlabhq. .alert-message.block-message.error - %ul.alert_holder + %ul.unstyled.alert_holder %li You should push repository to proceed. %li After push you will be able to browse code, commits etc. diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index 89a3a4265e4c7f140b7db7eb617ea90ca21f01df..ae92b1ca7b32b235311f88df2b65ae6cb45ab6d6 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -21,9 +21,13 @@ = text_field_tag :project_clone, @project.url_to_repo, :class => "xlarge one_click_select git_clone_url" - if @project.description.present? - = markdown @project.description + .prettyprint= markdown @project.description - unless @events.blank? - %h5.cgray Recent Activity + %br + %h5.cgray + %span.ico.activities + Recent Activity + %hr .content_list= render @events diff --git a/config/routes.rb b/config/routes.rb index be559282ae66b443a851003f44199e29b69d1ebe..8241b5427944328766cb6b1b491fec934e1b018d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -40,6 +40,7 @@ Gitlab::Application.routes.draw do get "dashboard", :to => "dashboard#index" get "dashboard/issues", :to => "dashboard#issues" get "dashboard/merge_requests", :to => "dashboard#merge_requests" + get "dashboard/activities", :to => "dashboard#activities" #get "profile/:id", :to => "profile#show" diff --git a/spec/requests/dashboard_spec.rb b/spec/requests/dashboard_spec.rb index 98de046fee17b0edd28f8fcefb94d17c73b2eea6..1ca256f93caca6c96c1f9829878cdfac7d6f9947 100644 --- a/spec/requests/dashboard_spec.rb +++ b/spec/requests/dashboard_spec.rb @@ -1,6 +1,4 @@ require 'spec_helper' -__END__ -# Disabled for now describe "Dashboard" do before do @project = Factory :project @@ -22,19 +20,21 @@ describe "Dashboard" do end it "should have projects panel" do - within ".project-list" do - page.should have_content(@project.name) - end + page.should have_content(@project.name) end + end - # Temporary disabled cause of travis - # TODO: fix or rewrite - #it "should have news feed" do - #within "#news-feed" do - #page.should have_content("commit") - #page.should have_content(@project.commit.author.name) - #page.should have_content(@project.commit.safe_message) - #end - #end + describe "GET /dashboard/activities" do + before do + visit dashboard_activities_path + end + + it "should be on dashboard page" do + current_path.should == dashboard_activities_path + end + + it "should have projects panel" do + page.should have_content(@project.name) + end end end