summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2011-12-08 21:17:53 +0200
committerDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2011-12-08 21:17:53 +0200
commit4107f2cc2e6d0b93208573f4873305ba0ef4c5de (patch)
treec8d7a7e5f9c5b90d2698dc2af31723d3989ab85c
parent8e0126e9ec676f1ec40bb1a3dcb811e6477fb8c6 (diff)
downloadgitlab-ce-4107f2cc2e6d0b93208573f4873305ba0ef4c5de.tar.gz
mixed dashboard - first try
-rw-r--r--app/assets/stylesheets/projects.css.scss1
-rw-r--r--app/assets/stylesheets/style.scss2
-rw-r--r--app/controllers/user_issues_controller.rb3
-rw-r--r--app/controllers/user_merge_requests_controller.rb3
-rw-r--r--app/views/dashboard/_issues_feed.html.haml28
-rw-r--r--app/views/dashboard/_merge_requests_feed.html.haml27
-rw-r--r--app/views/dashboard/_projects_feed.html.haml30
-rw-r--r--app/views/dashboard/index.html.haml23
-rw-r--r--app/views/issues/_show.html.haml5
-rw-r--r--app/views/layouts/_head_panel.html.erb3
-rw-r--r--app/views/user_issues/index.html.haml25
-rw-r--r--app/views/user_merge_requests/index.html.haml26
12 files changed, 125 insertions, 51 deletions
diff --git a/app/assets/stylesheets/projects.css.scss b/app/assets/stylesheets/projects.css.scss
index adf461474cc..a456d64d201 100644
--- a/app/assets/stylesheets/projects.css.scss
+++ b/app/assets/stylesheets/projects.css.scss
@@ -506,3 +506,4 @@ body.project-page table.no-borders td{
top: 6px;
right: 5px;
}
+.box-arrow{float: right; background: #E3E5EA; padding: 10px; border-radius: 5px; margin-top: 2px; text-shadow: none; color: #999; margin: 1.5em 0;}
diff --git a/app/assets/stylesheets/style.scss b/app/assets/stylesheets/style.scss
index ca17f04a4a3..3ba26621d69 100644
--- a/app/assets/stylesheets/style.scss
+++ b/app/assets/stylesheets/style.scss
@@ -351,7 +351,7 @@ header h1.logo a{
text-indent: -1000em;
}
-header nav{border-radius: 4px; box-shadow: 0 1px 2px black; width: 392px; margin: auto;
+header nav{border-radius: 4px; box-shadow: 0 1px 2px black; width: 294px; margin: auto;
background-image: -webkit-gradient(linear, 0 0, 0 30, color-stop(0.066, #595d63), to(#31363e));
background-image: -webkit-linear-gradient(#595d63 6.6%, #31363e);
background-image: -moz-linear-gradient(#595d63 6.6%, #31363e);
diff --git a/app/controllers/user_issues_controller.rb b/app/controllers/user_issues_controller.rb
index 4b2245a4c98..d7613aa090d 100644
--- a/app/controllers/user_issues_controller.rb
+++ b/app/controllers/user_issues_controller.rb
@@ -1,11 +1,10 @@
class UserIssuesController < ApplicationController
before_filter :authenticate_user!
- layout "user"
-
respond_to :js, :html
def index
+ @projects = current_user.projects.all
@user = current_user
@issues = current_user.assigned_issues.opened
diff --git a/app/controllers/user_merge_requests_controller.rb b/app/controllers/user_merge_requests_controller.rb
index 7b6710d55ea..879499e1013 100644
--- a/app/controllers/user_merge_requests_controller.rb
+++ b/app/controllers/user_merge_requests_controller.rb
@@ -1,9 +1,8 @@
class UserMergeRequestsController < ApplicationController
before_filter :authenticate_user!
- layout "user"
-
def index
+ @projects = current_user.projects.all
@merge_requests = current_user.assigned_merge_requests
end
end
diff --git a/app/views/dashboard/_issues_feed.html.haml b/app/views/dashboard/_issues_feed.html.haml
new file mode 100644
index 00000000000..bd0d144d930
--- /dev/null
+++ b/app/views/dashboard/_issues_feed.html.haml
@@ -0,0 +1,28 @@
+#news-feed.news-feed
+ %div
+ = link_to dashboard_path, :class => "left" do
+ .box-arrow
+ &larr;
+ %h2{:style => "width:86%; text-align:center"}
+ Issues
+ = link_to merge_requests_path, :class => "right" do
+ .box-arrow
+ &rarr;
+
+
+ .project-box.project-updates.ui-box.ui-box-small.ui-box-big
+ .data
+ - @issues.each do |update|
+ %a.project-update{:href => dashboard_feed_path(update.project, update)}
+ = image_tag gravatar_icon(update.author_email), :class => "left", :width => 40
+ %span.update-title
+ = dashboard_feed_title(update)
+ %span.update-author
+ %strong= update.author_name
+ authored
+ = time_ago_in_words(update.created_at)
+ ago
+ .right
+ - klass = update.class.to_s.split("::").last.downcase
+ %span.tag{ :class => klass }= klass
+
diff --git a/app/views/dashboard/_merge_requests_feed.html.haml b/app/views/dashboard/_merge_requests_feed.html.haml
new file mode 100644
index 00000000000..7443d5fa2f8
--- /dev/null
+++ b/app/views/dashboard/_merge_requests_feed.html.haml
@@ -0,0 +1,27 @@
+#news-feed.news-feed
+ %div
+ = link_to issues_path, :class => "left" do
+ .box-arrow
+ &larr;
+ %h2{:style => "width:86%; text-align:center"}
+ Merge Requests
+ = link_to dashboard_path, :class => "right" do
+ .box-arrow
+ &rarr;
+
+ .project-box.project-updates.ui-box.ui-box-small.ui-box-big
+ .data
+ - @merge_requests.each do |update|
+ %a.project-update{:href => dashboard_feed_path(update.project, update)}
+ = image_tag gravatar_icon(update.author_email), :class => "left", :width => 40
+ %span.update-title
+ = dashboard_feed_title(update)
+ %span.update-author
+ %strong= update.author_name
+ authored
+ = time_ago_in_words(update.created_at)
+ ago
+ .right
+ - klass = update.class.to_s.split("::").last.downcase
+ %span.tag{ :class => klass }= klass
+
diff --git a/app/views/dashboard/_projects_feed.html.haml b/app/views/dashboard/_projects_feed.html.haml
new file mode 100644
index 00000000000..7fe93240fd6
--- /dev/null
+++ b/app/views/dashboard/_projects_feed.html.haml
@@ -0,0 +1,30 @@
+#news-feed.news-feed
+ %div
+ = link_to merge_requests_path, :class => "left" do
+ .box-arrow
+ &larr;
+ %h2{:style => "width:86%; text-align:center"}
+ Activities
+ = link_to issues_path, :class => "right" do
+ .box-arrow
+ &rarr;
+
+ - @active_projects.first(3).each do |project|
+ .project-box.project-updates.ui-box.ui-box-small.ui-box-big
+ = link_to project, do
+ %h3= project.name
+ .data
+ - project.updates(3).each do |update|
+ %a.project-update{:href => dashboard_feed_path(project, update)}
+ = image_tag gravatar_icon(update.author_email), :class => "left", :width => 40
+ %span.update-title
+ = dashboard_feed_title(update)
+ %span.update-author
+ %strong= update.author_name
+ authored
+ = time_ago_in_words(update.created_at)
+ ago
+ .right
+ - klass = update.class.to_s.split("::").last.downcase
+ %span.tag{ :class => klass }= klass
+
diff --git a/app/views/dashboard/index.html.haml b/app/views/dashboard/index.html.haml
index 554d207c08c..2c934998f68 100644
--- a/app/views/dashboard/index.html.haml
+++ b/app/views/dashboard/index.html.haml
@@ -15,25 +15,4 @@
%span.time
%strong Last activity:
= project.last_activity_date ? time_ago_in_words(project.last_activity_date) + " ago" : "Never"
- #news-feed.news-feed
- %h2.icon
- %span>
- Dashboard
- - @active_projects.first(3).each do |project|
- .project-box.project-updates.ui-box.ui-box-small.ui-box-big
- = link_to project, do
- %h3= project.name
- .data
- - project.updates(3).each do |update|
- %a.project-update{:href => dashboard_feed_path(project, update)}
- = image_tag gravatar_icon(update.author_email), :class => "left", :width => 40
- %span.update-title
- = dashboard_feed_title(update)
- %span.update-author
- %strong= update.author_name
- authored
- = time_ago_in_words(update.created_at)
- ago
- .right
- - klass = update.class.to_s.split("::").last.downcase
- %span.tag{ :class => klass }= klass
+ = render "dashboard/projects_feed"
diff --git a/app/views/issues/_show.html.haml b/app/views/issues/_show.html.haml
index a68659d544f..904b18955b6 100644
--- a/app/views/issues/_show.html.haml
+++ b/app/views/issues/_show.html.haml
@@ -2,13 +2,10 @@
%td
%strong.issue-number{:class => sort_class}= "##{issue.id}"
%span
- = truncate(html_escape(issue.title), :length => fixed_mode? ? 100 : 200)
+ = truncate(html_escape(issue.title), :length => 40)
%br
%br
%div.note-author
- - if not @project.present?
- %strong= issue.project.name
- = '-'
%strong= issue.assignee.name
%cite.cgray
= time_ago_in_words(issue.created_at)
diff --git a/app/views/layouts/_head_panel.html.erb b/app/views/layouts/_head_panel.html.erb
index 5110c18455f..5ad82ecd86a 100644
--- a/app/views/layouts/_head_panel.html.erb
+++ b/app/views/layouts/_head_panel.html.erb
@@ -25,9 +25,6 @@
<%= link_to dashboard_path, :class => current_page?(root_path) ? "current dashboard" : "dashboard" do %>
<span></span>Dashboard
<% end %>
- <%= link_to issues_path, :class => current_page?(issues_path) ? "current issues" : "issues" do %>
- <span></span>Issues
- <% end %>
<%= link_to projects_path, :class => current_page?(projects_path) ? "current project" : "project" do %>
<span></span>Projects
<% end %>
diff --git a/app/views/user_issues/index.html.haml b/app/views/user_issues/index.html.haml
index bf05ca5eaa7..d2c745e8c31 100644
--- a/app/views/user_issues/index.html.haml
+++ b/app/views/user_issues/index.html.haml
@@ -1,9 +1,18 @@
-%div#issues-table-holder
- %table.round-borders#issues-table
- %thead
- %th
- .top_panel_issues
- %h2 Issues assigned to me
+- content_for(:body_class, "dashboard-page")
- = render 'issues/issues'
- %br
+#dashboard-content.dashboard-content.content
+ %aside
+ %h4
+ - if current_user.can_create_project?
+ %a.button-small.button-green{:href => new_project_path} New Project
+ Your Projects
+ %ol.project-list
+ - @projects.each do |project|
+ %li
+ %a{:href => project_path(project)}
+ %span.arrow →
+ %span.project-name= project.name
+ %span.time
+ %strong Last activity:
+ = project.last_activity_date ? time_ago_in_words(project.last_activity_date) + " ago" : "Never"
+ = render "dashboard/issues_feed"
diff --git a/app/views/user_merge_requests/index.html.haml b/app/views/user_merge_requests/index.html.haml
index cf1c4143083..75d56bf5e44 100644
--- a/app/views/user_merge_requests/index.html.haml
+++ b/app/views/user_merge_requests/index.html.haml
@@ -1,10 +1,18 @@
-- if @merge_requests.opened.count > 0
- %div{ :class => "update-data ui-box ui-box-small ui-box-big" }
- %h3
- %span.tag.open Open
- .data
- = render @merge_requests.opened
-
- .clear
- %br
+- content_for(:body_class, "dashboard-page")
+#dashboard-content.dashboard-content.content
+ %aside
+ %h4
+ - if current_user.can_create_project?
+ %a.button-small.button-green{:href => new_project_path} New Project
+ Your Projects
+ %ol.project-list
+ - @projects.each do |project|
+ %li
+ %a{:href => project_path(project)}
+ %span.arrow →
+ %span.project-name= project.name
+ %span.time
+ %strong Last activity:
+ = project.last_activity_date ? time_ago_in_words(project.last_activity_date) + " ago" : "Never"
+ = render "dashboard/merge_requests_feed"