diff options
author | Robert Speicher <rspeicher@gmail.com> | 2012-08-10 18:07:50 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2012-08-10 18:25:15 -0400 |
commit | 775418918782d5284000ed0bfea364458c748567 (patch) | |
tree | c31e3633a3bcbed17b000f0165cf35edad41f7ca /app/views/issues | |
parent | 1413c23c502d5a5cbc9b81f553a245103c1d6e50 (diff) | |
download | gitlab-ce-775418918782d5284000ed0bfea364458c748567.tar.gz |
Fully embrace Ruby 1.9 hash syntax
Didn't bother with files in db/, config/, or features/
Diffstat (limited to 'app/views/issues')
-rw-r--r-- | app/views/issues/_form.html.haml | 22 | ||||
-rw-r--r-- | app/views/issues/_head.html.haml | 12 | ||||
-rw-r--r-- | app/views/issues/_issues.html.haml | 4 | ||||
-rw-r--r-- | app/views/issues/_show.html.haml | 16 | ||||
-rw-r--r-- | app/views/issues/create.js.haml | 2 | ||||
-rw-r--r-- | app/views/issues/index.html.haml | 44 | ||||
-rw-r--r-- | app/views/issues/show.html.haml | 14 |
7 files changed, 57 insertions, 57 deletions
diff --git a/app/views/issues/_form.html.haml b/app/views/issues/_form.html.haml index 4f6f8396661..6139f3d4cbc 100644 --- a/app/views/issues/_form.html.haml +++ b/app/views/issues/_form.html.haml @@ -1,6 +1,6 @@ %div.issue-form-holder %h3= @issue.new_record? ? "New Issue" : "Edit Issue ##{@issue.id}" - = form_for [@project, @issue], :remote => request.xhr? do |f| + = form_for [@project, @issue], remote: request.xhr? do |f| -if @issue.errors.any? .alert-message.block-message.error %ul @@ -12,18 +12,18 @@ = f.label :title do %strong= "Subject *" .input - = f.text_field :title, :maxlength => 255, :class => "xxlarge" + = f.text_field :title, maxlength: 255, class: "xxlarge" .issue_middle_block .issue_assignee = f.label :assignee_id do %i.icon-user Assign to - .input= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select a user" }) + .input= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { include_blank: "Select a user" }) .issue_milestone = f.label :milestone_id do %i.icon-time Milestone - .input= f.select(:milestone_id, @project.milestones.active.all.collect {|p| [ p.title, p.id ] }, { :include_blank => "Select milestone" }) + .input= f.select(:milestone_id, @project.milestones.active.all.collect {|p| [ p.title, p.id ] }, { include_blank: "Select milestone" }) .issue_description .clearfix @@ -31,26 +31,26 @@ %i.icon-tag Labels .input - = f.text_field :label_list, :maxlength => 2000, :class => "xxlarge" + = f.text_field :label_list, maxlength: 2000, class: "xxlarge" %p.hint Separate with comma. .clearfix = f.label :description, "Details" .input - = f.text_area :description, :maxlength => 2000, :class => "xxlarge", :rows => 14 + = f.text_area :description, maxlength: 2000, class: "xxlarge", rows: 14 %p.hint Markdown is enabled. .actions - if @issue.new_record? - = f.submit 'Submit new issue', :class => "primary btn" + = f.submit 'Submit new issue', class: "primary btn" -else - = f.submit 'Save changes', :class => "primary btn" + = f.submit 'Save changes', class: "primary btn" - if request.xhr? - = link_to "Cancel", "#back", :onclick => "backToIssues();", :class => "btn" + = link_to "Cancel", "#back", onclick: "backToIssues();", class: "btn" - else - if @issue.new_record? - = link_to "Cancel", project_issues_path(@project), :class => "btn" + = link_to "Cancel", project_issues_path(@project), class: "btn" - else - = link_to "Cancel", project_issue_path(@project, @issue), :class => "btn" + = link_to "Cancel", project_issue_path(@project, @issue), class: "btn" diff --git a/app/views/issues/_head.html.haml b/app/views/issues/_head.html.haml index 701b0625852..1f6e7d7f81f 100644 --- a/app/views/issues/_head.html.haml +++ b/app/views/issues/_head.html.haml @@ -1,11 +1,11 @@ %ul.nav.nav-tabs - %li{:class => "#{'active' if current_page?(project_issues_path(@project))}"} - = link_to project_issues_path(@project), :class => "tab" do + %li{class: "#{'active' if current_page?(project_issues_path(@project))}"} + = link_to project_issues_path(@project), class: "tab" do Browse Issues - %li{:class => "#{'active' if current_page?(project_milestones_path(@project))}"} - = link_to project_milestones_path(@project), :class => "tab" do + %li{class: "#{'active' if current_page?(project_milestones_path(@project))}"} + = link_to project_milestones_path(@project), class: "tab" do Milestones %li.right %span.rss-icon - = link_to project_issues_path(@project, :atom, { :private_token => current_user.private_token }) do - = image_tag "rss_ui.png", :title => "feed" + = link_to project_issues_path(@project, :atom, { private_token: current_user.private_token }) do + = image_tag "rss_ui.png", title: "feed" diff --git a/app/views/issues/_issues.html.haml b/app/views/issues/_issues.html.haml index fc515ec3b49..f82ae8bde58 100644 --- a/app/views/issues/_issues.html.haml +++ b/app/views/issues/_issues.html.haml @@ -1,10 +1,10 @@ - @issues.each do |issue| - = render(:partial => 'issues/show', :locals => {:issue => issue}) + = render(partial: 'issues/show', locals: {issue: issue}) - if @issues.present? %li.bottom .row - .span7= paginate @issues, :remote => true, :theme => "gitlab" + .span7= paginate @issues, remote: true, theme: "gitlab" .span3.right %span.cgray.right %span.issue_counter #{@issues.total_count} diff --git a/app/views/issues/_show.html.haml b/app/views/issues/_show.html.haml index ed27bddd034..8500cd40a6e 100644 --- a/app/views/issues/_show.html.haml +++ b/app/views/issues/_show.html.haml @@ -1,7 +1,7 @@ -%li.wll{ :id => dom_id(issue), :class => issue_css_classes(issue), :url => project_issue_path(issue.project, issue) } +%li.wll{ id: dom_id(issue), class: issue_css_classes(issue), url: project_issue_path(issue.project, issue) } - if controller.controller_name == 'issues' .issue_check - = check_box_tag dom_id(issue,"selected"), nil, false, 'data-id' => issue.id, :class => "selected_issue", :disabled => !can?(current_user, :modify_issue, issue) + = check_box_tag dom_id(issue,"selected"), nil, false, 'data-id' => issue.id, class: "selected_issue", disabled: !can?(current_user, :modify_issue, issue) .right - issue.labels.each do |label| %span.label.label-issue.grouped @@ -13,19 +13,19 @@ = issue.notes.count - if can? current_user, :modify_issue, issue - if issue.closed - = link_to 'Reopen', project_issue_path(issue.project, issue, :issue => {:closed => false }, :status_only => true), :method => :put, :class => "btn small grouped reopen_issue", :remote => true + = link_to 'Reopen', project_issue_path(issue.project, issue, issue: {closed: false }, status_only: true), method: :put, class: "btn small grouped reopen_issue", remote: true - else - = link_to 'Resolve', project_issue_path(issue.project, issue, :issue => {:closed => true }, :status_only => true), :method => :put, :class => "success btn small grouped close_issue", :remote => true - = link_to edit_project_issue_path(issue.project, issue), :class => "btn small edit-issue-link", :remote => true do + = link_to 'Resolve', project_issue_path(issue.project, issue, issue: {closed: true }, status_only: true), method: :put, class: "success btn small grouped close_issue", remote: true + = link_to edit_project_issue_path(issue.project, issue), class: "btn small edit-issue-link", remote: true do %i.icon-edit Edit - if issue.assignee - = image_tag gravatar_icon(issue.assignee_email), :class => "avatar" + = image_tag gravatar_icon(issue.assignee_email), class: "avatar" - else - = image_tag "no_avatar.png", :class => "avatar" + = image_tag "no_avatar.png", class: "avatar" - %p= link_to_gfm truncate(issue.title, :length => 100), project_issue_path(issue.project, issue), :class => "row_title" + %p= link_to_gfm truncate(issue.title, length: 100), project_issue_path(issue.project, issue), class: "row_title" %span.update-author %small.cdark= "##{issue.id}" diff --git a/app/views/issues/create.js.haml b/app/views/issues/create.js.haml index abf3f6b858b..d90cbf0d30c 100644 --- a/app/views/issues/create.js.haml +++ b/app/views/issues/create.js.haml @@ -1,7 +1,7 @@ - if @issue.valid? :plain switchFromNewIssue(); - $("#issues-table").prepend("#{escape_javascript(render(:partial => 'show', :locals => {:issue => @issue}))}"); + $("#issues-table").prepend("#{escape_javascript(render(partial: 'show', locals: {issue: @issue}))}"); $.ajax({type: "GET", url: location.href, dataType: "script"}); - else :plain diff --git a/app/views/issues/index.html.haml b/app/views/issues/index.html.haml index 27eff501578..f3c743f75c3 100644 --- a/app/views/issues/index.html.haml +++ b/app/views/issues/index.html.haml @@ -6,51 +6,51 @@ .right .span5 - if can? current_user, :write_issue, @project - = link_to new_project_issue_path(@project), :class => "right btn small", :title => "New Issue", :remote => true do + = link_to new_project_issue_path(@project), class: "right btn small", title: "New Issue", remote: true do New Issue - = 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' } + = 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 :status, params[:f] - = search_field_tag :issue_search, nil, { :placeholder => 'Search', :class => 'issue_search span3 right neib' } + = search_field_tag :issue_search, nil, { placeholder: 'Search', class: 'issue_search span3 right neib' } .clearfix %div#issues-table-holder.ui-box .title - = check_box_tag "check_all_issues", nil, false, :class => "check_all_issues left" + = check_box_tag "check_all_issues", nil, false, class: "check_all_issues left" .issues_bulk_update.hide - = form_tag bulk_update_project_issues_path(@project), :method => :post do + = form_tag bulk_update_project_issues_path(@project), method: :post do %span.update_issues_text Update selected issues with .left - = select_tag('update[status]', options_for_select(['open', 'closed']), :prompt => "Status") - = select_tag('update[assignee_id]', options_from_collection_for_select(@project.users.all, "id", "name", params[:assignee_id]), :prompt => "Assignee") - = select_tag('update[milestone_id]', options_from_collection_for_select(@project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), :prompt => "Milestone") + = select_tag('update[status]', options_for_select(['open', 'closed']), prompt: "Status") + = select_tag('update[assignee_id]', options_from_collection_for_select(@project.users.all, "id", "name", params[:assignee_id]), prompt: "Assignee") + = select_tag('update[milestone_id]', options_from_collection_for_select(@project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), prompt: "Milestone") = hidden_field_tag 'update[issues_ids]', [] = hidden_field_tag :f, params[:f] - = button_tag "Save", :class => "btn update_selected_issues" + = button_tag "Save", class: "btn update_selected_issues" .issues_filters .left %ul.nav.nav-pills.left - %li{:class => ("active" if (params[:f] == issues_filter[:open] || !params[:f]))} - = link_to project_issues_path(@project, :f => issues_filter[:open], :milestone_id => params[:milestone_id]) do + %li{class: ("active" if (params[:f] == issues_filter[:open] || !params[:f]))} + = link_to project_issues_path(@project, f: issues_filter[:open], milestone_id: params[:milestone_id]) do Open - %li{:class => ("active" if params[:f] == issues_filter[:closed])} - = link_to project_issues_path(@project, :f => issues_filter[:closed], :milestone_id => params[:milestone_id]) do + %li{class: ("active" if params[:f] == issues_filter[:closed])} + = link_to project_issues_path(@project, f: issues_filter[:closed], milestone_id: params[:milestone_id]) do Closed - %li{:class => ("active" if params[:f] == issues_filter[:to_me])} - = link_to project_issues_path(@project, :f => issues_filter[:to_me], :milestone_id => params[:milestone_id]) do + %li{class: ("active" if params[:f] == issues_filter[:to_me])} + = link_to project_issues_path(@project, f: issues_filter[:to_me], milestone_id: params[:milestone_id]) do To Me - %li{:class => ("active" if params[:f] == issues_filter[:all])} - = link_to project_issues_path(@project, :f => issues_filter[:all], :milestone_id => params[:milestone_id]) do + %li{class: ("active" if params[:f] == issues_filter[:all])} + = link_to project_issues_path(@project, f: issues_filter[:all], milestone_id: params[:milestone_id]) do All .right - = form_tag project_issues_path(@project), :method => :get, :class => :right do - = select_tag(:label_name, options_for_select(issue_tags, params[:label_name]), :prompt => "Labels") - = select_tag(:assignee_id, options_from_collection_for_select(@project.users.all, "id", "name", params[:assignee_id]), :prompt => "Assignee") - = select_tag(:milestone_id, options_from_collection_for_select(@project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), :prompt => "Milestone") + = form_tag project_issues_path(@project), method: :get, class: :right do + = select_tag(:label_name, options_for_select(issue_tags, params[:label_name]), prompt: "Labels") + = select_tag(:assignee_id, options_from_collection_for_select(@project.users.all, "id", "name", params[:assignee_id]), prompt: "Assignee") + = select_tag(:milestone_id, options_from_collection_for_select(@project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), prompt: "Milestone") = hidden_field_tag :f, params[:f] .clearfix diff --git a/app/views/issues/show.html.haml b/app/views/issues/show.html.haml index c653377a68d..dce8cf6a59d 100644 --- a/app/views/issues/show.html.haml +++ b/app/views/issues/show.html.haml @@ -8,11 +8,11 @@ %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 small" + = link_to 'Reopen', project_issue_path(@project, @issue, issue: {closed: false }, status_only: true), method: :put, class: "btn small" - else - = link_to 'Close', project_issue_path(@project, @issue, :issue => {:closed => true }, :status_only => true), :method => :put, :class => "btn small", :title => "Close Issue" + = link_to 'Close', project_issue_path(@project, @issue, issue: {closed: true }, status_only: true), method: :put, class: "btn small", title: "Close Issue" - if can?(current_user, :admin_project, @project) || @issue.author == current_user - = link_to edit_project_issue_path(@project, @issue), :class => "btn small" do + = link_to edit_project_issue_path(@project, @issue), class: "btn small" do %i.icon-edit Edit @@ -35,18 +35,18 @@ .middle_box_content %cite.cgray Created by - = image_tag gravatar_icon(@issue.author_email), :width => 16, :class => "lil_av" + = image_tag gravatar_icon(@issue.author_email), width: 16, class: "lil_av" %strong.author= link_to_issue_author(@issue) - if @issue.assignee %cite.cgray and currently assigned to - = image_tag gravatar_icon(@issue.assignee_email), :width => 16, :class => "lil_av" + = image_tag gravatar_icon(@issue.assignee_email), width: 16, class: "lil_av" %strong.author= link_to_issue_assignee(@issue) - if @issue.milestone - milestone = @issue.milestone %cite.cgray and attached to milestone - %strong= link_to_gfm truncate(milestone.title, :length => 20), project_milestone_path(milestone.project, milestone) + %strong= link_to_gfm truncate(milestone.title, length: 20), project_milestone_path(milestone.project, milestone) .right - @issue.labels.each do |label| @@ -61,4 +61,4 @@ = markdown @issue.description -.issue_notes#notes= render "notes/notes", :tid => @issue.id, :tt => "issue" +.issue_notes#notes= render "notes/notes", tid: @issue.id, tt: "issue" |