diff --git a/app/assets/stylesheets/projects.css.scss b/app/assets/stylesheets/projects.css.scss index c94e7934..8ea868bc 100644 --- a/app/assets/stylesheets/projects.css.scss +++ b/app/assets/stylesheets/projects.css.scss @@ -344,12 +344,32 @@ body.project-page table .commit { background: #2c5c66; color:white; } + &.note { + background: #2c5c66; + color:white; + } &.issue { background: #D12F19; color:white; } &.commit { - background: #2c5c66; + background: #44aacc; color:white; } } + + +/* Project Dashboard Page */ +html, body { height: 100%; } + +body.dashboard.project-page .news-feed h2{float: left;} +body.dashboard.project-page .news-feed .project-updates {margin-bottom: 20px; display: block; width: 100%;} +body.dashboard.project-page .news-feed .project-updates .data{ padding: 0} +body.dashboard.project-page .news-feed .project-updates a.project-update {padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;} +body.dashboard.project-page .news-feed .project-updates a.project-update:last-child{border-bottom: 0} +body.dashboard.project-page .news-feed .project-updates a.project-update img{float: left; margin-right: 10px;} +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;} +body.dashboard.project-page .news-feed .project-updates a.project-update span.update-title{margin-bottom: 10px} +body.dashboard.project-page .news-feed .project-updates a.project-update span.update-author{color: #999; font-weight: normal; font-style: italic;} +body.dashboard.project-page .news-feed .project-updates a.project-update span.update-author strong{font-weight: bold; font-style: normal;} +/* eo Dashboard Page */ diff --git a/app/views/projects/_feed.html.haml b/app/views/projects/_feed.html.haml new file mode 100644 index 00000000..e1ed2944 --- /dev/null +++ b/app/views/projects/_feed.html.haml @@ -0,0 +1,15 @@ +%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 + - if update.kind_of?(Grit::Commit) + %span.tag.commit= update.head.name + diff --git a/app/views/projects/_recent_commits.html.haml b/app/views/projects/_recent_commits.html.haml deleted file mode 100644 index 9680eb52..00000000 --- a/app/views/projects/_recent_commits.html.haml +++ /dev/null @@ -1,34 +0,0 @@ -%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;" - .title - %p - %span.tag.commit= commit.head.name - = link_to truncate(commit.safe_message, :length => 40), project_commit_path(@project, :id => commit.id) - - %span - %span.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 deleted file mode 100644 index 57583f5c..00000000 --- a/app/views/projects/_recent_messages.html.haml +++ /dev/null @@ -1,27 +0,0 @@ -- @messages.group_by{ |x| [x.noteable_id, x.noteable_type]}.each do |item, notes| - - id, type = item[0], item[1] - - parent = load_note_parent(id, type, @project) - - next unless parent - - %table - %thead - %th - %div{ :class => "recent_message_parent"} - = link_to(truncate(dashboard_feed_title(parent), :length => 40 ), 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.title - = link_to markdown(truncate(note.note, :length => 40)), dashboard_feed_path(@project, parent) + "#note_#{note.id}" - - if note.attachment.url - %br - Attachment: - = link_to note.attachment_identifier, note.attachment.url - %div.author - %strong= note.author_name - %cite.cgray - = time_ago_in_words(note.updated_at) - ago - %br diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index f693cb9d..97ac92d1 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -1,8 +1,12 @@ -.left.width-49p - =render "projects/recent_commits" +- content_for(:body_class, "project-page dashboard") -.right.width-49p - =render "projects/recent_messages" +#news-feed.news-feed + %h2.icon + %span> + Activities + .project-box.project-updates.ui-box.ui-box-small.ui-box-big + - @project.updates(20).each do |update| + = render "projects/feed", :update => update, :project => @project :javascript function updateDashboard(){ diff --git a/spec/requests/projects_spec.rb b/spec/requests/projects_spec.rb index 87f76fdb..85c2d275 100644 --- a/spec/requests/projects_spec.rb +++ b/spec/requests/projects_spec.rb @@ -73,7 +73,7 @@ describe "Projects" do end it "should beahave like activities page" do - within ".commit" do + within ".project-update" do page.should have_content("master") page.should have_content(@project.commit.author.name) page.should have_content(@project.commit.safe_message)