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 107 additions and 107 deletions
%h3 Resque
%iframe{:src => "/info/resque", :width => 1168, :height => 600, :style => "border: none"}
\ No newline at end of file
%iframe{src: "/info/resque", width: 1168, height: 600, style: "border: none"}
\ No newline at end of file
= form_for @admin_team_member, :as => :team_member, :url => admin_team_member_path(@admin_team_member) do |f|
= form_for @admin_team_member, as: :team_member, url: admin_team_member_path(@admin_team_member) do |f|
-if @admin_team_member.errors.any?
.alert-message.block-message.error
%ul
Loading
Loading
@@ -8,12 +8,12 @@
.clearfix
%label Project Access:
.input
= f.select :project_access, options_for_select(Project.access_options, @admin_team_member.project_access), {}, :class => "project-access-select"
= f.select :project_access, options_for_select(Project.access_options, @admin_team_member.project_access), {}, class: "project-access-select"
 
%br
.actions
= f.submit 'Save', :class => "btn primary"
= link_to 'Cancel', :back, :class => "btn"
= f.submit 'Save', class: "btn primary"
= link_to 'Cancel', :back, class: "btn"
 
:css
form select {
Loading
Loading
Loading
Loading
@@ -22,17 +22,17 @@
 
-if f.object.new_record?
.clearfix
= f.label :admin, :class => "checkbox" do
= f.label :admin, class: "checkbox" do
= f.check_box :force_random_password, {}, true, nil
%span Generate random password
%div.password-fields
.clearfix
= f.label :password
.input= f.password_field :password, :disabled => f.object.force_random_password
.input= f.password_field :password, disabled: f.object.force_random_password
.clearfix
= f.label :password_confirmation
.input= f.password_field :password_confirmation, :disabled => f.object.force_random_password
.input= f.password_field :password_confirmation, disabled: f.object.force_random_password
%hr
.clearfix
= f.label :skype
Loading
Loading
@@ -46,27 +46,27 @@
.span6
.clearfix
= f.label :projects_limit
.input= f.text_field :projects_limit, :class => "small_input"
.input= f.text_field :projects_limit, class: "small_input"
 
.alert
.clearfix
%p Make the user a GitLab administrator.
= f.label :admin, :class => "checkbox" do
= f.label :admin, class: "checkbox" do
= f.check_box :admin
%span Administrator
- unless @admin_user.new_record?
.alert.alert-error
- if @admin_user.blocked
%span
= link_to 'Unblock', unblock_admin_user_path(@admin_user), :method => :put, :class => "btn small"
= link_to 'Unblock', unblock_admin_user_path(@admin_user), method: :put, class: "btn small"
This user is blocked and is not able to login to GitLab
- else
%span
= link_to 'Block', block_admin_user_path(@admin_user), :confirm => 'USER WILL BE BLOCKED! Are you sure?', :method => :put, :class => "btn small danger"
= link_to 'Block', block_admin_user_path(@admin_user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn small danger"
Blocked users will be removed from all projects & will not be able to login to GitLab.
.actions
= f.submit 'Save', :class => "btn primary"
= f.submit 'Save', class: "btn primary"
- if @admin_user.new_record?
= link_to 'Cancel', admin_users_path, :class => "btn"
= link_to 'Cancel', admin_users_path, class: "btn"
- else
= link_to 'Cancel', admin_user_path(@admin_user), :class => "btn"
= link_to 'Cancel', admin_user_path(@admin_user), class: "btn"
%h3
Users
= link_to 'New User', new_admin_user_path, :class => "btn small right"
= link_to 'New User', new_admin_user_path, class: "btn small right"
%br
 
= form_tag admin_users_path, :method => :get do
= text_field_tag :name, params[:name], :class => "xlarge"
= submit_tag "Search", :class => "btn submit primary"
= form_tag admin_users_path, method: :get do
= text_field_tag :name, params[:name], class: "xlarge"
= submit_tag "Search", class: "btn submit primary"
%ul.nav.nav-pills
%li{:class => "#{'active' unless params[:filter]}"}
%li{class: "#{'active' unless params[:filter]}"}
= link_to "Active", admin_users_path
%li{:class => "#{'active' if params[:filter] == "admins"}"}
= link_to admin_users_path(:filter => "admins") do
%li{class: "#{'active' if params[:filter] == "admins"}"}
= link_to admin_users_path(filter: "admins") do
Admins
%li{:class => "#{'active' if params[:filter] == "blocked"}"}
= link_to admin_users_path(:filter => "blocked") do
%li{class: "#{'active' if params[:filter] == "blocked"}"}
= link_to admin_users_path(filter: "blocked") do
Blocked
%li{:class => "#{'active' if params[:filter] == "wop"}"}
= link_to admin_users_path(:filter => "wop") do
%li{class: "#{'active' if params[:filter] == "wop"}"}
= link_to admin_users_path(filter: "wop") do
Without projects
 
%table.admin-table
Loading
Loading
@@ -31,16 +31,16 @@
 
- @admin_users.each do |user|
%tr
%td= check_box_tag "admin", 1, user.admin, :disabled => :disabled
%td= check_box_tag "admin", 1, user.admin, disabled: :disabled
%td= link_to user.name, [:admin, user]
%td= user.email
%td= user.users_projects.count
%td= link_to 'Edit', edit_admin_user_path(user), :id => "edit_#{dom_id(user)}", :class => "btn small"
%td= link_to 'Edit', edit_admin_user_path(user), id: "edit_#{dom_id(user)}", class: "btn small"
%td
- if user.blocked
= link_to 'Unblock', unblock_admin_user_path(user), :method => :put, :class => "btn small success"
= link_to 'Unblock', unblock_admin_user_path(user), method: :put, class: "btn small success"
- else
= link_to 'Block', block_admin_user_path(user), :confirm => 'USER WILL BE BLOCKED! Are you sure?', :method => :put, :class => "btn small danger"
%td.bgred= link_to 'Destroy', [:admin, user], :confirm => "USER #{user.name} WILL BE REMOVED! Are you sure?", :method => :delete, :class => "btn small danger"
= link_to 'Block', block_admin_user_path(user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn small danger"
%td.bgred= link_to 'Destroy', [:admin, user], confirm: "USER #{user.name} WILL BE REMOVED! Are you sure?", method: :delete, class: "btn small danger"
 
= paginate @admin_users, :theme => "admin"
= paginate @admin_users, theme: "admin"
Loading
Loading
@@ -4,7 +4,7 @@
%small Blocked
- if @admin_user.admin
%small Administrator
= link_to 'Edit', edit_admin_user_path(@admin_user), :class => "btn small right"
= link_to 'Edit', edit_admin_user_path(@admin_user), class: "btn small right"
 
%br
 
Loading
Loading
@@ -19,12 +19,12 @@
%td
%b
Admin:
%td= check_box_tag "admin", 1, @admin_user.admin, :disabled => :disabled
%td= check_box_tag "admin", 1, @admin_user.admin, disabled: :disabled
%tr
%td
%b
Blocked:
%td= check_box_tag "blocked", 1, @admin_user.blocked, :disabled => :disabled
%td= check_box_tag "blocked", 1, @admin_user.blocked, disabled: :disabled
%tr
%td
%b
Loading
Loading
@@ -56,7 +56,7 @@
%br
%h3 Add User to Projects
%br
= form_tag team_update_admin_user_path(@admin_user), :class => "bulk_import", :method => :put do
= form_tag team_update_admin_user_path(@admin_user), class: "bulk_import", method: :put do
%table.table-bordered
%thead
%tr
Loading
Loading
@@ -64,14 +64,14 @@
%th Project Access:
 
%tr
%td= select_tag :project_ids, options_from_collection_for_select(@projects , :id, :name), :multiple => true
%td= select_tag :project_access, options_for_select(Project.access_options), :class => "project-access-select"
%td= select_tag :project_ids, options_from_collection_for_select(@projects , :id, :name), multiple: true
%td= select_tag :project_access, options_for_select(Project.access_options), class: "project-access-select"
 
%tr
%td= submit_tag 'Add', :class => "btn primary"
%td= submit_tag 'Add', class: "btn primary"
%td
Read more about project permissions
%strong= link_to "here", help_permissions_path, :class => "vlink"
%strong= link_to "here", help_permissions_path, class: "vlink"
%br
 
- if @admin_user.projects.present?
Loading
Loading
@@ -90,9 +90,9 @@
- project = tm.project
%tr
%td= link_to project.name, admin_project_path(project)
%td= select_tag :tm_project_access, options_for_select(Project.access_options, tm.project_access), :class => "medium project-access-select", :disabled => :disabled
%td= link_to 'Edit Access', edit_admin_team_member_path(tm), :class => "btn small"
%td= link_to 'Remove from team', admin_team_member_path(tm), :confirm => 'Are you sure?', :method => :delete, :class => "btn small danger"
%td= select_tag :tm_project_access, options_for_select(Project.access_options, tm.project_access), class: "medium project-access-select", disabled: :disabled
%td= link_to 'Edit Access', edit_admin_team_member_path(tm), class: "btn small"
%td= link_to 'Remove from team', admin_team_member_path(tm), confirm: 'Are you sure?', method: :delete, class: "btn small danger"
 
:css
form select {
Loading
Loading
%li.commit
.browse_code_link_holder
%p
%strong= link_to "Browse Code »", tree_project_ref_path(@project, commit.id), :class => "right"
%strong= link_to "Browse Code »", tree_project_ref_path(@project, commit.id), class: "right"
%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.cgray= commit.author_name
–
= image_tag gravatar_icon(commit.author_email), :class => "avatar", :width => 16
= link_to_gfm truncate(commit.title, :length => 50), project_commit_path(@project, :id => commit.id), :class => "row_title"
= image_tag gravatar_icon(commit.author_email), class: "avatar", width: 16
= link_to_gfm truncate(commit.title, length: 50), project_commit_path(@project, id: commit.id), class: "row_title"
 
%span.committed_ago
= time_ago_in_words(commit.committed_date)
Loading
Loading
Loading
Loading
@@ -5,10 +5,10 @@
%span.btn.disabled.grouped
%i.icon-comment
= @notes_count
= link_to patch_project_commit_path(@project, @commit.id), :class => "btn small grouped" do
= link_to patch_project_commit_path(@project, @commit.id), class: "btn small grouped" do
%i.icon-download-alt
Get Patch
= link_to tree_project_ref_path(@project, @commit.id), :class => "browse-button primary grouped" do
= link_to tree_project_ref_path(@project, @commit.id), class: "browse-button primary grouped" do
%strong Browse Code »
%h3.commit-title.page_title
= gfm @commit.title
Loading
Loading
@@ -18,7 +18,7 @@
.commit-info
.row
.span4
= image_tag gravatar_icon(@commit.author_email, 40), :class => "avatar"
= image_tag gravatar_icon(@commit.author_email, 40), class: "avatar"
.author
%strong= @commit.author_name
authored
Loading
Loading
Loading
Loading
@@ -3,24 +3,24 @@
%li
- if diff.deleted_file
%span.removed_file
%a{:href => "##{diff.old_path}"}
%a{href: "##{diff.old_path}"}
= diff.old_path
= image_tag "diff_file_delete.png"
- elsif diff.renamed_file
%span.moved_file
%a{:href => "##{diff.new_path}"}
%a{href: "##{diff.new_path}"}
= diff.old_path
= "->"
= diff.new_path
= image_tag "diff_file_notice.png"
- elsif diff.new_file
%span.new_file
%a{:href => "##{diff.new_path}"}
%a{href: "##{diff.new_path}"}
= diff.new_path
= image_tag "diff_file_add.png"
- else
%span.edit_file
%a{:href => "##{diff.new_path}"}
%a{href: "##{diff.new_path}"}
= diff.new_path
= image_tag "diff_file_info.png"
 
Loading
Loading
@@ -5,12 +5,12 @@
%p To prevent performance issue we rejected diff information.
%p
But if you still want to see diff
= link_to "click this link", project_commit_path(@project, @commit.id, :force_show_diff => true), :class => "dark"
= link_to "click this link", project_commit_path(@project, @commit.id, force_show_diff: true), class: "dark"
 
%p.cgray
Showing #{pluralize(diffs.count, "changed file")}
.file_stats
= render "commits/diff_head", :diffs => diffs
= render "commits/diff_head", diffs: diffs
 
- unless @suppress_diff
- diffs.each_with_index do |diff, i|
Loading
Loading
@@ -22,26 +22,26 @@
.diff_file_header
- if diff.deleted_file
%i.icon-file
%span{:id => "#{diff.old_path}"}= diff.old_path
%span{id: "#{diff.old_path}"}= diff.old_path
- else
= link_to tree_file_project_ref_path(@project, @commit.id, diff.new_path) do
%i.icon-file
%span{:id => "#{diff.new_path}"}= diff.new_path
%span{id: "#{diff.new_path}"}= diff.new_path
%br/
.diff_file_content
-# Skipp all non non-supported blobs
- next unless file.respond_to?('text?')
 
- if file.text?
= render "commits/text_file", :diff => diff, :index => i
= render "commits/text_file", diff: diff, index: i
- elsif file.image?
- if diff.renamed_file || diff.new_file || diff.deleted_file
.diff_file_content_image
%img{:class => image_diff_class(diff), :src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
%img{class: image_diff_class(diff), src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
- else
- old_file = (@commit.prev_commit.tree / diff.old_path)
.diff_file_content_image.img_compared
%img{:class => "diff_image_removed", :src => "data:#{file.mime_type};base64,#{Base64.encode64(old_file.data)}"}
%img{:class => "diff_image_added", :src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
%img{class: "diff_image_removed", src: "data:#{file.mime_type};base64,#{Base64.encode64(old_file.data)}"}
%img{class: "diff_image_added", src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
- else
%p.nothing_here_message No preview for this file type
%ul.nav.nav-tabs
%li
= form_tag switch_project_refs_path(@project), :method => :get, :class => "project-refs-form" 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" do
= select_tag "ref", grouped_options_refs, onchange: "$(this.form).trigger('submit');", class: "project-refs-select"
= hidden_field_tag :destination, "commits"
 
%li{:class => "#{'active' if current_page?(project_commits_path(@project)) }"}
%li{class: "#{'active' if current_page?(project_commits_path(@project)) }"}
= link_to project_commits_path(@project) do
Commits
%li{:class => "#{'active' if current_page?(compare_project_commits_path(@project)) }"}
%li{class: "#{'active' if current_page?(compare_project_commits_path(@project)) }"}
= link_to compare_project_commits_path(@project) do
Compare
%li{:class => "#{branches_tab_class}"}
%li{class: "#{branches_tab_class}"}
= link_to project_repository_path(@project) do
Branches
%span.badge= @project.repo.branch_count
 
%li{:class => "#{'active' if current_page?(tags_project_repository_path(@project)) }"}
%li{class: "#{'active' if current_page?(tags_project_repository_path(@project)) }"}
= link_to tags_project_repository_path(@project) do
Tags
%span.badge= @project.repo.tag_count
Loading
Loading
@@ -24,8 +24,8 @@
- if current_page?(project_commits_path(@project)) && current_user.private_token
%li.right
%span.rss-icon
= link_to project_commits_path(@project, :atom, { :private_token => current_user.private_token, :ref => @ref }), :title => "Feed" do
= image_tag "rss_ui.png", :title => "feed"
= link_to project_commits_path(@project, :atom, { private_token: current_user.private_token, ref: @ref }), title: "Feed" do
= image_tag "rss_ui.png", title: "feed"
 
:javascript
$(function(){
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@
- if too_big
%a.supp_diff_link Diff suppressed. Click to show
 
%table{:class => "#{'hide' if too_big}"}
%table{class: "#{'hide' if too_big}"}
- each_diff_line(diff.diff.lines.to_a, index) do |line, type, line_code, line_new, line_old|
%tr.line_holder
- if type == "match"
Loading
Loading
@@ -11,16 +11,16 @@
%td.line_content.matched= line
- else
%td.old_line
= link_to raw(type == "new" ? " " : line_old), "##{line_code}", :id => line_code
= link_to raw(type == "new" ? " " : line_old), "##{line_code}", id: line_code
- if @comments_allowed
= link_to "", "#", :class => "line_note_link", "line_code" => line_code, :title => "Add note for this line"
%td.new_line= link_to raw(type == "old" ? " " : line_new) , "##{line_code}", :id => line_code
%td.line_content{:class => "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw "#{line}  "
= link_to "", "#", class: "line_note_link", "line_code" => line_code, title: "Add note for this line"
%td.new_line= link_to raw(type == "old" ? " " : line_new) , "##{line_code}", id: line_code
%td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw "#{line}  "
 
- if @comments_allowed
- comments = @line_notes.select { |n| n.line_code == line_code }.sort_by(&:created_at).reverse
- unless comments.empty?
- comments.each_with_index do |note, i|
= render "notes/reply_button", :line_code => line_code if i.zero?
= render "notes/per_line_show", :note => note
= render "notes/reply_button", line_code: line_code if i.zero?
= render "notes/per_line_show", note: note
- @line_notes.reject!{ |n| n == note }
Loading
Loading
@@ -14,13 +14,13 @@
 
%br
 
= form_tag compare_project_commits_path(@project), :method => :get do
= form_tag compare_project_commits_path(@project), method: :get do
.clearfix
= text_field_tag :from, params[:from], :placeholder => "master", :class => "xlarge"
= text_field_tag :from, params[:from], placeholder: "master", class: "xlarge"
= "..."
= text_field_tag :to, params[:to], :placeholder => "aa8b4ef", :class => "xlarge"
= text_field_tag :to, params[:to], placeholder: "aa8b4ef", class: "xlarge"
.actions
= submit_tag "Compare", :class => "btn btn-primary"
= submit_tag "Compare", class: "btn btn-primary"
 
 
- unless @commits.empty?
Loading
Loading
@@ -30,7 +30,7 @@
 
- unless @diffs.empty?
%h4 Diff
= render "commits/diffs", :diffs => @diffs
= render "commits/diffs", diffs: @diffs
 
:javascript
$(function() {
Loading
Loading
Loading
Loading
@@ -9,12 +9,12 @@
%span.divider
\/
%li
%a{:href => "#"}= params[:path].split("/").join(" / ")
%a{href: "#"}= params[:path].split("/").join(" / ")
 
%div{:id => dom_id(@project)}
%div{id: dom_id(@project)}
#commits_list= render "commits"
.clear
.loading{ :style => "display:none;"}
.loading{ style: "display:none;"}
 
- if @commits.count == @limit
:javascript
Loading
Loading
:plain
CommitsList.append(#{@commits.count}, "#{escape_javascript(render(:partial => 'commits/commits'))}");
CommitsList.append(#{@commits.count}, "#{escape_javascript(render(partial: 'commits/commits'))}");
 
= render "commits/commit_box"
= render "commits/diffs", :diffs => @commit.diffs
= render "notes/notes", :tid => @commit.id, :tt => "commit"
= render "commits/diffs", diffs: @commit.diffs
= render "notes/notes", tid: @commit.id, tt: "commit"
= render "notes/per_line_form"
 
 
Loading
Loading
Loading
Loading
@@ -6,7 +6,7 @@
%span
You wont be able to pull/push project code unless you
%strong
= link_to new_key_path, :class => "vlink" do
= link_to new_key_path, class: "vlink" do
add new key
to your profile
- if @events.any?
Loading
Loading
@@ -15,7 +15,7 @@
%h4.nothing_here_message Projects activity will be displayed here
.loading.hide
.side
= render "events/event_last_push", :event => @last_push
= render "events/event_last_push", event: @last_push
.projects_box
%h5
Projects
Loading
Loading
@@ -23,23 +23,23 @@
(#{@projects.total_count})
- if current_user.can_create_project?
%span.right
= link_to new_project_path, :class => "btn very_small info" do
= link_to new_project_path, class: "btn very_small info" do
%i.icon-plus
New Project
- @projects.each do |project|
= link_to project_path(project), :class => dom_class(project) do
= link_to project_path(project), class: dom_class(project) do
%h4
%span.ico.project
= truncate(project.name, :length => 25)
= truncate(project.name, length: 25)
%span.right
→
.bottom= paginate @projects, :theme => "gitlab"
.bottom= paginate @projects, theme: "gitlab"
 
%hr
%div
%span.rss-icon
= link_to dashboard_path(:atom, { :private_token => current_user.private_token }) do
= image_tag "rss_ui.png", :title => "feed"
= link_to dashboard_path(:atom, { private_token: current_user.private_token }) do
= image_tag "rss_ui.png", title: "feed"
%strong News Feed
 
- else
Loading
Loading
@@ -51,7 +51,7 @@
= current_user.projects_limit
projects. Click on button below to add a new one
.link_holder
= link_to new_project_path, :class => "btn primary" do
= link_to new_project_path, class: "btn primary" do
New Project »
- else
If you will be added to project - it will be displayed here
Loading
Loading
Loading
Loading
@@ -12,8 +12,8 @@
%h5= @project.name
%ul.unstyled.issues_table
- group[1].each do |issue|
= render(:partial => 'issues/show', :locals => {:issue => issue})
= render(partial: 'issues/show', locals: {issue: issue})
%hr
= paginate @issues, :theme => "gitlab"
= paginate @issues, theme: "gitlab"
- else
%h3.nothing_here_message Nothing to show here
Loading
Loading
@@ -10,9 +10,9 @@
- @project = group[0]
%h5= @project.name
- group[1].each do |merge_request|
= render(:partial => 'merge_requests/merge_request', :locals => {:merge_request => merge_request})
= render(partial: 'merge_requests/merge_request', locals: {merge_request: merge_request})
%hr
= paginate @merge_requests, :theme => "gitlab"
= paginate @merge_requests, theme: "gitlab"
 
- else
%h3.nothing_here_message Nothing to show here
%div
= form_for [@project, @key], :url => project_deploy_keys_path do |f|
= form_for [@project, @key], url: project_deploy_keys_path do |f|
-if @key.errors.any?
.alert-message.block-message.error
%ul
Loading
Loading
@@ -11,8 +11,8 @@
.input= f.text_field :title
.clearfix
= f.label :key
.input= f.text_area :key, :class => "xlarge"
.input= f.text_area :key, class: "xlarge"
.actions
= f.submit 'Save', :class => "primary btn"
= link_to "Cancel", project_deploy_keys_path(@project), :class => "btn"
= f.submit 'Save', class: "primary btn"
= link_to "Cancel", project_deploy_keys_path(@project), class: "btn"
 
%tr
%td
%a{:href => project_deploy_key_path(key.project, key)}
%a{href: project_deploy_key_path(key.project, key)}
%strong= key.title
%td
%span.update-author
Loading
Loading
@@ -8,5 +8,5 @@
= time_ago_in_words(key.created_at)
ago
%td
= link_to 'Remove', project_deploy_key_path(key.project, key), :confirm => 'Are you sure?', :method => :delete, :class => "danger btn delete-key small right"
= link_to 'Remove', project_deploy_key_path(key.project, key), confirm: 'Are you sure?', method: :delete, class: "danger btn delete-key small right"
 
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