Bootstrap: Issues & MR

This commit is contained in:
Dmitriy Zaporozhets 2012-01-29 12:04:09 +02:00
parent d81f0b7845
commit a77c8bf9c3
11 changed files with 168 additions and 137 deletions

View file

@ -162,6 +162,10 @@ img.avatar {
p { padding-top:5px;} p { padding-top:5px;}
} }
.author_link {
color: $active_link_color;
}
@import "reset_bootstrap.scss"; @import "reset_bootstrap.scss";
@import "top_panel.scss"; @import "top_panel.scss";
@import "projects.css.scss"; @import "projects.css.scss";

View file

@ -6,7 +6,33 @@ a {
} }
} }
.alert-message.entry { .entry {
position: relative;
padding: 7px 15px;
margin-bottom: 18px;
color: #404040;
background-color: #eedc94;
background-repeat: repeat-x;
background-image: -khtml-gradient(linear, left top, left bottom, from(#fceec1), to(#eedc94));
background-image: -moz-linear-gradient(top, #fceec1, #eedc94);
background-image: -ms-linear-gradient(top, #fceec1, #eedc94);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #fceec1), color-stop(100%, #eedc94));
background-image: -webkit-linear-gradient(top, #fceec1, #eedc94);
background-image: -o-linear-gradient(top, #fceec1, #eedc94);
background-image: linear-gradient(top, #fceec1, #eedc94);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFCEEC1', endColorstr='#FFEEDC94', GradientType=0);
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
border-color: #eedc94 #eedc94 #e4c652;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) fadein(rgba(0, 0, 0, 0.1), 15%);
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
border-width: 1px;
border-style: solid;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
background:#F1F1F1; background:#F1F1F1;
border-color:#ccc; border-color:#ccc;
} }

View file

@ -119,4 +119,8 @@ table.highlighttable .linenodiv pre {
background: #FFFFCF; background: #FFFFCF;
cursor:pointer; cursor:pointer;
} }
.tree-item-file-name {
font-weight:bold;
}
} }

View file

@ -27,7 +27,7 @@ class Commit
@head = head @head = head
end end
def safe_message() def safe_message
message message
end end

View file

@ -24,7 +24,7 @@
.clearfix .clearfix
= f.label :title = f.label :title
.input= f.text_area :title, :maxlength => 255, :class => "xlarge" .input= f.text_area :title, :maxlength => 255, :class => "xlarge"
.clearfix .actions
= f.submit 'Save', :class => "primary btn" = f.submit 'Save', :class => "primary btn"
- if request.xhr? - if request.xhr?
@ -36,6 +36,6 @@
= link_to "Cancel", project_issue_path(@project, @issue), :class => "btn" = link_to "Cancel", project_issue_path(@project, @issue), :class => "btn"
-#- unless @issue.new_record? - unless @issue.new_record?
.right .right
= link_to 'Remove', [@project, @issue], :confirm => 'Are you sure?', :method => :delete, :class => "red-button" = link_to 'Remove', [@project, @issue], :confirm => 'Are you sure?', :method => :delete, :class => "danger btn"

View file

@ -1,18 +1,18 @@
%tr{ :id => dom_id(issue), :class => "issue #{issue.critical ? "critical" : ""}", :url => project_issue_path(issue.project, issue) } %li.wll{ :id => dom_id(issue), :class => "issue #{issue.critical ? "critical" : ""}", :url => project_issue_path(issue.project, issue) }
%td = image_tag gravatar_icon(issue.author_email), :class => "avatar"
= image_tag gravatar_icon(issue.assignee_email), :class => "left", :width => 40, :style => "padding-right:5px;" %span.update-author
%span %strong
= truncate(html_escape(issue.title), :length => 50) = link_to project_team_member_path(@project, @project.team_member_by_id(issue.author_id)), :class => "author_link" do
%div.note-author = issue.author_name
%strong= issue.assignee.name authored
%cite.cgray
= time_ago_in_words(issue.created_at) = time_ago_in_words(issue.created_at)
ago ago
- if issue.critical - if issue.critical
%span.tag.high critical %span.label.important critical
- if issue.today? - if issue.today?
%span.tag.today today %span.label.success today
.right.action-links
.right
- if can? current_user, :write_issue, issue - if can? current_user, :write_issue, issue
- if issue.closed - if issue.closed
= link_to 'Reopen', project_issue_path(issue.project, issue, :issue => {:closed => false }, :status_only => true), :method => :put, :class => "btn small", :remote => true = link_to 'Reopen', project_issue_path(issue.project, issue, :issue => {:closed => false }, :status_only => true), :method => :put, :class => "btn small", :remote => true
@ -20,5 +20,15 @@
= link_to 'Resolve', project_issue_path(issue.project, issue, :issue => {:closed => true }, :status_only => true), :method => :put, :class => "success btn small", :remote => true = link_to 'Resolve', project_issue_path(issue.project, issue, :issue => {:closed => true }, :status_only => true), :method => :put, :class => "success btn small", :remote => true
- if can? current_user, :write_issue, issue - if can? current_user, :write_issue, issue
= link_to 'Edit', edit_project_issue_path(issue.project, issue), :class => "btn small edit-issue-link", :remote => true = link_to 'Edit', edit_project_issue_path(issue.project, issue), :class => "btn small edit-issue-link", :remote => true
- if can?(current_user, :admin_issue, @project) || issue.author == current_user -#- if can?(current_user, :admin_issue, @project) || issue.author == current_user
= link_to 'Remove', [issue.project, issue], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "danger btn small delete-issue", :id => "destroy_issue_#{issue.id}" = link_to 'Remove', [issue.project, issue], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "danger btn small delete-issue", :id => "destroy_issue_#{issue.id}"
= link_to project_issue_path(issue.project, issue) do
%p
Issue ##{issue.id}:
= truncate(issue.title, :length => 50)

View file

@ -13,6 +13,8 @@
New Issue New Issue
%hr %hr
%div#issues-table-holder %div#issues-table-holder
.row
.span8
%ul.pills.left %ul.pills.left
%li{:class => ("active" if (params[:f] == "0" || !params[:f]))} %li{:class => ("active" if (params[:f] == "0" || !params[:f]))}
= link_to project_issues_path(@project, :f => 0) do = link_to project_issues_path(@project, :f => 0) do
@ -27,11 +29,13 @@
= link_to project_issues_path(@project, :f => 1) do = link_to project_issues_path(@project, :f => 1) do
All All
.span2.right
= form_tag search_project_issues_path(@project), :method => :get, :remote => true, :id => "issue_search_form", :class => :right do = form_tag search_project_issues_path(@project), :method => :get, :remote => true, :id => "issue_search_form", :class => :right do
= hidden_field_tag :project_id, @project.id, { :id => 'project_id' } = hidden_field_tag :project_id, @project.id, { :id => 'project_id' }
= search_field_tag :issue_search, nil, { :placeholder => 'Search', :class => 'issue_search' } = search_field_tag :issue_search, nil, { :placeholder => 'Search', :class => 'issue_search' }
%table#issues-table= render "issues" %hr
%ul#issues-table.unstyled= render "issues"
:javascript :javascript
var href = $('.issue_search').parent().attr('action'); var href = $('.issue_search').parent().attr('action');
@ -46,7 +50,7 @@
if (terms.length >= 2 || terms.length == 0) { if (terms.length >= 2 || terms.length == 0) {
$.get(href, { 'status': status, 'terms': terms, project: project_id }, function(response) { $.get(href, { 'status': status, 'terms': terms, project: project_id }, function(response) {
$('#issues-table tbody').html(response); $('#issues-table').html(response);
setSortable(); setSortable();
}); });
} }
@ -57,7 +61,7 @@
$(this).closest('tr').fadeOut(); updatePage();}); $(this).closest('tr').fadeOut(); updatePage();});
function setSortable(){ function setSortable(){
$('#issues-table>tbody').sortable({ $('#issues-table').sortable({
axis: 'y', axis: 'y',
dropOnEmpty: false, dropOnEmpty: false,
handle: '.handle', handle: '.handle',
@ -68,10 +72,10 @@
update: function(){ update: function(){
$.ajax({ $.ajax({
type: 'post', type: 'post',
data: $('#issues-table>tbody').sortable('serialize'), data: $('#issues-table').sortable('serialize'),
dataType: 'script', dataType: 'script',
complete: function(request){ complete: function(request){
$('#issues-table>tbody').effect('highlight'); $('#issues-table').effect('highlight');
}, },
url: "#{sort_project_issues_path(@project)}"}) url: "#{sort_project_issues_path(@project)}"})
} }

View file

@ -1,49 +1,42 @@
%h3
Issue ##{@issue.id}
%span.right
- if can?(current_user, :admin_project, @project) || @issue.author == current_user
- if @issue.closed
= link_to 'Reopen', project_issue_path(@project, @issue, :issue => {:closed => false }, :status_only => true), :method => :put, :class => "btn"
- else
= link_to 'Close', project_issue_path(@project, @issue, :issue => {:closed => true }, :status_only => true), :method => :put, :class => "btn", :title => "Close merge request"
- if can?(current_user, :admin_project, @project) || @issue.author == current_user
= link_to edit_project_issue_path(@project, @issue), :class => "btn small" do
Edit
%hr
- if @issue.closed
.alert-message.error Closed
- else
.alert-message.success Open
%div.well
%div %div
%span.entity-info %span.entity-info
- if can?(current_user, :admin_project, @project) || @issue.author == current_user
= link_to edit_project_issue_path(@project, @issue) do
.entity-button
Edit Issue
%i
= image_tag gravatar_icon(@issue.author_email), :class => "left", :width => 40, :style => "padding-right:5px;" = image_tag gravatar_icon(@issue.author_email), :class => "left", :width => 40, :style => "padding-right:5px;"
%span.commit-title %span.commit-title
%strong %strong
= "Issue ##{@issue.id}:"
%span.commit-author %span.commit-author
%strong %strong
= link_to project_team_member_path(@project, @project.team_member_by_id(@issue.author.id)) do = link_to project_team_member_path(@project, @project.team_member_by_id(@issue.author.id)) do
%span.author= @issue.author_name %span.author= @issue.author_name
- if @issue.author != @issue.assignee
→ →
= link_to project_team_member_path(@project, @project.team_member_by_id(@issue.assignee.id)) do = link_to project_team_member_path(@project, @project.team_member_by_id(@issue.assignee.id)) do
%span.author= @issue.assignee_name %span.author= @issue.assignee_name
 
 
= @issue.created_at.stamp("Aug 21, 2011 9:23pm")
%hr
%br %br
%h3 .cgray= @issue.created_at.stamp("Aug 21, 2011 9:23pm")
= simple_format @issue.title
.clear
%br
%br
.merge-tabs %div= simple_format @issue.title
= link_to "#notes", :class => "merge-notes-tab active tab" do
%span
Notes
.right
- if @issue.closed
= link_to 'Reopen', project_issue_path(@project, @issue, :issue => {:closed => false }, :status_only => true), :method => :put, :class => "red-button"
- else
= link_to 'Close', project_issue_path(@project, @issue, :issue => {:closed => true }, :status_only => true), :method => :put, :class => "positive-button"
.merge-request-notes
.issue_notes= render "notes/notes" .issue_notes= render "notes/notes"
.loading{ :style => "display:none;"}
%center= image_tag "ajax-loader.gif"
.clear

View file

@ -1,19 +1,15 @@
- if @commits.size > 0 - if @commits.size > 0
.merge-request-commits.ui-box.width-100p .merge-request-commits
- @commits.each do |commit| - @commits.each do |commit|
%a{ :class => "commit", :href => project_commit_path(@project, :id => commit.id) } .entry
- if commit.author_email = link_to project_commit_path(@project, :id => commit.id) do
= image_tag gravatar_icon(commit.author_email), :class => "left", :width => 40, :style => "padding-right:5px;" %strong
- else = truncate(commit.id.to_s, :length => 10)
= image_tag "no_avatar.png", :class => "left", :width => 40, :style => "padding-right:5px;" = image_tag gravatar_icon(commit.author_email), :class => "", :width => 16
%span.commit-title %span= truncate(commit.safe_message, :length => 40)
= truncate commit.safe_message, :length => 60 %span.right
%span.commit-author = time_ago_in_words(commit.committed_date)
%strong= commit.author_name
authored
= time_ago_in_words(commit.created_at)
ago ago
.clear
- if @commits.empty? - if @commits.empty?
%p.cgray Nothing to merge %p.cgray Nothing to merge

View file

@ -1,14 +1,17 @@
%a.update-item{:href => project_merge_request_path(merge_request.project, merge_request)} %li.wll
= image_tag gravatar_icon(merge_request.author_email), :class => "left", :width => 40 = image_tag gravatar_icon(merge_request.author_email), :class => "avatar"
%span.update-title
= truncate(merge_request.title, :length => 60)
%span.update-author %span.update-author
%strong= merge_request.author_name %strong
= link_to project_team_member_path(@project, @project.team_member_by_id(merge_request.author_id)), :class => "author_link" do
= merge_request.author_name
authored authored
= time_ago_in_words(merge_request.created_at) = time_ago_in_words(merge_request.created_at)
ago ago
.right .right
%span.tag.commit= merge_request.source_branch %span.label= merge_request.source_branch
→ →
%span.tag.commit= merge_request.target_branch %span.label= merge_request.target_branch
= link_to project_merge_request_path(merge_request.project, merge_request) do
%p
Merge Request ##{merge_request.id}:
= truncate(merge_request.title, :length => 50)

View file

@ -1,28 +1,19 @@
.left.issues_filter %h3
= form_tag project_merge_requests_path(@project), :method => :get do Merge Requests
.left - if can? current_user, :write_issue, @project
= radio_button_tag :f, 0, (params[:f] || "0") == "0", :onclick => "this.form.submit()", :id => "open_merge_requests", :class => "status" = link_to new_project_merge_request_path(@project), :class => "right btn small", :title => "New Merge Request" do
= label_tag "open_merge_requests" do New Merge Request
%span.tag.open Open
.left
= radio_button_tag :f, 2, params[:f] == "2", :onclick => "this.form.submit()", :id => "closed_merge_requests", :class => "status"
= label_tag "closed_merge_requests" do
%span.tag.closed Closed
.clear
%hr %hr
%ul.pills
%li{:class => ("active" if (params[:f] == "0" || !params[:f]))}
= link_to project_merge_requests_path(@project, :f => 0) do
Open
%li{:class => ("active" if params[:f] == "2")}
= link_to project_merge_requests_path(@project, :f => 2) do
Closed
%hr
%ul.unstyled= render @merge_requests
.row
.span10
- if @merge_requests.count > 0
%div{ :class => "update-data ui-box ui-box-small ui-box-big" }
.data
= render @merge_requests
.span4
- if can? current_user, :write_merge_request, @project
.alert-message.block-message.info
%p You can open a new merge request.
- if current_page?(project_merge_requests_path(@project))
= link_to new_project_merge_request_path(@project), :class => "btn small", :title => "New Merge request" do
Add new