Skip to content
Snippets Groups Projects
Commit 77541891 authored by Robert Speicher's avatar Robert Speicher
Browse files

Fully embrace Ruby 1.9 hash syntax

Didn't bother with files in db/, config/, or features/
parent 1413c23c
No related branches found
No related tags found
1 merge request!1219Fully embrace Ruby 1.9 hash syntax
Showing
with 97 additions and 97 deletions
Loading
Loading
@@ -2,10 +2,10 @@
- if can? current_user, :admin_project, @project
.alert-message.block-message
Deploy keys allow read-only access to repository.
= link_to new_project_deploy_key_path(@project), :class => "btn small", :title => "New Deploy Key" do
= link_to new_project_deploy_key_path(@project), class: "btn small", title: "New Deploy Key" do
Add Deploy Key
 
- if @keys.any?
%table
- @keys.each do |key|
= render(:partial => 'show', :locals => {:key => key})
= render(partial: 'show', locals: {key: key})
Loading
Loading
@@ -3,5 +3,5 @@
%hr
%pre= @key.key
.actions
= link_to 'Remove', project_deploy_key_path(@key.project, @key), :confirm => 'Are you sure?', :method => :delete, :class => "danger btn delete-key"
= link_to 'Remove', project_deploy_key_path(@key.project, @key), confirm: 'Are you sure?', method: :delete, class: "danger btn delete-key"
.clear
= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put, :class => "login-box" }) do |f|
= image_tag "login-logo.png", :width => "304", :height => "66", :class => "login-logo", :alt => "Login Logo"
= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put, class: "login-box" }) do |f|
= image_tag "login-logo.png", width: "304", height: "66", class: "login-logo", alt: "Login Logo"
%h3 Change your password
= devise_error_messages!
= f.hidden_field :reset_password_token
%div
= f.password_field :password, :class => "text top", :placeholder => "New password"
= f.password_field :password, class: "text top", placeholder: "New password"
%div
= f.password_field :password_confirmation, :class => "text bottom", :placeholder => "Confirm new password"
= f.password_field :password_confirmation, class: "text bottom", placeholder: "Confirm new password"
%div
= f.submit "Change my password", :class => "btn primary"
.right= render :partial => "devise/shared/links"
= f.submit "Change my password", class: "btn primary"
.right= render partial: "devise/shared/links"
Loading
Loading
@@ -2,4 +2,4 @@
%h3 Access Denied
%hr
%p Youre not allowed to access this page
%p Read more about project permissions #{link_to "here", help_permissions_path, :class => "vlink"}
%p Read more about project permissions #{link_to "here", help_permissions_path, class: "vlink"}
- commit = CommitDecorator.decorate(commit)
%li.wll.commit
%p
= link_to commit.short_id(8), project_commit_path(project, :id => commit.id), :class => "commit_short_id"
= link_to commit.short_id(8), project_commit_path(project, id: commit.id), class: "commit_short_id"
%strong.cdark= commit.author_name
–
= image_tag gravatar_icon(commit.author_email), :class => "avatar", :width => 16
= gfm truncate(commit.title, :length => 50), project_commit_path(project, :id => commit.id) rescue "--broken encoding"
= image_tag gravatar_icon(commit.author_email), class: "avatar", width: 16
= gfm truncate(commit.title, length: 50), project_commit_path(project, id: commit.id) rescue "--broken encoding"
 
- if event.allowed?
- if event.issue?
.event_feed
= render "events/event_issue", :event => event
= render "events/event_issue", event: event
 
- elsif event.merge_request?
.event_feed
= render "events/event_merge_request", :event => event
= render "events/event_merge_request", event: event
 
- elsif event.push?
.event_feed
= render "events/event_push", :event => event
= render "events/event_push", event: event
 
= image_tag gravatar_icon(event.author_email), :class => "avatar"
= image_tag gravatar_icon(event.author_email), class: "avatar"
%strong #{event.author_name}
%span.event_label{:class => event.action_name}= event.action_name
%span.event_label{class: event.action_name}= event.action_name
issue
= link_to project_issue_path(event.project, event.issue) do
%strong= truncate event.issue_title
Loading
Loading
- if show_last_push_widget?(event)
.event_lp
%div
= image_tag gravatar_icon(event.author_email), :class => "avatar"
= image_tag gravatar_icon(event.author_email), class: "avatar"
%span Your pushed to
= event.ref_type
= link_to project_commits_path(event.project, :ref => event.ref_name) do
%strong= truncate(event.ref_name, :length => 28)
= link_to project_commits_path(event.project, ref: event.ref_name) do
%strong= truncate(event.ref_name, length: 28)
at
%strong= link_to event.project.name, event.project
 
= link_to new_mr_path_from_push_event(event), :title => "New Merge Request", :class => "btn very_small primary" do
= link_to new_mr_path_from_push_event(event), title: "New Merge Request", class: "btn very_small primary" do
Create Merge Request
- if event.action_name == "merged"
.event_icon= image_tag "event_mr_merged.png"
= image_tag gravatar_icon(event.author_email), :class => "avatar"
= image_tag gravatar_icon(event.author_email), class: "avatar"
%strong #{event.author_name}
%span.event_label{:class => event.action_name}= event.action_name
%span.event_label{class: event.action_name}= event.action_name
merge request
= link_to project_merge_request_path(event.project, event.merge_request) do
%strong= truncate event.merge_request_title
Loading
Loading
%div
.event_icon= image_tag "event_push.png"
= image_tag gravatar_icon(event.author_email), :class => "avatar"
= image_tag gravatar_icon(event.author_email), class: "avatar"
%strong #{event.author_name}
%span.event_label.pushed= event.push_action_name
= event.ref_type
= link_to project_commits_path(event.project, :ref => event.ref_name) do
= link_to project_commits_path(event.project, ref: event.ref_name) do
%strong= event.ref_name
at
%strong= link_to event.project.name, event.project
Loading
Loading
@@ -14,17 +14,17 @@
 
- if event.push_with_commits?
- if event.commits_count > 1
= link_to compare_project_commits_path(event.project, :from => event.parent_commit.id, :to => event.last_commit.id) do
= link_to compare_project_commits_path(event.project, from: event.parent_commit.id, to: event.last_commit.id) do
%strong #{event.parent_commit.id[0..7]}...#{event.last_commit.id[0..7]}
- project = event.project
%ul.unstyled.event_commits
- if event.commits_count > 3
- event.commits[0...2].each do |commit|
= render "events/commit", :commit => commit, :project => project
= render "events/commit", commit: commit, project: project
%li
%br
\... and #{event.commits_count - 2} more commits
- else
- event.commits.each do |commit|
= render "events/commit", :commit => commit, :project => project
= render "events/commit", commit: commit, project: project
 
Loading
Loading
@@ -6,13 +6,13 @@
 
%ol
%li
%a{:href => "#README"} README
%a{href: "#README"} README
%li
%a{:href => "#projects"} Projects
%a{href: "#projects"} Projects
%li
%a{:href => "#users"} Users
%a{href: "#users"} Users
%li
%a{:href => "#issues"} Issues
%a{href: "#issues"} Issues
 
.file_holder#README
.file_title
Loading
Loading
Loading
Loading
@@ -6,9 +6,9 @@
Post receive hooks for binding events when someone push to repository.
%br
Read more about web hooks
%strong #{link_to "here", help_web_hooks_path, :class => "vlink"}
%strong #{link_to "here", help_web_hooks_path, class: "vlink"}
 
= form_for [@project, @hook], :as => :hook, :url => project_hooks_path(@project) do |f|
= form_for [@project, @hook], as: :hook, url: project_hooks_path(@project) do |f|
-if @hook.errors.any?
.alert-message.block-message.error
- @hook.errors.full_messages.each do |msg|
Loading
Loading
@@ -16,9 +16,9 @@
.clearfix
= f.label :url, "URL:"
.input
= f.text_field :url, :class => "text_field xxlarge"
= f.text_field :url, class: "text_field xxlarge"
 
= f.submit "Add Web Hook", :class => "btn primary"
= f.submit "Add Web Hook", class: "btn primary"
%hr
 
-if @hooks.any?
Loading
Loading
@@ -36,7 +36,7 @@
%td
= link_to project_hook_path(@project, hook) do
%strong= hook.url
= link_to 'Test Hook', test_project_hook_path(@project, hook), :class => "btn small right"
= link_to 'Test Hook', test_project_hook_path(@project, hook), class: "btn small right"
%td POST
%td
= link_to 'Remove', project_hook_path(@project, hook), :confirm => 'Are you sure?', :method => :delete, :class => "danger btn small right"
= link_to 'Remove', project_hook_path(@project, hook), confirm: 'Are you sure?', method: :delete, class: "danger btn small right"
%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
Loading
Loading
@@ -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
Loading
Loading
@@ -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"
%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"
- @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}
Loading
Loading
%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
Loading
Loading
@@ -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}"
Loading
Loading
- 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
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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
 
Loading
Loading
@@ -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|
Loading
Loading
@@ -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"
Loading
Loading
@@ -6,4 +6,4 @@
-# per_page: number of items to fetch per page
-# remote: data-remote
%span.first
= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote
= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, remote: remote
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment