Commit 8786aff25a8e68e1dd6c50f3802eadb35908f151

Authored by Dmitriy Zaporozhets
1 parent 4dd5d9c8

project avtivity page

app/assets/stylesheets/projects.css.scss
... ... @@ -344,12 +344,32 @@ body.project-page table .commit {
344 344 background: #2c5c66;
345 345 color:white;
346 346 }
  347 + &.note {
  348 + background: #2c5c66;
  349 + color:white;
  350 + }
347 351 &.issue {
348 352 background: #D12F19;
349 353 color:white;
350 354 }
351 355 &.commit {
352   - background: #2c5c66;
  356 + background: #44aacc;
353 357 color:white;
354 358 }
355 359 }
  360 +
  361 +
  362 +/* Project Dashboard Page */
  363 +html, body { height: 100%; }
  364 +
  365 +body.dashboard.project-page .news-feed h2{float: left;}
  366 +body.dashboard.project-page .news-feed .project-updates {margin-bottom: 20px; display: block; width: 100%;}
  367 +body.dashboard.project-page .news-feed .project-updates .data{ padding: 0}
  368 +body.dashboard.project-page .news-feed .project-updates a.project-update {padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;}
  369 +body.dashboard.project-page .news-feed .project-updates a.project-update:last-child{border-bottom: 0}
  370 +body.dashboard.project-page .news-feed .project-updates a.project-update img{float: left; margin-right: 10px;}
  371 +body.dashboard.project-page .news-feed .project-updates a.project-update span.update-title, .dashboard-page .news-feed .project-updates li a span.update-author{display: block;}
  372 +body.dashboard.project-page .news-feed .project-updates a.project-update span.update-title{margin-bottom: 10px}
  373 +body.dashboard.project-page .news-feed .project-updates a.project-update span.update-author{color: #999; font-weight: normal; font-style: italic;}
  374 +body.dashboard.project-page .news-feed .project-updates a.project-update span.update-author strong{font-weight: bold; font-style: normal;}
  375 +/* eo Dashboard Page */
... ...
app/views/projects/_feed.html.haml 0 → 100644
... ... @@ -0,0 +1,15 @@
  1 +%a.project-update{:href => dashboard_feed_path(project, update)}
  2 + = image_tag gravatar_icon(update.author_email), :class => "left", :width => 40
  3 + %span.update-title
  4 + = dashboard_feed_title(update)
  5 + %span.update-author
  6 + %strong= update.author_name
  7 + authored
  8 + = time_ago_in_words(update.created_at)
  9 + ago
  10 + .right
  11 + - klass = update.class.to_s.split("::").last.downcase
  12 + %span.tag{ :class => klass }= klass
  13 + - if update.kind_of?(Grit::Commit)
  14 + %span.tag.commit= update.head.name
  15 +
... ...
app/views/projects/_recent_commits.html.haml
... ... @@ -1,34 +0,0 @@
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   - .title
25   - %p
26   - %span.tag.commit= commit.head.name
27   - = link_to truncate(commit.safe_message, :length => 40), project_commit_path(@project, :id => commit.id)
28   -
29   - %span
30   - %span.author
31   - %strong= commit.author.name.force_encoding("UTF-8")
32   - %cite.cgray
33   - = time_ago_in_words(commit.committed_date)
34   - ago
app/views/projects/_recent_messages.html.haml
... ... @@ -1,27 +0,0 @@
1   -- @messages.group_by{ |x| [x.noteable_id, x.noteable_type]}.each do |item, notes|
2   - - id, type = item[0], item[1]
3   - - parent = load_note_parent(id, type, @project)
4   - - next unless parent
5   -
6   - %table
7   - %thead
8   - %th
9   - %div{ :class => "recent_message_parent"}
10   - = link_to(truncate(dashboard_feed_title(parent), :length => 40 ), 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.title
17   - = link_to markdown(truncate(note.note, :length => 40)), dashboard_feed_path(@project, parent) + "#note_#{note.id}"
18   - - if note.attachment.url
19   - %br
20   - Attachment:
21   - = link_to note.attachment_identifier, note.attachment.url
22   - %div.author
23   - %strong= note.author_name
24   - %cite.cgray
25   - = time_ago_in_words(note.updated_at)
26   - ago
27   - %br
app/views/projects/show.html.haml
1   -.left.width-49p
2   - =render "projects/recent_commits"
  1 +- content_for(:body_class, "project-page dashboard")
3 2  
4   -.right.width-49p
5   - =render "projects/recent_messages"
  3 +#news-feed.news-feed
  4 + %h2.icon
  5 + %span>
  6 + Activities
  7 + .project-box.project-updates.ui-box.ui-box-small.ui-box-big
  8 + - @project.updates(20).each do |update|
  9 + = render "projects/feed", :update => update, :project => @project
6 10  
7 11 :javascript
8 12 function updateDashboard(){
... ...
spec/requests/projects_spec.rb
... ... @@ -73,7 +73,7 @@ describe &quot;Projects&quot; do
73 73 end
74 74  
75 75 it "should beahave like activities page" do
76   - within ".commit" do
  76 + within ".project-update" do
77 77 page.should have_content("master")
78 78 page.should have_content(@project.commit.author.name)
79 79 page.should have_content(@project.commit.safe_message)
... ...