diff options
Diffstat (limited to 'app/views/refs')
-rw-r--r-- | app/views/refs/_head.html.haml | 6 | ||||
-rw-r--r-- | app/views/refs/_submodule_item.html.haml | 6 | ||||
-rw-r--r-- | app/views/refs/_tree.html.haml | 18 | ||||
-rw-r--r-- | app/views/refs/_tree_commit.html.haml | 2 | ||||
-rw-r--r-- | app/views/refs/_tree_file.html.haml | 14 | ||||
-rw-r--r-- | app/views/refs/_tree_item.html.haml | 6 | ||||
-rw-r--r-- | app/views/refs/blame.html.haml | 12 | ||||
-rw-r--r-- | app/views/refs/logs_tree.js.haml | 2 | ||||
-rw-r--r-- | app/views/refs/tree.html.haml | 2 | ||||
-rw-r--r-- | app/views/refs/tree.js.haml | 2 |
10 files changed, 35 insertions, 35 deletions
diff --git a/app/views/refs/_head.html.haml b/app/views/refs/_head.html.haml index 16a0cddfa24..8825493a0ec 100644 --- a/app/views/refs/_head.html.haml +++ b/app/views/refs/_head.html.haml @@ -1,10 +1,10 @@ %ul.nav.nav-tabs %li - = form_tag switch_project_refs_path(@project), :method => :get, :class => "project-refs-form", :remote => true do - = select_tag "ref", grouped_options_refs, :onchange => "$(this.form).trigger('submit');", :class => "project-refs-select" + = form_tag switch_project_refs_path(@project), method: :get, class: "project-refs-form", remote: true do + = select_tag "ref", grouped_options_refs, onchange: "$(this.form).trigger('submit');", class: "project-refs-select" = hidden_field_tag :destination, "tree" = hidden_field_tag :path, params[:path] - %li{:class => "#{'active' if (controller.controller_name == "refs") }"} + %li{class: "#{'active' if (controller.controller_name == "refs") }"} = link_to tree_project_ref_path(@project, @ref) do Source diff --git a/app/views/refs/_submodule_item.html.haml b/app/views/refs/_submodule_item.html.haml index 6db49310a08..6b9f5877028 100644 --- a/app/views/refs/_submodule_item.html.haml +++ b/app/views/refs/_submodule_item.html.haml @@ -1,13 +1,13 @@ - url = content.url(@ref) rescue nil - name = content.basename - return unless url -%tr{ :class => "tree-item", :url => url } +%tr{ class: "tree-item", url: url } %td.tree-item-file-name = image_tag "submodule.png" - %strong= truncate(name, :length => 40) + %strong= truncate(name, length: 40) %td %code= content.id[0..10] %td - = link_to truncate(url, :length => 40), url + = link_to truncate(url, length: 40), url diff --git a/app/views/refs/_tree.html.haml b/app/views/refs/_tree.html.haml index ba0bd69116b..6f8175da7a0 100644 --- a/app/views/refs/_tree.html.haml +++ b/app/views/refs/_tree.html.haml @@ -1,7 +1,7 @@ %ul.breadcrumb %li %span.arrow - = link_to tree_project_ref_path(@project, @ref, :path => nil), :remote => true do + = link_to tree_project_ref_path(@project, @ref, path: nil), remote: true do = @project.name - tree.breadcrumbs(6) do |link| \/ @@ -10,32 +10,32 @@ %div.tree_progress #tree-content-holder - if tree.is_blob? - = render :partial => "refs/tree_file", :locals => { :name => tree.name, :content => tree.data, :file => tree } + = render partial: "refs/tree_file", locals: { name: tree.name, content: tree.data, file: tree } - else - contents = tree.contents - %table#tree-slider.bordered-table.table{:class => "table_#{@hex_path}" } + %table#tree-slider.bordered-table.table{class: "table_#{@hex_path}" } %thead %th Name %th Last Update %th Last commit - = link_to "History", tree.history_path, :class => "right" + = link_to "History", tree.history_path, class: "right" - if tree.up_dir? - %tr{ :class => "tree-item", :url => tree.up_dir_path } + %tr{ class: "tree-item", url: tree.up_dir_path } %td.tree-item-file-name = image_tag "file_empty.png" - = link_to "..", tree.up_dir_path, :remote => :true + = link_to "..", tree.up_dir_path, remote: :true %td %td - index = 0 - contents.select{ |i| i.is_a?(Grit::Tree)}.each do |content| - = render :partial => "refs/tree_item", :locals => { :content => content, :index => (index += 1) } + = render partial: "refs/tree_item", locals: { content: content, index: (index += 1) } - contents.select{ |i| i.is_a?(Grit::Blob)}.each do |content| - = render :partial => "refs/tree_item", :locals => { :content => content, :index => (index += 1) } + = render partial: "refs/tree_item", locals: { content: content, index: (index += 1) } - contents.select{ |i| i.is_a?(Grit::Submodule)}.each do |content| - = render :partial => "refs/submodule_item", :locals => { :content => content, :index => (index += 1) } + = render partial: "refs/submodule_item", locals: { content: content, index: (index += 1) } - if content = contents.select{ |c| c.is_a?(Grit::Blob) and c.name =~ /^readme/i }.first .file_holder#README diff --git a/app/views/refs/_tree_commit.html.haml b/app/views/refs/_tree_commit.html.haml index 2c8cd932ada..a5681aa2f61 100644 --- a/app/views/refs/_tree_commit.html.haml +++ b/app/views/refs/_tree_commit.html.haml @@ -1,3 +1,3 @@ - if tm %strong= link_to "[#{tm.user_name}]", project_team_member_path(@project, tm) -= link_to_gfm truncate(content_commit.title, :length => tm ? 30 : 50), project_commit_path(@project, content_commit.id), :class => "tree-commit-link" += link_to_gfm truncate(content_commit.title, length: tm ? 30 : 50), project_commit_path(@project, content_commit.id), class: "tree-commit-link" diff --git a/app/views/refs/_tree_file.html.haml b/app/views/refs/_tree_file.html.haml index d45a03df8aa..b5ed61bb45a 100644 --- a/app/views/refs/_tree_file.html.haml +++ b/app/views/refs/_tree_file.html.haml @@ -5,9 +5,9 @@ = name %small #{file.mode} %span.options - = link_to "raw", blob_project_ref_path(@project, @ref, :path => params[:path]), :class => "btn very_small", :target => "_blank" - = link_to "history", project_commits_path(@project, :path => params[:path], :ref => @ref), :class => "btn very_small" - = link_to "blame", blame_file_project_ref_path(@project, @ref, :path => params[:path]), :class => "btn very_small" + = link_to "raw", blob_project_ref_path(@project, @ref, path: params[:path]), class: "btn very_small", target: "_blank" + = link_to "history", project_commits_path(@project, path: params[:path], ref: @ref), class: "btn very_small" + = link_to "blame", blame_file_project_ref_path(@project, @ref, path: params[:path]), class: "btn very_small" - if file.text? - if name =~ /\.(md|markdown)$/i .file_content.wiki @@ -16,7 +16,7 @@ - else .file_content.code - unless file.empty? - %div{:class => current_user.dark_scheme ? "black" : "white"} + %div{class: current_user.dark_scheme ? "black" : "white"} = preserve do = raw file.colorize(options: { linenos: 'True'}) - else @@ -24,14 +24,14 @@ - elsif file.image? .file_content.image_file - %img{ :src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} + %img{ src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} - else .file_content.blob_file %center - = link_to blob_project_ref_path(@project, @ref, :path => params[:path]) do + = link_to blob_project_ref_path(@project, @ref, path: params[:path]) do %div.padded %br - = image_tag "download.png", :width => 64 + = image_tag "download.png", width: 64 %h3 Download (#{file.mb_size}) diff --git a/app/views/refs/_tree_item.html.haml b/app/views/refs/_tree_item.html.haml index 4ce16b22ddd..2e6bbf6221b 100644 --- a/app/views/refs/_tree_item.html.haml +++ b/app/views/refs/_tree_item.html.haml @@ -1,11 +1,11 @@ - file = tree_full_path(content) -%tr{ :class => "tree-item #{tree_hex_class(content)}", :url => tree_file_project_ref_path(@project, @ref, file) } +%tr{ class: "tree-item #{tree_hex_class(content)}", url: tree_file_project_ref_path(@project, @ref, file) } %td.tree-item-file-name = tree_icon(content) - = link_to truncate(content.name, :length => 40), tree_file_project_ref_path(@project, @ref || @commit.id, file), :remote => :true + = link_to truncate(content.name, length: 40), tree_file_project_ref_path(@project, @ref || @commit.id, file), remote: :true %td.tree_time_ago.cgray - if index == 1 %span.log_loading Loading commit data.. - = image_tag "ajax_loader_tree.gif", :width => 14 + = image_tag "ajax_loader_tree.gif", width: 14 %td.tree_commit diff --git a/app/views/refs/blame.html.haml b/app/views/refs/blame.html.haml index 6d036c94c64..34478d4b491 100644 --- a/app/views/refs/blame.html.haml +++ b/app/views/refs/blame.html.haml @@ -4,7 +4,7 @@ %ul.breadcrumb %li %span.arrow - = link_to tree_project_ref_path(@project, @ref, :path => nil) do + = link_to tree_project_ref_path(@project, @ref, path: nil) do = @project.name - @tree.breadcrumbs(6) do |link| \/ @@ -18,9 +18,9 @@ = @tree.name %small blame %span.options - = link_to "raw", blob_project_ref_path(@project, @ref, :path => params[:path]), :class => "btn very_small", :target => "_blank" - = link_to "history", project_commits_path(@project, :path => params[:path], :ref => @ref), :class => "btn very_small" - = link_to "source", tree_file_project_ref_path(@project, @ref, :path => params[:path]), :class => "btn very_small" + = link_to "raw", blob_project_ref_path(@project, @ref, path: params[:path]), class: "btn very_small", target: "_blank" + = link_to "history", project_commits_path(@project, path: params[:path], ref: @ref), class: "btn very_small" + = link_to "source", tree_file_project_ref_path(@project, @ref, path: params[:path]), class: "btn very_small" .file_content.blame %table - @blame.each do |commit, lines| @@ -32,8 +32,8 @@ = commit.author_name %td.blame_commit - %code= link_to commit.short_id, project_commit_path(@project, :id => commit.id) - = link_to_gfm truncate(commit.title, :length => 30), project_commit_path(@project, :id => commit.id), :class => "row_title" rescue "--broken encoding" + %code= link_to commit.short_id, project_commit_path(@project, id: commit.id) + = link_to_gfm truncate(commit.title, length: 30), project_commit_path(@project, id: commit.id), class: "row_title" rescue "--broken encoding" %td.lines = preserve do %pre diff --git a/app/views/refs/logs_tree.js.haml b/app/views/refs/logs_tree.js.haml index 402f5aa72bc..61ccbaee1fe 100644 --- a/app/views/refs/logs_tree.js.haml +++ b/app/views/refs/logs_tree.js.haml @@ -6,4 +6,4 @@ :plain var row = $("table.table_#{@hex_path} tr.file_#{hexdigest(file_name)}"); row.find("td.tree_time_ago").html('#{escape_javascript(time_ago_in_words(content_commit.committed_date))} ago'); - row.find("td.tree_commit").html('#{escape_javascript(render("tree_commit", :tm => tm, :content_commit => content_commit))}'); + row.find("td.tree_commit").html('#{escape_javascript(render("tree_commit", tm: tm, content_commit: content_commit))}'); diff --git a/app/views/refs/tree.html.haml b/app/views/refs/tree.html.haml index b48f7f91782..181be6426d4 100644 --- a/app/views/refs/tree.html.haml +++ b/app/views/refs/tree.html.haml @@ -1,5 +1,5 @@ = render "head" -#tree-holder= render :partial => "tree", :locals => {:repo => @repo, :commit => @commit, :tree => @tree} +#tree-holder= render partial: "tree", locals: {repo: @repo, commit: @commit, tree: @tree} :javascript $(function() { diff --git a/app/views/refs/tree.js.haml b/app/views/refs/tree.js.haml index 9cf55057a6a..2eccf8c19a6 100644 --- a/app/views/refs/tree.js.haml +++ b/app/views/refs/tree.js.haml @@ -1,6 +1,6 @@ :plain // Load Files list - $("#tree-holder").html("#{escape_javascript(render(:partial => "tree", :locals => {:repo => @repo, :commit => @commit, :tree => @tree}))}"); + $("#tree-holder").html("#{escape_javascript(render(partial: "tree", locals: {repo: @repo, commit: @commit, tree: @tree}))}"); $("#tree-content-holder").show("slide", { direction: "right" }, 150); $('.project-refs-form #path').val("#{params[:path]}"); |