merge request list

This commit is contained in:
Dmitriy Zaporozhets 2011-11-28 20:30:35 +02:00
parent 6d460aa2d6
commit 6b941cf92c
6 changed files with 58 additions and 32 deletions

View file

@ -328,12 +328,16 @@ body.project-page table .commit {
border:none;
text-shadow:none;
&.high {
&.inline {
display:inline;
}
&.high, &.closed {
background: #D12F19;
color:white;
}
&.today {
&.today, &.open {
background: #44aa22;
color:white;
}
@ -399,6 +403,19 @@ body.project-page .merge-request-commits a.commit span.update-author{color: #999
body.project-page .merge-request-commits a.commit span.update-author strong{font-weight: bold; font-style: normal;}
/** Update entry **/
.update-data { padding: 0 }
.update-data { width:100%; }
.update-data.ui-box .data { padding:0; }
a.update-item {padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;}
a.update-item:last-child{border-bottom: 0}
a.update-item img{float: left; margin-right: 10px;}
a.update-item span.update-title, .dashboard-page .news-feed .project-updates li a span.update-author{display: block;}
a.update-item span.update-title{margin-bottom: 10px}
a.update-item span.update-author{color: #999; font-weight: normal; font-style: italic;}
a.update-item span.update-author strong{font-weight: bold; font-style: normal;}
body.project-page .team_member_new .span-6, .team_member_edit .span-6{ padding:10px 0; }
body.projects-page input.text.git-url.project_list_url { width:165px; }

View file

@ -10,7 +10,7 @@ class MergeRequestsController < ApplicationController
before_filter :authorize_write_project!, :only => [:new, :create, :edit, :update]
def index
@merge_requests = @project.merge_requests.all
@merge_requests = @project.merge_requests
end
def show

View file

@ -3,9 +3,9 @@
= "Issue ##{@issue.id}"
.right
- if @issue.closed
%span.tag.high Resolved
%span.tag.closed Closed
- else
%span.tag.today Open
%span.tag.open Open
.data
%p= @issue.title
@ -28,7 +28,7 @@
- if @issue.closed
= link_to 'Reopen', project_issue_path(@project, @issue, :issue => {:closed => false }, :status_only => true), :method => :put, :class => "grey-button"
- else
= link_to 'Resolve', project_issue_path(@project, @issue, :issue => {:closed => true }, :status_only => true), :method => :put, :class => "grey-button"
= link_to 'Close', project_issue_path(@project, @issue, :issue => {:closed => true }, :status_only => true), :method => :put, :class => "grey-button"
.right
= link_to 'Edit', edit_project_issue_path(@project, @issue), :class => "grey-button positive"

View file

@ -0,0 +1,14 @@
%a.update-item{:href => project_merge_request_path(@project, merge_request)}
= image_tag gravatar_icon(merge_request.author_email), :class => "left", :width => 40
%span.update-title
= merge_request.title
%span.update-author
%strong= merge_request.author_name
authored
= time_ago_in_words(merge_request.created_at)
ago
.right
%span.tag.commit= merge_request.source_branch
&rarr;
%span.tag.commit= merge_request.target_branch

View file

@ -1,25 +1,20 @@
%table
%thead
%th Target branch
%th Source branch
%th Author
%th Assignee
%th Title
%th
%th
%th
- 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
- @merge_requests.each do |merge_request|
%tr
%td= merge_request.target_branch
%td= merge_request.source_branch
%td= merge_request.author_id
%td= merge_request.assignee_id
%td= merge_request.title
%td= link_to 'Show', [@project, merge_request]
%td= link_to 'Edit', edit_project_merge_request_path(@project, merge_request)
%td= link_to 'Destroy', [@project, merge_request], :confirm => 'Are you sure?', :method => :delete
.clear
%br
%br
- if @merge_requests.closed.count > 0
%div{ :class => "update-data ui-box ui-box-small ui-box-big" }
%h3
%span.tag.closed Closed
.data
= render @merge_requests.closed
.clear
%br
= link_to 'New Merge request', new_project_merge_request_path(@project)
= link_to 'New Merge request', new_project_merge_request_path(@project), :class => "grey-button"

View file

@ -2,12 +2,12 @@
%h3
= "Merge Request ##{@merge_request.id}:"
&nbsp;
= "'#{@merge_request.source_branch}'"
.tag.commit.inline= @merge_request.source_branch
&rarr;
= "'#{@merge_request.target_branch}'"
.tag.commit.inline= @merge_request.target_branch
.right
- if @merge_request.closed
%span.tag.high Resolved
%span.tag.high Closed
- else
%span.tag.today Open
@ -32,7 +32,7 @@
- if @merge_request.closed
= link_to 'Reopen', project_merge_request_path(@project, @merge_request, :merge_request => {:closed => false }, :status_only => true), :method => :put, :class => "grey-button"
- else
= link_to 'Resolve', project_merge_request_path(@project, @merge_request, :merge_request => {:closed => true }, :status_only => true), :method => :put, :class => "grey-button"
= link_to 'Close', project_merge_request_path(@project, @merge_request, :merge_request => {:closed => true }, :status_only => true), :method => :put, :class => "grey-button"
.right
= link_to 'Edit', edit_project_merge_request_path(@project, @merge_request), :class => "grey-button positive"