diff options
author | Dmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com> | 2011-11-09 01:56:10 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com> | 2011-11-09 01:56:10 +0200 |
commit | a44e329222516573ae3a9c255801bd057ec2fd36 (patch) | |
tree | bba5c6ab3bb2f8ee250e42d0937d108f72cc4cba /app | |
parent | 1d85197b08346c99e6015cb25b31f8fd10f4100f (diff) | |
download | gitlab-ce-a44e329222516573ae3a9c255801bd057ec2fd36.tar.gz |
project dashboard updated
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/stylesheets/projects.css.scss | 55 | ||||
-rw-r--r-- | app/helpers/dashboard_helper.rb | 4 | ||||
-rw-r--r-- | app/views/dashboard/index.html.haml | 4 | ||||
-rw-r--r-- | app/views/projects/_recent_commits.html.haml | 49 | ||||
-rw-r--r-- | app/views/projects/_recent_messages.html.haml | 69 | ||||
-rw-r--r-- | app/views/projects/show.html.haml | 19 |
6 files changed, 62 insertions, 138 deletions
diff --git a/app/assets/stylesheets/projects.css.scss b/app/assets/stylesheets/projects.css.scss index 1d6d43f3775..8c5d8a683d9 100644 --- a/app/assets/stylesheets/projects.css.scss +++ b/app/assets/stylesheets/projects.css.scss @@ -443,57 +443,6 @@ input.ssh_project_url { padding: 10px; } -.recent_message_parent { - img { - padding-right:10px; - } - - float: left; - margin: 0 20px 20px 0px; - padding: 5px 0px;; - width: 420px; - - &.dash_wall{ - border-bottom: 2px solid orange; - span { - background: orange; - color:black; - } - } - - &.dash_issue{ - border-bottom: 2px solid #ffbbbb; - span { - background: #ffbbbb; - } - } - &.dash_commit{ - border-bottom: 2px solid #bbbbff; - - span{ - background: #bbbbff; - } - } - - &.dash_snippet{ - border-bottom: 2px solid #bbffbb; - - span{ - background: #bbffbb; - } - } - - span{ - border: 1px solid #aaa; - color:black; - padding:1px 4px; - } - - h4 { - margin-bottom:3px; - } - -} .commit, .message{ .author { @@ -665,6 +614,8 @@ table.highlighttable pre{ margin-right:15px; } } +.filter .left { margin-right:15px; } + .cgray { color:gray; } .cred { color:#D12F19; } @@ -721,3 +672,5 @@ body.project-page #notes-list .note span.note-author strong{font-weight: bold; f border-bottom: 1px solid #DEE2E3; } } + +.message .note-title p { margin-bottom:0px; } diff --git a/app/helpers/dashboard_helper.rb b/app/helpers/dashboard_helper.rb index 0560af5daf5..03f6a015886 100644 --- a/app/helpers/dashboard_helper.rb +++ b/app/helpers/dashboard_helper.rb @@ -12,7 +12,7 @@ module DashboardHelper when "Commit" then project_commit_path(project, :id => note.noteable_id) else wall_project_path(project) end - else "#" + else wall_project_path(project) end rescue "#" @@ -23,7 +23,7 @@ module DashboardHelper when "Note" then markdown(object.note) when "Issue" then object.title when "Grit::Commit" then object.safe_message - else "" + else return "Project Wall" end "[#{object.class.name}] #{truncate(sanitize(title, :tags => []), :length => 60)} " end diff --git a/app/views/dashboard/index.html.haml b/app/views/dashboard/index.html.haml index eb2122dff8f..8d48d1f70b5 100644 --- a/app/views/dashboard/index.html.haml +++ b/app/views/dashboard/index.html.haml @@ -23,7 +23,7 @@ .project-box.project-updates.ui-box.ui-box-small.ui-box-big %h3= project.name .data - - project.updates.each do |update| + - project.updates(4).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 @@ -34,7 +34,5 @@ = time_ago_in_words(update.created_at) ago %br - / .project-update - / .project-updates / #news-feed / #dashboard-content diff --git a/app/views/projects/_recent_commits.html.haml b/app/views/projects/_recent_commits.html.haml index b34470d6741..385fa4b6eed 100644 --- a/app/views/projects/_recent_commits.html.haml +++ b/app/views/projects/_recent_commits.html.haml @@ -1,18 +1,33 @@ -- @commits.each do |commit| - %div.commit - - if commit.author.email - = image_tag gravatar_icon(commit.author.email), :class => "left", :width => 40, :style => "padding-right:5px;" - - else - = image_tag "no_avatar.png", :class => "left", :width => 40, :style => "padding-right:5px;" - %p{:style => "margin-bottom: 3px;"} - %strong - = link_to truncate(commit.safe_message, :length => 60), project_commit_path(@project, :id => commit.id) - - %span - %span.author - = commit.author.name.force_encoding("UTF-8") - %cite - = time_ago_in_words(commit.committed_date) - ago - %br +%table + %thead + %th + Commits + .filter.right + = form_tag project_path(@project), :method => :get, :class => "right" do + .left + = radio_button_tag :view, "recent", (params[:view] || "recent") == "recent", :onclick => "this.form.submit()", :id => "recent_view" + = label_tag "recent_view","Recent" + .left + = radio_button_tag :view, "day", params[:view] == "day", :onclick => "this.form.submit()", :id => "day_view" + = label_tag "day_view","Today" + .left + = radio_button_tag :view, "week", params[:view] == "week", :onclick => "this.form.submit()", :id => "week_view" + = label_tag "week_view","Week" + - @commits.each do |commit| + %tr + %td + %div.commit + - if commit.author.email + = image_tag gravatar_icon(commit.author.email), :class => "left", :width => 40, :style => "padding-right:5px;" + - else + = image_tag "no_avatar.png", :class => "left", :width => 40, :style => "padding-right:5px;" + %p{:style => "margin-bottom: 3px;"} + %strong + = link_to truncate(commit.safe_message, :length => fixed_mode? ? 40 : 100), project_commit_path(@project, :id => commit.id) + %span + %span.note-author + %strong= commit.author.name.force_encoding("UTF-8") + %cite.cgray + = time_ago_in_words(commit.committed_date) + ago diff --git a/app/views/projects/_recent_messages.html.haml b/app/views/projects/_recent_messages.html.haml index e5fb28b9eac..00052963e38 100644 --- a/app/views/projects/_recent_messages.html.haml +++ b/app/views/projects/_recent_messages.html.haml @@ -3,50 +3,25 @@ - parent = load_note_parent(id, type, @project) - next unless parent - - case type - - when "Issue" - - css_class = "dash_issue" - - issue = parent - - item_code = issue.author.email - - link_item_name = truncate(issue.title, :length => 50) - - link_to_item = project_issue_path(@project, issue) - - when "Snippet" - - css_class = "dash_snippet" - - item_code = parent.author.email - - link_item_name = parent.title - - link_to_item = project_snippet_path(@project, parent) - - when "Commit" - - css_class = "dash_commit" - - commit = parent - - item_code = commit.author.email - - link_item_name = truncate(commit.safe_message, :length => 50) - - link_to_item = project_commit_path(@project, :id => commit.id) - - else - - css_class = "dash_wall" - - item_code = @project.name - - link_item_name = "Project Wall" - - link_to_item = wall_project_path(@project) - - %div{ :class => "recent_message_parent #{css_class}"} - = image_tag gravatar_icon(item_code), :class => "left", :width => 40 - %h4 - = link_to(link_item_name, link_to_item) - %span - = type - .clear - - notes.sort {|x,y| x.updated_at <=> y.updated_at }.each do |note| - %div.message - = image_tag gravatar_icon(note.author.email), :class => "left", :width => 24, :style => "padding-right:5px;" - %p{:style => "margin-bottom: 3px;"} - %span.author - = note.author.name - = link_to markdown(truncate(note.note, :length => 200)), link_to_item + "#note_#{note.id}" - - if note.attachment.url - %br - Attachment: - = link_to note.attachment_identifier, note.attachment.url - %br - %br - .append-bottom - - .clear + %table + %thead + %th + %div{ :class => "recent_message_parent"} + = link_to(truncate(dashboard_feed_title(parent), :length => fixed_mode? ? 40 : 100 ), dashboard_feed_path(@project, parent)) + - notes.sort {|x,y| y.updated_at <=> x.updated_at }.each do |note| + %tr + %td + %div.message + = image_tag gravatar_icon(note.author_email), :class => "left", :width => 40, :style => "padding-right:5px;" + %div.note-author + %strong= note.author_name + %cite.cgray + = time_ago_in_words(note.updated_at) + ago + %div.note-title + = link_to markdown(truncate(note.note, :length => fixed_mode? ? 40 : 100)), dashboard_feed_path(@project, parent) + "#note_#{note.id}" + - if note.attachment.url + %br + Attachment: + = link_to note.attachment_identifier, note.attachment.url + %br diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index ff3524370bb..f693cb9d394 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -1,28 +1,11 @@ -%div - %h2.left History - .right - = form_tag project_path(@project), :method => :get do - .span-2 - = radio_button_tag :view, "recent", (params[:view] || "recent") == "recent", :onclick => "this.form.submit()", :id => "recent_view" - = label_tag "recent_view","Recent" - .span-2 - = radio_button_tag :view, "day", params[:view] == "day", :onclick => "this.form.submit()", :id => "day_view" - = label_tag "day_view","Today" - .span-2 - = radio_button_tag :view, "week", params[:view] == "week", :onclick => "this.form.submit()", :id => "week_view" - = label_tag "week_view","Week" - .clear - %hr .left.width-49p - %h3 Commits =render "projects/recent_commits" .right.width-49p - %h3 Talk =render "projects/recent_messages" :javascript function updateDashboard(){ - $('#content-container').load("#{escape_javascript(project_path(@project))} #content-container>*"); + $('.project-content').load("#{escape_javascript(project_path(@project))} .project-content>*"); } setInterval("updateDashboard()", 300000); |