diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-27 12:56:20 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-27 12:56:20 +0200 |
commit | 6b01196fb238cb921056ecd8d1572ff2874bf912 (patch) | |
tree | 37f437b6a918d6b7e6da041f7c44ac7214aaceb0 /app | |
parent | bd3b677b86d7c76788420e94862836343ac5c841 (diff) | |
download | gitlab-ce-6b01196fb238cb921056ecd8d1572ff2874bf912.tar.gz |
Dashboard to resource
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/dashboard_controller.rb | 4 | ||||
-rw-r--r-- | app/helpers/dashboard_helper.rb | 4 | ||||
-rw-r--r-- | app/views/dashboard/_projects.html.haml | 2 | ||||
-rw-r--r-- | app/views/dashboard/issues.atom.builder | 6 | ||||
-rw-r--r-- | app/views/dashboard/projects.html.haml | 34 | ||||
-rw-r--r-- | app/views/dashboard/show.atom.builder (renamed from app/views/dashboard/index.atom.builder) | 0 | ||||
-rw-r--r-- | app/views/dashboard/show.html.haml (renamed from app/views/dashboard/index.html.haml) | 0 | ||||
-rw-r--r-- | app/views/dashboard/show.js.haml (renamed from app/views/dashboard/index.js.haml) | 0 | ||||
-rw-r--r-- | app/views/groups/issues.atom.builder | 6 | ||||
-rw-r--r-- | app/views/layouts/application.html.haml | 8 |
10 files changed, 37 insertions, 27 deletions
diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index 13d8000873b..f320e819e26 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -2,9 +2,9 @@ class DashboardController < ApplicationController respond_to :html before_filter :load_projects - before_filter :event_filter, only: :index + before_filter :event_filter, only: :show - def index + def show @groups = current_user.authorized_groups @has_authorized_projects = @projects.count > 0 @teams = current_user.authorized_teams diff --git a/app/helpers/dashboard_helper.rb b/app/helpers/dashboard_helper.rb index 0baa5b4108e..c759dffa16e 100644 --- a/app/helpers/dashboard_helper.rb +++ b/app/helpers/dashboard_helper.rb @@ -9,9 +9,9 @@ module DashboardHelper case entity when 'issue' then - dashboard_issues_path(options) + issues_dashboard_path(options) when 'merge_request' - dashboard_merge_requests_path(options) + merge_requests_dashboard_path(options) end end diff --git a/app/views/dashboard/_projects.html.haml b/app/views/dashboard/_projects.html.haml index d7273fdca34..f2acd2b0b0c 100644 --- a/app/views/dashboard/_projects.html.haml +++ b/app/views/dashboard/_projects.html.haml @@ -28,4 +28,4 @@ %h3.nothing_here_message There are no projects here. - if @projects_count > 20 %li.bottom - %strong= link_to "show all projects", dashboard_projects_path + %strong= link_to "show all projects", projects_dashboard_path diff --git a/app/views/dashboard/issues.atom.builder b/app/views/dashboard/issues.atom.builder index 28bdc5ed814..0f0f3466e92 100644 --- a/app/views/dashboard/issues.atom.builder +++ b/app/views/dashboard/issues.atom.builder @@ -1,9 +1,9 @@ xml.instruct! xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do xml.title "#{current_user.name} issues" - xml.link :href => dashboard_issues_url(:atom, :private_token => current_user.private_token), :rel => "self", :type => "application/atom+xml" - xml.link :href => dashboard_issues_url(:private_token => current_user.private_token), :rel => "alternate", :type => "text/html" - xml.id dashboard_issues_url(:private_token => current_user.private_token) + xml.link :href => issues_dashboard_url(:atom, :private_token => current_user.private_token), :rel => "self", :type => "application/atom+xml" + xml.link :href => issues_dashboard_url(:private_token => current_user.private_token), :rel => "alternate", :type => "text/html" + xml.id issues_dashboard_url(:private_token => current_user.private_token) xml.updated @issues.first.created_at.strftime("%Y-%m-%dT%H:%M:%SZ") if @issues.any? @issues.each do |issue| diff --git a/app/views/dashboard/projects.html.haml b/app/views/dashboard/projects.html.haml index cfbb332a91a..e6c710e68e9 100644 --- a/app/views/dashboard/projects.html.haml +++ b/app/views/dashboard/projects.html.haml @@ -8,19 +8,20 @@ %i.icon-plus New Project + %hr .row .span3 %ul.nav.nav-pills.nav-stacked = nav_tab :scope, nil do - = link_to "All", dashboard_projects_path + = link_to "All", projects_dashboard_path = nav_tab :scope, 'personal' do - = link_to "Personal", dashboard_projects_path(scope: 'personal') + = link_to "Personal", projects_dashboard_path(scope: 'personal') = nav_tab :scope, 'joined' do - = link_to "Joined", dashboard_projects_path(scope: 'joined') + = link_to "Joined", projects_dashboard_path(scope: 'joined') .span9 - = form_tag dashboard_projects_path, method: 'get' do + = form_tag projects_dashboard_path, method: 'get' do %fieldset.dashboard-search-filter = hidden_field_tag "scope", params[:scope] = search_field_tag "search", params[:search], { placeholder: 'Search', class: 'left input-xxlarge' } @@ -29,16 +30,25 @@ %ul.well-list - @projects.each do |project| - %li - = link_to project_path(project), class: dom_class(project) do - - if project.namespace - = project.namespace.human_name - \/ - %strong.well-title - = truncate(project.name, length: 25) - %span.right.light + %li.clearfix + .left + = link_to project_path(project), class: dom_class(project) do + - if project.namespace + = project.namespace.human_name + \/ + %strong.well-title + = truncate(project.name, length: 25) + %br + %small.light %strong Last activity: %span= project_last_activity(project) + .right.light + - if project.owner == current_user + %i.icon-wrench + - tm = project.team.get_tm(current_user.id) + - if tm + = tm.project_access_human + - if @projects.blank? %li %h3.nothing_here_message There are no projects here. diff --git a/app/views/dashboard/index.atom.builder b/app/views/dashboard/show.atom.builder index 2bb42a65bac..2bb42a65bac 100644 --- a/app/views/dashboard/index.atom.builder +++ b/app/views/dashboard/show.atom.builder diff --git a/app/views/dashboard/index.html.haml b/app/views/dashboard/show.html.haml index 1a66ba4fb37..1a66ba4fb37 100644 --- a/app/views/dashboard/index.html.haml +++ b/app/views/dashboard/show.html.haml diff --git a/app/views/dashboard/index.js.haml b/app/views/dashboard/show.js.haml index 7e5a148e5ef..7e5a148e5ef 100644 --- a/app/views/dashboard/index.js.haml +++ b/app/views/dashboard/show.js.haml diff --git a/app/views/groups/issues.atom.builder b/app/views/groups/issues.atom.builder index 5bd07bcd89f..701747bdbc3 100644 --- a/app/views/groups/issues.atom.builder +++ b/app/views/groups/issues.atom.builder @@ -1,9 +1,9 @@ xml.instruct! xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do xml.title "#{@user.name} issues" - xml.link :href => dashboard_issues_url(:atom, :private_token => @user.private_token), :rel => "self", :type => "application/atom+xml" - xml.link :href => dashboard_issues_url(:private_token => @user.private_token), :rel => "alternate", :type => "text/html" - xml.id dashboard_issues_url(:private_token => @user.private_token) + xml.link :href => issues_dashboard_url(:atom, :private_token => @user.private_token), :rel => "self", :type => "application/atom+xml" + xml.link :href => issues_dashboard_url(:private_token => @user.private_token), :rel => "alternate", :type => "text/html" + xml.id issues_dashboard_url(:private_token => @user.private_token) xml.updated @issues.first.created_at.strftime("%Y-%m-%dT%H:%M:%SZ") if @issues.any? @issues.each do |issue| diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 0a83be3fd2e..261a8608ca4 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -6,17 +6,17 @@ = render "layouts/head_panel", title: "Dashboard" .container %ul.main_menu - = nav_link(path: 'dashboard#index', html_options: {class: 'home'}) do + = nav_link(path: 'dashboard#show', html_options: {class: 'home'}) do = link_to "Home", root_path, title: "Home" = nav_link(path: 'dashboard#projects') do - = link_to dashboard_projects_path do + = link_to projects_dashboard_path do Projects = nav_link(path: 'dashboard#issues') do - = link_to dashboard_issues_path do + = link_to issues_dashboard_path do Issues %span.count= current_user.assigned_issues.opened.count = nav_link(path: 'dashboard#merge_requests') do - = link_to dashboard_merge_requests_path do + = link_to merge_requests_dashboard_path do Merge Requests %span.count= current_user.cared_merge_requests.opened.count = nav_link(path: 'search#show') do |