Commit eb06dd79f8285c5a375bbbe796d6e92ab7080cab
1 parent
20496491
Exists in
master
and in
4 other branches
Update views for GFM
Showing
16 changed files
with
19 additions
and
18 deletions
Show diff stats
app/controllers/refs_controller.rb
@@ -90,6 +90,7 @@ class RefsController < ApplicationController | @@ -90,6 +90,7 @@ class RefsController < ApplicationController | ||
90 | 90 | ||
91 | @repo = project.repo | 91 | @repo = project.repo |
92 | @commit = project.commit(@ref) | 92 | @commit = project.commit(@ref) |
93 | + @commit = CommitDecorator.decorate(@commit) | ||
93 | @tree = Tree.new(@commit.tree, project, @ref, params[:path]) | 94 | @tree = Tree.new(@commit.tree, project, @ref, params[:path]) |
94 | @tree = TreeDecorator.new(@tree) | 95 | @tree = TreeDecorator.new(@tree) |
95 | @hex_path = Digest::SHA1.hexdigest(params[:path] || "/") | 96 | @hex_path = Digest::SHA1.hexdigest(params[:path] || "/") |
app/views/commits/_commit.html.haml
@@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
7 | %strong.cgray= commit.author_name | 7 | %strong.cgray= commit.author_name |
8 | – | 8 | – |
9 | = image_tag gravatar_icon(commit.author_email), :class => "avatar", :width => 16 | 9 | = image_tag gravatar_icon(commit.author_email), :class => "avatar", :width => 16 |
10 | - = link_to truncate(commit.title, :length => 50), project_commit_path(@project, :id => commit.id), :class => "row_title" | 10 | + = link_to_gfm truncate(commit.title, :length => 50), project_commit_path(@project, :id => commit.id), :class => "row_title" |
11 | 11 | ||
12 | %span.committed_ago | 12 | %span.committed_ago |
13 | = time_ago_in_words(commit.committed_date) | 13 | = time_ago_in_words(commit.committed_date) |
app/views/commits/_commit_box.html.haml
@@ -11,10 +11,10 @@ | @@ -11,10 +11,10 @@ | ||
11 | = link_to tree_project_ref_path(@project, @commit.id), :class => "browse-button primary grouped" do | 11 | = link_to tree_project_ref_path(@project, @commit.id), :class => "browse-button primary grouped" do |
12 | %strong Browse Code » | 12 | %strong Browse Code » |
13 | %h3.commit-title.page_title | 13 | %h3.commit-title.page_title |
14 | - = commit_msg_with_link_to_issues(@project, @commit.title) | 14 | + = gfm @commit.title |
15 | - if @commit.description.present? | 15 | - if @commit.description.present? |
16 | %pre.commit-description | 16 | %pre.commit-description |
17 | - = commit_msg_with_link_to_issues(@project, @commit.description) | 17 | + = gfm @commit.description |
18 | .commit-info | 18 | .commit-info |
19 | .row | 19 | .row |
20 | .span4 | 20 | .span4 |
app/views/commits/index.atom.builder
@@ -17,7 +17,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear | @@ -17,7 +17,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear | ||
17 | xml.name commit.author_name | 17 | xml.name commit.author_name |
18 | xml.email commit.author_email | 18 | xml.email commit.author_email |
19 | end | 19 | end |
20 | - xml.summary commit.description | 20 | + xml.summary gfm(commit.description) |
21 | end | 21 | end |
22 | end | 22 | end |
23 | end | 23 | end |
app/views/events/_commit.html.haml
@@ -5,5 +5,5 @@ | @@ -5,5 +5,5 @@ | ||
5 | %strong.cdark= commit.author_name | 5 | %strong.cdark= commit.author_name |
6 | – | 6 | – |
7 | = image_tag gravatar_icon(commit.author_email), :class => "avatar", :width => 16 | 7 | = image_tag gravatar_icon(commit.author_email), :class => "avatar", :width => 16 |
8 | - = truncate(commit.title, :length => 50) rescue "--broken encoding" | 8 | + = gfm truncate(commit.title, :length => 50), project_commit_path(project, :id => commit.id) rescue "--broken encoding" |
9 | 9 |
app/views/issues/_show.html.haml
@@ -24,7 +24,7 @@ | @@ -24,7 +24,7 @@ | ||
24 | - else | 24 | - else |
25 | = image_tag "no_avatar.png", :class => "avatar" | 25 | = image_tag "no_avatar.png", :class => "avatar" |
26 | 26 | ||
27 | - %p= link_to truncate(issue.title, :length => 100), project_issue_path(issue.project, issue), :class => "row_title" | 27 | + %p= link_to_gfm truncate(issue.title, :length => 100), project_issue_path(issue.project, issue), :class => "row_title" |
28 | 28 | ||
29 | %span.update-author | 29 | %span.update-author |
30 | %small.cdark= "##{issue.id}" | 30 | %small.cdark= "##{issue.id}" |
app/views/issues/show.html.haml
@@ -31,7 +31,7 @@ | @@ -31,7 +31,7 @@ | ||
31 | .alert-message.error.status_info Closed | 31 | .alert-message.error.status_info Closed |
32 | - else | 32 | - else |
33 | .alert-message.success.status_info Open | 33 | .alert-message.success.status_info Open |
34 | - = @issue.title | 34 | + = gfm @issue.title |
35 | 35 | ||
36 | .middle_box_content | 36 | .middle_box_content |
37 | %cite.cgray Created by | 37 | %cite.cgray Created by |
@@ -46,7 +46,7 @@ | @@ -46,7 +46,7 @@ | ||
46 | - if @issue.milestone | 46 | - if @issue.milestone |
47 | - milestone = @issue.milestone | 47 | - milestone = @issue.milestone |
48 | %cite.cgray and attached to milestone | 48 | %cite.cgray and attached to milestone |
49 | - %strong= link_to truncate(milestone.title, :length => 20), project_milestone_path(milestone.project, milestone) | 49 | + %strong= link_to_gfm truncate(milestone.title, :length => 20), project_milestone_path(milestone.project, milestone) |
50 | 50 | ||
51 | .right | 51 | .right |
52 | - @issue.labels.each do |label| | 52 | - @issue.labels.each do |label| |
app/views/merge_requests/_merge_request.html.haml
@@ -16,7 +16,7 @@ | @@ -16,7 +16,7 @@ | ||
16 | = merge_request.target_branch | 16 | = merge_request.target_branch |
17 | = image_tag gravatar_icon(merge_request.author_email), :class => "avatar" | 17 | = image_tag gravatar_icon(merge_request.author_email), :class => "avatar" |
18 | 18 | ||
19 | - %p= link_to truncate(merge_request.title, :length => 80), project_merge_request_path(merge_request.project, merge_request), :class => "row_title" | 19 | + %p= link_to_gfm truncate(merge_request.title, :length => 80), project_merge_request_path(merge_request.project, merge_request), :class => "row_title" |
20 | 20 | ||
21 | %span.update-author | 21 | %span.update-author |
22 | %small.cdark= "##{merge_request.id}" | 22 | %small.cdark= "##{merge_request.id}" |
app/views/merge_requests/show/_mr_box.html.haml
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | .alert-message.error.status_info Closed | 5 | .alert-message.error.status_info Closed |
6 | - else | 6 | - else |
7 | .alert-message.success.status_info Open | 7 | .alert-message.success.status_info Open |
8 | - = @merge_request.title | 8 | + = gfm @merge_request.title |
9 | 9 | ||
10 | .middle_box_content | 10 | .middle_box_content |
11 | %div | 11 | %div |
app/views/milestones/_milestone.html.haml
@@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
7 | - if can? current_user, :admin_milestone, milestone.project | 7 | - if can? current_user, :admin_milestone, milestone.project |
8 | = link_to 'Edit', edit_project_milestone_path(milestone.project, milestone), :class => "btn small edit-milestone-link grouped" | 8 | = link_to 'Edit', edit_project_milestone_path(milestone.project, milestone), :class => "btn small edit-milestone-link grouped" |
9 | %h4 | 9 | %h4 |
10 | - = link_to truncate(milestone.title, :length => 100), project_milestone_path(milestone.project, milestone), :class => "row_title" | 10 | + = link_to_gfm truncate(milestone.title, :length => 100), project_milestone_path(milestone.project, milestone), :class => "row_title" |
11 | %small | 11 | %small |
12 | = milestone.expires_at | 12 | = milestone.expires_at |
13 | %br | 13 | %br |
app/views/milestones/show.html.haml
@@ -21,7 +21,7 @@ | @@ -21,7 +21,7 @@ | ||
21 | .alert-message.error.status_info Closed | 21 | .alert-message.error.status_info Closed |
22 | - else | 22 | - else |
23 | .alert-message.success.status_info Open | 23 | .alert-message.success.status_info Open |
24 | - = @milestone.title | 24 | + = gfm @milestone.title |
25 | %small.right= @milestone.expires_at | 25 | %small.right= @milestone.expires_at |
26 | 26 | ||
27 | .middle_box_content | 27 | .middle_box_content |
@@ -51,7 +51,7 @@ | @@ -51,7 +51,7 @@ | ||
51 | = link_to [@project, issue] do | 51 | = link_to [@project, issue] do |
52 | %span.badge.badge-info ##{issue.id} | 52 | %span.badge.badge-info ##{issue.id} |
53 | – | 53 | – |
54 | - = link_to truncate(issue.title, :length => 60), [@project, issue] | 54 | + = link_to_gfm truncate(issue.title, :length => 60), [@project, issue] |
55 | %br | 55 | %br |
56 | = paginate @issues, :theme => "gitlab" | 56 | = paginate @issues, :theme => "gitlab" |
57 | 57 |
app/views/refs/_tree_commit.html.haml
1 | - if tm | 1 | - if tm |
2 | %strong= link_to "[#{tm.user_name}]", project_team_member_path(@project, tm) | 2 | %strong= link_to "[#{tm.user_name}]", project_team_member_path(@project, tm) |
3 | -= link_to truncate(content_commit.title, :length => tm ? 30 : 50), project_commit_path(@project, content_commit.id), :class => "tree-commit-link" | 3 | += link_to_gfm truncate(content_commit.title, :length => tm ? 30 : 50), project_commit_path(@project, content_commit.id), :class => "tree-commit-link" |
app/views/refs/blame.html.haml
@@ -33,7 +33,7 @@ | @@ -33,7 +33,7 @@ | ||
33 | %td.blame_commit | 33 | %td.blame_commit |
34 | | 34 | |
35 | %code= link_to commit.short_id, project_commit_path(@project, :id => commit.id) | 35 | %code= link_to commit.short_id, project_commit_path(@project, :id => commit.id) |
36 | - = link_to truncate(commit.title, :length => 30), project_commit_path(@project, :id => commit.id), :class => "row_title" rescue "--broken encoding" | 36 | + = link_to_gfm truncate(commit.title, :length => 30), project_commit_path(@project, :id => commit.id), :class => "row_title" rescue "--broken encoding" |
37 | %td.lines | 37 | %td.lines |
38 | = preserve do | 38 | = preserve do |
39 | %pre | 39 | %pre |
app/views/repositories/_branch.html.haml
@@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
11 | %code= commit.short_id | 11 | %code= commit.short_id |
12 | 12 | ||
13 | = image_tag gravatar_icon(commit.author_email), :class => "", :width => 16 | 13 | = image_tag gravatar_icon(commit.author_email), :class => "", :width => 16 |
14 | - = truncate(commit.title, :length => 40) | 14 | + = gfm truncate(commit.title, :length => 40) |
15 | %td | 15 | %td |
16 | %span.update-author.right | 16 | %span.update-author.right |
17 | = time_ago_in_words(commit.committed_date) | 17 | = time_ago_in_words(commit.committed_date) |
app/views/repositories/_feed.html.haml
@@ -13,7 +13,7 @@ | @@ -13,7 +13,7 @@ | ||
13 | = link_to project_commits_path(@project, commit.id) do | 13 | = link_to project_commits_path(@project, commit.id) do |
14 | %code= commit.short_id | 14 | %code= commit.short_id |
15 | = image_tag gravatar_icon(commit.author_email), :class => "", :width => 16 | 15 | = image_tag gravatar_icon(commit.author_email), :class => "", :width => 16 |
16 | - = truncate(commit.title, :length => 40) | 16 | + = gfm truncate(commit.title, :length => 40) |
17 | %td | 17 | %td |
18 | %span.right.cgray | 18 | %span.right.cgray |
19 | = time_ago_in_words(commit.committed_date) | 19 | = time_ago_in_words(commit.committed_date) |
app/views/repositories/tags.html.haml
@@ -17,7 +17,7 @@ | @@ -17,7 +17,7 @@ | ||
17 | = link_to project_commit_path(@project, commit.id) do | 17 | = link_to project_commit_path(@project, commit.id) do |
18 | %code= commit.short_id | 18 | %code= commit.short_id |
19 | = image_tag gravatar_icon(commit.author_email), :class => "", :width => 16 | 19 | = image_tag gravatar_icon(commit.author_email), :class => "", :width => 16 |
20 | - = truncate(commit.title, :length => 40) | 20 | + = gfm truncate(commit.title, :length => 40) |
21 | %td | 21 | %td |
22 | %span.update-author.right | 22 | %span.update-author.right |
23 | = time_ago_in_words(commit.committed_date) | 23 | = time_ago_in_words(commit.committed_date) |