Commit a77c8bf9 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Bootstrap: Issues & MR

parent d81f0b78
...@@ -162,6 +162,10 @@ img.avatar { ...@@ -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";
......
...@@ -6,7 +6,33 @@ a { ...@@ -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;
} }
...@@ -119,4 +119,8 @@ table.highlighttable .linenodiv pre { ...@@ -119,4 +119,8 @@ table.highlighttable .linenodiv pre {
background: #FFFFCF; background: #FFFFCF;
cursor:pointer; cursor:pointer;
} }
.tree-item-file-name {
font-weight:bold;
}
} }
...@@ -27,7 +27,7 @@ class Commit ...@@ -27,7 +27,7 @@ class Commit
@head = head @head = head
end end
def safe_message() def safe_message
message message
end end
......
...@@ -24,7 +24,7 @@ ...@@ -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 @@ ...@@ -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"
%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.label.important critical
%span.tag.high critical - if issue.today?
- if issue.today? %span.label.success today
%span.tag.today 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
- else - else
= 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)
...@@ -13,25 +13,29 @@ ...@@ -13,25 +13,29 @@
New Issue New Issue
%hr %hr
%div#issues-table-holder %div#issues-table-holder
%ul.pills.left .row
%li{:class => ("active" if (params[:f] == "0" || !params[:f]))} .span8
= link_to project_issues_path(@project, :f => 0) do %ul.pills.left
Open %li{:class => ("active" if (params[:f] == "0" || !params[:f]))}
%li{:class => ("active" if params[:f] == "2")} = link_to project_issues_path(@project, :f => 0) do
= link_to project_issues_path(@project, :f => 2) do Open
Closed %li{:class => ("active" if params[:f] == "2")}
%li{:class => ("active" if params[:f] == "3")} = link_to project_issues_path(@project, :f => 2) do
= link_to project_issues_path(@project, :f => 3) do Closed
To Me %li{:class => ("active" if params[:f] == "3")}
%li{:class => ("active" if params[:f] == "1")} = link_to project_issues_path(@project, :f => 3) do
= link_to project_issues_path(@project, :f => 1) do To Me
All %li{:class => ("active" if params[:f] == "1")}
= link_to project_issues_path(@project, :f => 1) do
All
= form_tag search_project_issues_path(@project), :method => :get, :remote => true, :id => "issue_search_form", :class => :right do .span2.right
= hidden_field_tag :project_id, @project.id, { :id => 'project_id' } = form_tag search_project_issues_path(@project), :method => :get, :remote => true, :id => "issue_search_form", :class => :right do
= search_field_tag :issue_search, nil, { :placeholder => 'Search', :class => 'issue_search' } = hidden_field_tag :project_id, @project.id, { :id => 'project_id' }
= 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 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -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)}"})
} }
......
%div %h3
%span.entity-info 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 - if can?(current_user, :admin_project, @project) || @issue.author == current_user
= link_to edit_project_issue_path(@project, @issue) do = link_to edit_project_issue_path(@project, @issue), :class => "btn small" do
.entity-button Edit
Edit Issue
%i %hr
= image_tag gravatar_icon(@issue.author_email), :class => "left", :width => 40, :style => "padding-right:5px;" - if @issue.closed
%span.commit-title .alert-message.error Closed
%strong - else
= "Issue ##{@issue.id}:" .alert-message.success Open
%span.commit-author
%strong
= link_to project_team_member_path(@project, @project.team_member_by_id(@issue.author.id)) do %div.well
%span.author= @issue.author_name %div
- if @issue.author != @issue.assignee %span.entity-info
= image_tag gravatar_icon(@issue.author_email), :class => "left", :width => 40, :style => "padding-right:5px;"
%span.commit-title
%strong
%span.commit-author
%strong
= link_to project_team_member_path(@project, @project.team_member_by_id(@issue.author.id)) do
%span.author= @issue.author_name
→ →
= 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
  %br
.cgray= @issue.created_at.stamp("Aug 21, 2011 9:23pm")
 
= @issue.created_at.stamp("Aug 21, 2011 9:23pm")
%div= simple_format @issue.title
%hr
%br
%h3 .issue_notes= render "notes/notes"
= simple_format @issue.title
.clear
%br
%br
.merge-tabs
= 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"
.loading{ :style => "display:none;"}
%center= image_tag "ajax-loader.gif"
.clear
- 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 ago
authored
= time_ago_in_words(commit.created_at)
ago
.clear
- if @commits.empty? - if @commits.empty?
%p.cgray Nothing to merge %p.cgray Nothing to merge
%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)
.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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment