Commit a44e329222516573ae3a9c255801bd057ec2fd36
1 parent
1d85197b
Exists in
master
and in
4 other branches
project dashboard updated
Showing
7 changed files
with
62 additions
and
139 deletions
Show diff stats
app/assets/stylesheets/projects.css.scss
@@ -443,57 +443,6 @@ input.ssh_project_url { | @@ -443,57 +443,6 @@ input.ssh_project_url { | ||
443 | padding: 10px; | 443 | padding: 10px; |
444 | } | 444 | } |
445 | 445 | ||
446 | -.recent_message_parent { | ||
447 | - img { | ||
448 | - padding-right:10px; | ||
449 | - } | ||
450 | - | ||
451 | - float: left; | ||
452 | - margin: 0 20px 20px 0px; | ||
453 | - padding: 5px 0px;; | ||
454 | - width: 420px; | ||
455 | - | ||
456 | - &.dash_wall{ | ||
457 | - border-bottom: 2px solid orange; | ||
458 | - span { | ||
459 | - background: orange; | ||
460 | - color:black; | ||
461 | - } | ||
462 | - } | ||
463 | - | ||
464 | - &.dash_issue{ | ||
465 | - border-bottom: 2px solid #ffbbbb; | ||
466 | - span { | ||
467 | - background: #ffbbbb; | ||
468 | - } | ||
469 | - } | ||
470 | - &.dash_commit{ | ||
471 | - border-bottom: 2px solid #bbbbff; | ||
472 | - | ||
473 | - span{ | ||
474 | - background: #bbbbff; | ||
475 | - } | ||
476 | - } | ||
477 | - | ||
478 | - &.dash_snippet{ | ||
479 | - border-bottom: 2px solid #bbffbb; | ||
480 | - | ||
481 | - span{ | ||
482 | - background: #bbffbb; | ||
483 | - } | ||
484 | - } | ||
485 | - | ||
486 | - span{ | ||
487 | - border: 1px solid #aaa; | ||
488 | - color:black; | ||
489 | - padding:1px 4px; | ||
490 | - } | ||
491 | - | ||
492 | - h4 { | ||
493 | - margin-bottom:3px; | ||
494 | - } | ||
495 | - | ||
496 | -} | ||
497 | .commit, | 446 | .commit, |
498 | .message{ | 447 | .message{ |
499 | .author { | 448 | .author { |
@@ -665,6 +614,8 @@ table.highlighttable pre{ | @@ -665,6 +614,8 @@ table.highlighttable pre{ | ||
665 | margin-right:15px; | 614 | margin-right:15px; |
666 | } | 615 | } |
667 | } | 616 | } |
617 | +.filter .left { margin-right:15px; } | ||
618 | + | ||
668 | 619 | ||
669 | .cgray { color:gray; } | 620 | .cgray { color:gray; } |
670 | .cred { color:#D12F19; } | 621 | .cred { color:#D12F19; } |
@@ -721,3 +672,5 @@ body.project-page #notes-list .note span.note-author strong{font-weight: bold; f | @@ -721,3 +672,5 @@ body.project-page #notes-list .note span.note-author strong{font-weight: bold; f | ||
721 | border-bottom: 1px solid #DEE2E3; | 672 | border-bottom: 1px solid #DEE2E3; |
722 | } | 673 | } |
723 | } | 674 | } |
675 | + | ||
676 | +.message .note-title p { margin-bottom:0px; } |
app/helpers/dashboard_helper.rb
@@ -12,7 +12,7 @@ module DashboardHelper | @@ -12,7 +12,7 @@ module DashboardHelper | ||
12 | when "Commit" then project_commit_path(project, :id => note.noteable_id) | 12 | when "Commit" then project_commit_path(project, :id => note.noteable_id) |
13 | else wall_project_path(project) | 13 | else wall_project_path(project) |
14 | end | 14 | end |
15 | - else "#" | 15 | + else wall_project_path(project) |
16 | end | 16 | end |
17 | rescue | 17 | rescue |
18 | "#" | 18 | "#" |
@@ -23,7 +23,7 @@ module DashboardHelper | @@ -23,7 +23,7 @@ module DashboardHelper | ||
23 | when "Note" then markdown(object.note) | 23 | when "Note" then markdown(object.note) |
24 | when "Issue" then object.title | 24 | when "Issue" then object.title |
25 | when "Grit::Commit" then object.safe_message | 25 | when "Grit::Commit" then object.safe_message |
26 | - else "" | 26 | + else return "Project Wall" |
27 | end | 27 | end |
28 | "[#{object.class.name}] #{truncate(sanitize(title, :tags => []), :length => 60)} " | 28 | "[#{object.class.name}] #{truncate(sanitize(title, :tags => []), :length => 60)} " |
29 | end | 29 | end |
app/views/dashboard/index.html.haml
@@ -23,7 +23,7 @@ | @@ -23,7 +23,7 @@ | ||
23 | .project-box.project-updates.ui-box.ui-box-small.ui-box-big | 23 | .project-box.project-updates.ui-box.ui-box-small.ui-box-big |
24 | %h3= project.name | 24 | %h3= project.name |
25 | .data | 25 | .data |
26 | - - project.updates.each do |update| | 26 | + - project.updates(4).each do |update| |
27 | %a.project-update{:href => dashboard_feed_path(project, update)} | 27 | %a.project-update{:href => dashboard_feed_path(project, update)} |
28 | = image_tag gravatar_icon(update.author_email), :class => "left", :width => 40 | 28 | = image_tag gravatar_icon(update.author_email), :class => "left", :width => 40 |
29 | %span.update-title | 29 | %span.update-title |
@@ -34,7 +34,5 @@ | @@ -34,7 +34,5 @@ | ||
34 | = time_ago_in_words(update.created_at) | 34 | = time_ago_in_words(update.created_at) |
35 | ago | 35 | ago |
36 | %br | 36 | %br |
37 | - / .project-update | ||
38 | - / .project-updates | ||
39 | / #news-feed | 37 | / #news-feed |
40 | / #dashboard-content | 38 | / #dashboard-content |
app/views/projects/_recent_commits.html.haml
1 | -- @commits.each do |commit| | ||
2 | - %div.commit | ||
3 | - - if commit.author.email | ||
4 | - = image_tag gravatar_icon(commit.author.email), :class => "left", :width => 40, :style => "padding-right:5px;" | ||
5 | - - else | ||
6 | - = image_tag "no_avatar.png", :class => "left", :width => 40, :style => "padding-right:5px;" | ||
7 | - %p{:style => "margin-bottom: 3px;"} | ||
8 | - %strong | ||
9 | - = link_to truncate(commit.safe_message, :length => 60), project_commit_path(@project, :id => commit.id) | ||
10 | - | ||
11 | - %span | ||
12 | - %span.author | ||
13 | - = commit.author.name.force_encoding("UTF-8") | ||
14 | - %cite | ||
15 | - = time_ago_in_words(commit.committed_date) | ||
16 | - ago | ||
17 | - %br | 1 | +%table |
2 | + %thead | ||
3 | + %th | ||
4 | + Commits | ||
5 | + .filter.right | ||
6 | + = form_tag project_path(@project), :method => :get, :class => "right" do | ||
7 | + .left | ||
8 | + = radio_button_tag :view, "recent", (params[:view] || "recent") == "recent", :onclick => "this.form.submit()", :id => "recent_view" | ||
9 | + = label_tag "recent_view","Recent" | ||
10 | + .left | ||
11 | + = radio_button_tag :view, "day", params[:view] == "day", :onclick => "this.form.submit()", :id => "day_view" | ||
12 | + = label_tag "day_view","Today" | ||
13 | + .left | ||
14 | + = radio_button_tag :view, "week", params[:view] == "week", :onclick => "this.form.submit()", :id => "week_view" | ||
15 | + = label_tag "week_view","Week" | ||
16 | + - @commits.each do |commit| | ||
17 | + %tr | ||
18 | + %td | ||
19 | + %div.commit | ||
20 | + - if commit.author.email | ||
21 | + = image_tag gravatar_icon(commit.author.email), :class => "left", :width => 40, :style => "padding-right:5px;" | ||
22 | + - else | ||
23 | + = image_tag "no_avatar.png", :class => "left", :width => 40, :style => "padding-right:5px;" | ||
24 | + %p{:style => "margin-bottom: 3px;"} | ||
25 | + %strong | ||
26 | + = link_to truncate(commit.safe_message, :length => fixed_mode? ? 40 : 100), project_commit_path(@project, :id => commit.id) | ||
18 | 27 | ||
28 | + %span | ||
29 | + %span.note-author | ||
30 | + %strong= commit.author.name.force_encoding("UTF-8") | ||
31 | + %cite.cgray | ||
32 | + = time_ago_in_words(commit.committed_date) | ||
33 | + ago |
app/views/projects/_recent_messages.html.haml
@@ -3,50 +3,25 @@ | @@ -3,50 +3,25 @@ | ||
3 | - parent = load_note_parent(id, type, @project) | 3 | - parent = load_note_parent(id, type, @project) |
4 | - next unless parent | 4 | - next unless parent |
5 | 5 | ||
6 | - - case type | ||
7 | - - when "Issue" | ||
8 | - - css_class = "dash_issue" | ||
9 | - - issue = parent | ||
10 | - - item_code = issue.author.email | ||
11 | - - link_item_name = truncate(issue.title, :length => 50) | ||
12 | - - link_to_item = project_issue_path(@project, issue) | ||
13 | - - when "Snippet" | ||
14 | - - css_class = "dash_snippet" | ||
15 | - - item_code = parent.author.email | ||
16 | - - link_item_name = parent.title | ||
17 | - - link_to_item = project_snippet_path(@project, parent) | ||
18 | - - when "Commit" | ||
19 | - - css_class = "dash_commit" | ||
20 | - - commit = parent | ||
21 | - - item_code = commit.author.email | ||
22 | - - link_item_name = truncate(commit.safe_message, :length => 50) | ||
23 | - - link_to_item = project_commit_path(@project, :id => commit.id) | ||
24 | - - else | ||
25 | - - css_class = "dash_wall" | ||
26 | - - item_code = @project.name | ||
27 | - - link_item_name = "Project Wall" | ||
28 | - - link_to_item = wall_project_path(@project) | ||
29 | - | ||
30 | - %div{ :class => "recent_message_parent #{css_class}"} | ||
31 | - = image_tag gravatar_icon(item_code), :class => "left", :width => 40 | ||
32 | - %h4 | ||
33 | - = link_to(link_item_name, link_to_item) | ||
34 | - %span | ||
35 | - = type | ||
36 | - .clear | ||
37 | - - notes.sort {|x,y| x.updated_at <=> y.updated_at }.each do |note| | ||
38 | - %div.message | ||
39 | - = image_tag gravatar_icon(note.author.email), :class => "left", :width => 24, :style => "padding-right:5px;" | ||
40 | - %p{:style => "margin-bottom: 3px;"} | ||
41 | - %span.author | ||
42 | - = note.author.name | ||
43 | - = link_to markdown(truncate(note.note, :length => 200)), link_to_item + "#note_#{note.id}" | ||
44 | - - if note.attachment.url | ||
45 | - %br | ||
46 | - Attachment: | ||
47 | - = link_to note.attachment_identifier, note.attachment.url | ||
48 | - %br | ||
49 | - %br | ||
50 | - .append-bottom | ||
51 | - | ||
52 | - .clear | 6 | + %table |
7 | + %thead | ||
8 | + %th | ||
9 | + %div{ :class => "recent_message_parent"} | ||
10 | + = link_to(truncate(dashboard_feed_title(parent), :length => fixed_mode? ? 40 : 100 ), dashboard_feed_path(@project, parent)) | ||
11 | + - notes.sort {|x,y| y.updated_at <=> x.updated_at }.each do |note| | ||
12 | + %tr | ||
13 | + %td | ||
14 | + %div.message | ||
15 | + = image_tag gravatar_icon(note.author_email), :class => "left", :width => 40, :style => "padding-right:5px;" | ||
16 | + %div.note-author | ||
17 | + %strong= note.author_name | ||
18 | + %cite.cgray | ||
19 | + = time_ago_in_words(note.updated_at) | ||
20 | + ago | ||
21 | + %div.note-title | ||
22 | + = link_to markdown(truncate(note.note, :length => fixed_mode? ? 40 : 100)), dashboard_feed_path(@project, parent) + "#note_#{note.id}" | ||
23 | + - if note.attachment.url | ||
24 | + %br | ||
25 | + Attachment: | ||
26 | + = link_to note.attachment_identifier, note.attachment.url | ||
27 | + %br |
app/views/projects/show.html.haml
1 | -%div | ||
2 | - %h2.left History | ||
3 | - .right | ||
4 | - = form_tag project_path(@project), :method => :get do | ||
5 | - .span-2 | ||
6 | - = radio_button_tag :view, "recent", (params[:view] || "recent") == "recent", :onclick => "this.form.submit()", :id => "recent_view" | ||
7 | - = label_tag "recent_view","Recent" | ||
8 | - .span-2 | ||
9 | - = radio_button_tag :view, "day", params[:view] == "day", :onclick => "this.form.submit()", :id => "day_view" | ||
10 | - = label_tag "day_view","Today" | ||
11 | - .span-2 | ||
12 | - = radio_button_tag :view, "week", params[:view] == "week", :onclick => "this.form.submit()", :id => "week_view" | ||
13 | - = label_tag "week_view","Week" | ||
14 | - .clear | ||
15 | - %hr | ||
16 | .left.width-49p | 1 | .left.width-49p |
17 | - %h3 Commits | ||
18 | =render "projects/recent_commits" | 2 | =render "projects/recent_commits" |
19 | 3 | ||
20 | .right.width-49p | 4 | .right.width-49p |
21 | - %h3 Talk | ||
22 | =render "projects/recent_messages" | 5 | =render "projects/recent_messages" |
23 | 6 | ||
24 | :javascript | 7 | :javascript |
25 | function updateDashboard(){ | 8 | function updateDashboard(){ |
26 | - $('#content-container').load("#{escape_javascript(project_path(@project))} #content-container>*"); | 9 | + $('.project-content').load("#{escape_javascript(project_path(@project))} .project-content>*"); |
27 | } | 10 | } |
28 | setInterval("updateDashboard()", 300000); | 11 | setInterval("updateDashboard()", 300000); |
spec/requests/issues_spec.rb
@@ -158,7 +158,6 @@ describe "Issues" do | @@ -158,7 +158,6 @@ describe "Issues" do | ||
158 | it "should have valid show page for issue" do | 158 | it "should have valid show page for issue" do |
159 | page.should have_content @issue.title | 159 | page.should have_content @issue.title |
160 | page.should have_content @user.name | 160 | page.should have_content @user.name |
161 | - page.should have_content "today" | ||
162 | end | 161 | end |
163 | end | 162 | end |
164 | 163 |