Commit ac525a74ee2862d0012a443059954288d4634acd
Exists in
master
and in
4 other branches
Merge pull request #1219 from tsigo/ruby19_hashes
Fully embrace Ruby 1.9 hash syntax
Showing
256 changed files
with
1448 additions
and
1448 deletions
Show diff stats
app/contexts/commit_load.rb
1 | class CommitLoad < BaseContext | 1 | class CommitLoad < BaseContext |
2 | def execute | 2 | def execute |
3 | result = { | 3 | result = { |
4 | - :commit => nil, | ||
5 | - :suppress_diff => false, | ||
6 | - :line_notes => [], | ||
7 | - :notes_count => 0, | ||
8 | - :note => nil | 4 | + commit: nil, |
5 | + suppress_diff: false, | ||
6 | + line_notes: [], | ||
7 | + notes_count: 0, | ||
8 | + note: nil | ||
9 | } | 9 | } |
10 | 10 | ||
11 | commit = project.commit(params[:id]) | 11 | commit = project.commit(params[:id]) |
app/contexts/issues_bulk_update_context.rb
@@ -12,12 +12,12 @@ class IssuesBulkUpdateContext < BaseContext | @@ -12,12 +12,12 @@ class IssuesBulkUpdateContext < BaseContext | ||
12 | opts[:assignee_id] = assignee_id if assignee_id.present? | 12 | opts[:assignee_id] = assignee_id if assignee_id.present? |
13 | opts[:closed] = (status == "closed") if status.present? | 13 | opts[:closed] = (status == "closed") if status.present? |
14 | 14 | ||
15 | - issues = Issue.where(:id => issues_ids).all | 15 | + issues = Issue.where(id: issues_ids).all |
16 | issues = issues.select { |issue| can?(current_user, :modify_issue, issue) } | 16 | issues = issues.select { |issue| can?(current_user, :modify_issue, issue) } |
17 | issues.each { |issue| issue.update_attributes(opts) } | 17 | issues.each { |issue| issue.update_attributes(opts) } |
18 | { | 18 | { |
19 | - :count => issues.count, | ||
20 | - :success => !issues.count.zero? | 19 | + count: issues.count, |
20 | + success: !issues.count.zero? | ||
21 | } | 21 | } |
22 | end | 22 | end |
23 | end | 23 | end |
app/controllers/admin/projects_controller.rb
@@ -2,7 +2,7 @@ class Admin::ProjectsController < ApplicationController | @@ -2,7 +2,7 @@ class Admin::ProjectsController < ApplicationController | ||
2 | layout "admin" | 2 | layout "admin" |
3 | before_filter :authenticate_user! | 3 | before_filter :authenticate_user! |
4 | before_filter :authenticate_admin! | 4 | before_filter :authenticate_admin! |
5 | - before_filter :admin_project, :only => [:edit, :show, :update, :destroy, :team_update] | 5 | + before_filter :admin_project, only: [:edit, :show, :update, :destroy, :team_update] |
6 | 6 | ||
7 | def index | 7 | def index |
8 | @admin_projects = Project.scoped | 8 | @admin_projects = Project.scoped |
@@ -36,7 +36,7 @@ class Admin::ProjectsController < ApplicationController | @@ -36,7 +36,7 @@ class Admin::ProjectsController < ApplicationController | ||
36 | if @admin_project.save | 36 | if @admin_project.save |
37 | redirect_to [:admin, @admin_project], notice: 'Project was successfully created.' | 37 | redirect_to [:admin, @admin_project], notice: 'Project was successfully created.' |
38 | else | 38 | else |
39 | - render :action => "new" | 39 | + render action: "new" |
40 | end | 40 | end |
41 | end | 41 | end |
42 | 42 | ||
@@ -50,7 +50,7 @@ class Admin::ProjectsController < ApplicationController | @@ -50,7 +50,7 @@ class Admin::ProjectsController < ApplicationController | ||
50 | if @admin_project.update_attributes(params[:project]) | 50 | if @admin_project.update_attributes(params[:project]) |
51 | redirect_to [:admin, @admin_project], notice: 'Project was successfully updated.' | 51 | redirect_to [:admin, @admin_project], notice: 'Project was successfully updated.' |
52 | else | 52 | else |
53 | - render :action => "edit" | 53 | + render action: "edit" |
54 | end | 54 | end |
55 | end | 55 | end |
56 | 56 |
app/controllers/admin/users_controller.rb
@@ -34,7 +34,7 @@ class Admin::UsersController < ApplicationController | @@ -34,7 +34,7 @@ class Admin::UsersController < ApplicationController | ||
34 | 34 | ||
35 | 35 | ||
36 | def new | 36 | def new |
37 | - @admin_user = User.new(:projects_limit => Gitlab.config.default_projects_limit) | 37 | + @admin_user = User.new(projects_limit: Gitlab.config.default_projects_limit) |
38 | end | 38 | end |
39 | 39 | ||
40 | def edit | 40 | def edit |
app/controllers/application_controller.rb
@@ -11,15 +11,15 @@ class ApplicationController < ActionController::Base | @@ -11,15 +11,15 @@ class ApplicationController < ActionController::Base | ||
11 | helper_method :abilities, :can? | 11 | helper_method :abilities, :can? |
12 | 12 | ||
13 | rescue_from Gitlab::Gitolite::AccessDenied do |exception| | 13 | rescue_from Gitlab::Gitolite::AccessDenied do |exception| |
14 | - render "errors/gitolite", :layout => "error" | 14 | + render "errors/gitolite", layout: "error" |
15 | end | 15 | end |
16 | 16 | ||
17 | rescue_from Encoding::CompatibilityError do |exception| | 17 | rescue_from Encoding::CompatibilityError do |exception| |
18 | - render "errors/encoding", :layout => "error", :status => 404 | 18 | + render "errors/encoding", layout: "error", status: 404 |
19 | end | 19 | end |
20 | 20 | ||
21 | rescue_from ActiveRecord::RecordNotFound do |exception| | 21 | rescue_from ActiveRecord::RecordNotFound do |exception| |
22 | - render "errors/not_found", :layout => "error", :status => 404 | 22 | + render "errors/not_found", layout: "error", status: 404 |
23 | end | 23 | end |
24 | 24 | ||
25 | layout :layout_by_resource | 25 | layout :layout_by_resource |
@@ -97,15 +97,15 @@ class ApplicationController < ActionController::Base | @@ -97,15 +97,15 @@ class ApplicationController < ActionController::Base | ||
97 | end | 97 | end |
98 | 98 | ||
99 | def access_denied! | 99 | def access_denied! |
100 | - render "errors/access_denied", :layout => "error", :status => 404 | 100 | + render "errors/access_denied", layout: "error", status: 404 |
101 | end | 101 | end |
102 | 102 | ||
103 | def not_found! | 103 | def not_found! |
104 | - render "errors/not_found", :layout => "error", :status => 404 | 104 | + render "errors/not_found", layout: "error", status: 404 |
105 | end | 105 | end |
106 | 106 | ||
107 | def git_not_found! | 107 | def git_not_found! |
108 | - render "errors/git_not_found", :layout => "error", :status => 404 | 108 | + render "errors/git_not_found", layout: "error", status: 404 |
109 | end | 109 | end |
110 | 110 | ||
111 | def method_missing(method_sym, *arguments, &block) | 111 | def method_missing(method_sym, *arguments, &block) |
@@ -127,7 +127,7 @@ class ApplicationController < ActionController::Base | @@ -127,7 +127,7 @@ class ApplicationController < ActionController::Base | ||
127 | end | 127 | end |
128 | 128 | ||
129 | def render_404 | 129 | def render_404 |
130 | - render :file => File.join(Rails.root, "public", "404"), :layout => false, :status => "404" | 130 | + render file: File.join(Rails.root, "public", "404"), layout: false, status: "404" |
131 | end | 131 | end |
132 | 132 | ||
133 | def require_non_empty_project | 133 | def require_non_empty_project |
app/controllers/commits_controller.rb
@@ -9,7 +9,7 @@ class CommitsController < ApplicationController | @@ -9,7 +9,7 @@ class CommitsController < ApplicationController | ||
9 | before_filter :authorize_read_project! | 9 | before_filter :authorize_read_project! |
10 | before_filter :authorize_code_access! | 10 | before_filter :authorize_code_access! |
11 | before_filter :require_non_empty_project | 11 | before_filter :require_non_empty_project |
12 | - before_filter :load_refs, :only => :index # load @branch, @tag & @ref | 12 | + before_filter :load_refs, only: :index # load @branch, @tag & @ref |
13 | before_filter :render_full_content | 13 | before_filter :render_full_content |
14 | 14 | ||
15 | def index | 15 | def index |
@@ -22,7 +22,7 @@ class CommitsController < ApplicationController | @@ -22,7 +22,7 @@ class CommitsController < ApplicationController | ||
22 | respond_to do |format| | 22 | respond_to do |format| |
23 | format.html # index.html.erb | 23 | format.html # index.html.erb |
24 | format.js | 24 | format.js |
25 | - format.atom { render :layout => false } | 25 | + format.atom { render layout: false } |
26 | end | 26 | end |
27 | end | 27 | end |
28 | 28 | ||
@@ -61,9 +61,9 @@ class CommitsController < ApplicationController | @@ -61,9 +61,9 @@ class CommitsController < ApplicationController | ||
61 | 61 | ||
62 | send_data( | 62 | send_data( |
63 | @commit.to_patch, | 63 | @commit.to_patch, |
64 | - :type => "text/plain", | ||
65 | - :disposition => 'attachment', | ||
66 | - :filename => (@commit.id.to_s + ".patch") | 64 | + type: "text/plain", |
65 | + disposition: 'attachment', | ||
66 | + filename: (@commit.id.to_s + ".patch") | ||
67 | ) | 67 | ) |
68 | end | 68 | end |
69 | end | 69 | end |
app/controllers/dashboard_controller.rb
@@ -9,7 +9,7 @@ class DashboardController < ApplicationController | @@ -9,7 +9,7 @@ class DashboardController < ApplicationController | ||
9 | respond_to do |format| | 9 | respond_to do |format| |
10 | format.html | 10 | format.html |
11 | format.js | 11 | format.js |
12 | - format.atom { render :layout => false } | 12 | + format.atom { render layout: false } |
13 | end | 13 | end |
14 | end | 14 | end |
15 | 15 | ||
@@ -28,7 +28,7 @@ class DashboardController < ApplicationController | @@ -28,7 +28,7 @@ class DashboardController < ApplicationController | ||
28 | 28 | ||
29 | respond_to do |format| | 29 | respond_to do |format| |
30 | format.html | 30 | format.html |
31 | - format.atom { render :layout => false } | 31 | + format.atom { render layout: false } |
32 | end | 32 | end |
33 | end | 33 | end |
34 | end | 34 | end |
app/controllers/deploy_keys_controller.rb
@@ -40,7 +40,7 @@ class DeployKeysController < ApplicationController | @@ -40,7 +40,7 @@ class DeployKeysController < ApplicationController | ||
40 | 40 | ||
41 | respond_to do |format| | 41 | respond_to do |format| |
42 | format.html { redirect_to project_deploy_keys_url } | 42 | format.html { redirect_to project_deploy_keys_url } |
43 | - format.js { render :nothing => true } | 43 | + format.js { render nothing: true } |
44 | end | 44 | end |
45 | end | 45 | end |
46 | end | 46 | end |
app/controllers/hooks_controller.rb
@@ -6,7 +6,7 @@ class HooksController < ApplicationController | @@ -6,7 +6,7 @@ class HooksController < ApplicationController | ||
6 | # Authorize | 6 | # Authorize |
7 | before_filter :add_project_abilities | 7 | before_filter :add_project_abilities |
8 | before_filter :authorize_read_project! | 8 | before_filter :authorize_read_project! |
9 | - before_filter :authorize_admin_project!, :only => [:new, :create, :destroy] | 9 | + before_filter :authorize_admin_project!, only: [:new, :create, :destroy] |
10 | 10 | ||
11 | respond_to :html | 11 | respond_to :html |
12 | 12 |
app/controllers/issues_controller.rb
@@ -2,7 +2,7 @@ class IssuesController < ApplicationController | @@ -2,7 +2,7 @@ class IssuesController < ApplicationController | ||
2 | before_filter :authenticate_user! | 2 | before_filter :authenticate_user! |
3 | before_filter :project | 3 | before_filter :project |
4 | before_filter :module_enabled | 4 | before_filter :module_enabled |
5 | - before_filter :issue, :only => [:edit, :update, :destroy, :show] | 5 | + before_filter :issue, only: [:edit, :update, :destroy, :show] |
6 | helper_method :issues_filter | 6 | helper_method :issues_filter |
7 | 7 | ||
8 | layout "project" | 8 | layout "project" |
@@ -14,13 +14,13 @@ class IssuesController < ApplicationController | @@ -14,13 +14,13 @@ class IssuesController < ApplicationController | ||
14 | before_filter :authorize_read_issue! | 14 | before_filter :authorize_read_issue! |
15 | 15 | ||
16 | # Allow write(create) issue | 16 | # Allow write(create) issue |
17 | - before_filter :authorize_write_issue!, :only => [:new, :create] | 17 | + before_filter :authorize_write_issue!, only: [:new, :create] |
18 | 18 | ||
19 | # Allow modify issue | 19 | # Allow modify issue |
20 | - before_filter :authorize_modify_issue!, :only => [:close, :edit, :update] | 20 | + before_filter :authorize_modify_issue!, only: [:close, :edit, :update] |
21 | 21 | ||
22 | # Allow destroy issue | 22 | # Allow destroy issue |
23 | - before_filter :authorize_admin_issue!, :only => [:destroy] | 23 | + before_filter :authorize_admin_issue!, only: [:destroy] |
24 | 24 | ||
25 | respond_to :js, :html | 25 | respond_to :js, :html |
26 | 26 | ||
@@ -32,7 +32,7 @@ class IssuesController < ApplicationController | @@ -32,7 +32,7 @@ class IssuesController < ApplicationController | ||
32 | respond_to do |format| | 32 | respond_to do |format| |
33 | format.html # index.html.erb | 33 | format.html # index.html.erb |
34 | format.js | 34 | format.js |
35 | - format.atom { render :layout => false } | 35 | + format.atom { render layout: false } |
36 | end | 36 | end |
37 | end | 37 | end |
38 | 38 | ||
@@ -46,7 +46,7 @@ class IssuesController < ApplicationController | @@ -46,7 +46,7 @@ class IssuesController < ApplicationController | ||
46 | end | 46 | end |
47 | 47 | ||
48 | def show | 48 | def show |
49 | - @note = @project.notes.new(:noteable => @issue) | 49 | + @note = @project.notes.new(noteable: @issue) |
50 | 50 | ||
51 | respond_to do |format| | 51 | respond_to do |format| |
52 | format.html | 52 | format.html |
@@ -66,7 +66,7 @@ class IssuesController < ApplicationController | @@ -66,7 +66,7 @@ class IssuesController < ApplicationController | ||
66 | end | 66 | end |
67 | 67 | ||
68 | def update | 68 | def update |
69 | - @issue.update_attributes(params[:issue].merge(:author_id_of_changes => current_user.id)) | 69 | + @issue.update_attributes(params[:issue].merge(author_id_of_changes: current_user.id)) |
70 | 70 | ||
71 | respond_to do |format| | 71 | respond_to do |format| |
72 | format.js | 72 | format.js |
@@ -87,20 +87,20 @@ class IssuesController < ApplicationController | @@ -87,20 +87,20 @@ class IssuesController < ApplicationController | ||
87 | 87 | ||
88 | respond_to do |format| | 88 | respond_to do |format| |
89 | format.html { redirect_to project_issues_path } | 89 | format.html { redirect_to project_issues_path } |
90 | - format.js { render :nothing => true } | 90 | + format.js { render nothing: true } |
91 | end | 91 | end |
92 | end | 92 | end |
93 | 93 | ||
94 | def sort | 94 | def sort |
95 | return render_404 unless can?(current_user, :admin_issue, @project) | 95 | return render_404 unless can?(current_user, :admin_issue, @project) |
96 | 96 | ||
97 | - @issues = @project.issues.where(:id => params['issue']) | 97 | + @issues = @project.issues.where(id: params['issue']) |
98 | @issues.each do |issue| | 98 | @issues.each do |issue| |
99 | issue.position = params['issue'].index(issue.id.to_s) + 1 | 99 | issue.position = params['issue'].index(issue.id.to_s) + 1 |
100 | issue.save | 100 | issue.save |
101 | end | 101 | end |
102 | 102 | ||
103 | - render :nothing => true | 103 | + render nothing: true |
104 | end | 104 | end |
105 | 105 | ||
106 | def search | 106 | def search |
@@ -110,12 +110,12 @@ class IssuesController < ApplicationController | @@ -110,12 +110,12 @@ class IssuesController < ApplicationController | ||
110 | @issues = @issues.where("title LIKE ?", "%#{terms}%") unless terms.blank? | 110 | @issues = @issues.where("title LIKE ?", "%#{terms}%") unless terms.blank? |
111 | @issues = @issues.page(params[:page]).per(100) | 111 | @issues = @issues.page(params[:page]).per(100) |
112 | 112 | ||
113 | - render :partial => 'issues' | 113 | + render partial: 'issues' |
114 | end | 114 | end |
115 | 115 | ||
116 | def bulk_update | 116 | def bulk_update |
117 | result = IssuesBulkUpdateContext.new(project, current_user, params).execute | 117 | result = IssuesBulkUpdateContext.new(project, current_user, params).execute |
118 | - redirect_to :back, :notice => "#{result[:count]} issues updated" | 118 | + redirect_to :back, notice: "#{result[:count]} issues updated" |
119 | end | 119 | end |
120 | 120 | ||
121 | protected | 121 | protected |
@@ -144,8 +144,8 @@ class IssuesController < ApplicationController | @@ -144,8 +144,8 @@ class IssuesController < ApplicationController | ||
144 | else @project.issues.opened | 144 | else @project.issues.opened |
145 | end | 145 | end |
146 | 146 | ||
147 | - @issues = @issues.where(:assignee_id => params[:assignee_id]) if params[:assignee_id].present? | ||
148 | - @issues = @issues.where(:milestone_id => params[:milestone_id]) if params[:milestone_id].present? | 147 | + @issues = @issues.where(assignee_id: params[:assignee_id]) if params[:assignee_id].present? |
148 | + @issues = @issues.where(milestone_id: params[:milestone_id]) if params[:milestone_id].present? | ||
149 | @issues = @issues.tagged_with(params[:label_name]) if params[:label_name].present? | 149 | @issues = @issues.tagged_with(params[:label_name]) if params[:label_name].present? |
150 | @issues = @issues.includes(:author, :project).order("updated_at") | 150 | @issues = @issues.includes(:author, :project).order("updated_at") |
151 | @issues | 151 | @issues |
app/controllers/keys_controller.rb
@@ -29,7 +29,7 @@ class KeysController < ApplicationController | @@ -29,7 +29,7 @@ class KeysController < ApplicationController | ||
29 | 29 | ||
30 | respond_to do |format| | 30 | respond_to do |format| |
31 | format.html { redirect_to keys_url } | 31 | format.html { redirect_to keys_url } |
32 | - format.js { render :nothing => true } | 32 | + format.js { render nothing: true } |
33 | end | 33 | end |
34 | end | 34 | end |
35 | end | 35 | end |
app/controllers/merge_requests_controller.rb
@@ -2,9 +2,9 @@ class MergeRequestsController < ApplicationController | @@ -2,9 +2,9 @@ class MergeRequestsController < ApplicationController | ||
2 | before_filter :authenticate_user! | 2 | before_filter :authenticate_user! |
3 | before_filter :project | 3 | before_filter :project |
4 | before_filter :module_enabled | 4 | before_filter :module_enabled |
5 | - before_filter :merge_request, :only => [:edit, :update, :destroy, :show, :commits, :diffs, :automerge, :automerge_check, :raw] | ||
6 | - before_filter :validates_merge_request, :only => [:show, :diffs, :raw] | ||
7 | - before_filter :define_show_vars, :only => [:show, :diffs] | 5 | + before_filter :merge_request, only: [:edit, :update, :destroy, :show, :commits, :diffs, :automerge, :automerge_check, :raw] |
6 | + before_filter :validates_merge_request, only: [:show, :diffs, :raw] | ||
7 | + before_filter :define_show_vars, only: [:show, :diffs] | ||
8 | layout "project" | 8 | layout "project" |
9 | 9 | ||
10 | # Authorize | 10 | # Authorize |
@@ -14,13 +14,13 @@ class MergeRequestsController < ApplicationController | @@ -14,13 +14,13 @@ class MergeRequestsController < ApplicationController | ||
14 | before_filter :authorize_read_merge_request! | 14 | before_filter :authorize_read_merge_request! |
15 | 15 | ||
16 | # Allow write(create) merge_request | 16 | # Allow write(create) merge_request |
17 | - before_filter :authorize_write_merge_request!, :only => [:new, :create] | 17 | + before_filter :authorize_write_merge_request!, only: [:new, :create] |
18 | 18 | ||
19 | # Allow modify merge_request | 19 | # Allow modify merge_request |
20 | - before_filter :authorize_modify_merge_request!, :only => [:close, :edit, :update, :sort] | 20 | + before_filter :authorize_modify_merge_request!, only: [:close, :edit, :update, :sort] |
21 | 21 | ||
22 | # Allow destroy merge_request | 22 | # Allow destroy merge_request |
23 | - before_filter :authorize_admin_merge_request!, :only => [:destroy] | 23 | + before_filter :authorize_admin_merge_request!, only: [:destroy] |
24 | 24 | ||
25 | 25 | ||
26 | def index | 26 | def index |
@@ -66,7 +66,7 @@ class MergeRequestsController < ApplicationController | @@ -66,7 +66,7 @@ class MergeRequestsController < ApplicationController | ||
66 | end | 66 | end |
67 | 67 | ||
68 | def update | 68 | def update |
69 | - if @merge_request.update_attributes(params[:merge_request].merge(:author_id_of_changes => current_user.id)) | 69 | + if @merge_request.update_attributes(params[:merge_request].merge(author_id_of_changes: current_user.id)) |
70 | @merge_request.reload_code | 70 | @merge_request.reload_code |
71 | @merge_request.mark_as_unchecked | 71 | @merge_request.mark_as_unchecked |
72 | redirect_to [@project, @merge_request], notice: 'Merge request was successfully updated.' | 72 | redirect_to [@project, @merge_request], notice: 'Merge request was successfully updated.' |
@@ -79,7 +79,7 @@ class MergeRequestsController < ApplicationController | @@ -79,7 +79,7 @@ class MergeRequestsController < ApplicationController | ||
79 | if @merge_request.unchecked? | 79 | if @merge_request.unchecked? |
80 | @merge_request.check_if_can_be_merged | 80 | @merge_request.check_if_can_be_merged |
81 | end | 81 | end |
82 | - render :json => {:state => @merge_request.human_state} | 82 | + render json: {state: @merge_request.human_state} |
83 | end | 83 | end |
84 | 84 | ||
85 | def automerge | 85 | def automerge |
@@ -138,7 +138,7 @@ class MergeRequestsController < ApplicationController | @@ -138,7 +138,7 @@ class MergeRequestsController < ApplicationController | ||
138 | 138 | ||
139 | def define_show_vars | 139 | def define_show_vars |
140 | # Build a note object for comment form | 140 | # Build a note object for comment form |
141 | - @note = @project.notes.new(:noteable => @merge_request) | 141 | + @note = @project.notes.new(noteable: @merge_request) |
142 | 142 | ||
143 | # Get commits from repository | 143 | # Get commits from repository |
144 | # or from cache if already merged | 144 | # or from cache if already merged |
app/controllers/milestones_controller.rb
@@ -2,7 +2,7 @@ class MilestonesController < ApplicationController | @@ -2,7 +2,7 @@ class MilestonesController < ApplicationController | ||
2 | before_filter :authenticate_user! | 2 | before_filter :authenticate_user! |
3 | before_filter :project | 3 | before_filter :project |
4 | before_filter :module_enabled | 4 | before_filter :module_enabled |
5 | - before_filter :milestone, :only => [:edit, :update, :destroy, :show] | 5 | + before_filter :milestone, only: [:edit, :update, :destroy, :show] |
6 | layout "project" | 6 | layout "project" |
7 | 7 | ||
8 | # Authorize | 8 | # Authorize |
@@ -12,7 +12,7 @@ class MilestonesController < ApplicationController | @@ -12,7 +12,7 @@ class MilestonesController < ApplicationController | ||
12 | before_filter :authorize_read_milestone! | 12 | before_filter :authorize_read_milestone! |
13 | 13 | ||
14 | # Allow admin milestone | 14 | # Allow admin milestone |
15 | - before_filter :authorize_admin_milestone!, :except => [:index, :show] | 15 | + before_filter :authorize_admin_milestone!, except: [:index, :show] |
16 | 16 | ||
17 | respond_to :html | 17 | respond_to :html |
18 | 18 | ||
@@ -77,7 +77,7 @@ class MilestonesController < ApplicationController | @@ -77,7 +77,7 @@ class MilestonesController < ApplicationController | ||
77 | 77 | ||
78 | respond_to do |format| | 78 | respond_to do |format| |
79 | format.html { redirect_to project_milestones_path } | 79 | format.html { redirect_to project_milestones_path } |
80 | - format.js { render :nothing => true } | 80 | + format.js { render nothing: true } |
81 | end | 81 | end |
82 | end | 82 | end |
83 | 83 |
app/controllers/notes_controller.rb
@@ -5,7 +5,7 @@ class NotesController < ApplicationController | @@ -5,7 +5,7 @@ class NotesController < ApplicationController | ||
5 | before_filter :add_project_abilities | 5 | before_filter :add_project_abilities |
6 | 6 | ||
7 | before_filter :authorize_read_note! | 7 | before_filter :authorize_read_note! |
8 | - before_filter :authorize_write_note!, :only => [:create] | 8 | + before_filter :authorize_write_note!, only: [:create] |
9 | 9 | ||
10 | respond_to :js | 10 | respond_to :js |
11 | 11 | ||
@@ -29,12 +29,12 @@ class NotesController < ApplicationController | @@ -29,12 +29,12 @@ class NotesController < ApplicationController | ||
29 | @note.destroy | 29 | @note.destroy |
30 | 30 | ||
31 | respond_to do |format| | 31 | respond_to do |format| |
32 | - format.js { render :nothing => true } | 32 | + format.js { render nothing: true } |
33 | end | 33 | end |
34 | end | 34 | end |
35 | 35 | ||
36 | def preview | 36 | def preview |
37 | - render :text => view_context.markdown(params[:note]) | 37 | + render text: view_context.markdown(params[:note]) |
38 | end | 38 | end |
39 | 39 | ||
40 | protected | 40 | protected |
app/controllers/profile_controller.rb
@@ -26,7 +26,7 @@ class ProfileController < ApplicationController | @@ -26,7 +26,7 @@ class ProfileController < ApplicationController | ||
26 | flash[:notice] = "Password was successfully updated. Please login with it" | 26 | flash[:notice] = "Password was successfully updated. Please login with it" |
27 | redirect_to new_user_session_path | 27 | redirect_to new_user_session_path |
28 | else | 28 | else |
29 | - render :action => "password" | 29 | + render action: "password" |
30 | end | 30 | end |
31 | end | 31 | end |
32 | 32 |
app/controllers/projects_controller.rb
1 | require File.join(Rails.root, 'lib', 'graph_commit') | 1 | require File.join(Rails.root, 'lib', 'graph_commit') |
2 | 2 | ||
3 | class ProjectsController < ApplicationController | 3 | class ProjectsController < ApplicationController |
4 | - before_filter :project, :except => [:index, :new, :create] | 4 | + before_filter :project, except: [:index, :new, :create] |
5 | layout :determine_layout | 5 | layout :determine_layout |
6 | 6 | ||
7 | # Authorize | 7 | # Authorize |
8 | before_filter :add_project_abilities | 8 | before_filter :add_project_abilities |
9 | - before_filter :authorize_read_project!, :except => [:index, :new, :create] | ||
10 | - before_filter :authorize_admin_project!, :only => [:edit, :update, :destroy] | ||
11 | - before_filter :require_non_empty_project, :only => [:blob, :tree, :graph] | 9 | + before_filter :authorize_read_project!, except: [:index, :new, :create] |
10 | + before_filter :authorize_admin_project!, only: [:edit, :update, :destroy] | ||
11 | + before_filter :require_non_empty_project, only: [:blob, :tree, :graph] | ||
12 | 12 | ||
13 | def new | 13 | def new |
14 | @project = Project.new | 14 | @project = Project.new |
@@ -35,7 +35,7 @@ class ProjectsController < ApplicationController | @@ -35,7 +35,7 @@ class ProjectsController < ApplicationController | ||
35 | def update | 35 | def update |
36 | respond_to do |format| | 36 | respond_to do |format| |
37 | if project.update_attributes(params[:project]) | 37 | if project.update_attributes(params[:project]) |
38 | - format.html { redirect_to edit_project_path(project), :notice => 'Project was successfully updated.' } | 38 | + format.html { redirect_to edit_project_path(project), notice: 'Project was successfully updated.' } |
39 | format.js | 39 | format.js |
40 | else | 40 | else |
41 | format.html { render action: "edit" } | 41 | format.html { render action: "edit" } |
app/controllers/protected_branches_controller.rb
@@ -6,7 +6,7 @@ class ProtectedBranchesController < ApplicationController | @@ -6,7 +6,7 @@ class ProtectedBranchesController < ApplicationController | ||
6 | before_filter :authorize_read_project! | 6 | before_filter :authorize_read_project! |
7 | before_filter :require_non_empty_project | 7 | before_filter :require_non_empty_project |
8 | 8 | ||
9 | - before_filter :authorize_admin_project!, :only => [:destroy, :create] | 9 | + before_filter :authorize_admin_project!, only: [:destroy, :create] |
10 | before_filter :render_full_content | 10 | before_filter :render_full_content |
11 | 11 | ||
12 | layout "project" | 12 | layout "project" |
@@ -26,7 +26,7 @@ class ProtectedBranchesController < ApplicationController | @@ -26,7 +26,7 @@ class ProtectedBranchesController < ApplicationController | ||
26 | 26 | ||
27 | respond_to do |format| | 27 | respond_to do |format| |
28 | format.html { redirect_to project_protected_branches_path } | 28 | format.html { redirect_to project_protected_branches_path } |
29 | - format.js { render :nothing => true } | 29 | + format.js { render nothing: true } |
30 | end | 30 | end |
31 | end | 31 | end |
32 | end | 32 | end |
app/controllers/refs_controller.rb
@@ -9,7 +9,7 @@ class RefsController < ApplicationController | @@ -9,7 +9,7 @@ class RefsController < ApplicationController | ||
9 | before_filter :require_non_empty_project | 9 | before_filter :require_non_empty_project |
10 | 10 | ||
11 | before_filter :ref | 11 | before_filter :ref |
12 | - before_filter :define_tree_vars, :only => [:tree, :blob, :blame, :logs_tree] | 12 | + before_filter :define_tree_vars, only: [:tree, :blob, :blame, :logs_tree] |
13 | before_filter :render_full_content | 13 | before_filter :render_full_content |
14 | 14 | ||
15 | layout "project" | 15 | layout "project" |
@@ -20,7 +20,7 @@ class RefsController < ApplicationController | @@ -20,7 +20,7 @@ class RefsController < ApplicationController | ||
20 | new_path = if params[:destination] == "tree" | 20 | new_path = if params[:destination] == "tree" |
21 | tree_project_ref_path(@project, params[:ref]) | 21 | tree_project_ref_path(@project, params[:ref]) |
22 | else | 22 | else |
23 | - project_commits_path(@project, :ref => params[:ref]) | 23 | + project_commits_path(@project, ref: params[:ref]) |
24 | end | 24 | end |
25 | 25 | ||
26 | redirect_to new_path | 26 | redirect_to new_path |
@@ -53,8 +53,8 @@ class RefsController < ApplicationController | @@ -53,8 +53,8 @@ class RefsController < ApplicationController | ||
53 | last_commit = @project.commits(@commit.id, file, 1).last | 53 | last_commit = @project.commits(@commit.id, file, 1).last |
54 | last_commit = CommitDecorator.decorate(last_commit) | 54 | last_commit = CommitDecorator.decorate(last_commit) |
55 | { | 55 | { |
56 | - :file_name => content.name, | ||
57 | - :commit => last_commit | 56 | + file_name: content.name, |
57 | + commit: last_commit | ||
58 | } | 58 | } |
59 | end | 59 | end |
60 | end | 60 | end |
@@ -70,9 +70,9 @@ class RefsController < ApplicationController | @@ -70,9 +70,9 @@ class RefsController < ApplicationController | ||
70 | 70 | ||
71 | send_data( | 71 | send_data( |
72 | @tree.data, | 72 | @tree.data, |
73 | - :type => mime_type, | ||
74 | - :disposition => 'inline', | ||
75 | - :filename => @tree.name | 73 | + type: mime_type, |
74 | + disposition: 'inline', | ||
75 | + filename: @tree.name | ||
76 | ) | 76 | ) |
77 | else | 77 | else |
78 | head(404) | 78 | head(404) |
app/controllers/search_controller.rb
@@ -8,8 +8,8 @@ class SearchController < ApplicationController | @@ -8,8 +8,8 @@ class SearchController < ApplicationController | ||
8 | 8 | ||
9 | if query.present? | 9 | if query.present? |
10 | @projects = current_user.projects.search(query).limit(10) | 10 | @projects = current_user.projects.search(query).limit(10) |
11 | - @merge_requests = MergeRequest.where(:project_id => current_user.project_ids).search(query).limit(10) | ||
12 | - @issues = Issue.where(:project_id => current_user.project_ids).search(query).limit(10) | 11 | + @merge_requests = MergeRequest.where(project_id: current_user.project_ids).search(query).limit(10) |
12 | + @issues = Issue.where(project_id: current_user.project_ids).search(query).limit(10) | ||
13 | end | 13 | end |
14 | end | 14 | end |
15 | end | 15 | end |
app/controllers/snippets_controller.rb
1 | class SnippetsController < ApplicationController | 1 | class SnippetsController < ApplicationController |
2 | before_filter :authenticate_user! | 2 | before_filter :authenticate_user! |
3 | before_filter :project | 3 | before_filter :project |
4 | - before_filter :snippet, :only => [:show, :edit, :destroy, :update, :raw] | 4 | + before_filter :snippet, only: [:show, :edit, :destroy, :update, :raw] |
5 | layout "project" | 5 | layout "project" |
6 | 6 | ||
7 | # Authorize | 7 | # Authorize |
@@ -11,13 +11,13 @@ class SnippetsController < ApplicationController | @@ -11,13 +11,13 @@ class SnippetsController < ApplicationController | ||
11 | before_filter :authorize_read_snippet! | 11 | before_filter :authorize_read_snippet! |
12 | 12 | ||
13 | # Allow write(create) snippet | 13 | # Allow write(create) snippet |
14 | - before_filter :authorize_write_snippet!, :only => [:new, :create] | 14 | + before_filter :authorize_write_snippet!, only: [:new, :create] |
15 | 15 | ||
16 | # Allow modify snippet | 16 | # Allow modify snippet |
17 | - before_filter :authorize_modify_snippet!, :only => [:edit, :update] | 17 | + before_filter :authorize_modify_snippet!, only: [:edit, :update] |
18 | 18 | ||
19 | # Allow destroy snippet | 19 | # Allow destroy snippet |
20 | - before_filter :authorize_admin_snippet!, :only => [:destroy] | 20 | + before_filter :authorize_admin_snippet!, only: [:destroy] |
21 | 21 | ||
22 | respond_to :html | 22 | respond_to :html |
23 | 23 | ||
@@ -55,7 +55,7 @@ class SnippetsController < ApplicationController | @@ -55,7 +55,7 @@ class SnippetsController < ApplicationController | ||
55 | end | 55 | end |
56 | 56 | ||
57 | def show | 57 | def show |
58 | - @note = @project.notes.new(:noteable => @snippet) | 58 | + @note = @project.notes.new(noteable: @snippet) |
59 | render_full_content | 59 | render_full_content |
60 | end | 60 | end |
61 | 61 | ||
@@ -70,9 +70,9 @@ class SnippetsController < ApplicationController | @@ -70,9 +70,9 @@ class SnippetsController < ApplicationController | ||
70 | def raw | 70 | def raw |
71 | send_data( | 71 | send_data( |
72 | @snippet.content, | 72 | @snippet.content, |
73 | - :type => "text/plain", | ||
74 | - :disposition => 'inline', | ||
75 | - :filename => @snippet.file_name | 73 | + type: "text/plain", |
74 | + disposition: 'inline', | ||
75 | + filename: @snippet.file_name | ||
76 | ) | 76 | ) |
77 | end | 77 | end |
78 | 78 |
app/controllers/team_members_controller.rb
@@ -5,7 +5,7 @@ class TeamMembersController < ApplicationController | @@ -5,7 +5,7 @@ class TeamMembersController < ApplicationController | ||
5 | # Authorize | 5 | # Authorize |
6 | before_filter :add_project_abilities | 6 | before_filter :add_project_abilities |
7 | before_filter :authorize_read_project! | 7 | before_filter :authorize_read_project! |
8 | - before_filter :authorize_admin_project!, :except => [:show] | 8 | + before_filter :authorize_admin_project!, except: [:show] |
9 | 9 | ||
10 | def show | 10 | def show |
11 | @team_member = project.users_projects.find(params[:id]) | 11 | @team_member = project.users_projects.find(params[:id]) |
@@ -41,7 +41,7 @@ class TeamMembersController < ApplicationController | @@ -41,7 +41,7 @@ class TeamMembersController < ApplicationController | ||
41 | 41 | ||
42 | respond_to do |format| | 42 | respond_to do |format| |
43 | format.html { redirect_to team_project_path(@project) } | 43 | format.html { redirect_to team_project_path(@project) } |
44 | - format.js { render :nothing => true } | 44 | + format.js { render nothing: true } |
45 | end | 45 | end |
46 | end | 46 | end |
47 | end | 47 | end |
app/controllers/wikis_controller.rb
@@ -2,8 +2,8 @@ class WikisController < ApplicationController | @@ -2,8 +2,8 @@ class WikisController < ApplicationController | ||
2 | before_filter :project | 2 | before_filter :project |
3 | before_filter :add_project_abilities | 3 | before_filter :add_project_abilities |
4 | before_filter :authorize_read_wiki! | 4 | before_filter :authorize_read_wiki! |
5 | - before_filter :authorize_write_wiki!, :only => [:edit, :create, :history] | ||
6 | - before_filter :authorize_admin_wiki!, :only => :destroy | 5 | + before_filter :authorize_write_wiki!, only: [:edit, :create, :history] |
6 | + before_filter :authorize_admin_wiki!, only: :destroy | ||
7 | layout "project" | 7 | layout "project" |
8 | 8 | ||
9 | def pages | 9 | def pages |
@@ -14,16 +14,16 @@ class WikisController < ApplicationController | @@ -14,16 +14,16 @@ class WikisController < ApplicationController | ||
14 | if params[:old_page_id] | 14 | if params[:old_page_id] |
15 | @wiki = @project.wikis.find(params[:old_page_id]) | 15 | @wiki = @project.wikis.find(params[:old_page_id]) |
16 | else | 16 | else |
17 | - @wiki = @project.wikis.where(:slug => params[:id]).order("created_at").last | 17 | + @wiki = @project.wikis.where(slug: params[:id]).order("created_at").last |
18 | end | 18 | end |
19 | 19 | ||
20 | - @note = @project.notes.new(:noteable => @wiki) | 20 | + @note = @project.notes.new(noteable: @wiki) |
21 | 21 | ||
22 | if @wiki | 22 | if @wiki |
23 | render 'show' | 23 | render 'show' |
24 | else | 24 | else |
25 | if can?(current_user, :write_wiki, @project) | 25 | if can?(current_user, :write_wiki, @project) |
26 | - @wiki = @project.wikis.new(:slug => params[:id]) | 26 | + @wiki = @project.wikis.new(slug: params[:id]) |
27 | render 'edit' | 27 | render 'edit' |
28 | else | 28 | else |
29 | render 'empty' | 29 | render 'empty' |
@@ -32,7 +32,7 @@ class WikisController < ApplicationController | @@ -32,7 +32,7 @@ class WikisController < ApplicationController | ||
32 | end | 32 | end |
33 | 33 | ||
34 | def edit | 34 | def edit |
35 | - @wiki = @project.wikis.where(:slug => params[:id]).order("created_at").last | 35 | + @wiki = @project.wikis.where(slug: params[:id]).order("created_at").last |
36 | @wiki = Wiki.regenerate_from @wiki | 36 | @wiki = Wiki.regenerate_from @wiki |
37 | end | 37 | end |
38 | 38 | ||
@@ -50,11 +50,11 @@ class WikisController < ApplicationController | @@ -50,11 +50,11 @@ class WikisController < ApplicationController | ||
50 | end | 50 | end |
51 | 51 | ||
52 | def history | 52 | def history |
53 | - @wikis = @project.wikis.where(:slug => params[:id]).order("created_at") | 53 | + @wikis = @project.wikis.where(slug: params[:id]).order("created_at") |
54 | end | 54 | end |
55 | 55 | ||
56 | def destroy | 56 | def destroy |
57 | - @wikis = @project.wikis.where(:slug => params[:id]).delete_all | 57 | + @wikis = @project.wikis.where(slug: params[:id]).delete_all |
58 | 58 | ||
59 | respond_to do |format| | 59 | respond_to do |format| |
60 | format.html { redirect_to project_wiki_path(@project, :index), notice: "Page was successfully deleted" } | 60 | format.html { redirect_to project_wiki_path(@project, :index), notice: "Page was successfully deleted" } |
app/decorators/application_decorator.rb
@@ -15,7 +15,7 @@ class ApplicationDecorator < Drapper::Base | @@ -15,7 +15,7 @@ class ApplicationDecorator < Drapper::Base | ||
15 | # | 15 | # |
16 | # def formatted_timestamp(time) | 16 | # def formatted_timestamp(time) |
17 | # h.content_tag :span, time.strftime("%a %m/%d/%y"), | 17 | # h.content_tag :span, time.strftime("%a %m/%d/%y"), |
18 | - # :class => 'timestamp' | 18 | + # class: 'timestamp' |
19 | # end | 19 | # end |
20 | # | 20 | # |
21 | # def created_at | 21 | # def created_at |
app/decorators/event_decorator.rb
@@ -19,7 +19,7 @@ class EventDecorator < ApplicationDecorator | @@ -19,7 +19,7 @@ class EventDecorator < ApplicationDecorator | ||
19 | elsif self.merge_request? | 19 | elsif self.merge_request? |
20 | h.project_merge_request_url(self.project, self.merge_request) | 20 | h.project_merge_request_url(self.project, self.merge_request) |
21 | elsif self.push? | 21 | elsif self.push? |
22 | - h.project_commits_url(self.project, :ref => self.ref_name) | 22 | + h.project_commits_url(self.project, ref: self.ref_name) |
23 | end | 23 | end |
24 | end | 24 | end |
25 | end | 25 | end |
app/decorators/tree_decorator.rb
@@ -8,14 +8,14 @@ class TreeDecorator < ApplicationDecorator | @@ -8,14 +8,14 @@ class TreeDecorator < ApplicationDecorator | ||
8 | 8 | ||
9 | #parts = parts[0...-1] if is_blob? | 9 | #parts = parts[0...-1] if is_blob? |
10 | 10 | ||
11 | - yield(h.link_to("..", "#", :remote => :true)) if parts.count > max_links | 11 | + yield(h.link_to("..", "#", remote: :true)) if parts.count > max_links |
12 | 12 | ||
13 | parts.each do |part| | 13 | parts.each do |part| |
14 | part_path = File.join(part_path, part) unless part_path.empty? | 14 | part_path = File.join(part_path, part) unless part_path.empty? |
15 | part_path = part if part_path.empty? | 15 | part_path = part if part_path.empty? |
16 | 16 | ||
17 | next unless parts.last(2).include?(part) if parts.count > max_links | 17 | next unless parts.last(2).include?(part) if parts.count > max_links |
18 | - yield(h.link_to(h.truncate(part, :length => 40), h.tree_file_project_ref_path(project, ref, :path => part_path), :remote => :true)) | 18 | + yield(h.link_to(h.truncate(part, length: 40), h.tree_file_project_ref_path(project, ref, path: part_path), remote: :true)) |
19 | end | 19 | end |
20 | end | 20 | end |
21 | end | 21 | end |
@@ -30,7 +30,7 @@ class TreeDecorator < ApplicationDecorator | @@ -30,7 +30,7 @@ class TreeDecorator < ApplicationDecorator | ||
30 | end | 30 | end |
31 | 31 | ||
32 | def history_path | 32 | def history_path |
33 | - h.project_commits_path(project, :path => path, :ref => ref) | 33 | + h.project_commits_path(project, path: path, ref: ref) |
34 | end | 34 | end |
35 | 35 | ||
36 | def mb_size | 36 | def mb_size |
app/helpers/application_helper.rb
@@ -43,23 +43,23 @@ module ApplicationHelper | @@ -43,23 +43,23 @@ module ApplicationHelper | ||
43 | end | 43 | end |
44 | 44 | ||
45 | def search_autocomplete_source | 45 | def search_autocomplete_source |
46 | - projects = current_user.projects.map{ |p| { :label => p.name, :url => project_path(p) } } | 46 | + projects = current_user.projects.map{ |p| { label: p.name, url: project_path(p) } } |
47 | default_nav = [ | 47 | default_nav = [ |
48 | - { :label => "Profile", :url => profile_path }, | ||
49 | - { :label => "Keys", :url => keys_path }, | ||
50 | - { :label => "Dashboard", :url => root_path }, | ||
51 | - { :label => "Admin", :url => admin_root_path } | 48 | + { label: "Profile", url: profile_path }, |
49 | + { label: "Keys", url: keys_path }, | ||
50 | + { label: "Dashboard", url: root_path }, | ||
51 | + { label: "Admin", url: admin_root_path } | ||
52 | ] | 52 | ] |
53 | 53 | ||
54 | project_nav = [] | 54 | project_nav = [] |
55 | 55 | ||
56 | if @project && !@project.new_record? | 56 | if @project && !@project.new_record? |
57 | project_nav = [ | 57 | project_nav = [ |
58 | - { :label => "#{@project.name} / Issues", :url => project_issues_path(@project) }, | ||
59 | - { :label => "#{@project.name} / Wall", :url => wall_project_path(@project) }, | ||
60 | - { :label => "#{@project.name} / Tree", :url => tree_project_ref_path(@project, @project.root_ref) }, | ||
61 | - { :label => "#{@project.name} / Commits", :url => project_commits_path(@project) }, | ||
62 | - { :label => "#{@project.name} / Team", :url => team_project_path(@project) } | 58 | + { label: "#{@project.name} / Issues", url: project_issues_path(@project) }, |
59 | + { label: "#{@project.name} / Wall", url: wall_project_path(@project) }, | ||
60 | + { label: "#{@project.name} / Tree", url: tree_project_ref_path(@project, @project.root_ref) }, | ||
61 | + { label: "#{@project.name} / Commits", url: project_commits_path(@project) }, | ||
62 | + { label: "#{@project.name} / Team", url: team_project_path(@project) } | ||
63 | ] | 63 | ] |
64 | end | 64 | end |
65 | 65 | ||
@@ -89,7 +89,7 @@ module ApplicationHelper | @@ -89,7 +89,7 @@ module ApplicationHelper | ||
89 | when :wall; wall_tab? | 89 | when :wall; wall_tab? |
90 | when :wiki; controller.controller_name == "wikis" | 90 | when :wiki; controller.controller_name == "wikis" |
91 | when :issues; issues_tab? | 91 | when :issues; issues_tab? |
92 | - when :network; current_page?(:controller => "projects", :action => "graph", :id => @project) | 92 | + when :network; current_page?(controller: "projects", action: "graph", id: @project) |
93 | when :merge_requests; controller.controller_name == "merge_requests" | 93 | when :merge_requests; controller.controller_name == "merge_requests" |
94 | 94 | ||
95 | # Dashboard Area | 95 | # Dashboard Area |
@@ -100,10 +100,10 @@ module ApplicationHelper | @@ -100,10 +100,10 @@ module ApplicationHelper | ||
100 | when :root; current_page?(dashboard_path) || current_page?(root_path) | 100 | when :root; current_page?(dashboard_path) || current_page?(root_path) |
101 | 101 | ||
102 | # Profile Area | 102 | # Profile Area |
103 | - when :profile; current_page?(:controller => "profile", :action => :show) | ||
104 | - when :password; current_page?(:controller => "profile", :action => :password) | ||
105 | - when :token; current_page?(:controller => "profile", :action => :token) | ||
106 | - when :design; current_page?(:controller => "profile", :action => :design) | 103 | + when :profile; current_page?(controller: "profile", action: :show) |
104 | + when :password; current_page?(controller: "profile", action: :password) | ||
105 | + when :token; current_page?(controller: "profile", action: :token) | ||
106 | + when :design; current_page?(controller: "profile", action: :design) | ||
107 | when :ssh_keys; controller.controller_name == "keys" | 107 | when :ssh_keys; controller.controller_name == "keys" |
108 | 108 | ||
109 | # Admin Area | 109 | # Admin Area |
app/helpers/gitlab_markdown_helper.rb
@@ -28,32 +28,32 @@ module GitlabMarkdownHelper | @@ -28,32 +28,32 @@ module GitlabMarkdownHelper | ||
28 | 28 | ||
29 | # team member: @foo | 29 | # team member: @foo |
30 | when /^@/ | 30 | when /^@/ |
31 | - user = @project.users.where(:name => user_name).first | ||
32 | - member = @project.users_projects.where(:user_id => user).first if user | ||
33 | - link_to("@#{user_name}", project_team_member_path(@project, member), html_options.merge(:class => "gfm gfm-team_member #{html_options[:class]}")) if member | 31 | + user = @project.users.where(name: user_name).first |
32 | + member = @project.users_projects.where(user_id: user).first if user | ||
33 | + link_to("@#{user_name}", project_team_member_path(@project, member), html_options.merge(class: "gfm gfm-team_member #{html_options[:class]}")) if member | ||
34 | 34 | ||
35 | # issue: #123 | 35 | # issue: #123 |
36 | when /^#/ | 36 | when /^#/ |
37 | # avoid HTML entities | 37 | # avoid HTML entities |
38 | unless prefix.try(:end_with?, "&") && suffix.try(:start_with?, ";") | 38 | unless prefix.try(:end_with?, "&") && suffix.try(:start_with?, ";") |
39 | - issue = @project.issues.where(:id => issue_id).first | ||
40 | - link_to("##{issue_id}", project_issue_path(@project, issue), html_options.merge(:title => "Issue: #{issue.title}", :class => "gfm gfm-issue #{html_options[:class]}")) if issue | 39 | + issue = @project.issues.where(id: issue_id).first |
40 | + link_to("##{issue_id}", project_issue_path(@project, issue), html_options.merge(title: "Issue: #{issue.title}", class: "gfm gfm-issue #{html_options[:class]}")) if issue | ||
41 | end | 41 | end |
42 | 42 | ||
43 | # merge request: !123 | 43 | # merge request: !123 |
44 | when /^!/ | 44 | when /^!/ |
45 | - merge_request = @project.merge_requests.where(:id => merge_request_id).first | ||
46 | - link_to("!#{merge_request_id}", project_merge_request_path(@project, merge_request), html_options.merge(:title => "Merge Request: #{merge_request.title}", :class => "gfm gfm-merge_request #{html_options[:class]}")) if merge_request | 45 | + merge_request = @project.merge_requests.where(id: merge_request_id).first |
46 | + link_to("!#{merge_request_id}", project_merge_request_path(@project, merge_request), html_options.merge(title: "Merge Request: #{merge_request.title}", class: "gfm gfm-merge_request #{html_options[:class]}")) if merge_request | ||
47 | 47 | ||
48 | # snippet: $123 | 48 | # snippet: $123 |
49 | when /^\$/ | 49 | when /^\$/ |
50 | - snippet = @project.snippets.where(:id => snippet_id).first | ||
51 | - link_to("$#{snippet_id}", project_snippet_path(@project, snippet), html_options.merge(:title => "Snippet: #{snippet.title}", :class => "gfm gfm-snippet #{html_options[:class]}")) if snippet | 50 | + snippet = @project.snippets.where(id: snippet_id).first |
51 | + link_to("$#{snippet_id}", project_snippet_path(@project, snippet), html_options.merge(title: "Snippet: #{snippet.title}", class: "gfm gfm-snippet #{html_options[:class]}")) if snippet | ||
52 | 52 | ||
53 | # commit: 123456... | 53 | # commit: 123456... |
54 | when /^\h/ | 54 | when /^\h/ |
55 | commit = @project.commit(commit_id) | 55 | commit = @project.commit(commit_id) |
56 | - link_to(commit_id, project_commit_path(@project, :id => commit.id), html_options.merge(:title => "Commit: #{commit.author_name} - #{CommitDecorator.new(commit).title}", :class => "gfm gfm-commit #{html_options[:class]}")) if commit | 56 | + link_to(commit_id, project_commit_path(@project, id: commit.id), html_options.merge(title: "Commit: #{commit.author_name} - #{CommitDecorator.new(commit).title}", class: "gfm gfm-commit #{html_options[:class]}")) if commit |
57 | 57 | ||
58 | end # case | 58 | end # case |
59 | 59 |
app/helpers/issues_helper.rb
@@ -9,7 +9,7 @@ module IssuesHelper | @@ -9,7 +9,7 @@ module IssuesHelper | ||
9 | 9 | ||
10 | tm = project.team_member_by_id(issue.assignee_id) | 10 | tm = project.team_member_by_id(issue.assignee_id) |
11 | if tm | 11 | if tm |
12 | - link_to issue.assignee_name, project_team_member_path(project, tm), :class => "author_link" | 12 | + link_to issue.assignee_name, project_team_member_path(project, tm), class: "author_link" |
13 | else | 13 | else |
14 | issue.assignee_name | 14 | issue.assignee_name |
15 | end | 15 | end |
@@ -20,7 +20,7 @@ module IssuesHelper | @@ -20,7 +20,7 @@ module IssuesHelper | ||
20 | 20 | ||
21 | tm = project.team_member_by_id(issue.author_id) | 21 | tm = project.team_member_by_id(issue.author_id) |
22 | if tm | 22 | if tm |
23 | - link_to issue.author_name, project_team_member_path(project, tm), :class => "author_link" | 23 | + link_to issue.author_name, project_team_member_path(project, tm), class: "author_link" |
24 | else | 24 | else |
25 | issue.author_name | 25 | issue.author_name |
26 | end | 26 | end |
app/helpers/merge_requests_helper.rb
@@ -4,7 +4,7 @@ module MergeRequestsHelper | @@ -4,7 +4,7 @@ module MergeRequestsHelper | ||
4 | 4 | ||
5 | tm = project.team_member_by_id(merge_request.assignee_id) | 5 | tm = project.team_member_by_id(merge_request.assignee_id) |
6 | if tm | 6 | if tm |
7 | - link_to merge_request.assignee_name, project_team_member_path(project, tm), :class => "author_link" | 7 | + link_to merge_request.assignee_name, project_team_member_path(project, tm), class: "author_link" |
8 | else | 8 | else |
9 | merge_request.assignee_name | 9 | merge_request.assignee_name |
10 | end | 10 | end |
@@ -15,7 +15,7 @@ module MergeRequestsHelper | @@ -15,7 +15,7 @@ module MergeRequestsHelper | ||
15 | 15 | ||
16 | tm = project.team_member_by_id(merge_request.author_id) | 16 | tm = project.team_member_by_id(merge_request.author_id) |
17 | if tm | 17 | if tm |
18 | - link_to merge_request.author_name, project_team_member_path(project, tm), :class => "author_link" | 18 | + link_to merge_request.author_name, project_team_member_path(project, tm), class: "author_link" |
19 | else | 19 | else |
20 | merge_request.author_name | 20 | merge_request.author_name |
21 | end | 21 | end |
@@ -24,10 +24,10 @@ module MergeRequestsHelper | @@ -24,10 +24,10 @@ module MergeRequestsHelper | ||
24 | def new_mr_path_from_push_event(event) | 24 | def new_mr_path_from_push_event(event) |
25 | new_project_merge_request_path( | 25 | new_project_merge_request_path( |
26 | event.project, | 26 | event.project, |
27 | - :merge_request => { | ||
28 | - :source_branch => event.branch_name, | ||
29 | - :target_branch => event.project.root_ref, | ||
30 | - :title => event.branch_name.titleize | 27 | + merge_request: { |
28 | + source_branch: event.branch_name, | ||
29 | + target_branch: event.project.root_ref, | ||
30 | + title: event.branch_name.titleize | ||
31 | } | 31 | } |
32 | ) | 32 | ) |
33 | end | 33 | end |
app/helpers/tab_helper.rb
@@ -4,12 +4,12 @@ module TabHelper | @@ -4,12 +4,12 @@ module TabHelper | ||
4 | end | 4 | end |
5 | 5 | ||
6 | def wall_tab? | 6 | def wall_tab? |
7 | - current_page?(:controller => "projects", :action => "wall", :id => @project) | 7 | + current_page?(controller: "projects", action: "wall", id: @project) |
8 | end | 8 | end |
9 | 9 | ||
10 | def project_tab_class | 10 | def project_tab_class |
11 | [:show, :files, :team, :edit, :update].each do |action| | 11 | [:show, :files, :team, :edit, :update].each do |action| |
12 | - return "current" if current_page?(:controller => "projects", :action => action, :id => @project) | 12 | + return "current" if current_page?(controller: "projects", action: action, id: @project) |
13 | end | 13 | end |
14 | 14 | ||
15 | if ['snippets', 'hooks', 'deploy_keys', 'team_members'].include? controller.controller_name | 15 | if ['snippets', 'hooks', 'deploy_keys', 'team_members'].include? controller.controller_name |
app/mailers/notify.rb
@@ -12,20 +12,20 @@ class Notify < ActionMailer::Base | @@ -12,20 +12,20 @@ class Notify < ActionMailer::Base | ||
12 | def new_user_email(user_id, password) | 12 | def new_user_email(user_id, password) |
13 | @user = User.find(user_id) | 13 | @user = User.find(user_id) |
14 | @password = password | 14 | @password = password |
15 | - mail(:to => @user.email, :subject => "gitlab | Account was created for you") | 15 | + mail(to: @user.email, subject: "gitlab | Account was created for you") |
16 | end | 16 | end |
17 | 17 | ||
18 | def new_issue_email(issue_id) | 18 | def new_issue_email(issue_id) |
19 | @issue = Issue.find(issue_id) | 19 | @issue = Issue.find(issue_id) |
20 | @project = @issue.project | 20 | @project = @issue.project |
21 | - mail(:to => @issue.assignee_email, :subject => "gitlab | new issue ##{@issue.id} | #{@issue.title} | #{@project.name}") | 21 | + mail(to: @issue.assignee_email, subject: "gitlab | new issue ##{@issue.id} | #{@issue.title} | #{@project.name}") |
22 | end | 22 | end |
23 | 23 | ||
24 | def note_wall_email(recipient_id, note_id) | 24 | def note_wall_email(recipient_id, note_id) |
25 | recipient = User.find(recipient_id) | 25 | recipient = User.find(recipient_id) |
26 | @note = Note.find(note_id) | 26 | @note = Note.find(note_id) |
27 | @project = @note.project | 27 | @project = @note.project |
28 | - mail(:to => recipient.email, :subject => "gitlab | #{@project.name}") | 28 | + mail(to: recipient.email, subject: "gitlab | #{@project.name}") |
29 | end | 29 | end |
30 | 30 | ||
31 | def note_commit_email(recipient_id, note_id) | 31 | def note_commit_email(recipient_id, note_id) |
@@ -34,7 +34,7 @@ class Notify < ActionMailer::Base | @@ -34,7 +34,7 @@ class Notify < ActionMailer::Base | ||
34 | @commit = @note.target | 34 | @commit = @note.target |
35 | @commit = CommitDecorator.decorate(@commit) | 35 | @commit = CommitDecorator.decorate(@commit) |
36 | @project = @note.project | 36 | @project = @note.project |
37 | - mail(:to => recipient.email, :subject => "gitlab | note for commit #{@commit.short_id} | #{@commit.title} | #{@project.name}") | 37 | + mail(to: recipient.email, subject: "gitlab | note for commit #{@commit.short_id} | #{@commit.title} | #{@project.name}") |
38 | end | 38 | end |
39 | 39 | ||
40 | def note_merge_request_email(recipient_id, note_id) | 40 | def note_merge_request_email(recipient_id, note_id) |
@@ -42,7 +42,7 @@ class Notify < ActionMailer::Base | @@ -42,7 +42,7 @@ class Notify < ActionMailer::Base | ||
42 | @note = Note.find(note_id) | 42 | @note = Note.find(note_id) |
43 | @merge_request = @note.noteable | 43 | @merge_request = @note.noteable |
44 | @project = @note.project | 44 | @project = @note.project |
45 | - mail(:to => recipient.email, :subject => "gitlab | note for merge request !#{@merge_request.id} | #{@project.name}") | 45 | + mail(to: recipient.email, subject: "gitlab | note for merge request !#{@merge_request.id} | #{@project.name}") |
46 | end | 46 | end |
47 | 47 | ||
48 | def note_issue_email(recipient_id, note_id) | 48 | def note_issue_email(recipient_id, note_id) |
@@ -50,7 +50,7 @@ class Notify < ActionMailer::Base | @@ -50,7 +50,7 @@ class Notify < ActionMailer::Base | ||
50 | @note = Note.find(note_id) | 50 | @note = Note.find(note_id) |
51 | @issue = @note.noteable | 51 | @issue = @note.noteable |
52 | @project = @note.project | 52 | @project = @note.project |
53 | - mail(:to => recipient.email, :subject => "gitlab | note for issue ##{@issue.id} | #{@project.name}") | 53 | + mail(to: recipient.email, subject: "gitlab | note for issue ##{@issue.id} | #{@project.name}") |
54 | end | 54 | end |
55 | 55 | ||
56 | def note_wiki_email(recipient_id, note_id) | 56 | def note_wiki_email(recipient_id, note_id) |
@@ -58,13 +58,13 @@ class Notify < ActionMailer::Base | @@ -58,13 +58,13 @@ class Notify < ActionMailer::Base | ||
58 | @note = Note.find(note_id) | 58 | @note = Note.find(note_id) |
59 | @wiki = @note.noteable | 59 | @wiki = @note.noteable |
60 | @project = @note.project | 60 | @project = @note.project |
61 | - mail(:to => recipient.email, :subject => "gitlab | note for wiki | #{@project.name}") | 61 | + mail(to: recipient.email, subject: "gitlab | note for wiki | #{@project.name}") |
62 | end | 62 | end |
63 | 63 | ||
64 | def new_merge_request_email(merge_request_id) | 64 | def new_merge_request_email(merge_request_id) |
65 | @merge_request = MergeRequest.find(merge_request_id) | 65 | @merge_request = MergeRequest.find(merge_request_id) |
66 | @project = @merge_request.project | 66 | @project = @merge_request.project |
67 | - mail(:to => @merge_request.assignee_email, :subject => "gitlab | new merge request !#{@merge_request.id} | #{@merge_request.title} | #{@project.name}") | 67 | + mail(to: @merge_request.assignee_email, subject: "gitlab | new merge request !#{@merge_request.id} | #{@merge_request.title} | #{@project.name}") |
68 | end | 68 | end |
69 | 69 | ||
70 | def reassigned_merge_request_email(recipient_id, merge_request_id, previous_assignee_id) | 70 | def reassigned_merge_request_email(recipient_id, merge_request_id, previous_assignee_id) |
@@ -72,7 +72,7 @@ class Notify < ActionMailer::Base | @@ -72,7 +72,7 @@ class Notify < ActionMailer::Base | ||
72 | @merge_request = MergeRequest.find(merge_request_id) | 72 | @merge_request = MergeRequest.find(merge_request_id) |
73 | @previous_assignee ||= User.find(previous_assignee_id) | 73 | @previous_assignee ||= User.find(previous_assignee_id) |
74 | @project = @merge_request.project | 74 | @project = @merge_request.project |
75 | - mail(:to => recipient.email, :subject => "gitlab | changed merge request !#{@merge_request.id} | #{@merge_request.title} | #{@project.name}") | 75 | + mail(to: recipient.email, subject: "gitlab | changed merge request !#{@merge_request.id} | #{@merge_request.title} | #{@project.name}") |
76 | end | 76 | end |
77 | 77 | ||
78 | def reassigned_issue_email(recipient_id, issue_id, previous_assignee_id) | 78 | def reassigned_issue_email(recipient_id, issue_id, previous_assignee_id) |
@@ -80,6 +80,6 @@ class Notify < ActionMailer::Base | @@ -80,6 +80,6 @@ class Notify < ActionMailer::Base | ||
80 | @issue = Issue.find(issue_id) | 80 | @issue = Issue.find(issue_id) |
81 | @previous_assignee ||= User.find(previous_assignee_id) | 81 | @previous_assignee ||= User.find(previous_assignee_id) |
82 | @project = @issue.project | 82 | @project = @issue.project |
83 | - mail(:to => recipient.email, :subject => "gitlab | changed issue ##{@issue.id} | #{@issue.title} | #{@project.name}") | 83 | + mail(to: recipient.email, subject: "gitlab | changed issue ##{@issue.id} | #{@issue.title} | #{@project.name}") |
84 | end | 84 | end |
85 | end | 85 | end |
app/models/commit.rb
@@ -20,7 +20,7 @@ class Commit | @@ -20,7 +20,7 @@ class Commit | ||
20 | :tree, | 20 | :tree, |
21 | :id, | 21 | :id, |
22 | :to_patch, | 22 | :to_patch, |
23 | - :to => :commit | 23 | + to: :commit |
24 | 24 | ||
25 | 25 | ||
26 | class << self | 26 | class << self |
@@ -57,7 +57,7 @@ class Commit | @@ -57,7 +57,7 @@ class Commit | ||
57 | 57 | ||
58 | def commits_since(repo, date) | 58 | def commits_since(repo, date) |
59 | commits = repo.heads.map do |h| | 59 | commits = repo.heads.map do |h| |
60 | - repo.log(h.name, nil, :since => date).each { |c| Commit.new(c, h) } | 60 | + repo.log(h.name, nil, since: date).each { |c| Commit.new(c, h) } |
61 | end.flatten.uniq { |c| c.id } | 61 | end.flatten.uniq { |c| c.id } |
62 | 62 | ||
63 | commits.sort! do |x, y| | 63 | commits.sort! do |x, y| |
@@ -69,7 +69,7 @@ class Commit | @@ -69,7 +69,7 @@ class Commit | ||
69 | 69 | ||
70 | def commits(repo, ref, path = nil, limit = nil, offset = nil) | 70 | def commits(repo, ref, path = nil, limit = nil, offset = nil) |
71 | if path | 71 | if path |
72 | - repo.log(ref, path, :max_count => limit, :skip => offset) | 72 | + repo.log(ref, path, max_count: limit, skip: offset) |
73 | elsif limit && offset | 73 | elsif limit && offset |
74 | repo.commits(ref, limit, offset) | 74 | repo.commits(ref, limit, offset) |
75 | else | 75 | else |
@@ -86,9 +86,9 @@ class Commit | @@ -86,9 +86,9 @@ class Commit | ||
86 | last = project.commit(from.try(:strip)) | 86 | last = project.commit(from.try(:strip)) |
87 | 87 | ||
88 | result = { | 88 | result = { |
89 | - :commits => [], | ||
90 | - :diffs => [], | ||
91 | - :commit => nil | 89 | + commits: [], |
90 | + diffs: [], | ||
91 | + commit: nil | ||
92 | } | 92 | } |
93 | 93 | ||
94 | if first && last | 94 | if first && last |
app/models/event.rb
@@ -12,13 +12,13 @@ class Event < ActiveRecord::Base | @@ -12,13 +12,13 @@ class Event < ActiveRecord::Base | ||
12 | Merged = 7 | 12 | Merged = 7 |
13 | 13 | ||
14 | belongs_to :project | 14 | belongs_to :project |
15 | - belongs_to :target, :polymorphic => true | 15 | + belongs_to :target, polymorphic: true |
16 | 16 | ||
17 | # For Hash only | 17 | # For Hash only |
18 | serialize :data | 18 | serialize :data |
19 | 19 | ||
20 | scope :recent, order("created_at DESC") | 20 | scope :recent, order("created_at DESC") |
21 | - scope :code_push, where(:action => Pushed) | 21 | + scope :code_push, where(action: Pushed) |
22 | 22 | ||
23 | def self.determine_action(record) | 23 | def self.determine_action(record) |
24 | if [Issue, MergeRequest].include? record.class | 24 | if [Issue, MergeRequest].include? record.class |
@@ -29,7 +29,7 @@ class Event < ActiveRecord::Base | @@ -29,7 +29,7 @@ class Event < ActiveRecord::Base | ||
29 | end | 29 | end |
30 | 30 | ||
31 | def self.recent_for_user user | 31 | def self.recent_for_user user |
32 | - where(:project_id => user.projects.map(&:id)).recent | 32 | + where(project_id: user.projects.map(&:id)).recent |
33 | end | 33 | end |
34 | 34 | ||
35 | # Next events currently enabled for system | 35 | # Next events currently enabled for system |
@@ -106,9 +106,9 @@ class Event < ActiveRecord::Base | @@ -106,9 +106,9 @@ class Event < ActiveRecord::Base | ||
106 | end | 106 | end |
107 | end | 107 | end |
108 | 108 | ||
109 | - delegate :name, :email, :to => :author, :prefix => true, :allow_nil => true | ||
110 | - delegate :title, :to => :issue, :prefix => true, :allow_nil => true | ||
111 | - delegate :title, :to => :merge_request, :prefix => true, :allow_nil => true | 109 | + delegate :name, :email, to: :author, prefix: true, allow_nil: true |
110 | + delegate :title, to: :issue, prefix: true, allow_nil: true | ||
111 | + delegate :title, to: :merge_request, prefix: true, allow_nil: true | ||
112 | end | 112 | end |
113 | # == Schema Information | 113 | # == Schema Information |
114 | # | 114 | # |
app/models/issue.rb
@@ -7,7 +7,7 @@ class Issue < ActiveRecord::Base | @@ -7,7 +7,7 @@ class Issue < ActiveRecord::Base | ||
7 | belongs_to :milestone | 7 | belongs_to :milestone |
8 | 8 | ||
9 | validates :description, | 9 | validates :description, |
10 | - :length => { :within => 0..2000 } | 10 | + length: { within: 0..2000 } |
11 | 11 | ||
12 | acts_as_list | 12 | acts_as_list |
13 | 13 |
app/models/key.rb
@@ -6,16 +6,16 @@ class Key < ActiveRecord::Base | @@ -6,16 +6,16 @@ class Key < ActiveRecord::Base | ||
6 | belongs_to :project | 6 | belongs_to :project |
7 | 7 | ||
8 | validates :title, | 8 | validates :title, |
9 | - :presence => true, | ||
10 | - :length => { :within => 0..255 } | 9 | + presence: true, |
10 | + length: { within: 0..255 } | ||
11 | 11 | ||
12 | validates :key, | 12 | validates :key, |
13 | - :presence => true, | ||
14 | - :length => { :within => 0..5000 } | 13 | + presence: true, |
14 | + length: { within: 0..5000 } | ||
15 | 15 | ||
16 | before_save :set_identifier | 16 | before_save :set_identifier |
17 | before_validation :strip_white_space | 17 | before_validation :strip_white_space |
18 | - delegate :name, :email, :to => :user, :prefix => true | 18 | + delegate :name, :email, to: :user, prefix: true |
19 | validate :unique_key | 19 | validate :unique_key |
20 | 20 | ||
21 | def strip_white_space | 21 | def strip_white_space |
@@ -23,7 +23,7 @@ class Key < ActiveRecord::Base | @@ -23,7 +23,7 @@ class Key < ActiveRecord::Base | ||
23 | end | 23 | end |
24 | 24 | ||
25 | def unique_key | 25 | def unique_key |
26 | - query = Key.where(:key => key) | 26 | + query = Key.where(key: key) |
27 | query = query.where('(project_id IS NULL OR project_id = ?)', project_id) if project_id | 27 | query = query.where('(project_id IS NULL OR project_id = ?)', project_id) if project_id |
28 | if (query.count > 0) | 28 | if (query.count > 0) |
29 | errors.add :key, 'already exist.' | 29 | errors.add :key, 'already exist.' |
app/models/merge_request.rb
@@ -20,7 +20,7 @@ class MergeRequest < ActiveRecord::Base | @@ -20,7 +20,7 @@ class MergeRequest < ActiveRecord::Base | ||
20 | validate :validate_branches | 20 | validate :validate_branches |
21 | 21 | ||
22 | def self.find_all_by_branch(branch_name) | 22 | def self.find_all_by_branch(branch_name) |
23 | - where("source_branch like :branch or target_branch like :branch", :branch => branch_name) | 23 | + where("source_branch like :branch or target_branch like :branch", branch: branch_name) |
24 | end | 24 | end |
25 | 25 | ||
26 | def human_state | 26 | def human_state |
@@ -48,7 +48,7 @@ class MergeRequest < ActiveRecord::Base | @@ -48,7 +48,7 @@ class MergeRequest < ActiveRecord::Base | ||
48 | end | 48 | end |
49 | 49 | ||
50 | def mark_as_unchecked | 50 | def mark_as_unchecked |
51 | - self.update_attributes(:state => UNCHECKED) | 51 | + self.update_attributes(state: UNCHECKED) |
52 | end | 52 | end |
53 | 53 | ||
54 | def can_be_merged? | 54 | def can_be_merged? |
@@ -101,11 +101,11 @@ class MergeRequest < ActiveRecord::Base | @@ -101,11 +101,11 @@ class MergeRequest < ActiveRecord::Base | ||
101 | end | 101 | end |
102 | 102 | ||
103 | def merge_event | 103 | def merge_event |
104 | - self.project.events.where(:target_id => self.id, :target_type => "MergeRequest", :action => Event::Merged).last | 104 | + self.project.events.where(target_id: self.id, target_type: "MergeRequest", action: Event::Merged).last |
105 | end | 105 | end |
106 | 106 | ||
107 | def closed_event | 107 | def closed_event |
108 | - self.project.events.where(:target_id => self.id, :target_type => "MergeRequest", :action => Event::Closed).last | 108 | + self.project.events.where(target_id: self.id, target_type: "MergeRequest", action: Event::Closed).last |
109 | end | 109 | end |
110 | 110 | ||
111 | def commits | 111 | def commits |
@@ -128,7 +128,7 @@ class MergeRequest < ActiveRecord::Base | @@ -128,7 +128,7 @@ class MergeRequest < ActiveRecord::Base | ||
128 | end | 128 | end |
129 | 129 | ||
130 | def mark_as_unmergable | 130 | def mark_as_unmergable |
131 | - self.update_attributes :state => CANNOT_BE_MERGED | 131 | + self.update_attributes state: CANNOT_BE_MERGED |
132 | end | 132 | end |
133 | 133 | ||
134 | def reloaded_commits | 134 | def reloaded_commits |
@@ -150,11 +150,11 @@ class MergeRequest < ActiveRecord::Base | @@ -150,11 +150,11 @@ class MergeRequest < ActiveRecord::Base | ||
150 | def merge!(user_id) | 150 | def merge!(user_id) |
151 | self.mark_as_merged! | 151 | self.mark_as_merged! |
152 | Event.create( | 152 | Event.create( |
153 | - :project => self.project, | ||
154 | - :action => Event::Merged, | ||
155 | - :target_id => self.id, | ||
156 | - :target_type => "MergeRequest", | ||
157 | - :author_id => user_id | 153 | + project: self.project, |
154 | + action: Event::Merged, | ||
155 | + target_id: self.id, | ||
156 | + target_type: "MergeRequest", | ||
157 | + author_id: user_id | ||
158 | ) | 158 | ) |
159 | end | 159 | end |
160 | 160 |
app/models/milestone.rb
@@ -24,7 +24,7 @@ class Milestone < ActiveRecord::Base | @@ -24,7 +24,7 @@ class Milestone < ActiveRecord::Base | ||
24 | end | 24 | end |
25 | 25 | ||
26 | def participants | 26 | def participants |
27 | - User.where(:id => issues.map(&:assignee_id)) | 27 | + User.where(id: issues.map(&:assignee_id)) |
28 | end | 28 | end |
29 | 29 | ||
30 | def percent_complete | 30 | def percent_complete |
app/models/note.rb
@@ -3,18 +3,18 @@ require 'file_size_validator' | @@ -3,18 +3,18 @@ require 'file_size_validator' | ||
3 | 3 | ||
4 | class Note < ActiveRecord::Base | 4 | class Note < ActiveRecord::Base |
5 | belongs_to :project | 5 | belongs_to :project |
6 | - belongs_to :noteable, :polymorphic => true | 6 | + belongs_to :noteable, polymorphic: true |
7 | belongs_to :author, | 7 | belongs_to :author, |
8 | - :class_name => "User" | 8 | + class_name: "User" |
9 | 9 | ||
10 | delegate :name, | 10 | delegate :name, |
11 | - :to => :project, | ||
12 | - :prefix => true | 11 | + to: :project, |
12 | + prefix: true | ||
13 | 13 | ||
14 | delegate :name, | 14 | delegate :name, |
15 | :email, | 15 | :email, |
16 | - :to => :author, | ||
17 | - :prefix => true | 16 | + to: :author, |
17 | + prefix: true | ||
18 | 18 | ||
19 | attr_protected :author, :author_id | 19 | attr_protected :author, :author_id |
20 | attr_accessor :notify | 20 | attr_accessor :notify |
@@ -23,19 +23,19 @@ class Note < ActiveRecord::Base | @@ -23,19 +23,19 @@ class Note < ActiveRecord::Base | ||
23 | validates_presence_of :project | 23 | validates_presence_of :project |
24 | 24 | ||
25 | validates :note, | 25 | validates :note, |
26 | - :presence => true, | ||
27 | - :length => { :within => 0..5000 } | 26 | + presence: true, |
27 | + length: { within: 0..5000 } | ||
28 | 28 | ||
29 | validates :attachment, | 29 | validates :attachment, |
30 | - :file_size => { | ||
31 | - :maximum => 10.megabytes.to_i | 30 | + file_size: { |
31 | + maximum: 10.megabytes.to_i | ||
32 | } | 32 | } |
33 | 33 | ||
34 | - scope :common, where(:noteable_id => nil) | 34 | + scope :common, where(noteable_id: nil) |
35 | 35 | ||
36 | - scope :today, where("created_at >= :date", :date => Date.today) | ||
37 | - scope :last_week, where("created_at >= :date", :date => (Date.today - 7.days)) | ||
38 | - scope :since, lambda { |day| where("created_at >= :date", :date => (day)) } | 36 | + scope :today, where("created_at >= :date", date: Date.today) |
37 | + scope :last_week, where("created_at >= :date", date: (Date.today - 7.days)) | ||
38 | + scope :since, lambda { |day| where("created_at >= :date", date: (day)) } | ||
39 | scope :fresh, order("created_at DESC") | 39 | scope :fresh, order("created_at DESC") |
40 | scope :inc_author_project, includes(:project, :author) | 40 | scope :inc_author_project, includes(:project, :author) |
41 | scope :inc_author, includes(:author) | 41 | scope :inc_author, includes(:author) |
@@ -43,11 +43,11 @@ class Note < ActiveRecord::Base | @@ -43,11 +43,11 @@ class Note < ActiveRecord::Base | ||
43 | mount_uploader :attachment, AttachmentUploader | 43 | mount_uploader :attachment, AttachmentUploader |
44 | 44 | ||
45 | def self.create_status_change_note(noteable, author, status) | 45 | def self.create_status_change_note(noteable, author, status) |
46 | - create({ :noteable => noteable, | ||
47 | - :project => noteable.project, | ||
48 | - :author => author, | ||
49 | - :note => "_Status changed to #{status}_" }, | ||
50 | - :without_protection => true) | 46 | + create({ noteable: noteable, |
47 | + project: noteable.project, | ||
48 | + author: author, | ||
49 | + note: "_Status changed to #{status}_" }, | ||
50 | + without_protection: true) | ||
51 | end | 51 | end |
52 | 52 | ||
53 | def notify | 53 | def notify |
app/models/project.rb
@@ -9,19 +9,19 @@ class Project < ActiveRecord::Base | @@ -9,19 +9,19 @@ class Project < ActiveRecord::Base | ||
9 | # | 9 | # |
10 | # Relations | 10 | # Relations |
11 | # | 11 | # |
12 | - belongs_to :owner, :class_name => "User" | ||
13 | - has_many :users, :through => :users_projects | ||
14 | - has_many :events, :dependent => :destroy | ||
15 | - has_many :merge_requests, :dependent => :destroy | ||
16 | - has_many :issues, :dependent => :destroy, :order => "closed, created_at DESC" | ||
17 | - has_many :milestones, :dependent => :destroy | ||
18 | - has_many :users_projects, :dependent => :destroy | ||
19 | - has_many :notes, :dependent => :destroy | ||
20 | - has_many :snippets, :dependent => :destroy | ||
21 | - has_many :deploy_keys, :dependent => :destroy, :foreign_key => "project_id", :class_name => "Key" | ||
22 | - has_many :hooks, :dependent => :destroy, :class_name => "ProjectHook" | ||
23 | - has_many :wikis, :dependent => :destroy | ||
24 | - has_many :protected_branches, :dependent => :destroy | 12 | + belongs_to :owner, class_name: "User" |
13 | + has_many :users, through: :users_projects | ||
14 | + has_many :events, dependent: :destroy | ||
15 | + has_many :merge_requests, dependent: :destroy | ||
16 | + has_many :issues, dependent: :destroy, order: "closed, created_at DESC" | ||
17 | + has_many :milestones, dependent: :destroy | ||
18 | + has_many :users_projects, dependent: :destroy | ||
19 | + has_many :notes, dependent: :destroy | ||
20 | + has_many :snippets, dependent: :destroy | ||
21 | + has_many :deploy_keys, dependent: :destroy, foreign_key: "project_id", class_name: "Key" | ||
22 | + has_many :hooks, dependent: :destroy, class_name: "ProjectHook" | ||
23 | + has_many :wikis, dependent: :destroy | ||
24 | + has_many :protected_branches, dependent: :destroy | ||
25 | 25 | ||
26 | attr_accessor :error_code | 26 | attr_accessor :error_code |
27 | 27 | ||
@@ -33,15 +33,15 @@ class Project < ActiveRecord::Base | @@ -33,15 +33,15 @@ class Project < ActiveRecord::Base | ||
33 | # | 33 | # |
34 | # Scopes | 34 | # Scopes |
35 | # | 35 | # |
36 | - scope :public_only, where(:private_flag => false) | ||
37 | - scope :without_user, lambda { |user| where("id not in (:ids)", :ids => user.projects.map(&:id) ) } | 36 | + scope :public_only, where(private_flag: false) |
37 | + scope :without_user, lambda { |user| where("id not in (:ids)", ids: user.projects.map(&:id) ) } | ||
38 | 38 | ||
39 | def self.active | 39 | def self.active |
40 | joins(:issues, :notes, :merge_requests).order("issues.created_at, notes.created_at, merge_requests.created_at DESC") | 40 | joins(:issues, :notes, :merge_requests).order("issues.created_at, notes.created_at, merge_requests.created_at DESC") |
41 | end | 41 | end |
42 | 42 | ||
43 | def self.search query | 43 | def self.search query |
44 | - where("name like :query or code like :query or path like :query", :query => "%#{query}%") | 44 | + where("name like :query or code like :query or path like :query", query: "%#{query}%") |
45 | end | 45 | end |
46 | 46 | ||
47 | def self.create_by_user(params, user) | 47 | def self.create_by_user(params, user) |
@@ -53,7 +53,7 @@ class Project < ActiveRecord::Base | @@ -53,7 +53,7 @@ class Project < ActiveRecord::Base | ||
53 | project.save! | 53 | project.save! |
54 | 54 | ||
55 | # Add user as project master | 55 | # Add user as project master |
56 | - project.users_projects.create!(:project_access => UsersProject::MASTER, :user => user) | 56 | + project.users_projects.create!(project_access: UsersProject::MASTER, user: user) |
57 | 57 | ||
58 | # when project saved no team member exist so | 58 | # when project saved no team member exist so |
59 | # project repository should be updated after first user add | 59 | # project repository should be updated after first user add |
@@ -82,28 +82,28 @@ class Project < ActiveRecord::Base | @@ -82,28 +82,28 @@ class Project < ActiveRecord::Base | ||
82 | # Validations | 82 | # Validations |
83 | # | 83 | # |
84 | validates :name, | 84 | validates :name, |
85 | - :uniqueness => true, | ||
86 | - :presence => true, | ||
87 | - :length => { :within => 0..255 } | 85 | + uniqueness: true, |
86 | + presence: true, | ||
87 | + length: { within: 0..255 } | ||
88 | 88 | ||
89 | validates :path, | 89 | validates :path, |
90 | - :uniqueness => true, | ||
91 | - :presence => true, | ||
92 | - :format => { :with => /^[a-zA-Z][a-zA-Z0-9_\-\.]*$/, | ||
93 | - :message => "only letters, digits & '_' '-' '.' allowed. Letter should be first" }, | ||
94 | - :length => { :within => 0..255 } | 90 | + uniqueness: true, |
91 | + presence: true, | ||
92 | + format: { with: /^[a-zA-Z][a-zA-Z0-9_\-\.]*$/, | ||
93 | + message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" }, | ||
94 | + length: { within: 0..255 } | ||
95 | 95 | ||
96 | validates :description, | 96 | validates :description, |
97 | - :length => { :within => 0..2000 } | 97 | + length: { within: 0..2000 } |
98 | 98 | ||
99 | validates :code, | 99 | validates :code, |
100 | - :presence => true, | ||
101 | - :uniqueness => true, | ||
102 | - :format => { :with => /^[a-zA-Z][a-zA-Z0-9_\-\.]*$/, | ||
103 | - :message => "only letters, digits & '_' '-' '.' allowed. Letter should be first" }, | ||
104 | - :length => { :within => 1..255 } | 100 | + presence: true, |
101 | + uniqueness: true, | ||
102 | + format: { with: /^[a-zA-Z][a-zA-Z0-9_\-\.]*$/, | ||
103 | + message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" }, | ||
104 | + length: { within: 1..255 } | ||
105 | 105 | ||
106 | - validates :owner, :presence => true | 106 | + validates :owner, presence: true |
107 | validate :check_limit | 107 | validate :check_limit |
108 | validate :repo_name | 108 | validate :repo_name |
109 | 109 | ||
@@ -134,19 +134,19 @@ class Project < ActiveRecord::Base | @@ -134,19 +134,19 @@ class Project < ActiveRecord::Base | ||
134 | end | 134 | end |
135 | 135 | ||
136 | def common_notes | 136 | def common_notes |
137 | - notes.where(:noteable_type => ["", nil]).inc_author_project | 137 | + notes.where(noteable_type: ["", nil]).inc_author_project |
138 | end | 138 | end |
139 | 139 | ||
140 | def build_commit_note(commit) | 140 | def build_commit_note(commit) |
141 | - notes.new(:noteable_id => commit.id, :noteable_type => "Commit") | 141 | + notes.new(noteable_id: commit.id, noteable_type: "Commit") |
142 | end | 142 | end |
143 | 143 | ||
144 | def commit_notes(commit) | 144 | def commit_notes(commit) |
145 | - notes.where(:noteable_id => commit.id, :noteable_type => "Commit", :line_code => nil) | 145 | + notes.where(noteable_id: commit.id, noteable_type: "Commit", line_code: nil) |
146 | end | 146 | end |
147 | 147 | ||
148 | def commit_line_notes(commit) | 148 | def commit_line_notes(commit) |
149 | - notes.where(:noteable_id => commit.id, :noteable_type => "Commit").where("line_code is not null") | 149 | + notes.where(noteable_id: commit.id, noteable_type: "Commit").where("line_code is not null") |
150 | end | 150 | end |
151 | 151 | ||
152 | def public? | 152 | def public? |
app/models/snippet.rb
@@ -2,29 +2,29 @@ class Snippet < ActiveRecord::Base | @@ -2,29 +2,29 @@ class Snippet < ActiveRecord::Base | ||
2 | include Linguist::BlobHelper | 2 | include Linguist::BlobHelper |
3 | 3 | ||
4 | belongs_to :project | 4 | belongs_to :project |
5 | - belongs_to :author, :class_name => "User" | ||
6 | - has_many :notes, :as => :noteable, :dependent => :destroy | 5 | + belongs_to :author, class_name: "User" |
6 | + has_many :notes, as: :noteable, dependent: :destroy | ||
7 | 7 | ||
8 | delegate :name, | 8 | delegate :name, |
9 | :email, | 9 | :email, |
10 | - :to => :author, | ||
11 | - :prefix => true | 10 | + to: :author, |
11 | + prefix: true | ||
12 | attr_protected :author, :author_id, :project, :project_id | 12 | attr_protected :author, :author_id, :project, :project_id |
13 | 13 | ||
14 | validates_presence_of :project_id | 14 | validates_presence_of :project_id |
15 | validates_presence_of :author_id | 15 | validates_presence_of :author_id |
16 | 16 | ||
17 | validates :title, | 17 | validates :title, |
18 | - :presence => true, | ||
19 | - :length => { :within => 0..255 } | 18 | + presence: true, |
19 | + length: { within: 0..255 } | ||
20 | 20 | ||
21 | validates :file_name, | 21 | validates :file_name, |
22 | - :presence => true, | ||
23 | - :length => { :within => 0..255 } | 22 | + presence: true, |
23 | + length: { within: 0..255 } | ||
24 | 24 | ||
25 | validates :content, | 25 | validates :content, |
26 | - :presence => true, | ||
27 | - :length => { :within => 0..10000 } | 26 | + presence: true, |
27 | + length: { within: 0..10000 } | ||
28 | 28 | ||
29 | scope :fresh, order("created_at DESC") | 29 | scope :fresh, order("created_at DESC") |
30 | scope :non_expired, where(["expires_at IS NULL OR expires_at > ?", Time.current]) | 30 | scope :non_expired, where(["expires_at IS NULL OR expires_at > ?", Time.current]) |
app/models/tree.rb
@@ -11,7 +11,7 @@ class Tree | @@ -11,7 +11,7 @@ class Tree | ||
11 | :size, | 11 | :size, |
12 | :text?, | 12 | :text?, |
13 | :colorize, | 13 | :colorize, |
14 | - :to => :tree | 14 | + to: :tree |
15 | 15 | ||
16 | def initialize(raw_tree, project, ref = nil, path = nil) | 16 | def initialize(raw_tree, project, ref = nil, path = nil) |
17 | @project, @ref, @path = project, ref, path, | 17 | @project, @ref, @path = project, ref, path, |
app/models/user.rb
@@ -11,58 +11,58 @@ class User < ActiveRecord::Base | @@ -11,58 +11,58 @@ class User < ActiveRecord::Base | ||
11 | 11 | ||
12 | attr_accessor :force_random_password | 12 | attr_accessor :force_random_password |
13 | 13 | ||
14 | - has_many :users_projects, :dependent => :destroy | ||
15 | - has_many :projects, :through => :users_projects | ||
16 | - has_many :my_own_projects, :class_name => "Project", :foreign_key => :owner_id | ||
17 | - has_many :keys, :dependent => :destroy | 14 | + has_many :users_projects, dependent: :destroy |
15 | + has_many :projects, through: :users_projects | ||
16 | + has_many :my_own_projects, class_name: "Project", foreign_key: :owner_id | ||
17 | + has_many :keys, dependent: :destroy | ||
18 | 18 | ||
19 | has_many :events, | 19 | has_many :events, |
20 | - :class_name => "Event", | ||
21 | - :foreign_key => :author_id, | ||
22 | - :dependent => :destroy | 20 | + class_name: "Event", |
21 | + foreign_key: :author_id, | ||
22 | + dependent: :destroy | ||
23 | 23 | ||
24 | has_many :recent_events, | 24 | has_many :recent_events, |
25 | - :class_name => "Event", | ||
26 | - :foreign_key => :author_id, | ||
27 | - :order => "id DESC" | 25 | + class_name: "Event", |
26 | + foreign_key: :author_id, | ||
27 | + order: "id DESC" | ||
28 | 28 | ||
29 | has_many :issues, | 29 | has_many :issues, |
30 | - :foreign_key => :author_id, | ||
31 | - :dependent => :destroy | 30 | + foreign_key: :author_id, |
31 | + dependent: :destroy | ||
32 | 32 | ||
33 | has_many :notes, | 33 | has_many :notes, |
34 | - :foreign_key => :author_id, | ||
35 | - :dependent => :destroy | 34 | + foreign_key: :author_id, |
35 | + dependent: :destroy | ||
36 | 36 | ||
37 | has_many :assigned_issues, | 37 | has_many :assigned_issues, |
38 | - :class_name => "Issue", | ||
39 | - :foreign_key => :assignee_id, | ||
40 | - :dependent => :destroy | 38 | + class_name: "Issue", |
39 | + foreign_key: :assignee_id, | ||
40 | + dependent: :destroy | ||
41 | 41 | ||
42 | has_many :merge_requests, | 42 | has_many :merge_requests, |
43 | - :foreign_key => :author_id, | ||
44 | - :dependent => :destroy | 43 | + foreign_key: :author_id, |
44 | + dependent: :destroy | ||
45 | 45 | ||
46 | has_many :assigned_merge_requests, | 46 | has_many :assigned_merge_requests, |
47 | - :class_name => "MergeRequest", | ||
48 | - :foreign_key => :assignee_id, | ||
49 | - :dependent => :destroy | 47 | + class_name: "MergeRequest", |
48 | + foreign_key: :assignee_id, | ||
49 | + dependent: :destroy | ||
50 | 50 | ||
51 | validates :projects_limit, | 51 | validates :projects_limit, |
52 | - :presence => true, | ||
53 | - :numericality => {:greater_than_or_equal_to => 0} | 52 | + presence: true, |
53 | + numericality: {greater_than_or_equal_to: 0} | ||
54 | 54 | ||
55 | - validates :bio, :length => { :within => 0..255 } | 55 | + validates :bio, length: { within: 0..255 } |
56 | 56 | ||
57 | before_save :ensure_authentication_token | 57 | before_save :ensure_authentication_token |
58 | alias_attribute :private_token, :authentication_token | 58 | alias_attribute :private_token, :authentication_token |
59 | 59 | ||
60 | - scope :not_in_project, lambda { |project| where("id not in (:ids)", :ids => project.users.map(&:id) ) } | ||
61 | - scope :admins, where(:admin => true) | ||
62 | - scope :blocked, where(:blocked => true) | ||
63 | - scope :active, where(:blocked => false) | 60 | + scope :not_in_project, lambda { |project| where("id not in (:ids)", ids: project.users.map(&:id) ) } |
61 | + scope :admins, where(admin: true) | ||
62 | + scope :blocked, where(blocked: true) | ||
63 | + scope :active, where(blocked: false) | ||
64 | 64 | ||
65 | - before_validation :generate_password, :on => :create | 65 | + before_validation :generate_password, on: :create |
66 | 66 | ||
67 | def generate_password | 67 | def generate_password |
68 | if self.force_random_password | 68 | if self.force_random_password |
@@ -94,17 +94,17 @@ class User < ActiveRecord::Base | @@ -94,17 +94,17 @@ class User < ActiveRecord::Base | ||
94 | else | 94 | else |
95 | password = Devise.friendly_token[0, 8].downcase | 95 | password = Devise.friendly_token[0, 8].downcase |
96 | @user = User.create( | 96 | @user = User.create( |
97 | - :name => name, | ||
98 | - :email => email, | ||
99 | - :password => password, | ||
100 | - :password_confirmation => password, | ||
101 | - :projects_limit => Gitlab.config.default_projects_limit | 97 | + name: name, |
98 | + email: email, | ||
99 | + password: password, | ||
100 | + password_confirmation: password, | ||
101 | + projects_limit: Gitlab.config.default_projects_limit | ||
102 | ) | 102 | ) |
103 | end | 103 | end |
104 | end | 104 | end |
105 | 105 | ||
106 | def self.search query | 106 | def self.search query |
107 | - where("name like :query or email like :query", :query => "%#{query}%") | 107 | + where("name like :query or email like :query", query: "%#{query}%") |
108 | end | 108 | end |
109 | end | 109 | end |
110 | # == Schema Information | 110 | # == Schema Information |
app/models/users_project.rb
@@ -12,18 +12,18 @@ class UsersProject < ActiveRecord::Base | @@ -12,18 +12,18 @@ class UsersProject < ActiveRecord::Base | ||
12 | after_save :update_repository | 12 | after_save :update_repository |
13 | after_destroy :update_repository | 13 | after_destroy :update_repository |
14 | 14 | ||
15 | - validates_uniqueness_of :user_id, :scope => [:project_id] | 15 | + validates_uniqueness_of :user_id, scope: [:project_id] |
16 | validates_presence_of :user_id | 16 | validates_presence_of :user_id |
17 | validates_presence_of :project_id | 17 | validates_presence_of :project_id |
18 | 18 | ||
19 | - delegate :name, :email, :to => :user, :prefix => true | 19 | + delegate :name, :email, to: :user, prefix: true |
20 | 20 | ||
21 | def self.bulk_import(project, user_ids, project_access) | 21 | def self.bulk_import(project, user_ids, project_access) |
22 | UsersProject.transaction do | 22 | UsersProject.transaction do |
23 | user_ids.each do |user_id| | 23 | user_ids.each do |user_id| |
24 | users_project = UsersProject.new( | 24 | users_project = UsersProject.new( |
25 | - :project_access => project_access, | ||
26 | - :user_id => user_id | 25 | + project_access: project_access, |
26 | + user_id: user_id | ||
27 | ) | 27 | ) |
28 | users_project.project = project | 28 | users_project.project = project |
29 | users_project.save | 29 | users_project.save |
@@ -35,7 +35,7 @@ class UsersProject < ActiveRecord::Base | @@ -35,7 +35,7 @@ class UsersProject < ActiveRecord::Base | ||
35 | UsersProject.transaction do | 35 | UsersProject.transaction do |
36 | project_ids.each do |project_id| | 36 | project_ids.each do |project_id| |
37 | users_project = UsersProject.new( | 37 | users_project = UsersProject.new( |
38 | - :project_access => project_access, | 38 | + project_access: project_access, |
39 | ) | 39 | ) |
40 | users_project.project_id = project_id | 40 | users_project.project_id = project_id |
41 | users_project.user_id = user.id | 41 | users_project.user_id = user.id |
app/models/wiki.rb
1 | class Wiki < ActiveRecord::Base | 1 | class Wiki < ActiveRecord::Base |
2 | belongs_to :project | 2 | belongs_to :project |
3 | belongs_to :user | 3 | belongs_to :user |
4 | - has_many :notes, :as => :noteable, :dependent => :destroy | 4 | + has_many :notes, as: :noteable, dependent: :destroy |
5 | 5 | ||
6 | - validates :content, :title, :user_id, :presence => true | ||
7 | - validates :title, :length => 1..250 | 6 | + validates :content, :title, :user_id, presence: true |
7 | + validates :title, length: 1..250 | ||
8 | 8 | ||
9 | before_update :set_slug | 9 | before_update :set_slug |
10 | 10 |
app/observers/activity_observer.rb
@@ -3,22 +3,22 @@ class ActivityObserver < ActiveRecord::Observer | @@ -3,22 +3,22 @@ class ActivityObserver < ActiveRecord::Observer | ||
3 | 3 | ||
4 | def after_create(record) | 4 | def after_create(record) |
5 | Event.create( | 5 | Event.create( |
6 | - :project => record.project, | ||
7 | - :target_id => record.id, | ||
8 | - :target_type => record.class.name, | ||
9 | - :action => Event.determine_action(record), | ||
10 | - :author_id => record.author_id | 6 | + project: record.project, |
7 | + target_id: record.id, | ||
8 | + target_type: record.class.name, | ||
9 | + action: Event.determine_action(record), | ||
10 | + author_id: record.author_id | ||
11 | ) | 11 | ) |
12 | end | 12 | end |
13 | 13 | ||
14 | def after_save(record) | 14 | def after_save(record) |
15 | if record.changed.include?("closed") | 15 | if record.changed.include?("closed") |
16 | Event.create( | 16 | Event.create( |
17 | - :project => record.project, | ||
18 | - :target_id => record.id, | ||
19 | - :target_type => record.class.name, | ||
20 | - :action => (record.closed ? Event::Closed : Event::Reopened), | ||
21 | - :author_id => record.author_id_of_changes | 17 | + project: record.project, |
18 | + target_id: record.id, | ||
19 | + target_type: record.class.name, | ||
20 | + action: (record.closed ? Event::Closed : Event::Reopened), | ||
21 | + author_id: record.author_id_of_changes | ||
22 | ) | 22 | ) |
23 | end | 23 | end |
24 | end | 24 | end |
app/observers/mailer_observer.rb
@@ -71,7 +71,7 @@ class MailerObserver < ActiveRecord::Observer | @@ -71,7 +71,7 @@ class MailerObserver < ActiveRecord::Observer | ||
71 | 71 | ||
72 | # Create comment about status changed | 72 | # Create comment about status changed |
73 | if target.closed_changed? | 73 | if target.closed_changed? |
74 | - note = Note.new(:noteable => target, :project => target.project) | 74 | + note = Note.new(noteable: target, project: target.project) |
75 | note.author = current_user | 75 | note.author = current_user |
76 | note.note = "_Status changed to #{target.closed ? 'closed' : 'reopened'}_" | 76 | note.note = "_Status changed to #{target.closed ? 'closed' : 'reopened'}_" |
77 | note.save() | 77 | note.save() |
app/roles/account.rb
@@ -24,7 +24,7 @@ module Account | @@ -24,7 +24,7 @@ module Account | ||
24 | end | 24 | end |
25 | 25 | ||
26 | def cared_merge_requests | 26 | def cared_merge_requests |
27 | - MergeRequest.where("author_id = :id or assignee_id = :id", :id => self.id).opened | 27 | + MergeRequest.where("author_id = :id or assignee_id = :id", id: self.id).opened |
28 | end | 28 | end |
29 | 29 | ||
30 | def project_ids | 30 | def project_ids |
@@ -50,7 +50,7 @@ module Account | @@ -50,7 +50,7 @@ module Account | ||
50 | def recent_push project_id = nil | 50 | def recent_push project_id = nil |
51 | # Get push events not earlier than 2 hours ago | 51 | # Get push events not earlier than 2 hours ago |
52 | events = recent_events.code_push.where("created_at > ?", Time.now - 2.hours) | 52 | events = recent_events.code_push.where("created_at > ?", Time.now - 2.hours) |
53 | - events = events.where(:project_id => project_id) if project_id | 53 | + events = events.where(project_id: project_id) if project_id |
54 | 54 | ||
55 | # Take only latest one | 55 | # Take only latest one |
56 | events = events.recent.limit(1).first | 56 | events = events.recent.limit(1).first |
app/roles/authority.rb
@@ -3,56 +3,56 @@ module Authority | @@ -3,56 +3,56 @@ module Authority | ||
3 | # Should be rewrited for new access rights | 3 | # Should be rewrited for new access rights |
4 | def add_access(user, *access) | 4 | def add_access(user, *access) |
5 | access = if access.include?(:admin) | 5 | access = if access.include?(:admin) |
6 | - { :project_access => UsersProject::MASTER } | 6 | + { project_access: UsersProject::MASTER } |
7 | elsif access.include?(:write) | 7 | elsif access.include?(:write) |
8 | - { :project_access => UsersProject::DEVELOPER } | 8 | + { project_access: UsersProject::DEVELOPER } |
9 | else | 9 | else |
10 | - { :project_access => UsersProject::REPORTER } | 10 | + { project_access: UsersProject::REPORTER } |
11 | end | 11 | end |
12 | - opts = { :user => user } | 12 | + opts = { user: user } |
13 | opts.merge!(access) | 13 | opts.merge!(access) |
14 | users_projects.create(opts) | 14 | users_projects.create(opts) |
15 | end | 15 | end |
16 | 16 | ||
17 | def reset_access(user) | 17 | def reset_access(user) |
18 | - users_projects.where(:project_id => self.id, :user_id => user.id).destroy if self.id | 18 | + users_projects.where(project_id: self.id, user_id: user.id).destroy if self.id |
19 | end | 19 | end |
20 | 20 | ||
21 | def repository_readers | 21 | def repository_readers |
22 | - keys = Key.joins({:user => :users_projects}). | 22 | + keys = Key.joins({user: :users_projects}). |
23 | where("users_projects.project_id = ? AND users_projects.project_access = ?", id, UsersProject::REPORTER) | 23 | where("users_projects.project_id = ? AND users_projects.project_access = ?", id, UsersProject::REPORTER) |
24 | keys.map(&:identifier) + deploy_keys.map(&:identifier) | 24 | keys.map(&:identifier) + deploy_keys.map(&:identifier) |
25 | end | 25 | end |
26 | 26 | ||
27 | def repository_writers | 27 | def repository_writers |
28 | - keys = Key.joins({:user => :users_projects}). | 28 | + keys = Key.joins({user: :users_projects}). |
29 | where("users_projects.project_id = ? AND users_projects.project_access = ?", id, UsersProject::DEVELOPER) | 29 | where("users_projects.project_id = ? AND users_projects.project_access = ?", id, UsersProject::DEVELOPER) |
30 | keys.map(&:identifier) | 30 | keys.map(&:identifier) |
31 | end | 31 | end |
32 | 32 | ||
33 | def repository_masters | 33 | def repository_masters |
34 | - keys = Key.joins({:user => :users_projects}). | 34 | + keys = Key.joins({user: :users_projects}). |
35 | where("users_projects.project_id = ? AND users_projects.project_access = ?", id, UsersProject::MASTER) | 35 | where("users_projects.project_id = ? AND users_projects.project_access = ?", id, UsersProject::MASTER) |
36 | keys.map(&:identifier) | 36 | keys.map(&:identifier) |
37 | end | 37 | end |
38 | 38 | ||
39 | def allow_read_for?(user) | 39 | def allow_read_for?(user) |
40 | - !users_projects.where(:user_id => user.id).empty? | 40 | + !users_projects.where(user_id: user.id).empty? |
41 | end | 41 | end |
42 | 42 | ||
43 | def guest_access_for?(user) | 43 | def guest_access_for?(user) |
44 | - !users_projects.where(:user_id => user.id).empty? | 44 | + !users_projects.where(user_id: user.id).empty? |
45 | end | 45 | end |
46 | 46 | ||
47 | def report_access_for?(user) | 47 | def report_access_for?(user) |
48 | - !users_projects.where(:user_id => user.id, :project_access => [UsersProject::REPORTER, UsersProject::DEVELOPER, UsersProject::MASTER]).empty? | 48 | + !users_projects.where(user_id: user.id, project_access: [UsersProject::REPORTER, UsersProject::DEVELOPER, UsersProject::MASTER]).empty? |
49 | end | 49 | end |
50 | 50 | ||
51 | def dev_access_for?(user) | 51 | def dev_access_for?(user) |
52 | - !users_projects.where(:user_id => user.id, :project_access => [UsersProject::DEVELOPER, UsersProject::MASTER]).empty? | 52 | + !users_projects.where(user_id: user.id, project_access: [UsersProject::DEVELOPER, UsersProject::MASTER]).empty? |
53 | end | 53 | end |
54 | 54 | ||
55 | def master_access_for?(user) | 55 | def master_access_for?(user) |
56 | - !users_projects.where(:user_id => user.id, :project_access => [UsersProject::MASTER]).empty? || owner_id == user.id | 56 | + !users_projects.where(user_id: user.id, project_access: [UsersProject::MASTER]).empty? || owner_id == user.id |
57 | end | 57 | end |
58 | end | 58 | end |
app/roles/issue_commonality.rb
@@ -6,39 +6,39 @@ module IssueCommonality | @@ -6,39 +6,39 @@ module IssueCommonality | ||
6 | attr_protected :author, :author_id, :project, :project_id | 6 | attr_protected :author, :author_id, :project, :project_id |
7 | 7 | ||
8 | belongs_to :project | 8 | belongs_to :project |
9 | - belongs_to :author, :class_name => "User" | ||
10 | - belongs_to :assignee, :class_name => "User" | ||
11 | - has_many :notes, :as => :noteable, :dependent => :destroy | 9 | + belongs_to :author, class_name: "User" |
10 | + belongs_to :assignee, class_name: "User" | ||
11 | + has_many :notes, as: :noteable, dependent: :destroy | ||
12 | 12 | ||
13 | validates_presence_of :project_id | 13 | validates_presence_of :project_id |
14 | validates_presence_of :author_id | 14 | validates_presence_of :author_id |
15 | 15 | ||
16 | validates :title, | 16 | validates :title, |
17 | - :presence => true, | ||
18 | - :length => { :within => 0..255 } | 17 | + presence: true, |
18 | + length: { within: 0..255 } | ||
19 | 19 | ||
20 | 20 | ||
21 | - scope :opened, where(:closed => false) | ||
22 | - scope :closed, where(:closed => true) | ||
23 | - scope :assigned, lambda { |u| where(:assignee_id => u.id)} | 21 | + scope :opened, where(closed: false) |
22 | + scope :closed, where(closed: true) | ||
23 | + scope :assigned, lambda { |u| where(assignee_id: u.id)} | ||
24 | 24 | ||
25 | delegate :name, | 25 | delegate :name, |
26 | :email, | 26 | :email, |
27 | - :to => :author, | ||
28 | - :prefix => true | 27 | + to: :author, |
28 | + prefix: true | ||
29 | 29 | ||
30 | delegate :name, | 30 | delegate :name, |
31 | :email, | 31 | :email, |
32 | - :to => :assignee, | ||
33 | - :allow_nil => true, | ||
34 | - :prefix => true | 32 | + to: :assignee, |
33 | + allow_nil: true, | ||
34 | + prefix: true | ||
35 | 35 | ||
36 | attr_accessor :author_id_of_changes | 36 | attr_accessor :author_id_of_changes |
37 | end | 37 | end |
38 | 38 | ||
39 | module ClassMethods | 39 | module ClassMethods |
40 | def search(query) | 40 | def search(query) |
41 | - where("title like :query", :query => "%#{query}%") | 41 | + where("title like :query", query: "%#{query}%") |
42 | end | 42 | end |
43 | end | 43 | end |
44 | 44 |
app/roles/project_push.rb
@@ -3,10 +3,10 @@ module ProjectPush | @@ -3,10 +3,10 @@ module ProjectPush | ||
3 | data = post_receive_data(oldrev, newrev, ref, user) | 3 | data = post_receive_data(oldrev, newrev, ref, user) |
4 | 4 | ||
5 | Event.create( | 5 | Event.create( |
6 | - :project => self, | ||
7 | - :action => Event::Pushed, | ||
8 | - :data => data, | ||
9 | - :author_id => data[:user_id] | 6 | + project: self, |
7 | + action: Event::Pushed, | ||
8 | + data: data, | ||
9 | + author_id: data[:user_id] | ||
10 | ) | 10 | ) |
11 | end | 11 | end |
12 | 12 | ||
@@ -20,7 +20,7 @@ module ProjectPush | @@ -20,7 +20,7 @@ module ProjectPush | ||
20 | mrs.each { |merge_request| merge_request.reload_code; merge_request.mark_as_unchecked } | 20 | mrs.each { |merge_request| merge_request.reload_code; merge_request.mark_as_unchecked } |
21 | 21 | ||
22 | # Close merge requests | 22 | # Close merge requests |
23 | - mrs = self.merge_requests.opened.where(:target_branch => branch_name).all | 23 | + mrs = self.merge_requests.opened.where(target_branch: branch_name).all |
24 | mrs = mrs.select(&:last_commit).select { |mr| c_ids.include?(mr.last_commit.id) } | 24 | mrs = mrs.select(&:last_commit).select { |mr| c_ids.include?(mr.last_commit.id) } |
25 | mrs.each { |merge_request| merge_request.merge!(user.id) } | 25 | mrs.each { |merge_request| merge_request.merge!(user.id) } |
26 | 26 |
app/roles/ssh_key.rb
@@ -9,7 +9,7 @@ module SshKey | @@ -9,7 +9,7 @@ module SshKey | ||
9 | def repository_delete_key | 9 | def repository_delete_key |
10 | Gitlab::GitHost.system.new.configure do |c| | 10 | Gitlab::GitHost.system.new.configure do |c| |
11 | #delete key file is there is no identically deploy keys | 11 | #delete key file is there is no identically deploy keys |
12 | - if !is_deploy_key || Key.where(:identifier => identifier).count() == 0 | 12 | + if !is_deploy_key || Key.where(identifier: identifier).count() == 0 |
13 | c.delete_key(identifier) | 13 | c.delete_key(identifier) |
14 | end | 14 | end |
15 | c.update_projects(projects) | 15 | c.update_projects(projects) |
app/roles/team.rb
@@ -25,8 +25,8 @@ module Team | @@ -25,8 +25,8 @@ module Team | ||
25 | # with passed access role by user id | 25 | # with passed access role by user id |
26 | def add_user_id_to_team(user_id, access_role) | 26 | def add_user_id_to_team(user_id, access_role) |
27 | users_projects.create( | 27 | users_projects.create( |
28 | - :user_id => user_id, | ||
29 | - :project_access => access_role | 28 | + user_id: user_id, |
29 | + project_access: access_role | ||
30 | ) | 30 | ) |
31 | end | 31 | end |
32 | 32 |
app/uploaders/attachment_uploader.rb
@@ -23,7 +23,7 @@ class AttachmentUploader < CarrierWave::Uploader::Base | @@ -23,7 +23,7 @@ class AttachmentUploader < CarrierWave::Uploader::Base | ||
23 | # end | 23 | # end |
24 | 24 | ||
25 | # Process files as they are uploaded: | 25 | # Process files as they are uploaded: |
26 | - # process :scale => [200, 300] | 26 | + # process scale: [200, 300] |
27 | # | 27 | # |
28 | # def scale(width, height) | 28 | # def scale(width, height) |
29 | # # do something | 29 | # # do something |
@@ -31,7 +31,7 @@ class AttachmentUploader < CarrierWave::Uploader::Base | @@ -31,7 +31,7 @@ class AttachmentUploader < CarrierWave::Uploader::Base | ||
31 | 31 | ||
32 | # Create different versions of your uploaded files: | 32 | # Create different versions of your uploaded files: |
33 | # version :thumb do | 33 | # version :thumb do |
34 | - # process :scale => [50, 50] | 34 | + # process scale: [50, 50] |
35 | # end | 35 | # end |
36 | 36 | ||
37 | # Add a white list of extensions which are allowed to be uploaded. | 37 | # Add a white list of extensions which are allowed to be uploaded. |
app/views/admin/dashboard/index.html.haml
@@ -5,11 +5,11 @@ | @@ -5,11 +5,11 @@ | ||
5 | Resque Workers | 5 | Resque Workers |
6 | .data.padded | 6 | .data.padded |
7 | = link_to admin_resque_path do | 7 | = link_to admin_resque_path do |
8 | - %h1{:class => @workers.present? ? "cgreen" : "cred"} | 8 | + %h1{class: @workers.present? ? "cgreen" : "cred"} |
9 | = @workers.count | 9 | = @workers.count |
10 | %hr | 10 | %hr |
11 | %p | 11 | %p |
12 | - %strong{:class => @pending_jobs > 0 ? "cred" : "cgreen"} | 12 | + %strong{class: @pending_jobs > 0 ? "cred" : "cgreen"} |
13 | #{@pending_jobs} post receive jobs waiting | 13 | #{@pending_jobs} post receive jobs waiting |
14 | 14 | ||
15 | .span4 | 15 | .span4 |
@@ -19,7 +19,7 @@ | @@ -19,7 +19,7 @@ | ||
19 | = link_to admin_projects_path do | 19 | = link_to admin_projects_path do |
20 | %h1= Project.count | 20 | %h1= Project.count |
21 | %hr | 21 | %hr |
22 | - = link_to 'New Project', new_admin_project_path, :class => "btn small" | 22 | + = link_to 'New Project', new_admin_project_path, class: "btn small" |
23 | .span4 | 23 | .span4 |
24 | .ui-box | 24 | .ui-box |
25 | %h5 Users | 25 | %h5 Users |
@@ -27,7 +27,7 @@ | @@ -27,7 +27,7 @@ | ||
27 | = link_to admin_users_path do | 27 | = link_to admin_users_path do |
28 | %h1= User.count | 28 | %h1= User.count |
29 | %hr | 29 | %hr |
30 | - = link_to 'New User', new_admin_user_path, :class => "btn small" | 30 | + = link_to 'New User', new_admin_user_path, class: "btn small" |
31 | 31 | ||
32 | 32 | ||
33 | .row | 33 | .row |
app/views/admin/hooks/index.html.haml
@@ -3,9 +3,9 @@ | @@ -3,9 +3,9 @@ | ||
3 | Post receive hooks for binding events. | 3 | Post receive hooks for binding events. |
4 | %br | 4 | %br |
5 | Read more about system hooks | 5 | Read more about system hooks |
6 | - %strong #{link_to "here", help_system_hooks_path, :class => "vlink"} | 6 | + %strong #{link_to "here", help_system_hooks_path, class: "vlink"} |
7 | 7 | ||
8 | -= form_for @hook, :as => :hook, :url => admin_hooks_path do |f| | 8 | += form_for @hook, as: :hook, url: admin_hooks_path do |f| |
9 | -if @hook.errors.any? | 9 | -if @hook.errors.any? |
10 | .alert-message.block-message.error | 10 | .alert-message.block-message.error |
11 | - @hook.errors.full_messages.each do |msg| | 11 | - @hook.errors.full_messages.each do |msg| |
@@ -13,9 +13,9 @@ | @@ -13,9 +13,9 @@ | ||
13 | .clearfix | 13 | .clearfix |
14 | = f.label :url, "URL:" | 14 | = f.label :url, "URL:" |
15 | .input | 15 | .input |
16 | - = f.text_field :url, :class => "text_field xxlarge" | 16 | + = f.text_field :url, class: "text_field xxlarge" |
17 | | 17 | |
18 | - = f.submit "Add System Hook", :class => "btn primary" | 18 | + = f.submit "Add System Hook", class: "btn primary" |
19 | %hr | 19 | %hr |
20 | 20 | ||
21 | -if @hooks.any? | 21 | -if @hooks.any? |
@@ -33,7 +33,7 @@ | @@ -33,7 +33,7 @@ | ||
33 | %td | 33 | %td |
34 | = link_to admin_hook_path(hook) do | 34 | = link_to admin_hook_path(hook) do |
35 | %strong= hook.url | 35 | %strong= hook.url |
36 | - = link_to 'Test Hook', admin_hook_test_path(hook), :class => "btn small right" | 36 | + = link_to 'Test Hook', admin_hook_test_path(hook), class: "btn small right" |
37 | %td POST | 37 | %td POST |
38 | %td | 38 | %td |
39 | - = link_to 'Remove', admin_hook_path(hook), :confirm => 'Are you sure?', :method => :delete, :class => "danger btn small right" | 39 | + = link_to 'Remove', admin_hook_path(hook), confirm: 'Are you sure?', method: :delete, class: "danger btn small right" |
app/views/admin/projects/_form.html.haml
@@ -9,8 +9,8 @@ | @@ -9,8 +9,8 @@ | ||
9 | = f.label :name do | 9 | = f.label :name do |
10 | Project name is | 10 | Project name is |
11 | .input | 11 | .input |
12 | - = f.text_field :name, :placeholder => "Example Project", :class => "xxlarge" | ||
13 | - = f.submit project.new_record? ? 'Create project' : 'Save Project', :class => "btn primary" | 12 | + = f.text_field :name, placeholder: "Example Project", class: "xxlarge" |
13 | + = f.submit project.new_record? ? 'Create project' : 'Save Project', class: "btn primary" | ||
14 | 14 | ||
15 | %hr | 15 | %hr |
16 | .alert.alert-info | 16 | .alert.alert-info |
@@ -21,7 +21,7 @@ | @@ -21,7 +21,7 @@ | ||
21 | .input | 21 | .input |
22 | .input-prepend | 22 | .input-prepend |
23 | %span.add-on= Gitlab.config.ssh_path | 23 | %span.add-on= Gitlab.config.ssh_path |
24 | - = f.text_field :path, :placeholder => "example_project", :disabled => !!project.id | 24 | + = f.text_field :path, placeholder: "example_project", disabled: !!project.id |
25 | %span.add-on= ".git" | 25 | %span.add-on= ".git" |
26 | .clearfix | 26 | .clearfix |
27 | = f.label :code do | 27 | = f.label :code do |
@@ -29,7 +29,7 @@ | @@ -29,7 +29,7 @@ | ||
29 | .input | 29 | .input |
30 | .input-prepend | 30 | .input-prepend |
31 | %span.add-on= web_app_url | 31 | %span.add-on= web_app_url |
32 | - = f.text_field :code, :placeholder => "example" | 32 | + = f.text_field :code, placeholder: "example" |
33 | 33 | ||
34 | - unless project.new_record? | 34 | - unless project.new_record? |
35 | .clearfix | 35 | .clearfix |
@@ -39,7 +39,7 @@ | @@ -39,7 +39,7 @@ | ||
39 | - if project.repo_exists? | 39 | - if project.repo_exists? |
40 | .clearfix | 40 | .clearfix |
41 | = f.label :default_branch, "Default Branch" | 41 | = f.label :default_branch, "Default Branch" |
42 | - .input= f.select(:default_branch, project.heads.map(&:name), {}, :style => "width:210px;") | 42 | + .input= f.select(:default_branch, project.heads.map(&:name), {}, style: "width:210px;") |
43 | 43 | ||
44 | - unless project.new_record? | 44 | - unless project.new_record? |
45 | .alert.alert-info | 45 | .alert.alert-info |
@@ -63,7 +63,7 @@ | @@ -63,7 +63,7 @@ | ||
63 | 63 | ||
64 | - unless project.new_record? | 64 | - unless project.new_record? |
65 | .actions | 65 | .actions |
66 | - = f.submit 'Save Project', :class => "btn primary" | 66 | + = f.submit 'Save Project', class: "btn primary" |
67 | 67 | ||
68 | 68 | ||
69 | 69 |
app/views/admin/projects/edit.html.haml
app/views/admin/projects/index.html.haml
1 | %h3 | 1 | %h3 |
2 | Projects | 2 | Projects |
3 | - = link_to 'New Project', new_admin_project_path, :class => "btn small right" | 3 | + = link_to 'New Project', new_admin_project_path, class: "btn small right" |
4 | %br | 4 | %br |
5 | -= form_tag admin_projects_path, :method => :get do | ||
6 | - = text_field_tag :name, params[:name], :class => "xlarge" | ||
7 | - = submit_tag "Search", :class => "btn submit primary" | 5 | += form_tag admin_projects_path, method: :get do |
6 | + = text_field_tag :name, params[:name], class: "xlarge" | ||
7 | + = submit_tag "Search", class: "btn submit primary" | ||
8 | 8 | ||
9 | %table.admin-table | 9 | %table.admin-table |
10 | %thead | 10 | %thead |
@@ -21,8 +21,8 @@ | @@ -21,8 +21,8 @@ | ||
21 | %td= link_to project.name, [:admin, project] | 21 | %td= link_to project.name, [:admin, project] |
22 | %td= project.path | 22 | %td= project.path |
23 | %td= project.users_projects.count | 23 | %td= project.users_projects.count |
24 | - %td= check_box_tag :post_receive_file, 1, project.has_post_receive_file?, :disabled => true | 24 | + %td= check_box_tag :post_receive_file, 1, project.has_post_receive_file?, disabled: true |
25 | %td= last_commit(project) | 25 | %td= last_commit(project) |
26 | - %td= link_to 'Edit', edit_admin_project_path(project), :id => "edit_#{dom_id(project)}", :class => "btn small" | ||
27 | - %td.bgred= link_to 'Destroy', [:admin, project], :confirm => "REMOVE #{project.name}? Are you sure?", :method => :delete, :class => "btn small danger" | ||
28 | -= paginate @admin_projects, :theme => "admin" | 26 | + %td= link_to 'Edit', edit_admin_project_path(project), id: "edit_#{dom_id(project)}", class: "btn small" |
27 | + %td.bgred= link_to 'Destroy', [:admin, project], confirm: "REMOVE #{project.name}? Are you sure?", method: :delete, class: "btn small danger" | ||
28 | += paginate @admin_projects, theme: "admin" |
app/views/admin/projects/new.html.haml
app/views/admin/projects/show.html.haml
1 | %h3 | 1 | %h3 |
2 | = @admin_project.name | 2 | = @admin_project.name |
3 | - = link_to 'Edit', edit_admin_project_path(@admin_project), :class => "btn right small" | 3 | + = link_to 'Edit', edit_admin_project_path(@admin_project), class: "btn right small" |
4 | 4 | ||
5 | %br | 5 | %br |
6 | %table.zebra-striped.table-bordered | 6 | %table.zebra-striped.table-bordered |
@@ -33,7 +33,7 @@ | @@ -33,7 +33,7 @@ | ||
33 | %b | 33 | %b |
34 | Post Receive File: | 34 | Post Receive File: |
35 | %td | 35 | %td |
36 | - = check_box_tag :post_receive_file, 1, @admin_project.has_post_receive_file?, :disabled => true | 36 | + = check_box_tag :post_receive_file, 1, @admin_project.has_post_receive_file?, disabled: true |
37 | %br | 37 | %br |
38 | %h3 | 38 | %h3 |
39 | Team | 39 | Team |
@@ -52,14 +52,14 @@ | @@ -52,14 +52,14 @@ | ||
52 | %tr | 52 | %tr |
53 | %td | 53 | %td |
54 | = link_to tm.user_name, admin_user_path(tm.user) | 54 | = link_to tm.user_name, admin_user_path(tm.user) |
55 | - %td= select_tag :tm_project_access, options_for_select(Project.access_options, tm.project_access), :class => "medium project-access-select", :disabled => :disabled | ||
56 | - %td= link_to 'Edit Access', edit_admin_team_member_path(tm), :class => "btn small" | ||
57 | - %td= link_to 'Remove from team', admin_team_member_path(tm), :confirm => 'Are you sure?', :method => :delete, :class => "btn danger small" | 55 | + %td= select_tag :tm_project_access, options_for_select(Project.access_options, tm.project_access), class: "medium project-access-select", disabled: :disabled |
56 | + %td= link_to 'Edit Access', edit_admin_team_member_path(tm), class: "btn small" | ||
57 | + %td= link_to 'Remove from team', admin_team_member_path(tm), confirm: 'Are you sure?', method: :delete, class: "btn danger small" | ||
58 | 58 | ||
59 | %br | 59 | %br |
60 | %h3 Add new team member | 60 | %h3 Add new team member |
61 | %br | 61 | %br |
62 | -= form_tag team_update_admin_project_path(@admin_project), :class => "bulk_import", :method => :put do | 62 | += form_tag team_update_admin_project_path(@admin_project), class: "bulk_import", method: :put do |
63 | %table.zebra-striped.table-bordered | 63 | %table.zebra-striped.table-bordered |
64 | %thead | 64 | %thead |
65 | %tr | 65 | %tr |
@@ -67,14 +67,14 @@ | @@ -67,14 +67,14 @@ | ||
67 | %th Project Access: | 67 | %th Project Access: |
68 | 68 | ||
69 | %tr | 69 | %tr |
70 | - %td= select_tag :user_ids, options_from_collection_for_select(@users , :id, :name), :multiple => true | ||
71 | - %td= select_tag :project_access, options_for_select(Project.access_options), :class => "project-access-select" | 70 | + %td= select_tag :user_ids, options_from_collection_for_select(@users , :id, :name), multiple: true |
71 | + %td= select_tag :project_access, options_for_select(Project.access_options), class: "project-access-select" | ||
72 | 72 | ||
73 | %tr | 73 | %tr |
74 | - %td= submit_tag 'Add', :class => "btn primary" | 74 | + %td= submit_tag 'Add', class: "btn primary" |
75 | %td | 75 | %td |
76 | Read more about project permissions | 76 | Read more about project permissions |
77 | - %strong= link_to "here", help_permissions_path, :class => "vlink" | 77 | + %strong= link_to "here", help_permissions_path, class: "vlink" |
78 | 78 | ||
79 | :css | 79 | :css |
80 | form select { | 80 | form select { |
app/views/admin/resque/show.html.haml
1 | %h3 Resque | 1 | %h3 Resque |
2 | -%iframe{:src => "/info/resque", :width => 1168, :height => 600, :style => "border: none"} | ||
3 | \ No newline at end of file | 2 | \ No newline at end of file |
3 | +%iframe{src: "/info/resque", width: 1168, height: 600, style: "border: none"} | ||
4 | \ No newline at end of file | 4 | \ No newline at end of file |
app/views/admin/team_members/_form.html.haml
1 | -= form_for @admin_team_member, :as => :team_member, :url => admin_team_member_path(@admin_team_member) do |f| | 1 | += form_for @admin_team_member, as: :team_member, url: admin_team_member_path(@admin_team_member) do |f| |
2 | -if @admin_team_member.errors.any? | 2 | -if @admin_team_member.errors.any? |
3 | .alert-message.block-message.error | 3 | .alert-message.block-message.error |
4 | %ul | 4 | %ul |
@@ -8,12 +8,12 @@ | @@ -8,12 +8,12 @@ | ||
8 | .clearfix | 8 | .clearfix |
9 | %label Project Access: | 9 | %label Project Access: |
10 | .input | 10 | .input |
11 | - = f.select :project_access, options_for_select(Project.access_options, @admin_team_member.project_access), {}, :class => "project-access-select" | 11 | + = f.select :project_access, options_for_select(Project.access_options, @admin_team_member.project_access), {}, class: "project-access-select" |
12 | 12 | ||
13 | %br | 13 | %br |
14 | .actions | 14 | .actions |
15 | - = f.submit 'Save', :class => "btn primary" | ||
16 | - = link_to 'Cancel', :back, :class => "btn" | 15 | + = f.submit 'Save', class: "btn primary" |
16 | + = link_to 'Cancel', :back, class: "btn" | ||
17 | 17 | ||
18 | :css | 18 | :css |
19 | form select { | 19 | form select { |
app/views/admin/users/_form.html.haml
@@ -22,17 +22,17 @@ | @@ -22,17 +22,17 @@ | ||
22 | 22 | ||
23 | -if f.object.new_record? | 23 | -if f.object.new_record? |
24 | .clearfix | 24 | .clearfix |
25 | - = f.label :admin, :class => "checkbox" do | 25 | + = f.label :admin, class: "checkbox" do |
26 | = f.check_box :force_random_password, {}, true, nil | 26 | = f.check_box :force_random_password, {}, true, nil |
27 | %span Generate random password | 27 | %span Generate random password |
28 | 28 | ||
29 | %div.password-fields | 29 | %div.password-fields |
30 | .clearfix | 30 | .clearfix |
31 | = f.label :password | 31 | = f.label :password |
32 | - .input= f.password_field :password, :disabled => f.object.force_random_password | 32 | + .input= f.password_field :password, disabled: f.object.force_random_password |
33 | .clearfix | 33 | .clearfix |
34 | = f.label :password_confirmation | 34 | = f.label :password_confirmation |
35 | - .input= f.password_field :password_confirmation, :disabled => f.object.force_random_password | 35 | + .input= f.password_field :password_confirmation, disabled: f.object.force_random_password |
36 | %hr | 36 | %hr |
37 | .clearfix | 37 | .clearfix |
38 | = f.label :skype | 38 | = f.label :skype |
@@ -46,27 +46,27 @@ | @@ -46,27 +46,27 @@ | ||
46 | .span6 | 46 | .span6 |
47 | .clearfix | 47 | .clearfix |
48 | = f.label :projects_limit | 48 | = f.label :projects_limit |
49 | - .input= f.text_field :projects_limit, :class => "small_input" | 49 | + .input= f.text_field :projects_limit, class: "small_input" |
50 | 50 | ||
51 | .alert | 51 | .alert |
52 | .clearfix | 52 | .clearfix |
53 | %p Make the user a GitLab administrator. | 53 | %p Make the user a GitLab administrator. |
54 | - = f.label :admin, :class => "checkbox" do | 54 | + = f.label :admin, class: "checkbox" do |
55 | = f.check_box :admin | 55 | = f.check_box :admin |
56 | %span Administrator | 56 | %span Administrator |
57 | - unless @admin_user.new_record? | 57 | - unless @admin_user.new_record? |
58 | .alert.alert-error | 58 | .alert.alert-error |
59 | - if @admin_user.blocked | 59 | - if @admin_user.blocked |
60 | %span | 60 | %span |
61 | - = link_to 'Unblock', unblock_admin_user_path(@admin_user), :method => :put, :class => "btn small" | 61 | + = link_to 'Unblock', unblock_admin_user_path(@admin_user), method: :put, class: "btn small" |
62 | This user is blocked and is not able to login to GitLab | 62 | This user is blocked and is not able to login to GitLab |
63 | - else | 63 | - else |
64 | %span | 64 | %span |
65 | - = link_to 'Block', block_admin_user_path(@admin_user), :confirm => 'USER WILL BE BLOCKED! Are you sure?', :method => :put, :class => "btn small danger" | 65 | + = link_to 'Block', block_admin_user_path(@admin_user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn small danger" |
66 | Blocked users will be removed from all projects & will not be able to login to GitLab. | 66 | Blocked users will be removed from all projects & will not be able to login to GitLab. |
67 | .actions | 67 | .actions |
68 | - = f.submit 'Save', :class => "btn primary" | 68 | + = f.submit 'Save', class: "btn primary" |
69 | - if @admin_user.new_record? | 69 | - if @admin_user.new_record? |
70 | - = link_to 'Cancel', admin_users_path, :class => "btn" | 70 | + = link_to 'Cancel', admin_users_path, class: "btn" |
71 | - else | 71 | - else |
72 | - = link_to 'Cancel', admin_user_path(@admin_user), :class => "btn" | 72 | + = link_to 'Cancel', admin_user_path(@admin_user), class: "btn" |
app/views/admin/users/index.html.haml
1 | %h3 | 1 | %h3 |
2 | Users | 2 | Users |
3 | - = link_to 'New User', new_admin_user_path, :class => "btn small right" | 3 | + = link_to 'New User', new_admin_user_path, class: "btn small right" |
4 | %br | 4 | %br |
5 | 5 | ||
6 | -= form_tag admin_users_path, :method => :get do | ||
7 | - = text_field_tag :name, params[:name], :class => "xlarge" | ||
8 | - = submit_tag "Search", :class => "btn submit primary" | 6 | += form_tag admin_users_path, method: :get do |
7 | + = text_field_tag :name, params[:name], class: "xlarge" | ||
8 | + = submit_tag "Search", class: "btn submit primary" | ||
9 | %ul.nav.nav-pills | 9 | %ul.nav.nav-pills |
10 | - %li{:class => "#{'active' unless params[:filter]}"} | 10 | + %li{class: "#{'active' unless params[:filter]}"} |
11 | = link_to "Active", admin_users_path | 11 | = link_to "Active", admin_users_path |
12 | - %li{:class => "#{'active' if params[:filter] == "admins"}"} | ||
13 | - = link_to admin_users_path(:filter => "admins") do | 12 | + %li{class: "#{'active' if params[:filter] == "admins"}"} |
13 | + = link_to admin_users_path(filter: "admins") do | ||
14 | Admins | 14 | Admins |
15 | - %li{:class => "#{'active' if params[:filter] == "blocked"}"} | ||
16 | - = link_to admin_users_path(:filter => "blocked") do | 15 | + %li{class: "#{'active' if params[:filter] == "blocked"}"} |
16 | + = link_to admin_users_path(filter: "blocked") do | ||
17 | Blocked | 17 | Blocked |
18 | - %li{:class => "#{'active' if params[:filter] == "wop"}"} | ||
19 | - = link_to admin_users_path(:filter => "wop") do | 18 | + %li{class: "#{'active' if params[:filter] == "wop"}"} |
19 | + = link_to admin_users_path(filter: "wop") do | ||
20 | Without projects | 20 | Without projects |
21 | 21 | ||
22 | %table.admin-table | 22 | %table.admin-table |
@@ -31,16 +31,16 @@ | @@ -31,16 +31,16 @@ | ||
31 | 31 | ||
32 | - @admin_users.each do |user| | 32 | - @admin_users.each do |user| |
33 | %tr | 33 | %tr |
34 | - %td= check_box_tag "admin", 1, user.admin, :disabled => :disabled | 34 | + %td= check_box_tag "admin", 1, user.admin, disabled: :disabled |
35 | %td= link_to user.name, [:admin, user] | 35 | %td= link_to user.name, [:admin, user] |
36 | %td= user.email | 36 | %td= user.email |
37 | %td= user.users_projects.count | 37 | %td= user.users_projects.count |
38 | - %td= link_to 'Edit', edit_admin_user_path(user), :id => "edit_#{dom_id(user)}", :class => "btn small" | 38 | + %td= link_to 'Edit', edit_admin_user_path(user), id: "edit_#{dom_id(user)}", class: "btn small" |
39 | %td | 39 | %td |
40 | - if user.blocked | 40 | - if user.blocked |
41 | - = link_to 'Unblock', unblock_admin_user_path(user), :method => :put, :class => "btn small success" | 41 | + = link_to 'Unblock', unblock_admin_user_path(user), method: :put, class: "btn small success" |
42 | - else | 42 | - else |
43 | - = link_to 'Block', block_admin_user_path(user), :confirm => 'USER WILL BE BLOCKED! Are you sure?', :method => :put, :class => "btn small danger" | ||
44 | - %td.bgred= link_to 'Destroy', [:admin, user], :confirm => "USER #{user.name} WILL BE REMOVED! Are you sure?", :method => :delete, :class => "btn small danger" | 43 | + = link_to 'Block', block_admin_user_path(user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn small danger" |
44 | + %td.bgred= link_to 'Destroy', [:admin, user], confirm: "USER #{user.name} WILL BE REMOVED! Are you sure?", method: :delete, class: "btn small danger" | ||
45 | 45 | ||
46 | -= paginate @admin_users, :theme => "admin" | 46 | += paginate @admin_users, theme: "admin" |
app/views/admin/users/show.html.haml
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | %small Blocked | 4 | %small Blocked |
5 | - if @admin_user.admin | 5 | - if @admin_user.admin |
6 | %small Administrator | 6 | %small Administrator |
7 | - = link_to 'Edit', edit_admin_user_path(@admin_user), :class => "btn small right" | 7 | + = link_to 'Edit', edit_admin_user_path(@admin_user), class: "btn small right" |
8 | 8 | ||
9 | %br | 9 | %br |
10 | 10 | ||
@@ -19,12 +19,12 @@ | @@ -19,12 +19,12 @@ | ||
19 | %td | 19 | %td |
20 | %b | 20 | %b |
21 | Admin: | 21 | Admin: |
22 | - %td= check_box_tag "admin", 1, @admin_user.admin, :disabled => :disabled | 22 | + %td= check_box_tag "admin", 1, @admin_user.admin, disabled: :disabled |
23 | %tr | 23 | %tr |
24 | %td | 24 | %td |
25 | %b | 25 | %b |
26 | Blocked: | 26 | Blocked: |
27 | - %td= check_box_tag "blocked", 1, @admin_user.blocked, :disabled => :disabled | 27 | + %td= check_box_tag "blocked", 1, @admin_user.blocked, disabled: :disabled |
28 | %tr | 28 | %tr |
29 | %td | 29 | %td |
30 | %b | 30 | %b |
@@ -56,7 +56,7 @@ | @@ -56,7 +56,7 @@ | ||
56 | %br | 56 | %br |
57 | %h3 Add User to Projects | 57 | %h3 Add User to Projects |
58 | %br | 58 | %br |
59 | -= form_tag team_update_admin_user_path(@admin_user), :class => "bulk_import", :method => :put do | 59 | += form_tag team_update_admin_user_path(@admin_user), class: "bulk_import", method: :put do |
60 | %table.table-bordered | 60 | %table.table-bordered |
61 | %thead | 61 | %thead |
62 | %tr | 62 | %tr |
@@ -64,14 +64,14 @@ | @@ -64,14 +64,14 @@ | ||
64 | %th Project Access: | 64 | %th Project Access: |
65 | 65 | ||
66 | %tr | 66 | %tr |
67 | - %td= select_tag :project_ids, options_from_collection_for_select(@projects , :id, :name), :multiple => true | ||
68 | - %td= select_tag :project_access, options_for_select(Project.access_options), :class => "project-access-select" | 67 | + %td= select_tag :project_ids, options_from_collection_for_select(@projects , :id, :name), multiple: true |
68 | + %td= select_tag :project_access, options_for_select(Project.access_options), class: "project-access-select" | ||
69 | 69 | ||
70 | %tr | 70 | %tr |
71 | - %td= submit_tag 'Add', :class => "btn primary" | 71 | + %td= submit_tag 'Add', class: "btn primary" |
72 | %td | 72 | %td |
73 | Read more about project permissions | 73 | Read more about project permissions |
74 | - %strong= link_to "here", help_permissions_path, :class => "vlink" | 74 | + %strong= link_to "here", help_permissions_path, class: "vlink" |
75 | %br | 75 | %br |
76 | 76 | ||
77 | - if @admin_user.projects.present? | 77 | - if @admin_user.projects.present? |
@@ -90,9 +90,9 @@ | @@ -90,9 +90,9 @@ | ||
90 | - project = tm.project | 90 | - project = tm.project |
91 | %tr | 91 | %tr |
92 | %td= link_to project.name, admin_project_path(project) | 92 | %td= link_to project.name, admin_project_path(project) |
93 | - %td= select_tag :tm_project_access, options_for_select(Project.access_options, tm.project_access), :class => "medium project-access-select", :disabled => :disabled | ||
94 | - %td= link_to 'Edit Access', edit_admin_team_member_path(tm), :class => "btn small" | ||
95 | - %td= link_to 'Remove from team', admin_team_member_path(tm), :confirm => 'Are you sure?', :method => :delete, :class => "btn small danger" | 93 | + %td= select_tag :tm_project_access, options_for_select(Project.access_options, tm.project_access), class: "medium project-access-select", disabled: :disabled |
94 | + %td= link_to 'Edit Access', edit_admin_team_member_path(tm), class: "btn small" | ||
95 | + %td= link_to 'Remove from team', admin_team_member_path(tm), confirm: 'Are you sure?', method: :delete, class: "btn small danger" | ||
96 | 96 | ||
97 | :css | 97 | :css |
98 | form select { | 98 | form select { |
app/views/commits/_commit.html.haml
1 | %li.commit | 1 | %li.commit |
2 | .browse_code_link_holder | 2 | .browse_code_link_holder |
3 | %p | 3 | %p |
4 | - %strong= link_to "Browse Code »", tree_project_ref_path(@project, commit.id), :class => "right" | 4 | + %strong= link_to "Browse Code »", tree_project_ref_path(@project, commit.id), class: "right" |
5 | %p | 5 | %p |
6 | - = link_to commit.short_id(8), project_commit_path(@project, :id => commit.id), :class => "commit_short_id" | 6 | + = link_to commit.short_id(8), project_commit_path(@project, id: commit.id), class: "commit_short_id" |
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 | ||
10 | - = link_to_gfm truncate(commit.title, :length => 50), project_commit_path(@project, :id => commit.id), :class => "row_title" | 9 | + = image_tag gravatar_icon(commit.author_email), class: "avatar", width: 16 |
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
@@ -5,10 +5,10 @@ | @@ -5,10 +5,10 @@ | ||
5 | %span.btn.disabled.grouped | 5 | %span.btn.disabled.grouped |
6 | %i.icon-comment | 6 | %i.icon-comment |
7 | = @notes_count | 7 | = @notes_count |
8 | - = link_to patch_project_commit_path(@project, @commit.id), :class => "btn small grouped" do | 8 | + = link_to patch_project_commit_path(@project, @commit.id), class: "btn small grouped" do |
9 | %i.icon-download-alt | 9 | %i.icon-download-alt |
10 | Get Patch | 10 | Get Patch |
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 | = gfm @commit.title | 14 | = gfm @commit.title |
@@ -18,7 +18,7 @@ | @@ -18,7 +18,7 @@ | ||
18 | .commit-info | 18 | .commit-info |
19 | .row | 19 | .row |
20 | .span4 | 20 | .span4 |
21 | - = image_tag gravatar_icon(@commit.author_email, 40), :class => "avatar" | 21 | + = image_tag gravatar_icon(@commit.author_email, 40), class: "avatar" |
22 | .author | 22 | .author |
23 | %strong= @commit.author_name | 23 | %strong= @commit.author_name |
24 | authored | 24 | authored |
app/views/commits/_diff_head.html.haml
@@ -3,24 +3,24 @@ | @@ -3,24 +3,24 @@ | ||
3 | %li | 3 | %li |
4 | - if diff.deleted_file | 4 | - if diff.deleted_file |
5 | %span.removed_file | 5 | %span.removed_file |
6 | - %a{:href => "##{diff.old_path}"} | 6 | + %a{href: "##{diff.old_path}"} |
7 | = diff.old_path | 7 | = diff.old_path |
8 | = image_tag "diff_file_delete.png" | 8 | = image_tag "diff_file_delete.png" |
9 | - elsif diff.renamed_file | 9 | - elsif diff.renamed_file |
10 | %span.moved_file | 10 | %span.moved_file |
11 | - %a{:href => "##{diff.new_path}"} | 11 | + %a{href: "##{diff.new_path}"} |
12 | = diff.old_path | 12 | = diff.old_path |
13 | = "->" | 13 | = "->" |
14 | = diff.new_path | 14 | = diff.new_path |
15 | = image_tag "diff_file_notice.png" | 15 | = image_tag "diff_file_notice.png" |
16 | - elsif diff.new_file | 16 | - elsif diff.new_file |
17 | %span.new_file | 17 | %span.new_file |
18 | - %a{:href => "##{diff.new_path}"} | 18 | + %a{href: "##{diff.new_path}"} |
19 | = diff.new_path | 19 | = diff.new_path |
20 | = image_tag "diff_file_add.png" | 20 | = image_tag "diff_file_add.png" |
21 | - else | 21 | - else |
22 | %span.edit_file | 22 | %span.edit_file |
23 | - %a{:href => "##{diff.new_path}"} | 23 | + %a{href: "##{diff.new_path}"} |
24 | = diff.new_path | 24 | = diff.new_path |
25 | = image_tag "diff_file_info.png" | 25 | = image_tag "diff_file_info.png" |
26 | 26 |
app/views/commits/_diffs.html.haml
@@ -5,12 +5,12 @@ | @@ -5,12 +5,12 @@ | ||
5 | %p To prevent performance issue we rejected diff information. | 5 | %p To prevent performance issue we rejected diff information. |
6 | %p | 6 | %p |
7 | But if you still want to see diff | 7 | But if you still want to see diff |
8 | - = link_to "click this link", project_commit_path(@project, @commit.id, :force_show_diff => true), :class => "dark" | 8 | + = link_to "click this link", project_commit_path(@project, @commit.id, force_show_diff: true), class: "dark" |
9 | 9 | ||
10 | %p.cgray | 10 | %p.cgray |
11 | Showing #{pluralize(diffs.count, "changed file")} | 11 | Showing #{pluralize(diffs.count, "changed file")} |
12 | .file_stats | 12 | .file_stats |
13 | - = render "commits/diff_head", :diffs => diffs | 13 | + = render "commits/diff_head", diffs: diffs |
14 | 14 | ||
15 | - unless @suppress_diff | 15 | - unless @suppress_diff |
16 | - diffs.each_with_index do |diff, i| | 16 | - diffs.each_with_index do |diff, i| |
@@ -22,26 +22,26 @@ | @@ -22,26 +22,26 @@ | ||
22 | .diff_file_header | 22 | .diff_file_header |
23 | - if diff.deleted_file | 23 | - if diff.deleted_file |
24 | %i.icon-file | 24 | %i.icon-file |
25 | - %span{:id => "#{diff.old_path}"}= diff.old_path | 25 | + %span{id: "#{diff.old_path}"}= diff.old_path |
26 | - else | 26 | - else |
27 | = link_to tree_file_project_ref_path(@project, @commit.id, diff.new_path) do | 27 | = link_to tree_file_project_ref_path(@project, @commit.id, diff.new_path) do |
28 | %i.icon-file | 28 | %i.icon-file |
29 | - %span{:id => "#{diff.new_path}"}= diff.new_path | 29 | + %span{id: "#{diff.new_path}"}= diff.new_path |
30 | %br/ | 30 | %br/ |
31 | .diff_file_content | 31 | .diff_file_content |
32 | -# Skipp all non non-supported blobs | 32 | -# Skipp all non non-supported blobs |
33 | - next unless file.respond_to?('text?') | 33 | - next unless file.respond_to?('text?') |
34 | 34 | ||
35 | - if file.text? | 35 | - if file.text? |
36 | - = render "commits/text_file", :diff => diff, :index => i | 36 | + = render "commits/text_file", diff: diff, index: i |
37 | - elsif file.image? | 37 | - elsif file.image? |
38 | - if diff.renamed_file || diff.new_file || diff.deleted_file | 38 | - if diff.renamed_file || diff.new_file || diff.deleted_file |
39 | .diff_file_content_image | 39 | .diff_file_content_image |
40 | - %img{:class => image_diff_class(diff), :src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} | 40 | + %img{class: image_diff_class(diff), src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} |
41 | - else | 41 | - else |
42 | - old_file = (@commit.prev_commit.tree / diff.old_path) | 42 | - old_file = (@commit.prev_commit.tree / diff.old_path) |
43 | .diff_file_content_image.img_compared | 43 | .diff_file_content_image.img_compared |
44 | - %img{:class => "diff_image_removed", :src => "data:#{file.mime_type};base64,#{Base64.encode64(old_file.data)}"} | ||
45 | - %img{:class => "diff_image_added", :src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} | 44 | + %img{class: "diff_image_removed", src: "data:#{file.mime_type};base64,#{Base64.encode64(old_file.data)}"} |
45 | + %img{class: "diff_image_added", src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} | ||
46 | - else | 46 | - else |
47 | %p.nothing_here_message No preview for this file type | 47 | %p.nothing_here_message No preview for this file type |
app/views/commits/_head.html.haml
1 | %ul.nav.nav-tabs | 1 | %ul.nav.nav-tabs |
2 | %li | 2 | %li |
3 | - = form_tag switch_project_refs_path(@project), :method => :get, :class => "project-refs-form" do | ||
4 | - = select_tag "ref", grouped_options_refs, :onchange => "$(this.form).trigger('submit');", :class => "project-refs-select" | 3 | + = form_tag switch_project_refs_path(@project), method: :get, class: "project-refs-form" do |
4 | + = select_tag "ref", grouped_options_refs, onchange: "$(this.form).trigger('submit');", class: "project-refs-select" | ||
5 | = hidden_field_tag :destination, "commits" | 5 | = hidden_field_tag :destination, "commits" |
6 | 6 | ||
7 | - %li{:class => "#{'active' if current_page?(project_commits_path(@project)) }"} | 7 | + %li{class: "#{'active' if current_page?(project_commits_path(@project)) }"} |
8 | = link_to project_commits_path(@project) do | 8 | = link_to project_commits_path(@project) do |
9 | Commits | 9 | Commits |
10 | - %li{:class => "#{'active' if current_page?(compare_project_commits_path(@project)) }"} | 10 | + %li{class: "#{'active' if current_page?(compare_project_commits_path(@project)) }"} |
11 | = link_to compare_project_commits_path(@project) do | 11 | = link_to compare_project_commits_path(@project) do |
12 | Compare | 12 | Compare |
13 | - %li{:class => "#{branches_tab_class}"} | 13 | + %li{class: "#{branches_tab_class}"} |
14 | = link_to project_repository_path(@project) do | 14 | = link_to project_repository_path(@project) do |
15 | Branches | 15 | Branches |
16 | %span.badge= @project.repo.branch_count | 16 | %span.badge= @project.repo.branch_count |
17 | 17 | ||
18 | - %li{:class => "#{'active' if current_page?(tags_project_repository_path(@project)) }"} | 18 | + %li{class: "#{'active' if current_page?(tags_project_repository_path(@project)) }"} |
19 | = link_to tags_project_repository_path(@project) do | 19 | = link_to tags_project_repository_path(@project) do |
20 | Tags | 20 | Tags |
21 | %span.badge= @project.repo.tag_count | 21 | %span.badge= @project.repo.tag_count |
@@ -24,8 +24,8 @@ | @@ -24,8 +24,8 @@ | ||
24 | - if current_page?(project_commits_path(@project)) && current_user.private_token | 24 | - if current_page?(project_commits_path(@project)) && current_user.private_token |
25 | %li.right | 25 | %li.right |
26 | %span.rss-icon | 26 | %span.rss-icon |
27 | - = link_to project_commits_path(@project, :atom, { :private_token => current_user.private_token, :ref => @ref }), :title => "Feed" do | ||
28 | - = image_tag "rss_ui.png", :title => "feed" | 27 | + = link_to project_commits_path(@project, :atom, { private_token: current_user.private_token, ref: @ref }), title: "Feed" do |
28 | + = image_tag "rss_ui.png", title: "feed" | ||
29 | 29 | ||
30 | :javascript | 30 | :javascript |
31 | $(function(){ | 31 | $(function(){ |
app/views/commits/_text_file.html.haml
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | - if too_big | 2 | - if too_big |
3 | %a.supp_diff_link Diff suppressed. Click to show | 3 | %a.supp_diff_link Diff suppressed. Click to show |
4 | 4 | ||
5 | -%table{:class => "#{'hide' if too_big}"} | 5 | +%table{class: "#{'hide' if too_big}"} |
6 | - each_diff_line(diff.diff.lines.to_a, index) do |line, type, line_code, line_new, line_old| | 6 | - each_diff_line(diff.diff.lines.to_a, index) do |line, type, line_code, line_new, line_old| |
7 | %tr.line_holder | 7 | %tr.line_holder |
8 | - if type == "match" | 8 | - if type == "match" |
@@ -11,16 +11,16 @@ | @@ -11,16 +11,16 @@ | ||
11 | %td.line_content.matched= line | 11 | %td.line_content.matched= line |
12 | - else | 12 | - else |
13 | %td.old_line | 13 | %td.old_line |
14 | - = link_to raw(type == "new" ? " " : line_old), "##{line_code}", :id => line_code | 14 | + = link_to raw(type == "new" ? " " : line_old), "##{line_code}", id: line_code |
15 | - if @comments_allowed | 15 | - if @comments_allowed |
16 | - = link_to "", "#", :class => "line_note_link", "line_code" => line_code, :title => "Add note for this line" | ||
17 | - %td.new_line= link_to raw(type == "old" ? " " : line_new) , "##{line_code}", :id => line_code | ||
18 | - %td.line_content{:class => "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw "#{line} " | 16 | + = link_to "", "#", class: "line_note_link", "line_code" => line_code, title: "Add note for this line" |
17 | + %td.new_line= link_to raw(type == "old" ? " " : line_new) , "##{line_code}", id: line_code | ||
18 | + %td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw "#{line} " | ||
19 | 19 | ||
20 | - if @comments_allowed | 20 | - if @comments_allowed |
21 | - comments = @line_notes.select { |n| n.line_code == line_code }.sort_by(&:created_at).reverse | 21 | - comments = @line_notes.select { |n| n.line_code == line_code }.sort_by(&:created_at).reverse |
22 | - unless comments.empty? | 22 | - unless comments.empty? |
23 | - comments.each_with_index do |note, i| | 23 | - comments.each_with_index do |note, i| |
24 | - = render "notes/reply_button", :line_code => line_code if i.zero? | ||
25 | - = render "notes/per_line_show", :note => note | 24 | + = render "notes/reply_button", line_code: line_code if i.zero? |
25 | + = render "notes/per_line_show", note: note | ||
26 | - @line_notes.reject!{ |n| n == note } | 26 | - @line_notes.reject!{ |n| n == note } |
app/views/commits/compare.html.haml
@@ -14,13 +14,13 @@ | @@ -14,13 +14,13 @@ | ||
14 | 14 | ||
15 | %br | 15 | %br |
16 | 16 | ||
17 | - = form_tag compare_project_commits_path(@project), :method => :get do | 17 | + = form_tag compare_project_commits_path(@project), method: :get do |
18 | .clearfix | 18 | .clearfix |
19 | - = text_field_tag :from, params[:from], :placeholder => "master", :class => "xlarge" | 19 | + = text_field_tag :from, params[:from], placeholder: "master", class: "xlarge" |
20 | = "..." | 20 | = "..." |
21 | - = text_field_tag :to, params[:to], :placeholder => "aa8b4ef", :class => "xlarge" | 21 | + = text_field_tag :to, params[:to], placeholder: "aa8b4ef", class: "xlarge" |
22 | .actions | 22 | .actions |
23 | - = submit_tag "Compare", :class => "btn btn-primary" | 23 | + = submit_tag "Compare", class: "btn btn-primary" |
24 | 24 | ||
25 | 25 | ||
26 | - unless @commits.empty? | 26 | - unless @commits.empty? |
@@ -30,7 +30,7 @@ | @@ -30,7 +30,7 @@ | ||
30 | 30 | ||
31 | - unless @diffs.empty? | 31 | - unless @diffs.empty? |
32 | %h4 Diff | 32 | %h4 Diff |
33 | - = render "commits/diffs", :diffs => @diffs | 33 | + = render "commits/diffs", diffs: @diffs |
34 | 34 | ||
35 | :javascript | 35 | :javascript |
36 | $(function() { | 36 | $(function() { |
app/views/commits/index.html.haml
@@ -9,12 +9,12 @@ | @@ -9,12 +9,12 @@ | ||
9 | %span.divider | 9 | %span.divider |
10 | \/ | 10 | \/ |
11 | %li | 11 | %li |
12 | - %a{:href => "#"}= params[:path].split("/").join(" / ") | 12 | + %a{href: "#"}= params[:path].split("/").join(" / ") |
13 | 13 | ||
14 | -%div{:id => dom_id(@project)} | 14 | +%div{id: dom_id(@project)} |
15 | #commits_list= render "commits" | 15 | #commits_list= render "commits" |
16 | .clear | 16 | .clear |
17 | -.loading{ :style => "display:none;"} | 17 | +.loading{ style: "display:none;"} |
18 | 18 | ||
19 | - if @commits.count == @limit | 19 | - if @commits.count == @limit |
20 | :javascript | 20 | :javascript |
app/views/commits/index.js.haml
app/views/commits/show.html.haml
1 | = render "commits/commit_box" | 1 | = render "commits/commit_box" |
2 | -= render "commits/diffs", :diffs => @commit.diffs | ||
3 | -= render "notes/notes", :tid => @commit.id, :tt => "commit" | 2 | += render "commits/diffs", diffs: @commit.diffs |
3 | += render "notes/notes", tid: @commit.id, tt: "commit" | ||
4 | = render "notes/per_line_form" | 4 | = render "notes/per_line_form" |
5 | 5 | ||
6 | 6 |
app/views/dashboard/index.html.haml
@@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
6 | %span | 6 | %span |
7 | You wont be able to pull/push project code unless you | 7 | You wont be able to pull/push project code unless you |
8 | %strong | 8 | %strong |
9 | - = link_to new_key_path, :class => "vlink" do | 9 | + = link_to new_key_path, class: "vlink" do |
10 | add new key | 10 | add new key |
11 | to your profile | 11 | to your profile |
12 | - if @events.any? | 12 | - if @events.any? |
@@ -15,7 +15,7 @@ | @@ -15,7 +15,7 @@ | ||
15 | %h4.nothing_here_message Projects activity will be displayed here | 15 | %h4.nothing_here_message Projects activity will be displayed here |
16 | .loading.hide | 16 | .loading.hide |
17 | .side | 17 | .side |
18 | - = render "events/event_last_push", :event => @last_push | 18 | + = render "events/event_last_push", event: @last_push |
19 | .projects_box | 19 | .projects_box |
20 | %h5 | 20 | %h5 |
21 | Projects | 21 | Projects |
@@ -23,23 +23,23 @@ | @@ -23,23 +23,23 @@ | ||
23 | (#{@projects.total_count}) | 23 | (#{@projects.total_count}) |
24 | - if current_user.can_create_project? | 24 | - if current_user.can_create_project? |
25 | %span.right | 25 | %span.right |
26 | - = link_to new_project_path, :class => "btn very_small info" do | 26 | + = link_to new_project_path, class: "btn very_small info" do |
27 | %i.icon-plus | 27 | %i.icon-plus |
28 | New Project | 28 | New Project |
29 | - @projects.each do |project| | 29 | - @projects.each do |project| |
30 | - = link_to project_path(project), :class => dom_class(project) do | 30 | + = link_to project_path(project), class: dom_class(project) do |
31 | %h4 | 31 | %h4 |
32 | %span.ico.project | 32 | %span.ico.project |
33 | - = truncate(project.name, :length => 25) | 33 | + = truncate(project.name, length: 25) |
34 | %span.right | 34 | %span.right |
35 | → | 35 | → |
36 | - .bottom= paginate @projects, :theme => "gitlab" | 36 | + .bottom= paginate @projects, theme: "gitlab" |
37 | 37 | ||
38 | %hr | 38 | %hr |
39 | %div | 39 | %div |
40 | %span.rss-icon | 40 | %span.rss-icon |
41 | - = link_to dashboard_path(:atom, { :private_token => current_user.private_token }) do | ||
42 | - = image_tag "rss_ui.png", :title => "feed" | 41 | + = link_to dashboard_path(:atom, { private_token: current_user.private_token }) do |
42 | + = image_tag "rss_ui.png", title: "feed" | ||
43 | %strong News Feed | 43 | %strong News Feed |
44 | 44 | ||
45 | - else | 45 | - else |
@@ -51,7 +51,7 @@ | @@ -51,7 +51,7 @@ | ||
51 | = current_user.projects_limit | 51 | = current_user.projects_limit |
52 | projects. Click on button below to add a new one | 52 | projects. Click on button below to add a new one |
53 | .link_holder | 53 | .link_holder |
54 | - = link_to new_project_path, :class => "btn primary" do | 54 | + = link_to new_project_path, class: "btn primary" do |
55 | New Project » | 55 | New Project » |
56 | - else | 56 | - else |
57 | If you will be added to project - it will be displayed here | 57 | If you will be added to project - it will be displayed here |
app/views/dashboard/issues.html.haml
@@ -12,8 +12,8 @@ | @@ -12,8 +12,8 @@ | ||
12 | %h5= @project.name | 12 | %h5= @project.name |
13 | %ul.unstyled.issues_table | 13 | %ul.unstyled.issues_table |
14 | - group[1].each do |issue| | 14 | - group[1].each do |issue| |
15 | - = render(:partial => 'issues/show', :locals => {:issue => issue}) | 15 | + = render(partial: 'issues/show', locals: {issue: issue}) |
16 | %hr | 16 | %hr |
17 | - = paginate @issues, :theme => "gitlab" | 17 | + = paginate @issues, theme: "gitlab" |
18 | - else | 18 | - else |
19 | %h3.nothing_here_message Nothing to show here | 19 | %h3.nothing_here_message Nothing to show here |
app/views/dashboard/merge_requests.html.haml
@@ -10,9 +10,9 @@ | @@ -10,9 +10,9 @@ | ||
10 | - @project = group[0] | 10 | - @project = group[0] |
11 | %h5= @project.name | 11 | %h5= @project.name |
12 | - group[1].each do |merge_request| | 12 | - group[1].each do |merge_request| |
13 | - = render(:partial => 'merge_requests/merge_request', :locals => {:merge_request => merge_request}) | 13 | + = render(partial: 'merge_requests/merge_request', locals: {merge_request: merge_request}) |
14 | %hr | 14 | %hr |
15 | - = paginate @merge_requests, :theme => "gitlab" | 15 | + = paginate @merge_requests, theme: "gitlab" |
16 | 16 | ||
17 | - else | 17 | - else |
18 | %h3.nothing_here_message Nothing to show here | 18 | %h3.nothing_here_message Nothing to show here |
app/views/deploy_keys/_form.html.haml
1 | %div | 1 | %div |
2 | - = form_for [@project, @key], :url => project_deploy_keys_path do |f| | 2 | + = form_for [@project, @key], url: project_deploy_keys_path do |f| |
3 | -if @key.errors.any? | 3 | -if @key.errors.any? |
4 | .alert-message.block-message.error | 4 | .alert-message.block-message.error |
5 | %ul | 5 | %ul |
@@ -11,8 +11,8 @@ | @@ -11,8 +11,8 @@ | ||
11 | .input= f.text_field :title | 11 | .input= f.text_field :title |
12 | .clearfix | 12 | .clearfix |
13 | = f.label :key | 13 | = f.label :key |
14 | - .input= f.text_area :key, :class => "xlarge" | 14 | + .input= f.text_area :key, class: "xlarge" |
15 | .actions | 15 | .actions |
16 | - = f.submit 'Save', :class => "primary btn" | ||
17 | - = link_to "Cancel", project_deploy_keys_path(@project), :class => "btn" | 16 | + = f.submit 'Save', class: "primary btn" |
17 | + = link_to "Cancel", project_deploy_keys_path(@project), class: "btn" | ||
18 | 18 |
app/views/deploy_keys/_show.html.haml
1 | %tr | 1 | %tr |
2 | %td | 2 | %td |
3 | - %a{:href => project_deploy_key_path(key.project, key)} | 3 | + %a{href: project_deploy_key_path(key.project, key)} |
4 | %strong= key.title | 4 | %strong= key.title |
5 | %td | 5 | %td |
6 | %span.update-author | 6 | %span.update-author |
@@ -8,5 +8,5 @@ | @@ -8,5 +8,5 @@ | ||
8 | = time_ago_in_words(key.created_at) | 8 | = time_ago_in_words(key.created_at) |
9 | ago | 9 | ago |
10 | %td | 10 | %td |
11 | - = link_to 'Remove', project_deploy_key_path(key.project, key), :confirm => 'Are you sure?', :method => :delete, :class => "danger btn delete-key small right" | 11 | + = link_to 'Remove', project_deploy_key_path(key.project, key), confirm: 'Are you sure?', method: :delete, class: "danger btn delete-key small right" |
12 | 12 |
app/views/deploy_keys/index.html.haml
@@ -2,10 +2,10 @@ | @@ -2,10 +2,10 @@ | ||
2 | - if can? current_user, :admin_project, @project | 2 | - if can? current_user, :admin_project, @project |
3 | .alert-message.block-message | 3 | .alert-message.block-message |
4 | Deploy keys allow read-only access to repository. | 4 | Deploy keys allow read-only access to repository. |
5 | - = link_to new_project_deploy_key_path(@project), :class => "btn small", :title => "New Deploy Key" do | 5 | + = link_to new_project_deploy_key_path(@project), class: "btn small", title: "New Deploy Key" do |
6 | Add Deploy Key | 6 | Add Deploy Key |
7 | 7 | ||
8 | - if @keys.any? | 8 | - if @keys.any? |
9 | %table | 9 | %table |
10 | - @keys.each do |key| | 10 | - @keys.each do |key| |
11 | - = render(:partial => 'show', :locals => {:key => key}) | 11 | + = render(partial: 'show', locals: {key: key}) |
app/views/deploy_keys/show.html.haml
@@ -3,5 +3,5 @@ | @@ -3,5 +3,5 @@ | ||
3 | %hr | 3 | %hr |
4 | %pre= @key.key | 4 | %pre= @key.key |
5 | .actions | 5 | .actions |
6 | - = link_to 'Remove', project_deploy_key_path(@key.project, @key), :confirm => 'Are you sure?', :method => :delete, :class => "danger btn delete-key" | 6 | + = link_to 'Remove', project_deploy_key_path(@key.project, @key), confirm: 'Are you sure?', method: :delete, class: "danger btn delete-key" |
7 | .clear | 7 | .clear |
app/views/devise/passwords/edit.html.haml
1 | -= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put, :class => "login-box" }) do |f| | ||
2 | - = image_tag "login-logo.png", :width => "304", :height => "66", :class => "login-logo", :alt => "Login Logo" | 1 | += form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put, class: "login-box" }) do |f| |
2 | + = image_tag "login-logo.png", width: "304", height: "66", class: "login-logo", alt: "Login Logo" | ||
3 | %h3 Change your password | 3 | %h3 Change your password |
4 | = devise_error_messages! | 4 | = devise_error_messages! |
5 | = f.hidden_field :reset_password_token | 5 | = f.hidden_field :reset_password_token |
6 | %div | 6 | %div |
7 | - = f.password_field :password, :class => "text top", :placeholder => "New password" | 7 | + = f.password_field :password, class: "text top", placeholder: "New password" |
8 | %div | 8 | %div |
9 | - = f.password_field :password_confirmation, :class => "text bottom", :placeholder => "Confirm new password" | 9 | + = f.password_field :password_confirmation, class: "text bottom", placeholder: "Confirm new password" |
10 | %div | 10 | %div |
11 | - = f.submit "Change my password", :class => "btn primary" | ||
12 | - .right= render :partial => "devise/shared/links" | 11 | + = f.submit "Change my password", class: "btn primary" |
12 | + .right= render partial: "devise/shared/links" |
app/views/errors/access_denied.html.haml
@@ -2,4 +2,4 @@ | @@ -2,4 +2,4 @@ | ||
2 | %h3 Access Denied | 2 | %h3 Access Denied |
3 | %hr | 3 | %hr |
4 | %p Youre not allowed to access this page | 4 | %p Youre not allowed to access this page |
5 | - %p Read more about project permissions #{link_to "here", help_permissions_path, :class => "vlink"} | 5 | + %p Read more about project permissions #{link_to "here", help_permissions_path, class: "vlink"} |
app/views/events/_commit.html.haml
1 | - commit = CommitDecorator.decorate(commit) | 1 | - commit = CommitDecorator.decorate(commit) |
2 | %li.wll.commit | 2 | %li.wll.commit |
3 | %p | 3 | %p |
4 | - = link_to commit.short_id(8), project_commit_path(project, :id => commit.id), :class => "commit_short_id" | 4 | + = link_to commit.short_id(8), project_commit_path(project, id: commit.id), class: "commit_short_id" |
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 | ||
8 | - = gfm truncate(commit.title, :length => 50), project_commit_path(project, :id => commit.id) rescue "--broken encoding" | 7 | + = image_tag gravatar_icon(commit.author_email), class: "avatar", width: 16 |
8 | + = gfm truncate(commit.title, length: 50), project_commit_path(project, id: commit.id) rescue "--broken encoding" | ||
9 | 9 |
app/views/events/_event.html.haml
1 | - if event.allowed? | 1 | - if event.allowed? |
2 | - if event.issue? | 2 | - if event.issue? |
3 | .event_feed | 3 | .event_feed |
4 | - = render "events/event_issue", :event => event | 4 | + = render "events/event_issue", event: event |
5 | 5 | ||
6 | - elsif event.merge_request? | 6 | - elsif event.merge_request? |
7 | .event_feed | 7 | .event_feed |
8 | - = render "events/event_merge_request", :event => event | 8 | + = render "events/event_merge_request", event: event |
9 | 9 | ||
10 | - elsif event.push? | 10 | - elsif event.push? |
11 | .event_feed | 11 | .event_feed |
12 | - = render "events/event_push", :event => event | 12 | + = render "events/event_push", event: event |
13 | 13 |
app/views/events/_event_issue.html.haml
1 | -= image_tag gravatar_icon(event.author_email), :class => "avatar" | 1 | += image_tag gravatar_icon(event.author_email), class: "avatar" |
2 | %strong #{event.author_name} | 2 | %strong #{event.author_name} |
3 | -%span.event_label{:class => event.action_name}= event.action_name | 3 | +%span.event_label{class: event.action_name}= event.action_name |
4 | issue | 4 | issue |
5 | = link_to project_issue_path(event.project, event.issue) do | 5 | = link_to project_issue_path(event.project, event.issue) do |
6 | %strong= truncate event.issue_title | 6 | %strong= truncate event.issue_title |
app/views/events/_event_last_push.html.haml
1 | - if show_last_push_widget?(event) | 1 | - if show_last_push_widget?(event) |
2 | .event_lp | 2 | .event_lp |
3 | %div | 3 | %div |
4 | - = image_tag gravatar_icon(event.author_email), :class => "avatar" | 4 | + = image_tag gravatar_icon(event.author_email), class: "avatar" |
5 | %span Your pushed to | 5 | %span Your pushed to |
6 | = event.ref_type | 6 | = event.ref_type |
7 | - = link_to project_commits_path(event.project, :ref => event.ref_name) do | ||
8 | - %strong= truncate(event.ref_name, :length => 28) | 7 | + = link_to project_commits_path(event.project, ref: event.ref_name) do |
8 | + %strong= truncate(event.ref_name, length: 28) | ||
9 | at | 9 | at |
10 | %strong= link_to event.project.name, event.project | 10 | %strong= link_to event.project.name, event.project |
11 | 11 | ||
12 | - = link_to new_mr_path_from_push_event(event), :title => "New Merge Request", :class => "btn very_small primary" do | 12 | + = link_to new_mr_path_from_push_event(event), title: "New Merge Request", class: "btn very_small primary" do |
13 | Create Merge Request | 13 | Create Merge Request |
app/views/events/_event_merge_request.html.haml
1 | - if event.action_name == "merged" | 1 | - if event.action_name == "merged" |
2 | .event_icon= image_tag "event_mr_merged.png" | 2 | .event_icon= image_tag "event_mr_merged.png" |
3 | -= image_tag gravatar_icon(event.author_email), :class => "avatar" | 3 | += image_tag gravatar_icon(event.author_email), class: "avatar" |
4 | %strong #{event.author_name} | 4 | %strong #{event.author_name} |
5 | -%span.event_label{:class => event.action_name}= event.action_name | 5 | +%span.event_label{class: event.action_name}= event.action_name |
6 | merge request | 6 | merge request |
7 | = link_to project_merge_request_path(event.project, event.merge_request) do | 7 | = link_to project_merge_request_path(event.project, event.merge_request) do |
8 | %strong= truncate event.merge_request_title | 8 | %strong= truncate event.merge_request_title |
app/views/events/_event_push.html.haml
1 | %div | 1 | %div |
2 | .event_icon= image_tag "event_push.png" | 2 | .event_icon= image_tag "event_push.png" |
3 | - = image_tag gravatar_icon(event.author_email), :class => "avatar" | 3 | + = image_tag gravatar_icon(event.author_email), class: "avatar" |
4 | %strong #{event.author_name} | 4 | %strong #{event.author_name} |
5 | %span.event_label.pushed= event.push_action_name | 5 | %span.event_label.pushed= event.push_action_name |
6 | = event.ref_type | 6 | = event.ref_type |
7 | - = link_to project_commits_path(event.project, :ref => event.ref_name) do | 7 | + = link_to project_commits_path(event.project, ref: event.ref_name) do |
8 | %strong= event.ref_name | 8 | %strong= event.ref_name |
9 | at | 9 | at |
10 | %strong= link_to event.project.name, event.project | 10 | %strong= link_to event.project.name, event.project |
@@ -14,17 +14,17 @@ | @@ -14,17 +14,17 @@ | ||
14 | 14 | ||
15 | - if event.push_with_commits? | 15 | - if event.push_with_commits? |
16 | - if event.commits_count > 1 | 16 | - if event.commits_count > 1 |
17 | - = link_to compare_project_commits_path(event.project, :from => event.parent_commit.id, :to => event.last_commit.id) do | 17 | + = link_to compare_project_commits_path(event.project, from: event.parent_commit.id, to: event.last_commit.id) do |
18 | %strong #{event.parent_commit.id[0..7]}...#{event.last_commit.id[0..7]} | 18 | %strong #{event.parent_commit.id[0..7]}...#{event.last_commit.id[0..7]} |
19 | - project = event.project | 19 | - project = event.project |
20 | %ul.unstyled.event_commits | 20 | %ul.unstyled.event_commits |
21 | - if event.commits_count > 3 | 21 | - if event.commits_count > 3 |
22 | - event.commits[0...2].each do |commit| | 22 | - event.commits[0...2].each do |commit| |
23 | - = render "events/commit", :commit => commit, :project => project | 23 | + = render "events/commit", commit: commit, project: project |
24 | %li | 24 | %li |
25 | %br | 25 | %br |
26 | \... and #{event.commits_count - 2} more commits | 26 | \... and #{event.commits_count - 2} more commits |
27 | - else | 27 | - else |
28 | - event.commits.each do |commit| | 28 | - event.commits.each do |commit| |
29 | - = render "events/commit", :commit => commit, :project => project | 29 | + = render "events/commit", commit: commit, project: project |
30 | 30 |
app/views/help/api.html.haml
@@ -6,13 +6,13 @@ | @@ -6,13 +6,13 @@ | ||
6 | 6 | ||
7 | %ol | 7 | %ol |
8 | %li | 8 | %li |
9 | - %a{:href => "#README"} README | 9 | + %a{href: "#README"} README |
10 | %li | 10 | %li |
11 | - %a{:href => "#projects"} Projects | 11 | + %a{href: "#projects"} Projects |
12 | %li | 12 | %li |
13 | - %a{:href => "#users"} Users | 13 | + %a{href: "#users"} Users |
14 | %li | 14 | %li |
15 | - %a{:href => "#issues"} Issues | 15 | + %a{href: "#issues"} Issues |
16 | 16 | ||
17 | .file_holder#README | 17 | .file_holder#README |
18 | .file_title | 18 | .file_title |
app/views/hooks/index.html.haml
@@ -6,9 +6,9 @@ | @@ -6,9 +6,9 @@ | ||
6 | Post receive hooks for binding events when someone push to repository. | 6 | Post receive hooks for binding events when someone push to repository. |
7 | %br | 7 | %br |
8 | Read more about web hooks | 8 | Read more about web hooks |
9 | - %strong #{link_to "here", help_web_hooks_path, :class => "vlink"} | 9 | + %strong #{link_to "here", help_web_hooks_path, class: "vlink"} |
10 | 10 | ||
11 | -= form_for [@project, @hook], :as => :hook, :url => project_hooks_path(@project) do |f| | 11 | += form_for [@project, @hook], as: :hook, url: project_hooks_path(@project) do |f| |
12 | -if @hook.errors.any? | 12 | -if @hook.errors.any? |
13 | .alert-message.block-message.error | 13 | .alert-message.block-message.error |
14 | - @hook.errors.full_messages.each do |msg| | 14 | - @hook.errors.full_messages.each do |msg| |
@@ -16,9 +16,9 @@ | @@ -16,9 +16,9 @@ | ||
16 | .clearfix | 16 | .clearfix |
17 | = f.label :url, "URL:" | 17 | = f.label :url, "URL:" |
18 | .input | 18 | .input |
19 | - = f.text_field :url, :class => "text_field xxlarge" | 19 | + = f.text_field :url, class: "text_field xxlarge" |
20 | | 20 | |
21 | - = f.submit "Add Web Hook", :class => "btn primary" | 21 | + = f.submit "Add Web Hook", class: "btn primary" |
22 | %hr | 22 | %hr |
23 | 23 | ||
24 | -if @hooks.any? | 24 | -if @hooks.any? |
@@ -36,7 +36,7 @@ | @@ -36,7 +36,7 @@ | ||
36 | %td | 36 | %td |
37 | = link_to project_hook_path(@project, hook) do | 37 | = link_to project_hook_path(@project, hook) do |
38 | %strong= hook.url | 38 | %strong= hook.url |
39 | - = link_to 'Test Hook', test_project_hook_path(@project, hook), :class => "btn small right" | 39 | + = link_to 'Test Hook', test_project_hook_path(@project, hook), class: "btn small right" |
40 | %td POST | 40 | %td POST |
41 | %td | 41 | %td |
42 | - = link_to 'Remove', project_hook_path(@project, hook), :confirm => 'Are you sure?', :method => :delete, :class => "danger btn small right" | 42 | + = link_to 'Remove', project_hook_path(@project, hook), confirm: 'Are you sure?', method: :delete, class: "danger btn small right" |
app/views/issues/_form.html.haml
1 | %div.issue-form-holder | 1 | %div.issue-form-holder |
2 | %h3= @issue.new_record? ? "New Issue" : "Edit Issue ##{@issue.id}" | 2 | %h3= @issue.new_record? ? "New Issue" : "Edit Issue ##{@issue.id}" |
3 | - = form_for [@project, @issue], :remote => request.xhr? do |f| | 3 | + = form_for [@project, @issue], remote: request.xhr? do |f| |
4 | -if @issue.errors.any? | 4 | -if @issue.errors.any? |
5 | .alert-message.block-message.error | 5 | .alert-message.block-message.error |
6 | %ul | 6 | %ul |
@@ -12,18 +12,18 @@ | @@ -12,18 +12,18 @@ | ||
12 | = f.label :title do | 12 | = f.label :title do |
13 | %strong= "Subject *" | 13 | %strong= "Subject *" |
14 | .input | 14 | .input |
15 | - = f.text_field :title, :maxlength => 255, :class => "xxlarge" | 15 | + = f.text_field :title, maxlength: 255, class: "xxlarge" |
16 | .issue_middle_block | 16 | .issue_middle_block |
17 | .issue_assignee | 17 | .issue_assignee |
18 | = f.label :assignee_id do | 18 | = f.label :assignee_id do |
19 | %i.icon-user | 19 | %i.icon-user |
20 | Assign to | 20 | Assign to |
21 | - .input= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select a user" }) | 21 | + .input= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { include_blank: "Select a user" }) |
22 | .issue_milestone | 22 | .issue_milestone |
23 | = f.label :milestone_id do | 23 | = f.label :milestone_id do |
24 | %i.icon-time | 24 | %i.icon-time |
25 | Milestone | 25 | Milestone |
26 | - .input= f.select(:milestone_id, @project.milestones.active.all.collect {|p| [ p.title, p.id ] }, { :include_blank => "Select milestone" }) | 26 | + .input= f.select(:milestone_id, @project.milestones.active.all.collect {|p| [ p.title, p.id ] }, { include_blank: "Select milestone" }) |
27 | 27 | ||
28 | .issue_description | 28 | .issue_description |
29 | .clearfix | 29 | .clearfix |
@@ -31,26 +31,26 @@ | @@ -31,26 +31,26 @@ | ||
31 | %i.icon-tag | 31 | %i.icon-tag |
32 | Labels | 32 | Labels |
33 | .input | 33 | .input |
34 | - = f.text_field :label_list, :maxlength => 2000, :class => "xxlarge" | 34 | + = f.text_field :label_list, maxlength: 2000, class: "xxlarge" |
35 | %p.hint Separate with comma. | 35 | %p.hint Separate with comma. |
36 | 36 | ||
37 | .clearfix | 37 | .clearfix |
38 | = f.label :description, "Details" | 38 | = f.label :description, "Details" |
39 | .input | 39 | .input |
40 | - = f.text_area :description, :maxlength => 2000, :class => "xxlarge", :rows => 14 | 40 | + = f.text_area :description, maxlength: 2000, class: "xxlarge", rows: 14 |
41 | %p.hint Markdown is enabled. | 41 | %p.hint Markdown is enabled. |
42 | 42 | ||
43 | 43 | ||
44 | .actions | 44 | .actions |
45 | - if @issue.new_record? | 45 | - if @issue.new_record? |
46 | - = f.submit 'Submit new issue', :class => "primary btn" | 46 | + = f.submit 'Submit new issue', class: "primary btn" |
47 | -else | 47 | -else |
48 | - = f.submit 'Save changes', :class => "primary btn" | 48 | + = f.submit 'Save changes', class: "primary btn" |
49 | 49 | ||
50 | - if request.xhr? | 50 | - if request.xhr? |
51 | - = link_to "Cancel", "#back", :onclick => "backToIssues();", :class => "btn" | 51 | + = link_to "Cancel", "#back", onclick: "backToIssues();", class: "btn" |
52 | - else | 52 | - else |
53 | - if @issue.new_record? | 53 | - if @issue.new_record? |
54 | - = link_to "Cancel", project_issues_path(@project), :class => "btn" | 54 | + = link_to "Cancel", project_issues_path(@project), class: "btn" |
55 | - else | 55 | - else |
56 | - = link_to "Cancel", project_issue_path(@project, @issue), :class => "btn" | 56 | + = link_to "Cancel", project_issue_path(@project, @issue), class: "btn" |
app/views/issues/_head.html.haml
1 | %ul.nav.nav-tabs | 1 | %ul.nav.nav-tabs |
2 | - %li{:class => "#{'active' if current_page?(project_issues_path(@project))}"} | ||
3 | - = link_to project_issues_path(@project), :class => "tab" do | 2 | + %li{class: "#{'active' if current_page?(project_issues_path(@project))}"} |
3 | + = link_to project_issues_path(@project), class: "tab" do | ||
4 | Browse Issues | 4 | Browse Issues |
5 | - %li{:class => "#{'active' if current_page?(project_milestones_path(@project))}"} | ||
6 | - = link_to project_milestones_path(@project), :class => "tab" do | 5 | + %li{class: "#{'active' if current_page?(project_milestones_path(@project))}"} |
6 | + = link_to project_milestones_path(@project), class: "tab" do | ||
7 | Milestones | 7 | Milestones |
8 | %li.right | 8 | %li.right |
9 | %span.rss-icon | 9 | %span.rss-icon |
10 | - = link_to project_issues_path(@project, :atom, { :private_token => current_user.private_token }) do | ||
11 | - = image_tag "rss_ui.png", :title => "feed" | 10 | + = link_to project_issues_path(@project, :atom, { private_token: current_user.private_token }) do |
11 | + = image_tag "rss_ui.png", title: "feed" |
app/views/issues/_issues.html.haml
1 | - @issues.each do |issue| | 1 | - @issues.each do |issue| |
2 | - = render(:partial => 'issues/show', :locals => {:issue => issue}) | 2 | + = render(partial: 'issues/show', locals: {issue: issue}) |
3 | 3 | ||
4 | - if @issues.present? | 4 | - if @issues.present? |
5 | %li.bottom | 5 | %li.bottom |
6 | .row | 6 | .row |
7 | - .span7= paginate @issues, :remote => true, :theme => "gitlab" | 7 | + .span7= paginate @issues, remote: true, theme: "gitlab" |
8 | .span3.right | 8 | .span3.right |
9 | %span.cgray.right | 9 | %span.cgray.right |
10 | %span.issue_counter #{@issues.total_count} | 10 | %span.issue_counter #{@issues.total_count} |
app/views/issues/_show.html.haml
1 | -%li.wll{ :id => dom_id(issue), :class => issue_css_classes(issue), :url => project_issue_path(issue.project, issue) } | 1 | +%li.wll{ id: dom_id(issue), class: issue_css_classes(issue), url: project_issue_path(issue.project, issue) } |
2 | - if controller.controller_name == 'issues' | 2 | - if controller.controller_name == 'issues' |
3 | .issue_check | 3 | .issue_check |
4 | - = check_box_tag dom_id(issue,"selected"), nil, false, 'data-id' => issue.id, :class => "selected_issue", :disabled => !can?(current_user, :modify_issue, issue) | 4 | + = check_box_tag dom_id(issue,"selected"), nil, false, 'data-id' => issue.id, class: "selected_issue", disabled: !can?(current_user, :modify_issue, issue) |
5 | .right | 5 | .right |
6 | - issue.labels.each do |label| | 6 | - issue.labels.each do |label| |
7 | %span.label.label-issue.grouped | 7 | %span.label.label-issue.grouped |
@@ -13,19 +13,19 @@ | @@ -13,19 +13,19 @@ | ||
13 | = issue.notes.count | 13 | = issue.notes.count |
14 | - if can? current_user, :modify_issue, issue | 14 | - if can? current_user, :modify_issue, issue |
15 | - if issue.closed | 15 | - if issue.closed |
16 | - = 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 | 16 | + = 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 |
17 | - else | 17 | - else |
18 | - = 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 | ||
19 | - = link_to edit_project_issue_path(issue.project, issue), :class => "btn small edit-issue-link", :remote => true do | 18 | + = 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 |
19 | + = link_to edit_project_issue_path(issue.project, issue), class: "btn small edit-issue-link", remote: true do | ||
20 | %i.icon-edit | 20 | %i.icon-edit |
21 | Edit | 21 | Edit |
22 | 22 | ||
23 | - if issue.assignee | 23 | - if issue.assignee |
24 | - = image_tag gravatar_icon(issue.assignee_email), :class => "avatar" | 24 | + = image_tag gravatar_icon(issue.assignee_email), class: "avatar" |
25 | - else | 25 | - else |
26 | - = image_tag "no_avatar.png", :class => "avatar" | 26 | + = image_tag "no_avatar.png", class: "avatar" |
27 | 27 | ||
28 | - %p= link_to_gfm truncate(issue.title, :length => 100), project_issue_path(issue.project, issue), :class => "row_title" | 28 | + %p= link_to_gfm truncate(issue.title, length: 100), project_issue_path(issue.project, issue), class: "row_title" |
29 | 29 | ||
30 | %span.update-author | 30 | %span.update-author |
31 | %small.cdark= "##{issue.id}" | 31 | %small.cdark= "##{issue.id}" |
app/views/issues/create.js.haml
1 | - if @issue.valid? | 1 | - if @issue.valid? |
2 | :plain | 2 | :plain |
3 | switchFromNewIssue(); | 3 | switchFromNewIssue(); |
4 | - $("#issues-table").prepend("#{escape_javascript(render(:partial => 'show', :locals => {:issue => @issue}))}"); | 4 | + $("#issues-table").prepend("#{escape_javascript(render(partial: 'show', locals: {issue: @issue}))}"); |
5 | $.ajax({type: "GET", url: location.href, dataType: "script"}); | 5 | $.ajax({type: "GET", url: location.href, dataType: "script"}); |
6 | - else | 6 | - else |
7 | :plain | 7 | :plain |
app/views/issues/index.html.haml
@@ -6,51 +6,51 @@ | @@ -6,51 +6,51 @@ | ||
6 | .right | 6 | .right |
7 | .span5 | 7 | .span5 |
8 | - if can? current_user, :write_issue, @project | 8 | - if can? current_user, :write_issue, @project |
9 | - = link_to new_project_issue_path(@project), :class => "right btn small", :title => "New Issue", :remote => true do | 9 | + = link_to new_project_issue_path(@project), class: "right btn small", title: "New Issue", remote: true do |
10 | New Issue | 10 | New Issue |
11 | - = form_tag search_project_issues_path(@project), :method => :get, :remote => true, :id => "issue_search_form", :class => :right do | ||
12 | - = hidden_field_tag :project_id, @project.id, { :id => 'project_id' } | 11 | + = form_tag search_project_issues_path(@project), method: :get, remote: true, id: "issue_search_form", class: :right do |
12 | + = hidden_field_tag :project_id, @project.id, { id: 'project_id' } | ||
13 | = hidden_field_tag :status, params[:f] | 13 | = hidden_field_tag :status, params[:f] |
14 | - = search_field_tag :issue_search, nil, { :placeholder => 'Search', :class => 'issue_search span3 right neib' } | 14 | + = search_field_tag :issue_search, nil, { placeholder: 'Search', class: 'issue_search span3 right neib' } |
15 | 15 | ||
16 | .clearfix | 16 | .clearfix |
17 | 17 | ||
18 | %div#issues-table-holder.ui-box | 18 | %div#issues-table-holder.ui-box |
19 | .title | 19 | .title |
20 | - = check_box_tag "check_all_issues", nil, false, :class => "check_all_issues left" | 20 | + = check_box_tag "check_all_issues", nil, false, class: "check_all_issues left" |
21 | 21 | ||
22 | 22 | ||
23 | .issues_bulk_update.hide | 23 | .issues_bulk_update.hide |
24 | - = form_tag bulk_update_project_issues_path(@project), :method => :post do | 24 | + = form_tag bulk_update_project_issues_path(@project), method: :post do |
25 | %span.update_issues_text Update selected issues with | 25 | %span.update_issues_text Update selected issues with |
26 | .left | 26 | .left |
27 | - = select_tag('update[status]', options_for_select(['open', 'closed']), :prompt => "Status") | ||
28 | - = select_tag('update[assignee_id]', options_from_collection_for_select(@project.users.all, "id", "name", params[:assignee_id]), :prompt => "Assignee") | ||
29 | - = select_tag('update[milestone_id]', options_from_collection_for_select(@project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), :prompt => "Milestone") | 27 | + = select_tag('update[status]', options_for_select(['open', 'closed']), prompt: "Status") |
28 | + = select_tag('update[assignee_id]', options_from_collection_for_select(@project.users.all, "id", "name", params[:assignee_id]), prompt: "Assignee") | ||
29 | + = select_tag('update[milestone_id]', options_from_collection_for_select(@project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), prompt: "Milestone") | ||
30 | = hidden_field_tag 'update[issues_ids]', [] | 30 | = hidden_field_tag 'update[issues_ids]', [] |
31 | = hidden_field_tag :f, params[:f] | 31 | = hidden_field_tag :f, params[:f] |
32 | - = button_tag "Save", :class => "btn update_selected_issues" | 32 | + = button_tag "Save", class: "btn update_selected_issues" |
33 | .issues_filters | 33 | .issues_filters |
34 | .left | 34 | .left |
35 | %ul.nav.nav-pills.left | 35 | %ul.nav.nav-pills.left |
36 | - %li{:class => ("active" if (params[:f] == issues_filter[:open] || !params[:f]))} | ||
37 | - = link_to project_issues_path(@project, :f => issues_filter[:open], :milestone_id => params[:milestone_id]) do | 36 | + %li{class: ("active" if (params[:f] == issues_filter[:open] || !params[:f]))} |
37 | + = link_to project_issues_path(@project, f: issues_filter[:open], milestone_id: params[:milestone_id]) do | ||
38 | Open | 38 | Open |
39 | - %li{:class => ("active" if params[:f] == issues_filter[:closed])} | ||
40 | - = link_to project_issues_path(@project, :f => issues_filter[:closed], :milestone_id => params[:milestone_id]) do | 39 | + %li{class: ("active" if params[:f] == issues_filter[:closed])} |
40 | + = link_to project_issues_path(@project, f: issues_filter[:closed], milestone_id: params[:milestone_id]) do | ||
41 | Closed | 41 | Closed |
42 | - %li{:class => ("active" if params[:f] == issues_filter[:to_me])} | ||
43 | - = link_to project_issues_path(@project, :f => issues_filter[:to_me], :milestone_id => params[:milestone_id]) do | 42 | + %li{class: ("active" if params[:f] == issues_filter[:to_me])} |
43 | + = link_to project_issues_path(@project, f: issues_filter[:to_me], milestone_id: params[:milestone_id]) do | ||
44 | To Me | 44 | To Me |
45 | - %li{:class => ("active" if params[:f] == issues_filter[:all])} | ||
46 | - = link_to project_issues_path(@project, :f => issues_filter[:all], :milestone_id => params[:milestone_id]) do | 45 | + %li{class: ("active" if params[:f] == issues_filter[:all])} |
46 | + = link_to project_issues_path(@project, f: issues_filter[:all], milestone_id: params[:milestone_id]) do | ||
47 | All | 47 | All |
48 | 48 | ||
49 | .right | 49 | .right |
50 | - = form_tag project_issues_path(@project), :method => :get, :class => :right do | ||
51 | - = select_tag(:label_name, options_for_select(issue_tags, params[:label_name]), :prompt => "Labels") | ||
52 | - = select_tag(:assignee_id, options_from_collection_for_select(@project.users.all, "id", "name", params[:assignee_id]), :prompt => "Assignee") | ||
53 | - = select_tag(:milestone_id, options_from_collection_for_select(@project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), :prompt => "Milestone") | 50 | + = form_tag project_issues_path(@project), method: :get, class: :right do |
51 | + = select_tag(:label_name, options_for_select(issue_tags, params[:label_name]), prompt: "Labels") | ||
52 | + = select_tag(:assignee_id, options_from_collection_for_select(@project.users.all, "id", "name", params[:assignee_id]), prompt: "Assignee") | ||
53 | + = select_tag(:milestone_id, options_from_collection_for_select(@project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), prompt: "Milestone") | ||
54 | = hidden_field_tag :f, params[:f] | 54 | = hidden_field_tag :f, params[:f] |
55 | .clearfix | 55 | .clearfix |
56 | 56 |
app/views/issues/show.html.haml
@@ -8,11 +8,11 @@ | @@ -8,11 +8,11 @@ | ||
8 | %span.right | 8 | %span.right |
9 | - if can?(current_user, :admin_project, @project) || @issue.author == current_user | 9 | - if can?(current_user, :admin_project, @project) || @issue.author == current_user |
10 | - if @issue.closed | 10 | - if @issue.closed |
11 | - = link_to 'Reopen', project_issue_path(@project, @issue, :issue => {:closed => false }, :status_only => true), :method => :put, :class => "btn small" | 11 | + = link_to 'Reopen', project_issue_path(@project, @issue, issue: {closed: false }, status_only: true), method: :put, class: "btn small" |
12 | - else | 12 | - else |
13 | - = link_to 'Close', project_issue_path(@project, @issue, :issue => {:closed => true }, :status_only => true), :method => :put, :class => "btn small", :title => "Close Issue" | 13 | + = link_to 'Close', project_issue_path(@project, @issue, issue: {closed: true }, status_only: true), method: :put, class: "btn small", title: "Close Issue" |
14 | - if can?(current_user, :admin_project, @project) || @issue.author == current_user | 14 | - if can?(current_user, :admin_project, @project) || @issue.author == current_user |
15 | - = link_to edit_project_issue_path(@project, @issue), :class => "btn small" do | 15 | + = link_to edit_project_issue_path(@project, @issue), class: "btn small" do |
16 | %i.icon-edit | 16 | %i.icon-edit |
17 | Edit | 17 | Edit |
18 | 18 | ||
@@ -35,18 +35,18 @@ | @@ -35,18 +35,18 @@ | ||
35 | 35 | ||
36 | .middle_box_content | 36 | .middle_box_content |
37 | %cite.cgray Created by | 37 | %cite.cgray Created by |
38 | - = image_tag gravatar_icon(@issue.author_email), :width => 16, :class => "lil_av" | 38 | + = image_tag gravatar_icon(@issue.author_email), width: 16, class: "lil_av" |
39 | %strong.author= link_to_issue_author(@issue) | 39 | %strong.author= link_to_issue_author(@issue) |
40 | 40 | ||
41 | - if @issue.assignee | 41 | - if @issue.assignee |
42 | %cite.cgray and currently assigned to | 42 | %cite.cgray and currently assigned to |
43 | - = image_tag gravatar_icon(@issue.assignee_email), :width => 16, :class => "lil_av" | 43 | + = image_tag gravatar_icon(@issue.assignee_email), width: 16, class: "lil_av" |
44 | %strong.author= link_to_issue_assignee(@issue) | 44 | %strong.author= link_to_issue_assignee(@issue) |
45 | 45 | ||
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_gfm 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| |
@@ -61,4 +61,4 @@ | @@ -61,4 +61,4 @@ | ||
61 | = markdown @issue.description | 61 | = markdown @issue.description |
62 | 62 | ||
63 | 63 | ||
64 | -.issue_notes#notes= render "notes/notes", :tid => @issue.id, :tt => "issue" | 64 | +.issue_notes#notes= render "notes/notes", tid: @issue.id, tt: "issue" |
app/views/kaminari/admin/_first_page.html.haml
@@ -6,4 +6,4 @@ | @@ -6,4 +6,4 @@ | ||
6 | -# per_page: number of items to fetch per page | 6 | -# per_page: number of items to fetch per page |
7 | -# remote: data-remote | 7 | -# remote: data-remote |
8 | %span.first | 8 | %span.first |
9 | - = link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote | 9 | + = link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, remote: remote |
app/views/kaminari/admin/_last_page.html.haml
@@ -6,4 +6,4 @@ | @@ -6,4 +6,4 @@ | ||
6 | -# per_page: number of items to fetch per page | 6 | -# per_page: number of items to fetch per page |
7 | -# remote: data-remote | 7 | -# remote: data-remote |
8 | %span.last | 8 | %span.last |
9 | - = link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {:remote => remote} | 9 | + = link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {remote: remote} |
app/views/kaminari/admin/_next_page.html.haml
@@ -6,4 +6,4 @@ | @@ -6,4 +6,4 @@ | ||
6 | -# per_page: number of items to fetch per page | 6 | -# per_page: number of items to fetch per page |
7 | -# remote: data-remote | 7 | -# remote: data-remote |
8 | %li.next | 8 | %li.next |
9 | - = link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote | 9 | + = link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, rel: 'next', remote: remote |
app/views/kaminari/admin/_page.html.haml
@@ -6,5 +6,5 @@ | @@ -6,5 +6,5 @@ | ||
6 | -# num_pages: total number of pages | 6 | -# num_pages: total number of pages |
7 | -# per_page: number of items to fetch per page | 7 | -# per_page: number of items to fetch per page |
8 | -# remote: data-remote | 8 | -# remote: data-remote |
9 | -%li{:class => "page#{' active' if page.current?}"} | ||
10 | - = link_to page, url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} | 9 | +%li{class: "page#{' active' if page.current?}"} |
10 | + = link_to page, url, {remote: remote, rel: page.next? ? 'next' : page.prev? ? 'prev' : nil} |
app/views/kaminari/admin/_prev_page.html.haml
@@ -5,5 +5,5 @@ | @@ -5,5 +5,5 @@ | ||
5 | -# num_pages: total number of pages | 5 | -# num_pages: total number of pages |
6 | -# per_page: number of items to fetch per page | 6 | -# per_page: number of items to fetch per page |
7 | -# remote: data-remote | 7 | -# remote: data-remote |
8 | -%li{:class => "prev" } | ||
9 | - = link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote | 8 | +%li{class: "prev" } |
9 | + = link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, rel: 'prev', remote: remote |
app/views/kaminari/gitlab/_first_page.html.haml
@@ -6,4 +6,4 @@ | @@ -6,4 +6,4 @@ | ||
6 | -# per_page: number of items to fetch per page | 6 | -# per_page: number of items to fetch per page |
7 | -# remote: data-remote | 7 | -# remote: data-remote |
8 | %span.first | 8 | %span.first |
9 | - = link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote | 9 | + = link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, remote: remote |
app/views/kaminari/gitlab/_last_page.html.haml
@@ -6,4 +6,4 @@ | @@ -6,4 +6,4 @@ | ||
6 | -# per_page: number of items to fetch per page | 6 | -# per_page: number of items to fetch per page |
7 | -# remote: data-remote | 7 | -# remote: data-remote |
8 | %span.last | 8 | %span.last |
9 | - = link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {:remote => remote} | 9 | + = link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {remote: remote} |
app/views/kaminari/gitlab/_next_page.html.haml
@@ -6,4 +6,4 @@ | @@ -6,4 +6,4 @@ | ||
6 | -# per_page: number of items to fetch per page | 6 | -# per_page: number of items to fetch per page |
7 | -# remote: data-remote | 7 | -# remote: data-remote |
8 | %span.next | 8 | %span.next |
9 | - = link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote | 9 | + = link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, rel: 'next', remote: remote |
app/views/kaminari/gitlab/_page.html.haml
@@ -6,5 +6,5 @@ | @@ -6,5 +6,5 @@ | ||
6 | -# num_pages: total number of pages | 6 | -# num_pages: total number of pages |
7 | -# per_page: number of items to fetch per page | 7 | -# per_page: number of items to fetch per page |
8 | -# remote: data-remote | 8 | -# remote: data-remote |
9 | -%span{:class => "page#{' current' if page.current?}"} | ||
10 | - = link_to_unless page.current?, page, url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} | 9 | +%span{class: "page#{' current' if page.current?}"} |
10 | + = link_to_unless page.current?, page, url, {remote: remote, rel: page.next? ? 'next' : page.prev? ? 'prev' : nil} |
app/views/kaminari/gitlab/_prev_page.html.haml
@@ -6,4 +6,4 @@ | @@ -6,4 +6,4 @@ | ||
6 | -# per_page: number of items to fetch per page | 6 | -# per_page: number of items to fetch per page |
7 | -# remote: data-remote | 7 | -# remote: data-remote |
8 | %span.prev | 8 | %span.prev |
9 | - = link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote | 9 | + = link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, rel: 'prev', remote: remote |
app/views/keys/_form.html.haml
@@ -11,8 +11,8 @@ | @@ -11,8 +11,8 @@ | ||
11 | .input= f.text_field :title | 11 | .input= f.text_field :title |
12 | .clearfix | 12 | .clearfix |
13 | = f.label :key | 13 | = f.label :key |
14 | - .input= f.text_area :key, :class => [:xxlarge, :thin_area] | 14 | + .input= f.text_area :key, class: [:xxlarge, :thin_area] |
15 | .actions | 15 | .actions |
16 | - = f.submit 'Save', :class => "primary btn" | ||
17 | - = link_to "Cancel", keys_path, :class => "btn" | 16 | + = f.submit 'Save', class: "primary btn" |
17 | + = link_to "Cancel", keys_path, class: "btn" | ||
18 | 18 |
app/views/keys/_show.html.haml
@@ -9,5 +9,5 @@ | @@ -9,5 +9,5 @@ | ||
9 | = time_ago_in_words(key.created_at) | 9 | = time_ago_in_words(key.created_at) |
10 | ago | 10 | ago |
11 | %td | 11 | %td |
12 | - = link_to 'Remove', key, :confirm => 'Are you sure?', :method => :delete, :class => "btn small danger delete-key right" | 12 | + = link_to 'Remove', key, confirm: 'Are you sure?', method: :delete, class: "btn small danger delete-key right" |
13 | 13 |
app/views/keys/create.js.haml
1 | - if @key.valid? | 1 | - if @key.valid? |
2 | :plain | 2 | :plain |
3 | $("#new_key_dialog").dialog("close"); | 3 | $("#new_key_dialog").dialog("close"); |
4 | - $("#keys-table .data").append("#{escape_javascript(render(:partial => 'show', :locals => {:key => @key}))}"); | 4 | + $("#keys-table .data").append("#{escape_javascript(render(partial: 'show', locals: {key: @key}))}"); |
5 | $("#no_ssh_key_defined").hide(); | 5 | $("#no_ssh_key_defined").hide(); |
6 | - else | 6 | - else |
7 | :plain | 7 | :plain |
app/views/keys/index.html.haml
1 | %h3.page_title | 1 | %h3.page_title |
2 | SSH Keys | 2 | SSH Keys |
3 | - = link_to "Add new", new_key_path, :class => "btn small right" | 3 | + = link_to "Add new", new_key_path, class: "btn small right" |
4 | 4 | ||
5 | %hr | 5 | %hr |
6 | %p.slead | 6 | %p.slead |
@@ -14,9 +14,9 @@ | @@ -14,9 +14,9 @@ | ||
14 | %th Added | 14 | %th Added |
15 | %th | 15 | %th |
16 | - @keys.each do |key| | 16 | - @keys.each do |key| |
17 | - = render(:partial => 'show', :locals => {:key => key}) | 17 | + = render(partial: 'show', locals: {key: key}) |
18 | - if @keys.blank? | 18 | - if @keys.blank? |
19 | %tr | 19 | %tr |
20 | - %td{:colspan => 3} | 20 | + %td{colspan: 3} |
21 | %h3.nothing_here_message There are no SSH keys with access to your account. | 21 | %h3.nothing_here_message There are no SSH keys with access to your account. |
22 | 22 |
app/views/keys/show.html.haml
@@ -11,4 +11,4 @@ | @@ -11,4 +11,4 @@ | ||
11 | 11 | ||
12 | %pre= @key.key | 12 | %pre= @key.key |
13 | .actions | 13 | .actions |
14 | - = link_to 'Remove', @key, :confirm => 'Are you sure?', :method => :delete, :class => "btn danger delete-key" | 14 | + = link_to 'Remove', @key, confirm: 'Are you sure?', method: :delete, class: "btn danger delete-key" |
app/views/layouts/_app_menu.html.haml
1 | %ul.main_menu | 1 | %ul.main_menu |
2 | - %li.home{:class => tab_class(:root)} | ||
3 | - = link_to "Home", root_path, :title => "Home" | 2 | + %li.home{class: tab_class(:root)} |
3 | + = link_to "Home", root_path, title: "Home" | ||
4 | 4 | ||
5 | - %li{:class => tab_class(:dash_issues)} | 5 | + %li{class: tab_class(:dash_issues)} |
6 | = link_to dashboard_issues_path do | 6 | = link_to dashboard_issues_path do |
7 | Issues | 7 | Issues |
8 | %span.count= current_user.assigned_issues.opened.count | 8 | %span.count= current_user.assigned_issues.opened.count |
9 | 9 | ||
10 | - %li{:class => tab_class(:dash_mr)} | 10 | + %li{class: tab_class(:dash_mr)} |
11 | = link_to dashboard_merge_requests_path do | 11 | = link_to dashboard_merge_requests_path do |
12 | Merge Requests | 12 | Merge Requests |
13 | %span.count= current_user.cared_merge_requests.count | 13 | %span.count= current_user.cared_merge_requests.count |
14 | 14 | ||
15 | - %li{:class => tab_class(:search)} | 15 | + %li{class: tab_class(:search)} |
16 | = link_to "Search", search_path | 16 | = link_to "Search", search_path |
17 | 17 | ||
18 | - %li{:class => tab_class(:help)} | 18 | + %li{class: tab_class(:help)} |
19 | = link_to "Help", help_path | 19 | = link_to "Help", help_path |
app/views/layouts/_flash.html.haml
app/views/layouts/_head.html.haml
1 | %head | 1 | %head |
2 | - %meta{:charset => "utf-8"} | 2 | + %meta{charset: "utf-8"} |
3 | %title | 3 | %title |
4 | GitLab | 4 | GitLab |
5 | = " > #{@project.name}" if @project && !@project.new_record? | 5 | = " > #{@project.name}" if @project && !@project.new_record? |
@@ -9,10 +9,10 @@ | @@ -9,10 +9,10 @@ | ||
9 | 9 | ||
10 | -# Atom feed | 10 | -# Atom feed |
11 | - if controller_name == 'projects' && action_name == 'index' | 11 | - if controller_name == 'projects' && action_name == 'index' |
12 | - = auto_discovery_link_tag :atom, projects_url(:atom, :private_token => current_user.private_token), :title => "Dashboard feed" | 12 | + = auto_discovery_link_tag :atom, projects_url(:atom, private_token: current_user.private_token), title: "Dashboard feed" |
13 | - if @project && !@project.new_record? | 13 | - if @project && !@project.new_record? |
14 | - if current_page?(tree_project_ref_path(@project, @project.root_ref)) || current_page?(project_commits_path(@project)) | 14 | - if current_page?(tree_project_ref_path(@project, @project.root_ref)) || current_page?(project_commits_path(@project)) |
15 | - = auto_discovery_link_tag(:atom, project_commits_url(@project, :atom, :ref => @ref, :private_token => current_user.private_token), :title => "Recent commits to #{@project.name}:#{@ref}") | 15 | + = auto_discovery_link_tag(:atom, project_commits_url(@project, :atom, ref: @ref, private_token: current_user.private_token), title: "Recent commits to #{@project.name}:#{@ref}") |
16 | - if request.path == project_issues_path(@project) | 16 | - if request.path == project_issues_path(@project) |
17 | - = auto_discovery_link_tag(:atom, project_issues_url(@project, :atom, :private_token => current_user.private_token), :title => "#{@project.name} issues") | 17 | + = auto_discovery_link_tag(:atom, project_issues_url(@project, :atom, private_token: current_user.private_token), title: "#{@project.name} issues") |
18 | = csrf_meta_tags | 18 | = csrf_meta_tags |
app/views/layouts/_head_panel.html.haml
@@ -3,30 +3,30 @@ | @@ -3,30 +3,30 @@ | ||
3 | .container | 3 | .container |
4 | .top_panel_content | 4 | .top_panel_content |
5 | %div.app_logo | 5 | %div.app_logo |
6 | - = link_to root_path, :class => "home", :title => "Home" do | 6 | + = link_to root_path, class: "home", title: "Home" do |
7 | %h1 | 7 | %h1 |
8 | GITLAB | 8 | GITLAB |
9 | %span.separator | 9 | %span.separator |
10 | %h1.project_name= title | 10 | %h1.project_name= title |
11 | .search | 11 | .search |
12 | - = form_tag search_path, :method => :get do |f| | ||
13 | - = text_field_tag "search", nil, :placeholder => "Search", :class => "search-input" | 12 | + = form_tag search_path, method: :get do |f| |
13 | + = text_field_tag "search", nil, placeholder: "Search", class: "search-input" | ||
14 | .fbtn | 14 | .fbtn |
15 | - if current_user.is_admin? | 15 | - if current_user.is_admin? |
16 | - = link_to admin_root_path, :class => "btn small", :title => "Admin area" do | 16 | + = link_to admin_root_path, class: "btn small", title: "Admin area" do |
17 | %i.icon-cog | 17 | %i.icon-cog |
18 | Admin | 18 | Admin |
19 | - if current_user.can_create_project? | 19 | - if current_user.can_create_project? |
20 | - = link_to new_project_path, :class => "btn small", :title => "Create New Project" do | 20 | + = link_to new_project_path, class: "btn small", title: "Create New Project" do |
21 | %i.icon-plus | 21 | %i.icon-plus |
22 | Project | 22 | Project |
23 | .account-box | 23 | .account-box |
24 | - = link_to profile_path, :class => "pic" do | 24 | + = link_to profile_path, class: "pic" do |
25 | = image_tag gravatar_icon(current_user.email) | 25 | = image_tag gravatar_icon(current_user.email) |
26 | .account-links | 26 | .account-links |
27 | - = link_to profile_path, :class => "username" do | 27 | + = link_to profile_path, class: "username" do |
28 | My profile | 28 | My profile |
29 | - = link_to 'Logout', destroy_user_session_path, :class => "logout", :method => :delete | 29 | + = link_to 'Logout', destroy_user_session_path, class: "logout", method: :delete |
30 | 30 | ||
31 | :javascript | 31 | :javascript |
32 | $(function(){ | 32 | $(function(){ |
app/views/layouts/_project_menu.html.haml
1 | %ul.main_menu | 1 | %ul.main_menu |
2 | - %li.home{:class => project_tab_class} | ||
3 | - = link_to @project.code, project_path(@project), :title => "Project" | 2 | + %li.home{class: project_tab_class} |
3 | + = link_to @project.code, project_path(@project), title: "Project" | ||
4 | 4 | ||
5 | - if @project.repo_exists? | 5 | - if @project.repo_exists? |
6 | - if can? current_user, :download_code, @project | 6 | - if can? current_user, :download_code, @project |
7 | - %li{:class => tree_tab_class} | 7 | + %li{class: tree_tab_class} |
8 | = link_to tree_project_ref_path(@project, @project.root_ref) do | 8 | = link_to tree_project_ref_path(@project, @project.root_ref) do |
9 | Files | 9 | Files |
10 | - %li{:class => commit_tab_class} | 10 | + %li{class: commit_tab_class} |
11 | = link_to "Commits", project_commits_path(@project) | 11 | = link_to "Commits", project_commits_path(@project) |
12 | 12 | ||
13 | - %li{:class => tab_class(:network)} | 13 | + %li{class: tab_class(:network)} |
14 | = link_to "Network", graph_project_path(@project) | 14 | = link_to "Network", graph_project_path(@project) |
15 | 15 | ||
16 | - if @project.issues_enabled | 16 | - if @project.issues_enabled |
17 | - %li{:class => tab_class(:issues)} | 17 | + %li{class: tab_class(:issues)} |
18 | = link_to project_issues_filter_path(@project) do | 18 | = link_to project_issues_filter_path(@project) do |
19 | Issues | 19 | Issues |
20 | %span.count.issue_counter= @project.issues.opened.count | 20 | %span.count.issue_counter= @project.issues.opened.count |
21 | 21 | ||
22 | - if @project.repo_exists? | 22 | - if @project.repo_exists? |
23 | - if @project.merge_requests_enabled | 23 | - if @project.merge_requests_enabled |
24 | - %li{:class => tab_class(:merge_requests)} | 24 | + %li{class: tab_class(:merge_requests)} |
25 | = link_to project_merge_requests_path(@project) do | 25 | = link_to project_merge_requests_path(@project) do |
26 | Merge Requests | 26 | Merge Requests |
27 | %span.count.merge_counter= @project.merge_requests.opened.count | 27 | %span.count.merge_counter= @project.merge_requests.opened.count |
28 | 28 | ||
29 | - if @project.wall_enabled | 29 | - if @project.wall_enabled |
30 | - %li{:class => tab_class(:wall)} | 30 | + %li{class: tab_class(:wall)} |
31 | = link_to wall_project_path(@project) do | 31 | = link_to wall_project_path(@project) do |
32 | Wall | 32 | Wall |
33 | 33 | ||
34 | - if @project.wiki_enabled | 34 | - if @project.wiki_enabled |
35 | - %li{:class => tab_class(:wiki)} | 35 | + %li{class: tab_class(:wiki)} |
36 | = link_to project_wiki_path(@project, :index) do | 36 | = link_to project_wiki_path(@project, :index) do |
37 | Wiki | 37 | Wiki |
app/views/layouts/admin.html.haml
1 | !!! 5 | 1 | !!! 5 |
2 | -%html{ :lang => "en"} | 2 | +%html{ lang: "en"} |
3 | = render "layouts/head" | 3 | = render "layouts/head" |
4 | - %body{:class => "#{app_theme} admin"} | 4 | + %body{class: "#{app_theme} admin"} |
5 | = render "layouts/flash" | 5 | = render "layouts/flash" |
6 | - = render "layouts/head_panel", :title => "Admin area" | 6 | + = render "layouts/head_panel", title: "Admin area" |
7 | .container | 7 | .container |
8 | %ul.main_menu | 8 | %ul.main_menu |
9 | - %li.home{:class => tab_class(:admin_root)} | 9 | + %li.home{class: tab_class(:admin_root)} |
10 | = link_to "Stats", admin_root_path | 10 | = link_to "Stats", admin_root_path |
11 | - %li{:class => tab_class(:admin_projects)} | 11 | + %li{class: tab_class(:admin_projects)} |
12 | = link_to "Projects", admin_projects_path | 12 | = link_to "Projects", admin_projects_path |
13 | - %li{:class => tab_class(:admin_users)} | 13 | + %li{class: tab_class(:admin_users)} |
14 | = link_to "Users", admin_users_path | 14 | = link_to "Users", admin_users_path |
15 | - %li{:class => tab_class(:admin_logs)} | 15 | + %li{class: tab_class(:admin_logs)} |
16 | = link_to "Logs", admin_logs_path | 16 | = link_to "Logs", admin_logs_path |
17 | - %li{:class => tab_class(:admin_emails)} | 17 | + %li{class: tab_class(:admin_emails)} |
18 | = link_to "Hooks", admin_hooks_path | 18 | = link_to "Hooks", admin_hooks_path |
19 | - %li{:class => tab_class(:admin_resque)} | 19 | + %li{class: tab_class(:admin_resque)} |
20 | = link_to "Resque", admin_resque_path | 20 | = link_to "Resque", admin_resque_path |
21 | 21 | ||
22 | .content= yield | 22 | .content= yield |
app/views/layouts/application.html.haml
1 | !!! 5 | 1 | !!! 5 |
2 | -%html{ :lang => "en"} | 2 | +%html{ lang: "en"} |
3 | = render "layouts/head" | 3 | = render "layouts/head" |
4 | - %body{:class => "#{app_theme} application"} | 4 | + %body{class: "#{app_theme} application"} |
5 | = render "layouts/flash" | 5 | = render "layouts/flash" |
6 | - = render "layouts/head_panel", :title => "Dashboard" | 6 | + = render "layouts/head_panel", title: "Dashboard" |
7 | .container | 7 | .container |
8 | - = render :partial => "layouts/app_menu" | 8 | + = render partial: "layouts/app_menu" |
9 | .content | 9 | .content |
10 | = yield | 10 | = yield |
app/views/layouts/devise_layout.html.haml
app/views/layouts/error.html.haml
1 | !!! 5 | 1 | !!! 5 |
2 | -%html{ :lang => "en"} | 2 | +%html{ lang: "en"} |
3 | = render "layouts/head" | 3 | = render "layouts/head" |
4 | - %body{:class => "#{app_theme} application"} | 4 | + %body{class: "#{app_theme} application"} |
5 | = render "layouts/flash" | 5 | = render "layouts/flash" |
6 | - = render "layouts/head_panel", :title => "" | 6 | + = render "layouts/head_panel", title: "" |
7 | .container | 7 | .container |
8 | .content | 8 | .content |
9 | %br | 9 | %br |
app/views/layouts/notify.html.haml
1 | -%html{:lang => "en"} | 1 | +%html{lang: "en"} |
2 | %head | 2 | %head |
3 | - %meta{:content => "text/html; charset=utf-8", "http-equiv" => "Content-Type"} | 3 | + %meta{content: "text/html; charset=utf-8", "http-equiv" => "Content-Type"} |
4 | %title | 4 | %title |
5 | gitlabhq | 5 | gitlabhq |
6 | :css | 6 | :css |
@@ -11,28 +11,28 @@ | @@ -11,28 +11,28 @@ | ||
11 | .content a {color: #0eb6ce; text-decoration: none;} | 11 | .content a {color: #0eb6ce; text-decoration: none;} |
12 | .footer p {font-size: 11px; color:#7d7a7a; margin: 0; padding: 0; font-family: Helvetica, Arial, sans-serif;} | 12 | .footer p {font-size: 11px; color:#7d7a7a; margin: 0; padding: 0; font-family: Helvetica, Arial, sans-serif;} |
13 | .footer a {color: #0eb6ce; text-decoration: none;} | 13 | .footer a {color: #0eb6ce; text-decoration: none;} |
14 | - %body{:bgcolor => "#EAEAEA", :style => "margin: 0; padding: 0; background: #EAEAEA"} | ||
15 | - %table{:align => "center", :border => "0", :cellpadding => "0", :cellspacing => "0", :style => "padding: 35px 0; background: #EAEAEA;", :width => "100%"} | 14 | + %body{bgcolor: "#EAEAEA", style: "margin: 0; padding: 0; background: #EAEAEA"} |
15 | + %table{align: "center", border: "0", cellpadding: "0", cellspacing: "0", style: "padding: 35px 0; background: #EAEAEA;", width: "100%"} | ||
16 | %tr | 16 | %tr |
17 | - %td{:align => "center", :style => "margin: 0; padding: 0; background: #EAEAEA;"} | ||
18 | - %table.header{:align => "center", :border => "0", :cellpadding => "0", :cellspacing => "0", :style => "font-family: Helvetica, Arial, sans-serif; background:#333", :width => "600"} | 17 | + %td{align: "center", style: "margin: 0; padding: 0; background: #EAEAEA;"} |
18 | + %table.header{align: "center", border: "0", cellpadding: "0", cellspacing: "0", style: "font-family: Helvetica, Arial, sans-serif; background:#333", width: "600"} | ||
19 | %tr | 19 | %tr |
20 | - %td{:style => "font-size: 0px;", :width => "20"} | 20 | + %td{style: "font-size: 0px;", width: "20"} |
21 | \ | 21 | \ |
22 | - %td{:align => "left", :style => "padding: 18px 0 10px;", :width => "580"} | ||
23 | - %h1{:style => "color: #BBBBBB; font: normal 32px Helvetica, Arial, sans-serif; margin: 0; padding: 0; line-height: 40px;"} | 22 | + %td{align: "left", style: "padding: 18px 0 10px;", width: "580"} |
23 | + %h1{style: "color: #BBBBBB; font: normal 32px Helvetica, Arial, sans-serif; margin: 0; padding: 0; line-height: 40px;"} | ||
24 | gitlab | 24 | gitlab |
25 | - if @project | 25 | - if @project |
26 | | #{@project.name} | 26 | | #{@project.name} |
27 | - %table{:align => "center", :bgcolor => "#fff", :border => "0", :cellpadding => "0", :cellspacing => "0", :style => "font-family: Helvetica, Arial, sans-serif; background: #fff;", :width => "600"} | 27 | + %table{align: "center", bgcolor: "#fff", border: "0", cellpadding: "0", cellspacing: "0", style: "font-family: Helvetica, Arial, sans-serif; background: #fff;", width: "600"} |
28 | %tr= yield | 28 | %tr= yield |
29 | %tr | 29 | %tr |
30 | - %td{:align => "left", :colspan => "2", :height => "3", :style => "padding: font-size: 0; line-height: 0; height: 3px;", :width => "600"} | ||
31 | - %table.footer{:align => "center", :border => "0", :cellpadding => "0", :cellspacing => "0", :style => "font-family: Helvetica, Arial, sans-serif; line-height: 10px;", :width => "600"} | 30 | + %td{align: "left", colspan: "2", height: "3", style: "padding: font-size: 0; line-height: 0; height: 3px;", width: "600"} |
31 | + %table.footer{align: "center", border: "0", cellpadding: "0", cellspacing: "0", style: "font-family: Helvetica, Arial, sans-serif; line-height: 10px;", width: "600"} | ||
32 | %tr | 32 | %tr |
33 | - %td{:align => "center", :style => "padding: 5px 0 10px; font-size: 11px; color:#7d7a7a; margin: 0; line-height: 1.2;font-family: Helvetica, Arial, sans-serif;", :valign => "top"} | 33 | + %td{align: "center", style: "padding: 5px 0 10px; font-size: 11px; color:#7d7a7a; margin: 0; line-height: 1.2;font-family: Helvetica, Arial, sans-serif;", valign: "top"} |
34 | %br | 34 | %br |
35 | - %p{:style => "font-size: 11px; color:#7d7a7a; margin: 0; padding: 0; font-family: Helvetica, Arial, sans-serif;"} | 35 | + %p{style: "font-size: 11px; color:#7d7a7a; margin: 0; padding: 0; font-family: Helvetica, Arial, sans-serif;"} |
36 | You're receiving this notification because you are a member of the | 36 | You're receiving this notification because you are a member of the |
37 | - if @project | 37 | - if @project |
38 | #{@project.name} | 38 | #{@project.name} |
app/views/layouts/profile.html.haml
1 | !!! 5 | 1 | !!! 5 |
2 | -%html{ :lang => "en"} | 2 | +%html{ lang: "en"} |
3 | = render "layouts/head" | 3 | = render "layouts/head" |
4 | - %body{:class => "#{app_theme} profile"} | 4 | + %body{class: "#{app_theme} profile"} |
5 | = render "layouts/flash" | 5 | = render "layouts/flash" |
6 | - = render "layouts/head_panel", :title => "Profile" | 6 | + = render "layouts/head_panel", title: "Profile" |
7 | .container | 7 | .container |
8 | %ul.main_menu | 8 | %ul.main_menu |
9 | - %li.home{:class => tab_class(:profile)} | 9 | + %li.home{class: tab_class(:profile)} |
10 | = link_to "Profile", profile_path | 10 | = link_to "Profile", profile_path |
11 | 11 | ||
12 | - %li{:class => tab_class(:password)} | 12 | + %li{class: tab_class(:password)} |
13 | = link_to "Password", profile_password_path | 13 | = link_to "Password", profile_password_path |
14 | 14 | ||
15 | - %li{:class => tab_class(:ssh_keys)} | 15 | + %li{class: tab_class(:ssh_keys)} |
16 | = link_to keys_path do | 16 | = link_to keys_path do |
17 | SSH Keys | 17 | SSH Keys |
18 | %span.count= current_user.keys.count | 18 | %span.count= current_user.keys.count |
19 | 19 | ||
20 | - %li{:class => tab_class(:token)} | 20 | + %li{class: tab_class(:token)} |
21 | = link_to "Token", profile_token_path | 21 | = link_to "Token", profile_token_path |
22 | 22 | ||
23 | - %li{:class => tab_class(:design)} | 23 | + %li{class: tab_class(:design)} |
24 | = link_to "Design", profile_design_path | 24 | = link_to "Design", profile_design_path |
25 | 25 | ||
26 | 26 |
app/views/layouts/project.html.haml
1 | !!! 5 | 1 | !!! 5 |
2 | -%html{ :lang => "en"} | 2 | +%html{ lang: "en"} |
3 | = render "layouts/head" | 3 | = render "layouts/head" |
4 | - %body{:class => "#{app_theme} project"} | 4 | + %body{class: "#{app_theme} project"} |
5 | = render "layouts/flash" | 5 | = render "layouts/flash" |
6 | - = render "layouts/head_panel", :title => @project.name | 6 | + = render "layouts/head_panel", title: @project.name |
7 | .container | 7 | .container |
8 | - = render :partial => "layouts/project_menu" | 8 | + = render partial: "layouts/project_menu" |
9 | .content | 9 | .content |
10 | = yield | 10 | = yield |
11 | 11 |
app/views/merge_requests/_form.html.haml
1 | -= form_for [@project, @merge_request], :html => { :class => "new_merge_request form-horizontal" } do |f| | 1 | += form_for [@project, @merge_request], html: { class: "new_merge_request form-horizontal" } do |f| |
2 | -if @merge_request.errors.any? | 2 | -if @merge_request.errors.any? |
3 | .alert-message.block-message.error | 3 | .alert-message.block-message.error |
4 | %ul | 4 | %ul |
@@ -14,9 +14,9 @@ | @@ -14,9 +14,9 @@ | ||
14 | %h5 From (Head Branch) | 14 | %h5 From (Head Branch) |
15 | .body | 15 | .body |
16 | .padded | 16 | .padded |
17 | - = f.label :source_branch, "From", :class => "control-label" | 17 | + = f.label :source_branch, "From", class: "control-label" |
18 | .controls | 18 | .controls |
19 | - = f.select(:source_branch, @project.heads.map(&:name), { :include_blank => "Select branch" }, :style => "width:250px") | 19 | + = f.select(:source_branch, @project.heads.map(&:name), { include_blank: "Select branch" }, style: "width:250px") |
20 | .bottom_commit | 20 | .bottom_commit |
21 | .mr_source_commit | 21 | .mr_source_commit |
22 | 22 | ||
@@ -25,9 +25,9 @@ | @@ -25,9 +25,9 @@ | ||
25 | %h5 To (Base Branch) | 25 | %h5 To (Base Branch) |
26 | .body | 26 | .body |
27 | .padded | 27 | .padded |
28 | - = f.label :target_branch, "To", :class => "control-label" | 28 | + = f.label :target_branch, "To", class: "control-label" |
29 | .controls | 29 | .controls |
30 | - = f.select(:target_branch, @project.heads.map(&:name), { :include_blank => "Select branch" }, :style => "width:250px") | 30 | + = f.select(:target_branch, @project.heads.map(&:name), { include_blank: "Select branch" }, style: "width:250px") |
31 | .bottom_commit | 31 | .bottom_commit |
32 | .mr_target_commit | 32 | .mr_target_commit |
33 | 33 | ||
@@ -38,22 +38,22 @@ | @@ -38,22 +38,22 @@ | ||
38 | .top_box_content | 38 | .top_box_content |
39 | = f.label :title do | 39 | = f.label :title do |
40 | %strong= "Title *" | 40 | %strong= "Title *" |
41 | - .input= f.text_field :title, :class => "input-xxlarge pad", :maxlength => 255, :rows => 5 | 41 | + .input= f.text_field :title, class: "input-xxlarge pad", maxlength: 255, rows: 5 |
42 | .middle_box_content | 42 | .middle_box_content |
43 | = f.label :assignee_id do | 43 | = f.label :assignee_id do |
44 | %i.icon-user | 44 | %i.icon-user |
45 | Assign to | 45 | Assign to |
46 | - .input= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" }, :style => "width:250px") | 46 | + .input= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { include_blank: "Select user" }, style: "width:250px") |
47 | 47 | ||
48 | .control-group | 48 | .control-group |
49 | 49 | ||
50 | .form-actions | 50 | .form-actions |
51 | - = f.submit 'Save', :class => "btn-primary btn" | 51 | + = f.submit 'Save', class: "btn-primary btn" |
52 | - if @merge_request.new_record? | 52 | - if @merge_request.new_record? |
53 | - = link_to project_merge_requests_path(@project), :class => "btn" do | 53 | + = link_to project_merge_requests_path(@project), class: "btn" do |
54 | Cancel | 54 | Cancel |
55 | - else | 55 | - else |
56 | - = link_to project_merge_request_path(@project, @merge_request), :class => "btn" do | 56 | + = link_to project_merge_request_path(@project, @merge_request), class: "btn" do |
57 | Cancel | 57 | Cancel |
58 | 58 | ||
59 | 59 |
app/views/merge_requests/_head.html.haml
1 | .top-tabs | 1 | .top-tabs |
2 | - = link_to project_merge_requests_path(@project), :class => "tab #{'active' if current_page?(project_merge_requests_path(@project)) }" do | 2 | + = link_to project_merge_requests_path(@project), class: "tab #{'active' if current_page?(project_merge_requests_path(@project)) }" do |
3 | %span | 3 | %span |
4 | Merge Requests | 4 | Merge Requests |
5 | 5 |
app/views/merge_requests/_merge_request.html.haml
1 | -%li.wll{ :class => mr_css_classes(merge_request) } | 1 | +%li.wll{ class: mr_css_classes(merge_request) } |
2 | .right | 2 | .right |
3 | .left | 3 | .left |
4 | - if merge_request.merged? | 4 | - if merge_request.merged? |
@@ -14,9 +14,9 @@ | @@ -14,9 +14,9 @@ | ||
14 | = merge_request.source_branch | 14 | = merge_request.source_branch |
15 | → | 15 | → |
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_gfm 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.html.haml
@@ -7,16 +7,16 @@ | @@ -7,16 +7,16 @@ | ||
7 | - if @commits.present? | 7 | - if @commits.present? |
8 | %ul.nav.nav-tabs.mr_nav_tabs | 8 | %ul.nav.nav-tabs.mr_nav_tabs |
9 | %li | 9 | %li |
10 | - = link_to "#notes", "data-url" => project_merge_request_path(@project, @merge_request), :class => "merge-notes-tab tab" do | 10 | + = link_to "#notes", "data-url" => project_merge_request_path(@project, @merge_request), class: "merge-notes-tab tab" do |
11 | %i.icon-comment | 11 | %i.icon-comment |
12 | Comments | 12 | Comments |
13 | %li | 13 | %li |
14 | - = link_to "#diffs", "data-url" => diffs_project_merge_request_path(@project, @merge_request), :class => "merge-diffs-tab tab" do | 14 | + = link_to "#diffs", "data-url" => diffs_project_merge_request_path(@project, @merge_request), class: "merge-diffs-tab tab" do |
15 | %i.icon-list-alt | 15 | %i.icon-list-alt |
16 | Diff | 16 | Diff |
17 | 17 | ||
18 | -.merge_request_notes#notes{ :class => (controller.action_name == 'show') ? "" : "hide" } | ||
19 | - = render("notes/notes", :tid => @merge_request.id, :tt => "merge_request") | 18 | +.merge_request_notes#notes{ class: (controller.action_name == 'show') ? "" : "hide" } |
19 | + = render("notes/notes", tid: @merge_request.id, tt: "merge_request") | ||
20 | .merge-request-diffs | 20 | .merge-request-diffs |
21 | = render "merge_requests/show/diffs" if @diffs | 21 | = render "merge_requests/show/diffs" if @diffs |
22 | .status | 22 | .status |
app/views/merge_requests/branch_from.js.haml
app/views/merge_requests/branch_to.js.haml
app/views/merge_requests/commits.js.haml
app/views/merge_requests/diffs.js.haml
app/views/merge_requests/index.html.haml
1 | %h3.page_title | 1 | %h3.page_title |
2 | Merge Requests | 2 | Merge Requests |
3 | - if can? current_user, :write_issue, @project | 3 | - if can? current_user, :write_issue, @project |
4 | - = link_to new_project_merge_request_path(@project), :class => "right btn small", :title => "New Merge Request" do | 4 | + = link_to new_project_merge_request_path(@project), class: "right btn small", title: "New Merge Request" do |
5 | New Merge Request | 5 | New Merge Request |
6 | 6 | ||
7 | %br | 7 | %br |
@@ -10,17 +10,17 @@ | @@ -10,17 +10,17 @@ | ||
10 | .ui-box | 10 | .ui-box |
11 | .title | 11 | .title |
12 | %ul.nav.nav-pills | 12 | %ul.nav.nav-pills |
13 | - %li{:class => ("active" if (params[:f] == "0" || !params[:f]))} | ||
14 | - = link_to project_merge_requests_path(@project, :f => 0) do | 13 | + %li{class: ("active" if (params[:f] == "0" || !params[:f]))} |
14 | + = link_to project_merge_requests_path(@project, f: 0) do | ||
15 | Open | 15 | Open |
16 | - %li{:class => ("active" if params[:f] == "2")} | ||
17 | - = link_to project_merge_requests_path(@project, :f => 2) do | 16 | + %li{class: ("active" if params[:f] == "2")} |
17 | + = link_to project_merge_requests_path(@project, f: 2) do | ||
18 | Closed | 18 | Closed |
19 | - %li{:class => ("active" if params[:f] == "3")} | ||
20 | - = link_to project_merge_requests_path(@project, :f => 3) do | 19 | + %li{class: ("active" if params[:f] == "3")} |
20 | + = link_to project_merge_requests_path(@project, f: 3) do | ||
21 | To Me | 21 | To Me |
22 | - %li{:class => ("active" if params[:f] == "1")} | ||
23 | - = link_to project_merge_requests_path(@project, :f => 1) do | 22 | + %li{class: ("active" if params[:f] == "1")} |
23 | + = link_to project_merge_requests_path(@project, f: 1) do | ||
24 | All | 24 | All |
25 | 25 | ||
26 | %ul.unstyled | 26 | %ul.unstyled |
@@ -31,7 +31,7 @@ | @@ -31,7 +31,7 @@ | ||
31 | - if @merge_requests.present? | 31 | - if @merge_requests.present? |
32 | %li.bottom | 32 | %li.bottom |
33 | .row | 33 | .row |
34 | - .span7= paginate @merge_requests, :theme => "gitlab" | 34 | + .span7= paginate @merge_requests, theme: "gitlab" |
35 | .span4.right | 35 | .span4.right |
36 | %span.cgray.right #{@merge_requests.total_count} merge requests for this filter | 36 | %span.cgray.right #{@merge_requests.total_count} merge requests for this filter |
37 | 37 |
app/views/merge_requests/show.js.haml
app/views/merge_requests/show/_commits.html.haml
@@ -7,19 +7,19 @@ | @@ -7,19 +7,19 @@ | ||
7 | - if @commits.count > 8 | 7 | - if @commits.count > 8 |
8 | %ul.first_mr_commits.unstyled | 8 | %ul.first_mr_commits.unstyled |
9 | - @commits.first(8).each do |commit| | 9 | - @commits.first(8).each do |commit| |
10 | - = render "commits/commit", :commit => commit | 10 | + = render "commits/commit", commit: commit |
11 | %li.bottom | 11 | %li.bottom |
12 | 8 of #{@commits.count} commits displayed. | 12 | 8 of #{@commits.count} commits displayed. |
13 | %strong | 13 | %strong |
14 | %a.mr_show_all_commits Click here to show all | 14 | %a.mr_show_all_commits Click here to show all |
15 | %ul.all_mr_commits.hide.unstyled | 15 | %ul.all_mr_commits.hide.unstyled |
16 | - @commits.each do |commit| | 16 | - @commits.each do |commit| |
17 | - = render "commits/commit", :commit => commit | 17 | + = render "commits/commit", commit: commit |
18 | 18 | ||
19 | - else | 19 | - else |
20 | %ul.unstyled | 20 | %ul.unstyled |
21 | - @commits.each do |commit| | 21 | - @commits.each do |commit| |
22 | - = render "commits/commit", :commit => commit | 22 | + = render "commits/commit", commit: commit |
23 | 23 | ||
24 | - else | 24 | - else |
25 | %h5 | 25 | %h5 |
app/views/merge_requests/show/_diffs.html.haml
1 | - if @merge_request.valid_diffs? | 1 | - if @merge_request.valid_diffs? |
2 | - = render "commits/diffs", :diffs => @diffs | 2 | + = render "commits/diffs", diffs: @diffs |
3 | - elsif @merge_request.broken_diffs? | 3 | - elsif @merge_request.broken_diffs? |
4 | %h4.nothing_here_message | 4 | %h4.nothing_here_message |
5 | Can't load diff. | 5 | Can't load diff. |
6 | - You can #{link_to "download MR patch", raw_project_merge_request_path(@project, @merge_request), :class => "vlink"} instead. | 6 | + You can #{link_to "download MR patch", raw_project_merge_request_path(@project, @merge_request), class: "vlink"} instead. |
7 | - else | 7 | - else |
8 | %h4.nothing_here_message Nothing to merge | 8 | %h4.nothing_here_message Nothing to merge |
app/views/merge_requests/show/_how_to_merge.html.haml
app/views/merge_requests/show/_mr_accept.html.haml
@@ -4,29 +4,29 @@ | @@ -4,29 +4,29 @@ | ||
4 | 4 | ||
5 | 5 | ||
6 | - if @merge_request.open? && @commits.any? && can?(current_user, :accept_mr, @project) | 6 | - if @merge_request.open? && @commits.any? && can?(current_user, :accept_mr, @project) |
7 | - .automerge_widget.can_be_merged{:style => "display:none"} | 7 | + .automerge_widget.can_be_merged{style: "display:none"} |
8 | .alert.alert-success | 8 | .alert.alert-success |
9 | %span | 9 | %span |
10 | - = form_for [:automerge, @project, @merge_request], :remote => true, :method => :get do |f| | 10 | + = form_for [:automerge, @project, @merge_request], remote: true, method: :get do |f| |
11 | %p | 11 | %p |
12 | You can accept this request automatically. | 12 | You can accept this request automatically. |
13 | If you still want to do it manually - | 13 | If you still want to do it manually - |
14 | - %strong= link_to "click here", "#", :class => "how_to_merge_link vlink", :title => "How To Merge" | 14 | + %strong= link_to "click here", "#", class: "how_to_merge_link vlink", title: "How To Merge" |
15 | for instructions | 15 | for instructions |
16 | .accept_group | 16 | .accept_group |
17 | - = f.submit "Accept Merge Request", :class => "btn small success accept_merge_request" | 17 | + = f.submit "Accept Merge Request", class: "btn small success accept_merge_request" |
18 | - unless @project.root_ref? @merge_request.source_branch | 18 | - unless @project.root_ref? @merge_request.source_branch |
19 | .remove_branch_holder | 19 | .remove_branch_holder |
20 | - = label_tag :should_remove_source_branch, :class => "checkbox" do | 20 | + = label_tag :should_remove_source_branch, class: "checkbox" do |
21 | = check_box_tag :should_remove_source_branch | 21 | = check_box_tag :should_remove_source_branch |
22 | Remove source-branch | 22 | Remove source-branch |
23 | .clearfix | 23 | .clearfix |
24 | 24 | ||
25 | 25 | ||
26 | - .automerge_widget.cannot_be_merged{:style => "display:none"} | 26 | + .automerge_widget.cannot_be_merged{style: "display:none"} |
27 | .alert.alert-info | 27 | .alert.alert-info |
28 | %span | 28 | %span |
29 | - = link_to "Show how to merge", "#", :class => "how_to_merge_link btn small padded", :title => "How To Merge" | 29 | + = link_to "Show how to merge", "#", class: "how_to_merge_link btn small padded", title: "How To Merge" |
30 | | 30 | |
31 | %strong This request cant be merged with GitLab. You should do it manually | 31 | %strong This request cant be merged with GitLab. You should do it manually |
32 | 32 | ||
@@ -36,7 +36,7 @@ | @@ -36,7 +36,7 @@ | ||
36 | %i.icon-refresh | 36 | %i.icon-refresh |
37 | Checking for ability to automatically merge… | 37 | Checking for ability to automatically merge… |
38 | 38 | ||
39 | - .automerge_widget.already_cannot_be_merged{:style => "display:none"} | 39 | + .automerge_widget.already_cannot_be_merged{style: "display:none"} |
40 | .alert.alert-info | 40 | .alert.alert-info |
41 | %strong This merge request already can not be merged. Try to reload page. | 41 | %strong This merge request already can not be merged. Try to reload page. |
42 | 42 |
app/views/merge_requests/show/_mr_box.html.haml
@@ -10,12 +10,12 @@ | @@ -10,12 +10,12 @@ | ||
10 | .middle_box_content | 10 | .middle_box_content |
11 | %div | 11 | %div |
12 | %cite.cgray Created at #{@merge_request.created_at.stamp("Aug 21, 2011")} by | 12 | %cite.cgray Created at #{@merge_request.created_at.stamp("Aug 21, 2011")} by |
13 | - = image_tag gravatar_icon(@merge_request.author_email), :width => 16, :class => "lil_av" | 13 | + = image_tag gravatar_icon(@merge_request.author_email), width: 16, class: "lil_av" |
14 | %strong.author= link_to_merge_request_author(@merge_request) | 14 | %strong.author= link_to_merge_request_author(@merge_request) |
15 | 15 | ||
16 | - if @merge_request.assignee | 16 | - if @merge_request.assignee |
17 | %cite.cgray and currently assigned to | 17 | %cite.cgray and currently assigned to |
18 | - = image_tag gravatar_icon(@merge_request.assignee_email), :width => 16, :class => "lil_av" | 18 | + = image_tag gravatar_icon(@merge_request.assignee_email), width: 16, class: "lil_av" |
19 | %strong.author= link_to_merge_request_assignee(@merge_request) | 19 | %strong.author= link_to_merge_request_assignee(@merge_request) |
20 | 20 | ||
21 | 21 |
app/views/merge_requests/show/_mr_title.html.haml
@@ -13,13 +13,13 @@ | @@ -13,13 +13,13 @@ | ||
13 | = "MERGED" | 13 | = "MERGED" |
14 | - if can?(current_user, :modify_merge_request, @merge_request) | 14 | - if can?(current_user, :modify_merge_request, @merge_request) |
15 | - if @merge_request.open? | 15 | - if @merge_request.open? |
16 | - = link_to raw_project_merge_request_path(@project, @merge_request), :class => "btn grouped" do | 16 | + = link_to raw_project_merge_request_path(@project, @merge_request), class: "btn grouped" do |
17 | %i.icon-download-alt | 17 | %i.icon-download-alt |
18 | Get Patch | 18 | Get Patch |
19 | 19 | ||
20 | - = link_to 'Close', project_merge_request_path(@project, @merge_request, :merge_request => {:closed => true }, :status_only => true), :method => :put, :class => "btn grouped danger", :title => "Close merge request" | 20 | + = link_to 'Close', project_merge_request_path(@project, @merge_request, merge_request: {closed: true }, status_only: true), method: :put, class: "btn grouped danger", title: "Close merge request" |
21 | 21 | ||
22 | - = link_to edit_project_merge_request_path(@project, @merge_request), :class => "btn grouped" do | 22 | + = link_to edit_project_merge_request_path(@project, @merge_request), class: "btn grouped" do |
23 | %i.icon-edit | 23 | %i.icon-edit |
24 | Edit | 24 | Edit |
25 | 25 |
app/views/milestones/_form.html.haml
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | 5 | ||
6 | %hr | 6 | %hr |
7 | 7 | ||
8 | -= form_for [@project, @milestone], :html => {:class => "new_milestone form-horizontal"} do |f| | 8 | += form_for [@project, @milestone], html: {class: "new_milestone form-horizontal"} do |f| |
9 | -if @milestone.errors.any? | 9 | -if @milestone.errors.any? |
10 | .alert-message.block-message.error | 10 | .alert-message.block-message.error |
11 | %ul | 11 | %ul |
@@ -14,35 +14,35 @@ | @@ -14,35 +14,35 @@ | ||
14 | .row | 14 | .row |
15 | .span6 | 15 | .span6 |
16 | .control-group | 16 | .control-group |
17 | - = f.label :title, "Title", :class => "control-label" | 17 | + = f.label :title, "Title", class: "control-label" |
18 | .controls | 18 | .controls |
19 | - = f.text_field :title, :maxlength => 255, :class => "input-xlarge" | 19 | + = f.text_field :title, maxlength: 255, class: "input-xlarge" |
20 | %p.help-block Required | 20 | %p.help-block Required |
21 | .control-group | 21 | .control-group |
22 | - = f.label :description, "Description", :class => "control-label" | 22 | + = f.label :description, "Description", class: "control-label" |
23 | .controls | 23 | .controls |
24 | - = f.text_area :description, :maxlength => 2000, :class => "input-xlarge", :rows => 10 | 24 | + = f.text_area :description, maxlength: 2000, class: "input-xlarge", rows: 10 |
25 | %p.help-block Markdown is enabled. | 25 | %p.help-block Markdown is enabled. |
26 | .span6 | 26 | .span6 |
27 | .control-group | 27 | .control-group |
28 | - = f.label :due_date, "Due Date", :class => "control-label" | 28 | + = f.label :due_date, "Due Date", class: "control-label" |
29 | .input= f.hidden_field :due_date | 29 | .input= f.hidden_field :due_date |
30 | .controls | 30 | .controls |
31 | .datepicker | 31 | .datepicker |
32 | 32 | ||
33 | .form-actions | 33 | .form-actions |
34 | - if @milestone.new_record? | 34 | - if @milestone.new_record? |
35 | - = f.submit 'Create milestone', :class => "primary btn" | 35 | + = f.submit 'Create milestone', class: "primary btn" |
36 | -else | 36 | -else |
37 | - = f.submit 'Save changes', :class => "primary btn" | 37 | + = f.submit 'Save changes', class: "primary btn" |
38 | 38 | ||
39 | - if request.xhr? | 39 | - if request.xhr? |
40 | - = link_to "Cancel", "#back", :onclick => "backToIssues();", :class => "btn" | 40 | + = link_to "Cancel", "#back", onclick: "backToIssues();", class: "btn" |
41 | - else | 41 | - else |
42 | - if @milestone.new_record? | 42 | - if @milestone.new_record? |
43 | - = link_to "Cancel", project_milestones_path(@project), :class => "btn" | 43 | + = link_to "Cancel", project_milestones_path(@project), class: "btn" |
44 | - else | 44 | - else |
45 | - = link_to "Cancel", project_milestone_path(@project, @milestone), :class => "btn" | 45 | + = link_to "Cancel", project_milestone_path(@project, @milestone), class: "btn" |
46 | 46 | ||
47 | :javascript | 47 | :javascript |
48 | $(function() { | 48 | $(function() { |
app/views/milestones/_milestone.html.haml
1 | -%li{:class => "milestone", :id => dom_id(milestone) } | 1 | +%li{class: "milestone", id: dom_id(milestone) } |
2 | .right | 2 | .right |
3 | - if milestone.issues.any? | 3 | - if milestone.issues.any? |
4 | %span.btn.small.disabled.grouped= pluralize milestone.issues.count, 'issues' | 4 | %span.btn.small.disabled.grouped= pluralize milestone.issues.count, 'issues' |
5 | - if milestone.issues.count > 0 | 5 | - if milestone.issues.count > 0 |
6 | - = link_to 'Browse Issues', project_issues_path(milestone.project, :milestone_id => milestone.id), :class => "btn small grouped" | 6 | + = link_to 'Browse Issues', project_issues_path(milestone.project, milestone_id: milestone.id), class: "btn small grouped" |
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_gfm 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 |
14 | .progress.progress-success.span3 | 14 | .progress.progress-success.span3 |
15 | - .bar{:style => "width: #{milestone.percent_complete}%;"} | 15 | + .bar{style: "width: #{milestone.percent_complete}%;"} |
16 | 16 | ||
17 | 17 | ||
18 | | 18 | |
app/views/milestones/index.html.haml
@@ -3,23 +3,23 @@ | @@ -3,23 +3,23 @@ | ||
3 | %h3.page_title | 3 | %h3.page_title |
4 | Milestones | 4 | Milestones |
5 | - if can? current_user, :admin_milestone, @project | 5 | - if can? current_user, :admin_milestone, @project |
6 | - = link_to "New Milestone", new_project_milestone_path(@project), :class => "right btn small", :title => "New Milestone" | 6 | + = link_to "New Milestone", new_project_milestone_path(@project), class: "right btn small", title: "New Milestone" |
7 | %br | 7 | %br |
8 | %div.ui-box | 8 | %div.ui-box |
9 | .title | 9 | .title |
10 | %ul.nav.nav-pills | 10 | %ul.nav.nav-pills |
11 | - %li{:class => ("active" if (params[:f] == "0" || !params[:f]))} | ||
12 | - = link_to project_milestones_path(@project, :f => 0) do | 11 | + %li{class: ("active" if (params[:f] == "0" || !params[:f]))} |
12 | + = link_to project_milestones_path(@project, f: 0) do | ||
13 | Active | 13 | Active |
14 | - %li{:class => ("active" if params[:f] == "1")} | ||
15 | - = link_to project_milestones_path(@project, :f => 1) do | 14 | + %li{class: ("active" if params[:f] == "1")} |
15 | + = link_to project_milestones_path(@project, f: 1) do | ||
16 | All | 16 | All |
17 | 17 | ||
18 | %ul.unstyled | 18 | %ul.unstyled |
19 | = render @milestones | 19 | = render @milestones |
20 | 20 | ||
21 | - if @milestones.present? | 21 | - if @milestones.present? |
22 | - %li.bottom= paginate @milestones, :remote => true, :theme => "gitlab" | 22 | + %li.bottom= paginate @milestones, remote: true, theme: "gitlab" |
23 | - else | 23 | - else |
24 | %li | 24 | %li |
25 | %h3.nothing_here_message Nothing to show here | 25 | %h3.nothing_here_message Nothing to show here |
app/views/milestones/show.html.haml
@@ -4,9 +4,9 @@ | @@ -4,9 +4,9 @@ | ||
4 | = @milestone.expires_at | 4 | = @milestone.expires_at |
5 | 5 | ||
6 | %span.right | 6 | %span.right |
7 | - = link_to 'Browse Issues', project_issues_path(@milestone.project, :milestone_id => @milestone.id), :class => "btn edit-milestone-link small grouped" | 7 | + = link_to 'Browse Issues', project_issues_path(@milestone.project, milestone_id: @milestone.id), class: "btn edit-milestone-link small grouped" |
8 | - if can?(current_user, :admin_milestone, @project) | 8 | - if can?(current_user, :admin_milestone, @project) |
9 | - = link_to edit_project_milestone_path(@project, @milestone), :class => "btn small grouped" do | 9 | + = link_to edit_project_milestone_path(@project, @milestone), class: "btn small grouped" do |
10 | %i.icon-edit | 10 | %i.icon-edit |
11 | Edit | 11 | Edit |
12 | 12 | ||
@@ -32,7 +32,7 @@ | @@ -32,7 +32,7 @@ | ||
32 | – | 32 | – |
33 | #{@milestone.issues.closed.count} closed | 33 | #{@milestone.issues.closed.count} closed |
34 | .progress.progress-success | 34 | .progress.progress-success |
35 | - .bar{:style => "width: #{@milestone.percent_complete}%;"} | 35 | + .bar{style: "width: #{@milestone.percent_complete}%;"} |
36 | 36 | ||
37 | 37 | ||
38 | - if @milestone.description.present? | 38 | - if @milestone.description.present? |
@@ -51,9 +51,9 @@ | @@ -51,9 +51,9 @@ | ||
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_gfm 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 | ||
58 | .span6 | 58 | .span6 |
59 | %table.admin-table | 59 | %table.admin-table |
@@ -62,6 +62,6 @@ | @@ -62,6 +62,6 @@ | ||
62 | - @users.each do |user| | 62 | - @users.each do |user| |
63 | %tr | 63 | %tr |
64 | %td | 64 | %td |
65 | - = image_tag gravatar_icon(user.email, 24), :width => "24" | 65 | + = image_tag gravatar_icon(user.email, 24), width: "24" |
66 | | 66 | |
67 | = user.name | 67 | = user.name |
app/views/notes/_create_common.js.haml
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | :plain | 2 | :plain |
3 | $("#new_note .errors").remove(); | 3 | $("#new_note .errors").remove(); |
4 | $('#new_note textarea').val(""); | 4 | $('#new_note textarea').val(""); |
5 | - NoteList.prepend(#{note.id}, "#{escape_javascript(render :partial => "notes/show", :locals => {:note => note})}"); | 5 | + NoteList.prepend(#{note.id}, "#{escape_javascript(render partial: "notes/show", locals: {note: note})}"); |
6 | - else | 6 | - else |
7 | :plain | 7 | :plain |
8 | $("#new_note").replaceWith("#{escape_javascript(render('form'))}"); | 8 | $("#new_note").replaceWith("#{escape_javascript(render('form'))}"); |
app/views/notes/_create_line.js.haml
@@ -4,5 +4,5 @@ | @@ -4,5 +4,5 @@ | ||
4 | $('#new_note textarea').val(""); | 4 | $('#new_note textarea').val(""); |
5 | $("a.line_note_reply_link[line_code='#{note.line_code}']").closest("tr").remove(); | 5 | $("a.line_note_reply_link[line_code='#{note.line_code}']").closest("tr").remove(); |
6 | var trEl = $(".#{note.line_code}").parent(); | 6 | var trEl = $(".#{note.line_code}").parent(); |
7 | - trEl.after("#{escape_javascript(render :partial => "notes/per_line_show", :locals => {:note => note})}"); | ||
8 | - trEl.after("#{escape_javascript(render :partial => "notes/reply_button", :locals => {:line_code => note.line_code})}"); | 7 | + trEl.after("#{escape_javascript(render partial: "notes/per_line_show", locals: {note: note})}"); |
8 | + trEl.after("#{escape_javascript(render partial: "notes/reply_button", locals: {line_code: note.line_code})}"); |
app/views/notes/_form.html.haml
1 | -= form_for [@project, @note], :remote => "true", :multipart => true do |f| | 1 | += form_for [@project, @note], remote: "true", multipart: true do |f| |
2 | %h3.page_title Leave a comment | 2 | %h3.page_title Leave a comment |
3 | -if @note.errors.any? | 3 | -if @note.errors.any? |
4 | .alert-message.block-message.error | 4 | .alert-message.block-message.error |
@@ -7,16 +7,16 @@ | @@ -7,16 +7,16 @@ | ||
7 | 7 | ||
8 | = f.hidden_field :noteable_id | 8 | = f.hidden_field :noteable_id |
9 | = f.hidden_field :noteable_type | 9 | = f.hidden_field :noteable_type |
10 | - = f.text_area :note, :size => 255 | 10 | + = f.text_area :note, size: 255 |
11 | #preview-note.well.hide | 11 | #preview-note.well.hide |
12 | %p.hint | 12 | %p.hint |
13 | - = link_to "Gitlab Markdown", help_markdown_path, :target => '_blank' | 13 | + = link_to "Gitlab Markdown", help_markdown_path, target: '_blank' |
14 | is enabled. | 14 | is enabled. |
15 | - = link_to 'Preview', preview_project_notes_path(@project), :id => 'preview-link' | 15 | + = link_to 'Preview', preview_project_notes_path(@project), id: 'preview-link' |
16 | 16 | ||
17 | .row.note_advanced_opts.hide | 17 | .row.note_advanced_opts.hide |
18 | .span2 | 18 | .span2 |
19 | - = f.submit 'Add Comment', :class => "btn primary submit_note", :id => "submit_note" | 19 | + = f.submit 'Add Comment', class: "btn primary submit_note", id: "submit_note" |
20 | .span4.notify_opts | 20 | .span4.notify_opts |
21 | %h6.left Notify via email: | 21 | %h6.left Notify via email: |
22 | = label_tag :notify do | 22 | = label_tag :notify do |
@@ -33,6 +33,6 @@ | @@ -33,6 +33,6 @@ | ||
33 | 33 | ||
34 | .input.input_file | 34 | .input.input_file |
35 | %a.file_upload.btn.small Upload File | 35 | %a.file_upload.btn.small Upload File |
36 | - = f.file_field :attachment, :class => "input-file" | 36 | + = f.file_field :attachment, class: "input-file" |
37 | %span.hint Any file less than 10 MB | 37 | %span.hint Any file less than 10 MB |
38 | 38 |
app/views/notes/_load.js.haml
1 | - unless @notes.blank? | 1 | - unless @notes.blank? |
2 | - if params[:last_id] | 2 | - if params[:last_id] |
3 | :plain | 3 | :plain |
4 | - NoteList.replace("#{escape_javascript(render(:partial => 'notes/notes_list'))}"); | 4 | + NoteList.replace("#{escape_javascript(render(partial: 'notes/notes_list'))}"); |
5 | 5 | ||
6 | - elsif params[:first_id] | 6 | - elsif params[:first_id] |
7 | :plain | 7 | :plain |
8 | - NoteList.append(#{@notes.last.id}, "#{escape_javascript(render(:partial => 'notes/notes_list'))}"); | 8 | + NoteList.append(#{@notes.last.id}, "#{escape_javascript(render(partial: 'notes/notes_list'))}"); |
9 | 9 | ||
10 | - else | 10 | - else |
11 | :plain | 11 | :plain |
12 | - NoteList.setContent(#{@notes.last.id}, #{@notes.first.id}, "#{escape_javascript(render(:partial => 'notes/notes_list'))}"); | 12 | + NoteList.setContent(#{@notes.last.id}, #{@notes.first.id}, "#{escape_javascript(render(partial: 'notes/notes_list'))}"); |
13 | 13 | ||
14 | - else | 14 | - else |
15 | - if params[:first_id] | 15 | - if params[:first_id] |
app/views/notes/_notes_list.html.haml
app/views/notes/_per_line_form.html.haml
1 | -%table{:style => "display:none;"} | 1 | +%table{style: "display:none;"} |
2 | %tr.per_line_form | 2 | %tr.per_line_form |
3 | - %td{:colspan => 3 } | ||
4 | - = form_for [@project, @note], :remote => "true", :multipart => true do |f| | 3 | + %td{colspan: 3 } |
4 | + = form_for [@project, @note], remote: "true", multipart: true do |f| | ||
5 | %h3.page_title Leave a note | 5 | %h3.page_title Leave a note |
6 | %div.span10 | 6 | %div.span10 |
7 | -if @note.errors.any? | 7 | -if @note.errors.any? |
@@ -12,11 +12,11 @@ | @@ -12,11 +12,11 @@ | ||
12 | = f.hidden_field :noteable_id | 12 | = f.hidden_field :noteable_id |
13 | = f.hidden_field :noteable_type | 13 | = f.hidden_field :noteable_type |
14 | = f.hidden_field :line_code | 14 | = f.hidden_field :line_code |
15 | - = f.text_area :note, :size => 255 | 15 | + = f.text_area :note, size: 255 |
16 | .note_actions | 16 | .note_actions |
17 | .buttons | 17 | .buttons |
18 | - = f.submit 'Add note', :class => "btn primary submit_note", :id => "submit_note" | ||
19 | - = link_to "Cancel", "#", :class => "btn hide-button" | 18 | + = f.submit 'Add note', class: "btn primary submit_note", id: "submit_note" |
19 | + = link_to "Cancel", "#", class: "btn hide-button" | ||
20 | .options | 20 | .options |
21 | %h6.left Notify via email: | 21 | %h6.left Notify via email: |
22 | .labels | 22 | .labels |
app/views/notes/_per_line_show.html.haml
app/views/notes/_reply_button.html.haml
1 | %tr.line_notes_row.reply | 1 | %tr.line_notes_row.reply |
2 | - %td{:colspan => 3} | 2 | + %td{colspan: 3} |
3 | %i.icon-comment | 3 | %i.icon-comment |
4 | - = link_to "Reply", "#", :class => "line_note_reply_link", "line_code" => line_code, :title => "Add note for this line" | 4 | + = link_to "Reply", "#", class: "line_note_reply_link", "line_code" => line_code, title: "Add note for this line" |
app/views/notes/_show.html.haml
1 | -%li{:id => dom_id(note), :class => "note"} | ||
2 | - = image_tag gravatar_icon(note.author.email), :class => "avatar" | 1 | +%li{id: dom_id(note), class: "note"} |
2 | + = image_tag gravatar_icon(note.author.email), class: "avatar" | ||
3 | %div.note-author | 3 | %div.note-author |
4 | %strong= note.author_name | 4 | %strong= note.author_name |
5 | = link_to "##{dom_id(note)}", name: dom_id(note) do | 5 | = link_to "##{dom_id(note)}", name: dom_id(note) do |
@@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
7 | = time_ago_in_words(note.updated_at) | 7 | = time_ago_in_words(note.updated_at) |
8 | ago | 8 | ago |
9 | - if(note.author_id == current_user.id) || can?(current_user, :admin_note, @project) | 9 | - if(note.author_id == current_user.id) || can?(current_user, :admin_note, @project) |
10 | - = link_to [@project, note], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "cred delete-note btn very_small" do | 10 | + = link_to [@project, note], confirm: 'Are you sure?', method: :delete, remote: true, class: "cred delete-note btn very_small" do |
11 | %i.icon-trash | 11 | %i.icon-trash |
12 | Remove | 12 | Remove |
13 | 13 | ||
@@ -17,5 +17,5 @@ | @@ -17,5 +17,5 @@ | ||
17 | - if note.attachment.url | 17 | - if note.attachment.url |
18 | .right | 18 | .right |
19 | %div.file | 19 | %div.file |
20 | - = link_to note.attachment_identifier, note.attachment.url, :target => "_blank" | 20 | + = link_to note.attachment_identifier, note.attachment.url, target: "_blank" |
21 | .clear | 21 | .clear |
app/views/notes/create.js.haml
1 | - if @note.line_code | 1 | - if @note.line_code |
2 | - = render "create_line", :note => @note | 2 | + = render "create_line", note: @note |
3 | - else | 3 | - else |
4 | - = render "create_common", :note => @note | 4 | + = render "create_common", note: @note |
5 | 5 | ||
6 | -# Enable submit button | 6 | -# Enable submit button |
7 | :plain | 7 | :plain |
app/views/notify/new_issue_email.html.haml
1 | -%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"} | ||
2 | - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"} | 1 | +%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"} |
2 | + %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"} | ||
3 | %tr | 3 | %tr |
4 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | ||
5 | - %td{:align => "left", :style => "padding: 20px 0 0;"} | ||
6 | - %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} | 4 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
5 | + %td{align: "left", style: "padding: 20px 0 0;"} | ||
6 | + %h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} | ||
7 | New Issue was created and assigned to you. | 7 | New Issue was created and assigned to you. |
8 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | 8 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
9 | %tr | 9 | %tr |
10 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | ||
11 | - %td{:align => "left", :style => "padding: 20px 0 0;"} | ||
12 | - %h2{:style => "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} | 10 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
11 | + %td{align: "left", style: "padding: 20px 0 0;"} | ||
12 | + %h2{style: "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} | ||
13 | = "Issue ##{@issue.id}" | 13 | = "Issue ##{@issue.id}" |
14 | - = link_to_gfm truncate(@issue.title, :length => 45), project_issue_url(@issue.project, @issue), :title => @issue.title | 14 | + = link_to_gfm truncate(@issue.title, length: 45), project_issue_url(@issue.project, @issue), title: @issue.title |
15 | %br | 15 | %br |
app/views/notify/new_merge_request_email.html.haml
1 | -%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"} | ||
2 | - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"} | 1 | +%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"} |
2 | + %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"} | ||
3 | %tr | 3 | %tr |
4 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | ||
5 | - %td{:align => "left", :style => "padding: 20px 0 0;"} | ||
6 | - %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} | 4 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
5 | + %td{align: "left", style: "padding: 20px 0 0;"} | ||
6 | + %h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} | ||
7 | = "New Merge Request !#{@merge_request.id}" | 7 | = "New Merge Request !#{@merge_request.id}" |
8 | - = link_to_gfm truncate(@merge_request.title, :length => 16), project_merge_request_url(@merge_request.project, @merge_request) | ||
9 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | 8 | + = link_to_gfm truncate(@merge_request.title, length: 16), project_merge_request_url(@merge_request.project, @merge_request) |
9 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} | ||
10 | %tr | 10 | %tr |
11 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | ||
12 | - %td{:style => "padding: 15px 0 15px;", :valign => "top"} | ||
13 | - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} | 11 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
12 | + %td{style: "padding: 15px 0 15px;", valign: "top"} | ||
13 | + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} | ||
14 | Branches: #{@merge_request.source_branch} → #{@merge_request.target_branch} | 14 | Branches: #{@merge_request.source_branch} → #{@merge_request.target_branch} |
15 | - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} | 15 | + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} |
16 | Asignee: #{@merge_request.author_name} → #{@merge_request.assignee_name} | 16 | Asignee: #{@merge_request.author_name} → #{@merge_request.assignee_name} |
17 | %td | 17 | %td |
18 | 18 |
app/views/notify/new_user_email.html.haml
1 | -%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"} | ||
2 | - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"} | 1 | +%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"} |
2 | + %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"} | ||
3 | %tr | 3 | %tr |
4 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | ||
5 | - %td{:align => "left", :style => "padding: 20px 0 0;"} | ||
6 | - %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} | 4 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
5 | + %td{align: "left", style: "padding: 20px 0 0;"} | ||
6 | + %h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} | ||
7 | Hi #{@user['name']}! | 7 | Hi #{@user['name']}! |
8 | - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} | 8 | + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} |
9 | Administrator created account for you. Now you are a member of company gitlab application. | 9 | Administrator created account for you. Now you are a member of company gitlab application. |
10 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | 10 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
11 | %tr | 11 | %tr |
12 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | ||
13 | - %td{:style => "padding: 15px 0 15px;", :valign => "top"} | ||
14 | - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 28px; font-size: 16px;font-family: Helvetica, Arial, sans-serif; "} | 12 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
13 | + %td{style: "padding: 15px 0 15px;", valign: "top"} | ||
14 | + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 28px; font-size: 16px;font-family: Helvetica, Arial, sans-serif; "} | ||
15 | login.......................................... | 15 | login.......................................... |
16 | %code= @user['email'] | 16 | %code= @user['email'] |
17 | - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 28px; font-size: 16px;font-family: Helvetica, Arial, sans-serif; "} | 17 | + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 28px; font-size: 16px;font-family: Helvetica, Arial, sans-serif; "} |
18 | password.................................. | 18 | password.................................. |
19 | %code= @password | 19 | %code= @password |
20 | - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 28px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} | 20 | + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 28px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} |
21 | = link_to "Click here to login", root_url | 21 | = link_to "Click here to login", root_url |
22 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | 22 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
23 | 23 |
app/views/notify/note_commit_email.html.haml
1 | -%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"} | ||
2 | - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"} | 1 | +%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"} |
2 | + %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"} | ||
3 | %tr | 3 | %tr |
4 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | ||
5 | - %td{:align => "left", :style => "padding: 20px 0 0;"} | ||
6 | - %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} | 4 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
5 | + %td{align: "left", style: "padding: 20px 0 0;"} | ||
6 | + %h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} | ||
7 | = "New comment for Commit #{@commit.short_id}" | 7 | = "New comment for Commit #{@commit.short_id}" |
8 | - = link_to_gfm truncate(@commit.title, :length => 16), project_commit_url(@note.project, :id => @commit.id, :anchor => "note_#{@note.id}") | ||
9 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | 8 | + = link_to_gfm truncate(@commit.title, length: 16), project_commit_url(@note.project, id: @commit.id, anchor: "note_#{@note.id}") |
9 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} | ||
10 | %tr | 10 | %tr |
11 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | ||
12 | - %td{:style => "padding: 15px 0 15px;", :valign => "top"} | ||
13 | - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} | ||
14 | - %a{:href => "#", :style => "color: #0eb6ce; text-decoration: none;"} #{@note.author_name} | 11 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
12 | + %td{style: "padding: 15px 0 15px;", valign: "top"} | ||
13 | + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} | ||
14 | + %a{href: "#", style: "color: #0eb6ce; text-decoration: none;"} #{@note.author_name} | ||
15 | left next message: | 15 | left next message: |
16 | %br | 16 | %br |
17 | - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :width => "558"} | 17 | + %table{border: "0", cellpadding: "0", cellspacing: "0", width: "558"} |
18 | %tr | 18 | %tr |
19 | - %td{:valign => "top"} | ||
20 | - %div{ :style => "background:#f5f5f5; padding:20px;border:1px solid #ddd" } | 19 | + %td{valign: "top"} |
20 | + %div{ style: "background:#f5f5f5; padding:20px;border:1px solid #ddd" } | ||
21 | = markdown(@note.note) | 21 | = markdown(@note.note) |
22 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | 22 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
23 | 23 |
app/views/notify/note_issue_email.html.haml
1 | -%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"} | ||
2 | - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"} | 1 | +%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"} |
2 | + %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"} | ||
3 | %tr | 3 | %tr |
4 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | ||
5 | - %td{:align => "left", :style => "padding: 20px 0 0;"} | ||
6 | - %h2{:style => "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} | 4 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
5 | + %td{align: "left", style: "padding: 20px 0 0;"} | ||
6 | + %h2{style: "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} | ||
7 | = "New comment for Issue ##{@issue.id}" | 7 | = "New comment for Issue ##{@issue.id}" |
8 | - = link_to_gfm truncate(@issue.title, :length => 35), project_issue_url(@issue.project, @issue, :anchor => "note_#{@note.id}") | ||
9 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | 8 | + = link_to_gfm truncate(@issue.title, length: 35), project_issue_url(@issue.project, @issue, anchor: "note_#{@note.id}") |
9 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} | ||
10 | %tr | 10 | %tr |
11 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | ||
12 | - %td{:style => "padding: 15px 0 15px;", :valign => "top"} | ||
13 | - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} | ||
14 | - %a{:href => "#", :style => "color: #0eb6ce; text-decoration: none;"} #{@note.author_name} | 11 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
12 | + %td{style: "padding: 15px 0 15px;", valign: "top"} | ||
13 | + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} | ||
14 | + %a{href: "#", style: "color: #0eb6ce; text-decoration: none;"} #{@note.author_name} | ||
15 | left next message: | 15 | left next message: |
16 | %br | 16 | %br |
17 | - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :width => "558"} | 17 | + %table{border: "0", cellpadding: "0", cellspacing: "0", width: "558"} |
18 | %tr | 18 | %tr |
19 | - %td{:valign => "top"} | ||
20 | - %div{ :style => "background:#f5f5f5; padding:20px;border:1px solid #ddd" } | 19 | + %td{valign: "top"} |
20 | + %div{ style: "background:#f5f5f5; padding:20px;border:1px solid #ddd" } | ||
21 | = markdown(@note.note) | 21 | = markdown(@note.note) |
22 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | 22 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
23 | 23 |
app/views/notify/note_merge_request_email.html.haml
1 | -%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"} | ||
2 | - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"} | 1 | +%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"} |
2 | + %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"} | ||
3 | %tr | 3 | %tr |
4 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | ||
5 | - %td{:align => "left", :style => "padding: 20px 0 0;"} | ||
6 | - %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} | 4 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
5 | + %td{align: "left", style: "padding: 20px 0 0;"} | ||
6 | + %h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} | ||
7 | = "New comment for Merge Request !#{@merge_request.id}" | 7 | = "New comment for Merge Request !#{@merge_request.id}" |
8 | - = link_to_gfm truncate(@merge_request.title, :length => 16), project_merge_request_url(@merge_request.project, @merge_request, :anchor => "note_#{@note.id}") | ||
9 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | 8 | + = link_to_gfm truncate(@merge_request.title, length: 16), project_merge_request_url(@merge_request.project, @merge_request, anchor: "note_#{@note.id}") |
9 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} | ||
10 | %tr | 10 | %tr |
11 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | ||
12 | - %td{:style => "padding: 15px 0 15px;", :valign => "top"} | ||
13 | - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} | ||
14 | - %a{:href => "#", :style => "color: #0eb6ce; text-decoration: none;"} #{@note.author_name} | 11 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
12 | + %td{style: "padding: 15px 0 15px;", valign: "top"} | ||
13 | + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} | ||
14 | + %a{href: "#", style: "color: #0eb6ce; text-decoration: none;"} #{@note.author_name} | ||
15 | left next message: | 15 | left next message: |
16 | %br | 16 | %br |
17 | - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :width => "558"} | 17 | + %table{border: "0", cellpadding: "0", cellspacing: "0", width: "558"} |
18 | %tr | 18 | %tr |
19 | - %td{:valign => "top"} | ||
20 | - %div{ :style => "background:#f5f5f5; padding:20px;border:1px solid #ddd" } | 19 | + %td{valign: "top"} |
20 | + %div{ style: "background:#f5f5f5; padding:20px;border:1px solid #ddd" } | ||
21 | = markdown(@note.note) | 21 | = markdown(@note.note) |
22 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | 22 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
23 | 23 |
app/views/notify/note_wall_email.html.haml
1 | -%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"} | ||
2 | - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"} | 1 | +%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"} |
2 | + %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"} | ||
3 | %tr | 3 | %tr |
4 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | ||
5 | - %td{:align => "left", :style => "padding: 20px 0 0;"} | ||
6 | - %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} | 4 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
5 | + %td{align: "left", style: "padding: 20px 0 0;"} | ||
6 | + %h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} | ||
7 | New message on | 7 | New message on |
8 | - = link_to "Project Wall", wall_project_url(@note.project, :anchor => "note_#{@note.id}") | ||
9 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | 8 | + = link_to "Project Wall", wall_project_url(@note.project, anchor: "note_#{@note.id}") |
9 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} | ||
10 | %tr | 10 | %tr |
11 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | ||
12 | - %td{:style => "padding: 15px 0 15px;", :valign => "top"} | ||
13 | - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} | ||
14 | - %a{:href => "#", :style => "color: #0eb6ce; text-decoration: none;"} #{@note.author_name} | 11 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
12 | + %td{style: "padding: 15px 0 15px;", valign: "top"} | ||
13 | + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} | ||
14 | + %a{href: "#", style: "color: #0eb6ce; text-decoration: none;"} #{@note.author_name} | ||
15 | left next message: | 15 | left next message: |
16 | %br | 16 | %br |
17 | - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :width => "558"} | 17 | + %table{border: "0", cellpadding: "0", cellspacing: "0", width: "558"} |
18 | %tr | 18 | %tr |
19 | - %td{:valign => "top"} | ||
20 | - %div{ :style => "background:#f5f5f5; padding:20px;border:1px solid #ddd" } | 19 | + %td{valign: "top"} |
20 | + %div{ style: "background:#f5f5f5; padding:20px;border:1px solid #ddd" } | ||
21 | = markdown(@note.note) | 21 | = markdown(@note.note) |
22 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | 22 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
app/views/notify/note_wiki_email.html.haml
1 | -%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"} | ||
2 | - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"} | 1 | +%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"} |
2 | + %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"} | ||
3 | %tr | 3 | %tr |
4 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | ||
5 | - %td{:align => "left", :style => "padding: 20px 0 0;"} | ||
6 | - %h2{:style => "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} | 4 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
5 | + %td{align: "left", style: "padding: 20px 0 0;"} | ||
6 | + %h2{style: "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} | ||
7 | New comment for Wiki page | 7 | New comment for Wiki page |
8 | - = link_to_gfm @wiki.title, project_issue_url(@wiki.project, @wiki, :anchor => "note_#{@note.id}") | ||
9 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | 8 | + = link_to_gfm @wiki.title, project_issue_url(@wiki.project, @wiki, anchor: "note_#{@note.id}") |
9 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} | ||
10 | %tr | 10 | %tr |
11 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | ||
12 | - %td{:style => "padding: 15px 0 15px;", :valign => "top"} | ||
13 | - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} | ||
14 | - %a{:href => "#", :style => "color: #0eb6ce; text-decoration: none;"} #{@note.author_name} | 11 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
12 | + %td{style: "padding: 15px 0 15px;", valign: "top"} | ||
13 | + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} | ||
14 | + %a{href: "#", style: "color: #0eb6ce; text-decoration: none;"} #{@note.author_name} | ||
15 | commented on Wiki page: | 15 | commented on Wiki page: |
16 | %br | 16 | %br |
17 | - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :width => "558"} | 17 | + %table{border: "0", cellpadding: "0", cellspacing: "0", width: "558"} |
18 | %tr | 18 | %tr |
19 | - %td{:valign => "top"} | ||
20 | - %div{ :style => "background:#f5f5f5; padding:20px;border:1px solid #ddd" } | 19 | + %td{valign: "top"} |
20 | + %div{ style: "background:#f5f5f5; padding:20px;border:1px solid #ddd" } | ||
21 | = markdown(@note.note) | 21 | = markdown(@note.note) |
22 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | 22 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
23 | 23 |
app/views/notify/reassigned_issue_email.html.haml
1 | -%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"} | ||
2 | - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"} | 1 | +%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"} |
2 | + %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"} | ||
3 | %tr | 3 | %tr |
4 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | ||
5 | - %td{:align => "left", :style => "padding: 20px 0 0;"} | ||
6 | - %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} | 4 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
5 | + %td{align: "left", style: "padding: 20px 0 0;"} | ||
6 | + %h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} | ||
7 | = "Reassigned Issue ##{@issue.id}" | 7 | = "Reassigned Issue ##{@issue.id}" |
8 | - = link_to_gfm truncate(@issue.title, :length => 16), project_issue_url(@issue.project, @issue) | ||
9 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | 8 | + = link_to_gfm truncate(@issue.title, length: 16), project_issue_url(@issue.project, @issue) |
9 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} | ||
10 | %tr | 10 | %tr |
11 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | ||
12 | - %td{:style => "padding: 15px 0 15px;", :valign => "top"} | ||
13 | - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} | 11 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
12 | + %td{style: "padding: 15px 0 15px;", valign: "top"} | ||
13 | + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} | ||
14 | Assignee changed from #{@previous_assignee.name} to #{@issue.assignee_name} | 14 | Assignee changed from #{@previous_assignee.name} to #{@issue.assignee_name} |
15 | %td | 15 | %td |
16 | 16 |
app/views/notify/reassigned_merge_request_email.html.haml
1 | -%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"} | ||
2 | - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"} | 1 | +%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"} |
2 | + %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"} | ||
3 | %tr | 3 | %tr |
4 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | ||
5 | - %td{:align => "left", :style => "padding: 20px 0 0;"} | ||
6 | - %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} | 4 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
5 | + %td{align: "left", style: "padding: 20px 0 0;"} | ||
6 | + %h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} | ||
7 | = "Reassigned Merge Request !#{@merge_request.id}" | 7 | = "Reassigned Merge Request !#{@merge_request.id}" |
8 | - = link_to_gfm truncate(@merge_request.title, :length => 16), project_merge_request_url(@merge_request.project, @merge_request) | ||
9 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | 8 | + = link_to_gfm truncate(@merge_request.title, length: 16), project_merge_request_url(@merge_request.project, @merge_request) |
9 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} | ||
10 | %tr | 10 | %tr |
11 | - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} | ||
12 | - %td{:style => "padding: 15px 0 15px;", :valign => "top"} | ||
13 | - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} | 11 | + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
12 | + %td{style: "padding: 15px 0 15px;", valign: "top"} | ||
13 | + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} | ||
14 | Assignee changed from #{@previous_assignee.name} to #{@merge_request.assignee_name} | 14 | Assignee changed from #{@previous_assignee.name} to #{@merge_request.assignee_name} |
15 | %td | 15 | %td |
16 | 16 |
app/views/profile/design.html.haml
1 | -= form_for @user, :url => profile_update_path, :remote => true, :method => :put do |f| | 1 | += form_for @user, url: profile_update_path, remote: true, method: :put do |f| |
2 | %div | 2 | %div |
3 | %h3 Application theme | 3 | %h3 Application theme |
4 | %hr | 4 | %hr |
@@ -18,16 +18,16 @@ | @@ -18,16 +18,16 @@ | ||
18 | %h3 Code review | 18 | %h3 Code review |
19 | %hr | 19 | %hr |
20 | .row | 20 | .row |
21 | - %label.span3{:for => "user_dark_scheme_false"} | 21 | + %label.span3{for: "user_dark_scheme_false"} |
22 | .thumbnail | 22 | .thumbnail |
23 | - = image_tag "white.png", :width => 260, :class => "styled_image" | 23 | + = image_tag "white.png", width: 260, class: "styled_image" |
24 | .caption | 24 | .caption |
25 | %h5 | 25 | %h5 |
26 | = f.radio_button :dark_scheme, false | 26 | = f.radio_button :dark_scheme, false |
27 | White code preview | 27 | White code preview |
28 | - %label.span3{:for => "user_dark_scheme_true"} | 28 | + %label.span3{for: "user_dark_scheme_true"} |
29 | .thumbnail | 29 | .thumbnail |
30 | - = image_tag "dark.png", :width => 260, :class => "styled_image" | 30 | + = image_tag "dark.png", width: 260, class: "styled_image" |
31 | .caption | 31 | .caption |
32 | %h5 | 32 | %h5 |
33 | = f.radio_button :dark_scheme, true | 33 | = f.radio_button :dark_scheme, true |
app/views/profile/password.html.haml
1 | %h3.page_title Password | 1 | %h3.page_title Password |
2 | %hr | 2 | %hr |
3 | -= form_for @user, :url => profile_password_path, :method => :put do |f| | 3 | += form_for @user, url: profile_password_path, method: :put do |f| |
4 | .data | 4 | .data |
5 | %p.slead After successful password update you will be redirected to login page where you should login with new password | 5 | %p.slead After successful password update you will be redirected to login page where you should login with new password |
6 | -if @user.errors.any? | 6 | -if @user.errors.any? |
@@ -16,4 +16,4 @@ | @@ -16,4 +16,4 @@ | ||
16 | = f.label :password_confirmation | 16 | = f.label :password_confirmation |
17 | .input= f.password_field :password_confirmation | 17 | .input= f.password_field :password_confirmation |
18 | .actions | 18 | .actions |
19 | - = f.submit 'Save', :class => "btn primary" | 19 | + = f.submit 'Save', class: "btn primary" |
app/views/profile/show.html.haml
1 | .profile_avatar_holder | 1 | .profile_avatar_holder |
2 | - = image_tag gravatar_icon(@user.email, 90), :class => "styled_image" | 2 | + = image_tag gravatar_icon(@user.email, 90), class: "styled_image" |
3 | %h3.page_title | 3 | %h3.page_title |
4 | = @user.name | 4 | = @user.name |
5 | %br | 5 | %br |
@@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
9 | 9 | ||
10 | %hr | 10 | %hr |
11 | 11 | ||
12 | -= form_for @user, :url => profile_update_path, :method => :put, :html => { :class => "edit_user form-horizontal" } do |f| | 12 | += form_for @user, url: profile_update_path, method: :put, html: { class: "edit_user form-horizontal" } do |f| |
13 | -if @user.errors.any? | 13 | -if @user.errors.any? |
14 | %div.alert-message.block-message.error | 14 | %div.alert-message.block-message.error |
15 | %ul | 15 | %ul |
@@ -18,30 +18,30 @@ | @@ -18,30 +18,30 @@ | ||
18 | .row | 18 | .row |
19 | .span7 | 19 | .span7 |
20 | .control-group | 20 | .control-group |
21 | - = f.label :name, :class => "control-label" | 21 | + = f.label :name, class: "control-label" |
22 | .controls | 22 | .controls |
23 | - = f.text_field :name, :class => "input-xlarge" | 23 | + = f.text_field :name, class: "input-xlarge" |
24 | %span.help-block Enter your name, so people you know can recognize you. | 24 | %span.help-block Enter your name, so people you know can recognize you. |
25 | .control-group | 25 | .control-group |
26 | - = f.label :email, :class => "control-label" | 26 | + = f.label :email, class: "control-label" |
27 | .controls | 27 | .controls |
28 | - = f.text_field :email, :class => "input-xlarge" | 28 | + = f.text_field :email, class: "input-xlarge" |
29 | %span.help-block We also use email for avatar detection. | 29 | %span.help-block We also use email for avatar detection. |
30 | 30 | ||
31 | %hr | 31 | %hr |
32 | .control-group | 32 | .control-group |
33 | - = f.label :skype, :class => "control-label" | ||
34 | - .controls= f.text_field :skype, :class => "input-xlarge" | 33 | + = f.label :skype, class: "control-label" |
34 | + .controls= f.text_field :skype, class: "input-xlarge" | ||
35 | .control-group | 35 | .control-group |
36 | - = f.label :linkedin, :class => "control-label" | ||
37 | - .controls= f.text_field :linkedin, :class => "input-xlarge" | 36 | + = f.label :linkedin, class: "control-label" |
37 | + .controls= f.text_field :linkedin, class: "input-xlarge" | ||
38 | .control-group | 38 | .control-group |
39 | - = f.label :twitter, :class => "control-label" | ||
40 | - .controls= f.text_field :twitter, :class => "input-xlarge" | 39 | + = f.label :twitter, class: "control-label" |
40 | + .controls= f.text_field :twitter, class: "input-xlarge" | ||
41 | .control-group | 41 | .control-group |
42 | - = f.label :bio, :class => "control-label" | 42 | + = f.label :bio, class: "control-label" |
43 | .controls | 43 | .controls |
44 | - = f.text_area :bio, :rows => 6, :class => "input-xlarge", :maxlength => 250 | 44 | + = f.text_area :bio, rows: 6, class: "input-xlarge", maxlength: 250 |
45 | %span.help-block Tell us about yourself in fewer than 250 characters. | 45 | %span.help-block Tell us about yourself in fewer than 250 characters. |
46 | .span5.right | 46 | .span5.right |
47 | 47 | ||
@@ -56,14 +56,14 @@ | @@ -56,14 +56,14 @@ | ||
56 | of | 56 | of |
57 | %span= current_user.projects_limit | 57 | %span= current_user.projects_limit |
58 | .progress | 58 | .progress |
59 | - .bar{:style => "width: #{current_user.projects_limit_percent}%;"} | 59 | + .bar{style: "width: #{current_user.projects_limit_percent}%;"} |
60 | 60 | ||
61 | %h4 | 61 | %h4 |
62 | SSH public keys: | 62 | SSH public keys: |
63 | %small.right | 63 | %small.right |
64 | %span= link_to current_user.keys.count, keys_path | 64 | %span= link_to current_user.keys.count, keys_path |
65 | 65 | ||
66 | - = link_to "Add Public Key", new_key_path, :class => "btn small right" | 66 | + = link_to "Add Public Key", new_key_path, class: "btn small right" |
67 | 67 | ||
68 | .form-actions | 68 | .form-actions |
69 | - = f.submit 'Save', :class => "btn-primary btn" | 69 | + = f.submit 'Save', class: "btn-primary btn" |
app/views/profile/token.html.haml
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | %span.cred.right | 3 | %span.cred.right |
4 | keep it in secret! | 4 | keep it in secret! |
5 | %hr | 5 | %hr |
6 | -= form_for @user, :url => profile_reset_private_token_path, :method => :put do |f| | 6 | += form_for @user, url: profile_reset_private_token_path, method: :put do |f| |
7 | .data | 7 | .data |
8 | %p.slead | 8 | %p.slead |
9 | Private token used to access application resources without authentication. | 9 | Private token used to access application resources without authentication. |
@@ -11,13 +11,13 @@ | @@ -11,13 +11,13 @@ | ||
11 | It can be used for atom feed or API | 11 | It can be used for atom feed or API |
12 | %p.cgray | 12 | %p.cgray |
13 | - if current_user.private_token | 13 | - if current_user.private_token |
14 | - = text_field_tag "token", current_user.private_token, :class => "xxlarge large_text" | 14 | + = text_field_tag "token", current_user.private_token, class: "xxlarge large_text" |
15 | - else | 15 | - else |
16 | You don`t have one yet. Click generate to fix it. | 16 | You don`t have one yet. Click generate to fix it. |
17 | .actions | 17 | .actions |
18 | - if current_user.private_token | 18 | - if current_user.private_token |
19 | - = f.submit 'Reset', :confirm => "Are you sure?", :class => "btn" | 19 | + = f.submit 'Reset', confirm: "Are you sure?", class: "btn" |
20 | - else | 20 | - else |
21 | - = f.submit 'Generate', :class => "btn primary" | 21 | + = f.submit 'Generate', class: "btn primary" |
22 | 22 | ||
23 | 23 |
app/views/projects/_form.html.haml
1 | -= form_for(@project, :remote => true) do |f| | 1 | += form_for(@project, remote: true) do |f| |
2 | - if @project.errors.any? | 2 | - if @project.errors.any? |
3 | .alert-message.block-message.error | 3 | .alert-message.block-message.error |
4 | %ul | 4 | %ul |
@@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
8 | = f.label :name do | 8 | = f.label :name do |
9 | Project name is | 9 | Project name is |
10 | .input | 10 | .input |
11 | - = f.text_field :name, :placeholder => "Example Project", :class => "xxlarge" | 11 | + = f.text_field :name, placeholder: "Example Project", class: "xxlarge" |
12 | 12 | ||
13 | %h5.page_title | 13 | %h5.page_title |
14 | .alert.alert-info | 14 | .alert.alert-info |
@@ -19,19 +19,19 @@ | @@ -19,19 +19,19 @@ | ||
19 | .input | 19 | .input |
20 | .input-prepend | 20 | .input-prepend |
21 | %strong | 21 | %strong |
22 | - = text_field_tag :ppath, @project.path_to_repo, :class => "xlarge", :disabled => true | 22 | + = text_field_tag :ppath, @project.path_to_repo, class: "xlarge", disabled: true |
23 | .clearfix | 23 | .clearfix |
24 | = f.label :code do | 24 | = f.label :code do |
25 | URL | 25 | URL |
26 | .input | 26 | .input |
27 | .input-prepend | 27 | .input-prepend |
28 | %span.add-on= web_app_url | 28 | %span.add-on= web_app_url |
29 | - = f.text_field :code, :placeholder => "example" | 29 | + = f.text_field :code, placeholder: "example" |
30 | 30 | ||
31 | - unless @project.new_record? || @project.heads.empty? | 31 | - unless @project.new_record? || @project.heads.empty? |
32 | .clearfix | 32 | .clearfix |
33 | = f.label :default_branch, "Default Branch" | 33 | = f.label :default_branch, "Default Branch" |
34 | - .input= f.select(:default_branch, @project.heads.map(&:name), {}, :style => "width:210px;") | 34 | + .input= f.select(:default_branch, @project.heads.map(&:name), {}, style: "width:210px;") |
35 | 35 | ||
36 | - unless @project.new_record? | 36 | - unless @project.new_record? |
37 | .alert.alert-info | 37 | .alert.alert-info |
@@ -56,8 +56,8 @@ | @@ -56,8 +56,8 @@ | ||
56 | %br | 56 | %br |
57 | 57 | ||
58 | .actions | 58 | .actions |
59 | - = f.submit 'Save', :class => "btn primary" | ||
60 | - = link_to 'Cancel', @project, :class => "btn" | 59 | + = f.submit 'Save', class: "btn primary" |
60 | + = link_to 'Cancel', @project, class: "btn" | ||
61 | - unless @project.new_record? | 61 | - unless @project.new_record? |
62 | .right | 62 | .right |
63 | - = link_to 'Remove', @project, :confirm => 'Are you sure?', :method => :delete, :class => "btn danger" | 63 | + = link_to 'Remove', @project, confirm: 'Are you sure?', method: :delete, class: "btn danger" |
app/views/projects/_new_form.html.haml
1 | -= form_for(@project, :remote => true) do |f| | 1 | += form_for(@project, remote: true) do |f| |
2 | - if @project.errors.any? | 2 | - if @project.errors.any? |
3 | .alert-message.block-message.error | 3 | .alert-message.block-message.error |
4 | %span= @project.errors.full_messages.first | 4 | %span= @project.errors.full_messages.first |
@@ -6,8 +6,8 @@ | @@ -6,8 +6,8 @@ | ||
6 | = f.label :name do | 6 | = f.label :name do |
7 | Project name is | 7 | Project name is |
8 | .input | 8 | .input |
9 | - = f.text_field :name, :placeholder => "Example Project", :class => "xxlarge" | ||
10 | - = f.submit 'Create project', :class => "btn primary" | 9 | + = f.text_field :name, placeholder: "Example Project", class: "xxlarge" |
10 | + = f.submit 'Create project', class: "btn primary" | ||
11 | 11 | ||
12 | %hr | 12 | %hr |
13 | .alert.alert-info | 13 | .alert.alert-info |
@@ -18,7 +18,7 @@ | @@ -18,7 +18,7 @@ | ||
18 | .input | 18 | .input |
19 | .input-prepend | 19 | .input-prepend |
20 | %span.add-on= Gitlab.config.ssh_path | 20 | %span.add-on= Gitlab.config.ssh_path |
21 | - = f.text_field :path, :placeholder => "example_project", :disabled => !@project.new_record? | 21 | + = f.text_field :path, placeholder: "example_project", disabled: !@project.new_record? |
22 | %span.add-on= ".git" | 22 | %span.add-on= ".git" |
23 | .clearfix | 23 | .clearfix |
24 | = f.label :code do | 24 | = f.label :code do |
@@ -26,4 +26,4 @@ | @@ -26,4 +26,4 @@ | ||
26 | .input | 26 | .input |
27 | .input-prepend | 27 | .input-prepend |
28 | %span.add-on= web_app_url | 28 | %span.add-on= web_app_url |
29 | - = f.text_field :code, :placeholder => "example" | 29 | + = f.text_field :code, placeholder: "example" |
app/views/projects/_project_head.html.haml
1 | %ul.nav.nav-tabs | 1 | %ul.nav.nav-tabs |
2 | - %li{ :class => "#{'active' if current_page?(project_path(@project)) }" } | ||
3 | - = link_to project_path(@project), :class => "activities-tab tab" do | 2 | + %li{ class: "#{'active' if current_page?(project_path(@project)) }" } |
3 | + = link_to project_path(@project), class: "activities-tab tab" do | ||
4 | %i.icon-home | 4 | %i.icon-home |
5 | Show | 5 | Show |
6 | - %li{ :class => " #{'active' if (controller.controller_name == "team_members") || current_page?(team_project_path(@project)) }" } | ||
7 | - = link_to team_project_path(@project), :class => "team-tab tab" do | 6 | + %li{ class: " #{'active' if (controller.controller_name == "team_members") || current_page?(team_project_path(@project)) }" } |
7 | + = link_to team_project_path(@project), class: "team-tab tab" do | ||
8 | %i.icon-user | 8 | %i.icon-user |
9 | Team | 9 | Team |
10 | - %li{ :class => "#{'active' if current_page?(files_project_path(@project)) }" } | ||
11 | - = link_to files_project_path(@project), :class => "files-tab tab " do | 10 | + %li{ class: "#{'active' if current_page?(files_project_path(@project)) }" } |
11 | + = link_to files_project_path(@project), class: "files-tab tab " do | ||
12 | Attachments | 12 | Attachments |
13 | - %li{ :class => " #{'active' if (controller.controller_name == "snippets") }" } | ||
14 | - = link_to project_snippets_path(@project), :class => "snippets-tab tab" do | 13 | + %li{ class: " #{'active' if (controller.controller_name == "snippets") }" } |
14 | + = link_to project_snippets_path(@project), class: "snippets-tab tab" do | ||
15 | Snippets | 15 | Snippets |
16 | 16 | ||
17 | - if can? current_user, :admin_project, @project | 17 | - if can? current_user, :admin_project, @project |
18 | - %li.right{:class => "#{'active' if controller.controller_name == "deploy_keys"}"} | 18 | + %li.right{class: "#{'active' if controller.controller_name == "deploy_keys"}"} |
19 | = link_to project_deploy_keys_path(@project) do | 19 | = link_to project_deploy_keys_path(@project) do |
20 | %span | 20 | %span |
21 | Deploy Keys | 21 | Deploy Keys |
22 | - %li.right{:class => "#{'active' if controller.controller_name == "hooks" }"} | 22 | + %li.right{class: "#{'active' if controller.controller_name == "hooks" }"} |
23 | = link_to project_hooks_path(@project) do | 23 | = link_to project_hooks_path(@project) do |
24 | %span | 24 | %span |
25 | Hooks | 25 | Hooks |
26 | - %li.right{ :class => "#{'active' if current_page?(edit_project_path(@project)) }" } | ||
27 | - = link_to edit_project_path(@project), :class => "stat-tab tab " do | 26 | + %li.right{ class: "#{'active' if current_page?(edit_project_path(@project)) }" } |
27 | + = link_to edit_project_path(@project), class: "stat-tab tab " do | ||
28 | %i.icon-edit | 28 | %i.icon-edit |
29 | Edit | 29 | Edit |
app/views/projects/_refs.html.haml
1 | -= form_tag switch_project_refs_path(@project), :method => :get, :class => "project-refs-form" do | ||
2 | - = select_tag "ref", grouped_options_refs, :onchange => "this.form.submit();", :class => "project-refs-select" | 1 | += form_tag switch_project_refs_path(@project), method: :get, class: "project-refs-form" do |
2 | + = select_tag "ref", grouped_options_refs, onchange: "this.form.submit();", class: "project-refs-select" | ||
3 | = hidden_field_tag :destination, destination | 3 | = hidden_field_tag :destination, destination |
4 | 4 | ||
5 | :javascript | 5 | :javascript |
app/views/projects/_show.html.haml
@@ -2,9 +2,9 @@ | @@ -2,9 +2,9 @@ | ||
2 | = @project.name | 2 | = @project.name |
3 | %br | 3 | %br |
4 | %div | 4 | %div |
5 | - %a.btn.info{:href => tree_project_ref_path(@project, @project.root_ref)} Browse code | 5 | + %a.btn.info{href: tree_project_ref_path(@project, @project.root_ref)} Browse code |
6 | | 6 | |
7 | - %a.btn{:href => project_commits_path(@project)} Commits | 7 | + %a.btn{href: project_commits_path(@project)} Commits |
8 | %strong.right | 8 | %strong.right |
9 | = link_to project_path(@project) do | 9 | = link_to project_path(@project) do |
10 | Switch to project → | 10 | Switch to project → |
@@ -13,7 +13,7 @@ | @@ -13,7 +13,7 @@ | ||
13 | .input | 13 | .input |
14 | .input-prepend | 14 | .input-prepend |
15 | %span.add-on git clone | 15 | %span.add-on git clone |
16 | - = text_field_tag :project_clone, @project.url_to_repo, :class => "xlarge one_click_select git_clone_url" | 16 | + = text_field_tag :project_clone, @project.url_to_repo, class: "xlarge one_click_select git_clone_url" |
17 | 17 | ||
18 | = simple_format @project.description | 18 | = simple_format @project.description |
19 | - unless @events.blank? | 19 | - unless @events.blank? |
app/views/projects/_team.html.haml
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | %th Permissions | 5 | %th Permissions |
6 | %tbody | 6 | %tbody |
7 | - @project.users_projects.each do |up| | 7 | - @project.users_projects.each do |up| |
8 | - = render(:partial => 'team_members/show', :locals => {:member => up}) | 8 | + = render(partial: 'team_members/show', locals: {member: up}) |
9 | 9 | ||
10 | 10 | ||
11 | :javascript | 11 | :javascript |
app/views/projects/create.js.haml
1 | - if @project.saved? | 1 | - if @project.saved? |
2 | :plain | 2 | :plain |
3 | - location.href = "#{project_path(@project, :notice => 'Project was successfully created.')}"; | 3 | + location.href = "#{project_path(@project, notice: 'Project was successfully created.')}"; |
4 | - else | 4 | - else |
5 | - if @project.git_error? | 5 | - if @project.git_error? |
6 | location.href = "#{errors_githost_path}"; | 6 | location.href = "#{errors_githost_path}"; |
app/views/projects/empty.html.haml
@@ -16,7 +16,7 @@ | @@ -16,7 +16,7 @@ | ||
16 | - setup_str = ["git config --global user.name \"#{current_user.name}\"", | 16 | - setup_str = ["git config --global user.name \"#{current_user.name}\"", |
17 | "git config --global user.email \"#{current_user.email}\""].join("\n") | 17 | "git config --global user.email \"#{current_user.email}\""].join("\n") |
18 | = preserve do | 18 | = preserve do |
19 | - = raw bash_lexer.highlight(setup_str, :lexer => 'bash', :options => {:encoding => 'utf-8'}) | 19 | + = raw bash_lexer.highlight(setup_str, lexer: 'bash', options: {encoding: 'utf-8'}) |
20 | 20 | ||
21 | %br | 21 | %br |
22 | %br | 22 | %br |
@@ -44,4 +44,4 @@ | @@ -44,4 +44,4 @@ | ||
44 | 44 | ||
45 | - if can? current_user, :admin_project, @project | 45 | - if can? current_user, :admin_project, @project |
46 | .alert-message.block-message.error.prepend-top-20 | 46 | .alert-message.block-message.error.prepend-top-20 |
47 | - = link_to 'Remove project', @project, :confirm => 'Are you sure?', :method => :delete, :class => "btn danger" | 47 | + = link_to 'Remove project', @project, confirm: 'Are you sure?', method: :delete, class: "btn danger" |
app/views/projects/files.html.haml
@@ -4,8 +4,8 @@ | @@ -4,8 +4,8 @@ | ||
4 | - @notes.each do |note| | 4 | - @notes.each do |note| |
5 | %tr | 5 | %tr |
6 | %td | 6 | %td |
7 | - %a{:href => note.attachment.url} | ||
8 | - = image_tag gravatar_icon(note.author_email), :class => "left", :width => 16 | 7 | + %a{href: note.attachment.url} |
8 | + = image_tag gravatar_icon(note.author_email), class: "left", width: 16 | ||
9 | | 9 | |
10 | = note.attachment_identifier | 10 | = note.attachment_identifier |
11 | %td | 11 | %td |
app/views/projects/show.html.haml
@@ -7,23 +7,23 @@ | @@ -7,23 +7,23 @@ | ||
7 | .input-prepend.project_clone_holder | 7 | .input-prepend.project_clone_holder |
8 | 8 | ||
9 | %span.add-on git clone | 9 | %span.add-on git clone |
10 | - = link_to "SSH", "#", :class => "btn small active", :"data-clone" => @project.ssh_url_to_repo | ||
11 | - = link_to "HTTP", "#", :class => "btn small", :"data-clone" => @project.http_url_to_repo | ||
12 | - = text_field_tag :project_clone, @project.url_to_repo, :class => "one_click_select span5" | 10 | + = link_to "SSH", "#", class: "btn small active", :"data-clone" => @project.ssh_url_to_repo |
11 | + = link_to "HTTP", "#", class: "btn small", :"data-clone" => @project.http_url_to_repo | ||
12 | + = text_field_tag :project_clone, @project.url_to_repo, class: "one_click_select span5" | ||
13 | .span4.right | 13 | .span4.right |
14 | .right | 14 | .right |
15 | - if can? current_user, :download_code, @project | 15 | - if can? current_user, :download_code, @project |
16 | - = link_to archive_project_repository_path(@project), :class => "btn small grouped" do | 16 | + = link_to archive_project_repository_path(@project), class: "btn small grouped" do |
17 | %i.icon-download-alt | 17 | %i.icon-download-alt |
18 | Download | 18 | Download |
19 | - if @project.merge_requests_enabled && can?(current_user, :write_merge_request, @project) | 19 | - if @project.merge_requests_enabled && can?(current_user, :write_merge_request, @project) |
20 | - = link_to new_project_merge_request_path(@project), :title => "New Merge Request", :class => "btn small grouped" do | 20 | + = link_to new_project_merge_request_path(@project), title: "New Merge Request", class: "btn small grouped" do |
21 | Merge Request | 21 | Merge Request |
22 | - if @project.issues_enabled && can?(current_user, :write_issue, @project) | 22 | - if @project.issues_enabled && can?(current_user, :write_issue, @project) |
23 | - = link_to new_project_issue_path(@project), :title => "New Issue", :class => "btn small grouped" do | 23 | + = link_to new_project_issue_path(@project), title: "New Issue", class: "btn small grouped" do |
24 | Issue | 24 | Issue |
25 | 25 | ||
26 | -= render "events/event_last_push", :event => @last_push | 26 | += render "events/event_last_push", event: @last_push |
27 | .content_list= render @events | 27 | .content_list= render @events |
28 | 28 | ||
29 | :javascript | 29 | :javascript |
app/views/projects/team.html.haml
@@ -5,11 +5,11 @@ | @@ -5,11 +5,11 @@ | ||
5 | 5 | ||
6 | - if can? current_user, :admin_team_member, @project | 6 | - if can? current_user, :admin_team_member, @project |
7 | %p.slead | 7 | %p.slead |
8 | - = link_to new_project_team_member_path(@project), :class => "btn small right", :title => "New Team Member" do | 8 | + = link_to new_project_team_member_path(@project), class: "btn small right", title: "New Team Member" do |
9 | New Team Member | 9 | New Team Member |
10 | Read more about project permissions | 10 | Read more about project permissions |
11 | - %strong= link_to "here", help_permissions_path, :class => "vlink" | 11 | + %strong= link_to "here", help_permissions_path, class: "vlink" |
12 | 12 | ||
13 | 13 | ||
14 | -= render :partial => "team", :locals => {:project => @project} | 14 | += render partial: "team", locals: {project: @project} |
15 | 15 |
app/views/projects/tree.js.haml
1 | :plain | 1 | :plain |
2 | $("#tree-holder table").hide("slide", { direction: "left" }, 150, function(){ | 2 | $("#tree-holder table").hide("slide", { direction: "left" }, 150, function(){ |
3 | - $("#tree-holder").html("#{escape_javascript(render(:partial => "tree", :locals => {:repo => @repo, :commit => @commit, :tree => @tree}))}"); | 3 | + $("#tree-holder").html("#{escape_javascript(render(partial: "tree", locals: {repo: @repo, commit: @commit, tree: @tree}))}"); |
4 | $("#tree-holder table").show("slide", { direction: "right" }, 150); | 4 | $("#tree-holder table").show("slide", { direction: "right" }, 150); |
5 | }); | 5 | }); |
app/views/projects/update.js.haml
1 | - if @project.valid? | 1 | - if @project.valid? |
2 | :plain | 2 | :plain |
3 | - location.href = "#{edit_project_path(@project, :notice => 'Project was successfully updated.')}"; | 3 | + location.href = "#{edit_project_path(@project, notice: 'Project was successfully updated.')}"; |
4 | - else | 4 | - else |
5 | :plain | 5 | :plain |
6 | $('.project_edit_holder').show(); | 6 | $('.project_edit_holder').show(); |
app/views/projects/wall.html.haml
app/views/protected_branches/index.html.haml
1 | = render "repositories/branches_head" | 1 | = render "repositories/branches_head" |
2 | 2 | ||
3 | .alert | 3 | .alert |
4 | - %p Protected branches designed to prevent push for all except #{link_to "masters", help_permissions_path, :class => "vlink"}. | 4 | + %p Protected branches designed to prevent push for all except #{link_to "masters", help_permissions_path, class: "vlink"}. |
5 | %p This ability allows: | 5 | %p This ability allows: |
6 | %ul | 6 | %ul |
7 | %li keep stable branches secured | 7 | %li keep stable branches secured |
8 | %li forced code review before merge to protected branches | 8 | %li forced code review before merge to protected branches |
9 | - %p Read more about project permissions #{link_to "here", help_permissions_path, :class => "vlink"} | 9 | + %p Read more about project permissions #{link_to "here", help_permissions_path, class: "vlink"} |
10 | 10 | ||
11 | - if can? current_user, :admin_project, @project | 11 | - if can? current_user, :admin_project, @project |
12 | = form_for [@project, @protected_branch] do |f| | 12 | = form_for [@project, @protected_branch] do |f| |
@@ -19,9 +19,9 @@ | @@ -19,9 +19,9 @@ | ||
19 | .entry.clearfix | 19 | .entry.clearfix |
20 | = f.label :name, "Branch" | 20 | = f.label :name, "Branch" |
21 | .span3 | 21 | .span3 |
22 | - = f.select(:name, @project.open_branches.map { |br| [br.name, br.name] } , { :include_blank => "-- Select branch" }, { :class => "span3" }) | 22 | + = f.select(:name, @project.open_branches.map { |br| [br.name, br.name] } , { include_blank: "-- Select branch" }, { class: "span3" }) |
23 | | 23 | |
24 | - = f.submit 'Protect', :class => "primary btn" | 24 | + = f.submit 'Protect', class: "primary btn" |
25 | 25 | ||
26 | - unless @branches.empty? | 26 | - unless @branches.empty? |
27 | %table.admin-table | 27 | %table.admin-table |
@@ -34,18 +34,18 @@ | @@ -34,18 +34,18 @@ | ||
34 | - @branches.each do |branch| | 34 | - @branches.each do |branch| |
35 | %tr | 35 | %tr |
36 | %td | 36 | %td |
37 | - = link_to project_commits_path(@project, :ref => branch.name) do | 37 | + = link_to project_commits_path(@project, ref: branch.name) do |
38 | %strong= branch.name | 38 | %strong= branch.name |
39 | - if branch.name == @project.root_ref | 39 | - if branch.name == @project.root_ref |
40 | %span.label default | 40 | %span.label default |
41 | %td | 41 | %td |
42 | = link_to project_commit_path(@project, branch.commit.id) do | 42 | = link_to project_commit_path(@project, branch.commit.id) do |
43 | - = truncate branch.commit.id.to_s, :length => 10 | 43 | + = truncate branch.commit.id.to_s, length: 10 |
44 | = time_ago_in_words(branch.commit.committed_date) | 44 | = time_ago_in_words(branch.commit.committed_date) |
45 | ago | 45 | ago |
46 | %td | 46 | %td |
47 | - if can? current_user, :admin_project, @project | 47 | - if can? current_user, :admin_project, @project |
48 | - = link_to 'Unprotect', [@project, branch], :confirm => 'Are you sure?', :method => :delete, :class => "danger btn small" | 48 | + = link_to 'Unprotect', [@project, branch], confirm: 'Are you sure?', method: :delete, class: "danger btn small" |
49 | 49 | ||
50 | :javascript | 50 | :javascript |
51 | $('select#protected_branch_name').chosen(); | 51 | $('select#protected_branch_name').chosen(); |
app/views/refs/_head.html.haml
1 | %ul.nav.nav-tabs | 1 | %ul.nav.nav-tabs |
2 | %li | 2 | %li |
3 | - = form_tag switch_project_refs_path(@project), :method => :get, :class => "project-refs-form", :remote => true do | ||
4 | - = select_tag "ref", grouped_options_refs, :onchange => "$(this.form).trigger('submit');", :class => "project-refs-select" | 3 | + = form_tag switch_project_refs_path(@project), method: :get, class: "project-refs-form", remote: true do |
4 | + = select_tag "ref", grouped_options_refs, onchange: "$(this.form).trigger('submit');", class: "project-refs-select" | ||
5 | = hidden_field_tag :destination, "tree" | 5 | = hidden_field_tag :destination, "tree" |
6 | = hidden_field_tag :path, params[:path] | 6 | = hidden_field_tag :path, params[:path] |
7 | - %li{:class => "#{'active' if (controller.controller_name == "refs") }"} | 7 | + %li{class: "#{'active' if (controller.controller_name == "refs") }"} |
8 | = link_to tree_project_ref_path(@project, @ref) do | 8 | = link_to tree_project_ref_path(@project, @ref) do |
9 | Source | 9 | Source |
10 | 10 |
app/views/refs/_submodule_item.html.haml
1 | - url = content.url(@ref) rescue nil | 1 | - url = content.url(@ref) rescue nil |
2 | - name = content.basename | 2 | - name = content.basename |
3 | - return unless url | 3 | - return unless url |
4 | -%tr{ :class => "tree-item", :url => url } | 4 | +%tr{ class: "tree-item", url: url } |
5 | %td.tree-item-file-name | 5 | %td.tree-item-file-name |
6 | = image_tag "submodule.png" | 6 | = image_tag "submodule.png" |
7 | - %strong= truncate(name, :length => 40) | 7 | + %strong= truncate(name, length: 40) |
8 | %td | 8 | %td |
9 | %code= content.id[0..10] | 9 | %code= content.id[0..10] |
10 | %td | 10 | %td |
11 | - = link_to truncate(url, :length => 40), url | 11 | + = link_to truncate(url, length: 40), url |
12 | 12 | ||
13 | 13 |
app/views/refs/_tree.html.haml
1 | %ul.breadcrumb | 1 | %ul.breadcrumb |
2 | %li | 2 | %li |
3 | %span.arrow | 3 | %span.arrow |
4 | - = link_to tree_project_ref_path(@project, @ref, :path => nil), :remote => true do | 4 | + = link_to tree_project_ref_path(@project, @ref, path: nil), remote: true do |
5 | = @project.name | 5 | = @project.name |
6 | - tree.breadcrumbs(6) do |link| | 6 | - tree.breadcrumbs(6) do |link| |
7 | \/ | 7 | \/ |
@@ -10,32 +10,32 @@ | @@ -10,32 +10,32 @@ | ||
10 | %div.tree_progress | 10 | %div.tree_progress |
11 | #tree-content-holder | 11 | #tree-content-holder |
12 | - if tree.is_blob? | 12 | - if tree.is_blob? |
13 | - = render :partial => "refs/tree_file", :locals => { :name => tree.name, :content => tree.data, :file => tree } | 13 | + = render partial: "refs/tree_file", locals: { name: tree.name, content: tree.data, file: tree } |
14 | - else | 14 | - else |
15 | - contents = tree.contents | 15 | - contents = tree.contents |
16 | - %table#tree-slider.bordered-table.table{:class => "table_#{@hex_path}" } | 16 | + %table#tree-slider.bordered-table.table{class: "table_#{@hex_path}" } |
17 | %thead | 17 | %thead |
18 | %th Name | 18 | %th Name |
19 | %th Last Update | 19 | %th Last Update |
20 | %th | 20 | %th |
21 | Last commit | 21 | Last commit |
22 | - = link_to "History", tree.history_path, :class => "right" | 22 | + = link_to "History", tree.history_path, class: "right" |
23 | 23 | ||
24 | - if tree.up_dir? | 24 | - if tree.up_dir? |
25 | - %tr{ :class => "tree-item", :url => tree.up_dir_path } | 25 | + %tr{ class: "tree-item", url: tree.up_dir_path } |
26 | %td.tree-item-file-name | 26 | %td.tree-item-file-name |
27 | = image_tag "file_empty.png" | 27 | = image_tag "file_empty.png" |
28 | - = link_to "..", tree.up_dir_path, :remote => :true | 28 | + = link_to "..", tree.up_dir_path, remote: :true |
29 | %td | 29 | %td |
30 | %td | 30 | %td |
31 | 31 | ||
32 | - index = 0 | 32 | - index = 0 |
33 | - contents.select{ |i| i.is_a?(Grit::Tree)}.each do |content| | 33 | - contents.select{ |i| i.is_a?(Grit::Tree)}.each do |content| |
34 | - = render :partial => "refs/tree_item", :locals => { :content => content, :index => (index += 1) } | 34 | + = render partial: "refs/tree_item", locals: { content: content, index: (index += 1) } |
35 | - contents.select{ |i| i.is_a?(Grit::Blob)}.each do |content| | 35 | - contents.select{ |i| i.is_a?(Grit::Blob)}.each do |content| |
36 | - = render :partial => "refs/tree_item", :locals => { :content => content, :index => (index += 1) } | 36 | + = render partial: "refs/tree_item", locals: { content: content, index: (index += 1) } |
37 | - contents.select{ |i| i.is_a?(Grit::Submodule)}.each do |content| | 37 | - contents.select{ |i| i.is_a?(Grit::Submodule)}.each do |content| |
38 | - = render :partial => "refs/submodule_item", :locals => { :content => content, :index => (index += 1) } | 38 | + = render partial: "refs/submodule_item", locals: { content: content, index: (index += 1) } |
39 | 39 | ||
40 | - if content = contents.select{ |c| c.is_a?(Grit::Blob) and c.name =~ /^readme/i }.first | 40 | - if content = contents.select{ |c| c.is_a?(Grit::Blob) and c.name =~ /^readme/i }.first |
41 | .file_holder#README | 41 | .file_holder#README |
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_gfm 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/_tree_file.html.haml
@@ -5,9 +5,9 @@ | @@ -5,9 +5,9 @@ | ||
5 | = name | 5 | = name |
6 | %small #{file.mode} | 6 | %small #{file.mode} |
7 | %span.options | 7 | %span.options |
8 | - = link_to "raw", blob_project_ref_path(@project, @ref, :path => params[:path]), :class => "btn very_small", :target => "_blank" | ||
9 | - = link_to "history", project_commits_path(@project, :path => params[:path], :ref => @ref), :class => "btn very_small" | ||
10 | - = link_to "blame", blame_file_project_ref_path(@project, @ref, :path => params[:path]), :class => "btn very_small" | 8 | + = link_to "raw", blob_project_ref_path(@project, @ref, path: params[:path]), class: "btn very_small", target: "_blank" |
9 | + = link_to "history", project_commits_path(@project, path: params[:path], ref: @ref), class: "btn very_small" | ||
10 | + = link_to "blame", blame_file_project_ref_path(@project, @ref, path: params[:path]), class: "btn very_small" | ||
11 | - if file.text? | 11 | - if file.text? |
12 | - if name =~ /\.(md|markdown)$/i | 12 | - if name =~ /\.(md|markdown)$/i |
13 | .file_content.wiki | 13 | .file_content.wiki |
@@ -16,7 +16,7 @@ | @@ -16,7 +16,7 @@ | ||
16 | - else | 16 | - else |
17 | .file_content.code | 17 | .file_content.code |
18 | - unless file.empty? | 18 | - unless file.empty? |
19 | - %div{:class => current_user.dark_scheme ? "black" : "white"} | 19 | + %div{class: current_user.dark_scheme ? "black" : "white"} |
20 | = preserve do | 20 | = preserve do |
21 | = raw file.colorize(options: { linenos: 'True'}) | 21 | = raw file.colorize(options: { linenos: 'True'}) |
22 | - else | 22 | - else |
@@ -24,14 +24,14 @@ | @@ -24,14 +24,14 @@ | ||
24 | 24 | ||
25 | - elsif file.image? | 25 | - elsif file.image? |
26 | .file_content.image_file | 26 | .file_content.image_file |
27 | - %img{ :src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} | 27 | + %img{ src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} |
28 | 28 | ||
29 | - else | 29 | - else |
30 | .file_content.blob_file | 30 | .file_content.blob_file |
31 | %center | 31 | %center |
32 | - = link_to blob_project_ref_path(@project, @ref, :path => params[:path]) do | 32 | + = link_to blob_project_ref_path(@project, @ref, path: params[:path]) do |
33 | %div.padded | 33 | %div.padded |
34 | %br | 34 | %br |
35 | - = image_tag "download.png", :width => 64 | 35 | + = image_tag "download.png", width: 64 |
36 | %h3 | 36 | %h3 |
37 | Download (#{file.mb_size}) | 37 | Download (#{file.mb_size}) |
app/views/refs/_tree_item.html.haml
1 | - file = tree_full_path(content) | 1 | - file = tree_full_path(content) |
2 | -%tr{ :class => "tree-item #{tree_hex_class(content)}", :url => tree_file_project_ref_path(@project, @ref, file) } | 2 | +%tr{ class: "tree-item #{tree_hex_class(content)}", url: tree_file_project_ref_path(@project, @ref, file) } |
3 | %td.tree-item-file-name | 3 | %td.tree-item-file-name |
4 | = tree_icon(content) | 4 | = tree_icon(content) |
5 | - = link_to truncate(content.name, :length => 40), tree_file_project_ref_path(@project, @ref || @commit.id, file), :remote => :true | 5 | + = link_to truncate(content.name, length: 40), tree_file_project_ref_path(@project, @ref || @commit.id, file), remote: :true |
6 | %td.tree_time_ago.cgray | 6 | %td.tree_time_ago.cgray |
7 | - if index == 1 | 7 | - if index == 1 |
8 | %span.log_loading | 8 | %span.log_loading |
9 | Loading commit data.. | 9 | Loading commit data.. |
10 | - = image_tag "ajax_loader_tree.gif", :width => 14 | 10 | + = image_tag "ajax_loader_tree.gif", width: 14 |
11 | %td.tree_commit | 11 | %td.tree_commit |
app/views/refs/blame.html.haml
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | %ul.breadcrumb | 4 | %ul.breadcrumb |
5 | %li | 5 | %li |
6 | %span.arrow | 6 | %span.arrow |
7 | - = link_to tree_project_ref_path(@project, @ref, :path => nil) do | 7 | + = link_to tree_project_ref_path(@project, @ref, path: nil) do |
8 | = @project.name | 8 | = @project.name |
9 | - @tree.breadcrumbs(6) do |link| | 9 | - @tree.breadcrumbs(6) do |link| |
10 | \/ | 10 | \/ |
@@ -18,9 +18,9 @@ | @@ -18,9 +18,9 @@ | ||
18 | = @tree.name | 18 | = @tree.name |
19 | %small blame | 19 | %small blame |
20 | %span.options | 20 | %span.options |
21 | - = link_to "raw", blob_project_ref_path(@project, @ref, :path => params[:path]), :class => "btn very_small", :target => "_blank" | ||
22 | - = link_to "history", project_commits_path(@project, :path => params[:path], :ref => @ref), :class => "btn very_small" | ||
23 | - = link_to "source", tree_file_project_ref_path(@project, @ref, :path => params[:path]), :class => "btn very_small" | 21 | + = link_to "raw", blob_project_ref_path(@project, @ref, path: params[:path]), class: "btn very_small", target: "_blank" |
22 | + = link_to "history", project_commits_path(@project, path: params[:path], ref: @ref), class: "btn very_small" | ||
23 | + = link_to "source", tree_file_project_ref_path(@project, @ref, path: params[:path]), class: "btn very_small" | ||
24 | .file_content.blame | 24 | .file_content.blame |
25 | %table | 25 | %table |
26 | - @blame.each do |commit, lines| | 26 | - @blame.each do |commit, lines| |
@@ -32,8 +32,8 @@ | @@ -32,8 +32,8 @@ | ||
32 | = commit.author_name | 32 | = commit.author_name |
33 | %td.blame_commit | 33 | %td.blame_commit |
34 | | 34 | |
35 | - %code= link_to commit.short_id, project_commit_path(@project, :id => commit.id) | ||
36 | - = link_to_gfm truncate(commit.title, :length => 30), project_commit_path(@project, :id => commit.id), :class => "row_title" rescue "--broken encoding" | 35 | + %code= link_to commit.short_id, project_commit_path(@project, id: commit.id) |
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/refs/logs_tree.js.haml
@@ -6,4 +6,4 @@ | @@ -6,4 +6,4 @@ | ||
6 | :plain | 6 | :plain |
7 | var row = $("table.table_#{@hex_path} tr.file_#{hexdigest(file_name)}"); | 7 | var row = $("table.table_#{@hex_path} tr.file_#{hexdigest(file_name)}"); |
8 | row.find("td.tree_time_ago").html('#{escape_javascript(time_ago_in_words(content_commit.committed_date))} ago'); | 8 | row.find("td.tree_time_ago").html('#{escape_javascript(time_ago_in_words(content_commit.committed_date))} ago'); |
9 | - row.find("td.tree_commit").html('#{escape_javascript(render("tree_commit", :tm => tm, :content_commit => content_commit))}'); | 9 | + row.find("td.tree_commit").html('#{escape_javascript(render("tree_commit", tm: tm, content_commit: content_commit))}'); |
app/views/refs/tree.html.haml
1 | = render "head" | 1 | = render "head" |
2 | -#tree-holder= render :partial => "tree", :locals => {:repo => @repo, :commit => @commit, :tree => @tree} | 2 | +#tree-holder= render partial: "tree", locals: {repo: @repo, commit: @commit, tree: @tree} |
3 | 3 | ||
4 | :javascript | 4 | :javascript |
5 | $(function() { | 5 | $(function() { |
app/views/refs/tree.js.haml
1 | :plain | 1 | :plain |
2 | // Load Files list | 2 | // Load Files list |
3 | - $("#tree-holder").html("#{escape_javascript(render(:partial => "tree", :locals => {:repo => @repo, :commit => @commit, :tree => @tree}))}"); | 3 | + $("#tree-holder").html("#{escape_javascript(render(partial: "tree", locals: {repo: @repo, commit: @commit, tree: @tree}))}"); |
4 | $("#tree-content-holder").show("slide", { direction: "right" }, 150); | 4 | $("#tree-content-holder").show("slide", { direction: "right" }, 150); |
5 | $('.project-refs-form #path').val("#{params[:path]}"); | 5 | $('.project-refs-form #path').val("#{params[:path]}"); |
6 | 6 |
app/views/repositories/_branch.html.haml
@@ -2,20 +2,20 @@ | @@ -2,20 +2,20 @@ | ||
2 | - commit = CommitDecorator.decorate(commit) | 2 | - commit = CommitDecorator.decorate(commit) |
3 | %tr | 3 | %tr |
4 | %td | 4 | %td |
5 | - = link_to project_commits_path(@project, :ref => branch.name) do | ||
6 | - %strong= truncate(branch.name, :length => 60) | 5 | + = link_to project_commits_path(@project, ref: branch.name) do |
6 | + %strong= truncate(branch.name, length: 60) | ||
7 | - if branch.name == @project.root_ref | 7 | - if branch.name == @project.root_ref |
8 | %span.label default | 8 | %span.label default |
9 | %td | 9 | %td |
10 | - = link_to project_commit_path(@project, :id => commit.id) do | 10 | + = link_to project_commit_path(@project, id: commit.id) do |
11 | %code= commit.short_id | 11 | %code= commit.short_id |
12 | 12 | ||
13 | - = image_tag gravatar_icon(commit.author_email), :class => "", :width => 16 | ||
14 | - = gfm truncate(commit.title, :length => 40) | 13 | + = image_tag gravatar_icon(commit.author_email), class: "", width: 16 |
14 | + = gfm truncate(commit.title, length: 40) | ||
15 | %span.update-author.right | 15 | %span.update-author.right |
16 | = time_ago_in_words(commit.committed_date) | 16 | = time_ago_in_words(commit.committed_date) |
17 | ago | 17 | ago |
18 | %td | 18 | %td |
19 | - if can? current_user, :download_code, @project | 19 | - if can? current_user, :download_code, @project |
20 | - = link_to "Download", archive_project_repository_path(@project, :ref => branch.name), :class => "visible_link download_repo_link" | 20 | + = link_to "Download", archive_project_repository_path(@project, ref: branch.name), class: "visible_link download_repo_link" |
21 | 21 |
app/views/repositories/_branches_head.html.haml
1 | = render "commits/head" | 1 | = render "commits/head" |
2 | %ul.nav.nav-pills | 2 | %ul.nav.nav-pills |
3 | - %li{:class => ("active" if current_page?(project_repository_path(@project)))} | 3 | + %li{class: ("active" if current_page?(project_repository_path(@project)))} |
4 | = link_to project_repository_path(@project) do | 4 | = link_to project_repository_path(@project) do |
5 | Recent | 5 | Recent |
6 | - %li{:class => ("active" if current_page?(project_protected_branches_path(@project)))} | 6 | + %li{class: ("active" if current_page?(project_protected_branches_path(@project)))} |
7 | = link_to project_protected_branches_path(@project) do | 7 | = link_to project_protected_branches_path(@project) do |
8 | Protected | 8 | Protected |
9 | - %li{:class => ("active" if current_page?(branches_project_repository_path(@project)))} | 9 | + %li{class: ("active" if current_page?(branches_project_repository_path(@project)))} |
10 | = link_to branches_project_repository_path(@project) do | 10 | = link_to branches_project_repository_path(@project) do |
11 | All | 11 | All |
app/views/repositories/_feed.html.haml
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | - commit = CommitDecorator.new(commit) | 2 | - commit = CommitDecorator.new(commit) |
3 | %tr | 3 | %tr |
4 | %td | 4 | %td |
5 | - = link_to project_commits_path(@project, :ref => commit.head.name) do | 5 | + = link_to project_commits_path(@project, ref: commit.head.name) do |
6 | %strong | 6 | %strong |
7 | = commit.head.name | 7 | = commit.head.name |
8 | - if commit.head.name == @project.root_ref | 8 | - if commit.head.name == @project.root_ref |
@@ -12,8 +12,8 @@ | @@ -12,8 +12,8 @@ | ||
12 | %div | 12 | %div |
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 | ||
16 | - = gfm truncate(commit.title, :length => 40) | 15 | + = image_tag gravatar_icon(commit.author_email), class: "", width: 16 |
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/branches.html.haml
app/views/repositories/show.html.haml
app/views/repositories/tags.html.haml
@@ -12,12 +12,12 @@ | @@ -12,12 +12,12 @@ | ||
12 | - commit = CommitDecorator.decorate(commit) | 12 | - commit = CommitDecorator.decorate(commit) |
13 | %tr | 13 | %tr |
14 | %td | 14 | %td |
15 | - %strong= link_to tag.name, project_commits_path(@project, :ref => tag.name), :class => "" | 15 | + %strong= link_to tag.name, project_commits_path(@project, ref: tag.name), class: "" |
16 | %td | 16 | %td |
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 | ||
20 | - = gfm truncate(commit.title, :length => 40) | 19 | + = image_tag gravatar_icon(commit.author_email), class: "", width: 16 |
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) |
@@ -25,7 +25,7 @@ | @@ -25,7 +25,7 @@ | ||
25 | | 25 | |
26 | %td | 26 | %td |
27 | - if can? current_user, :download_code, @project | 27 | - if can? current_user, :download_code, @project |
28 | - = link_to "Download", archive_project_repository_path(@project, :ref => tag.name), :class => "visible_link download_repo_link" | 28 | + = link_to "Download", archive_project_repository_path(@project, ref: tag.name), class: "visible_link download_repo_link" |
29 | 29 | ||
30 | - else | 30 | - else |
31 | %h3 No tags | 31 | %h3 No tags |
app/views/search/show.html.haml
1 | -= form_tag search_path, :method => :get do |f| | 1 | += form_tag search_path, method: :get do |f| |
2 | .padded | 2 | .padded |
3 | = label_tag :search do | 3 | = label_tag :search do |
4 | %strong Looking for | 4 | %strong Looking for |
5 | .input | 5 | .input |
6 | - = text_field_tag :search, params[:search], :placeholder => "issue 143", :class => "input-xxlarge", :id => "dashboard_search" | ||
7 | - = submit_tag 'Search', :class => "btn btn-primary" | 6 | + = text_field_tag :search, params[:search], placeholder: "issue 143", class: "input-xxlarge", id: "dashboard_search" |
7 | + = submit_tag 'Search', class: "btn btn-primary" | ||
8 | - if params[:search].present? | 8 | - if params[:search].present? |
9 | %br | 9 | %br |
10 | %h3 | 10 | %h3 |
@@ -41,7 +41,7 @@ | @@ -41,7 +41,7 @@ | ||
41 | = link_to [merge_request.project, merge_request] do | 41 | = link_to [merge_request.project, merge_request] do |
42 | %span.badge.badge-info ##{merge_request.id} | 42 | %span.badge.badge-info ##{merge_request.id} |
43 | – | 43 | – |
44 | - %strong.term= truncate merge_request.title, :length => 50 | 44 | + %strong.term= truncate merge_request.title, length: 50 |
45 | %strong.right | 45 | %strong.right |
46 | %span.label= merge_request.project.name | 46 | %span.label= merge_request.project.name |
47 | - if @merge_requests.blank? | 47 | - if @merge_requests.blank? |
@@ -59,7 +59,7 @@ | @@ -59,7 +59,7 @@ | ||
59 | = link_to [issue.project, issue] do | 59 | = link_to [issue.project, issue] do |
60 | %span.badge.badge-info ##{issue.id} | 60 | %span.badge.badge-info ##{issue.id} |
61 | – | 61 | – |
62 | - %strong.term= truncate issue.title, :length => 40 | 62 | + %strong.term= truncate issue.title, length: 40 |
63 | %strong.right | 63 | %strong.right |
64 | %span.label= issue.project.name | 64 | %span.label= issue.project.name |
65 | - if @issues.blank? | 65 | - if @issues.blank? |
app/views/snippets/_form.html.haml
@@ -10,22 +10,22 @@ | @@ -10,22 +10,22 @@ | ||
10 | 10 | ||
11 | .clearfix | 11 | .clearfix |
12 | = f.label :title | 12 | = f.label :title |
13 | - .input= f.text_field :title, :placeholder => "Example Snippet" | 13 | + .input= f.text_field :title, placeholder: "Example Snippet" |
14 | .clearfix | 14 | .clearfix |
15 | = f.label :file_name | 15 | = f.label :file_name |
16 | - .input= f.text_field :file_name, :placeholder => "example.rb" | 16 | + .input= f.text_field :file_name, placeholder: "example.rb" |
17 | .clearfix | 17 | .clearfix |
18 | = f.label "Lifetime" | 18 | = f.label "Lifetime" |
19 | - .input= f.select :expires_at, lifetime_select_options, {}, :style => "width:200px;" | 19 | + .input= f.select :expires_at, lifetime_select_options, {}, style: "width:200px;" |
20 | .clearfix | 20 | .clearfix |
21 | = f.label :content, "Code" | 21 | = f.label :content, "Code" |
22 | - .input= f.text_area :content, :class => "span8" | 22 | + .input= f.text_area :content, class: "span8" |
23 | 23 | ||
24 | .actions | 24 | .actions |
25 | - = f.submit 'Save', :class => "primary btn" | ||
26 | - = link_to "Cancel", project_snippets_path(@project), :class => " btn" | 25 | + = f.submit 'Save', class: "primary btn" |
26 | + = link_to "Cancel", project_snippets_path(@project), class: " btn" | ||
27 | - unless @snippet.new_record? | 27 | - unless @snippet.new_record? |
28 | - .right= link_to 'Destroy', [@project, @snippet], :confirm => 'Are you sure?', :method => :delete, :class => "btn right danger delete-snippet", :id => "destroy_snippet_#{@snippet.id}" | 28 | + .right= link_to 'Destroy', [@project, @snippet], confirm: 'Are you sure?', method: :delete, class: "btn right danger delete-snippet", id: "destroy_snippet_#{@snippet.id}" |
29 | 29 | ||
30 | 30 | ||
31 | 31 |
app/views/snippets/_snippet.html.haml
1 | %tr | 1 | %tr |
2 | %td | 2 | %td |
3 | - %a{:href => project_snippet_path(snippet.project, snippet)} | ||
4 | - %strong= truncate(snippet.title, :length => 60) | 3 | + %a{href: project_snippet_path(snippet.project, snippet)} |
4 | + %strong= truncate(snippet.title, length: 60) | ||
5 | %td | 5 | %td |
6 | = snippet.file_name | 6 | = snippet.file_name |
7 | %td | 7 | %td |
app/views/snippets/index.html.haml
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | 2 | ||
3 | - if can? current_user, :write_snippet, @project | 3 | - if can? current_user, :write_snippet, @project |
4 | .alert-message.block-message | 4 | .alert-message.block-message |
5 | - = link_to new_project_snippet_path(@project), :class => "btn small add_new right", :title => "New Snippet" do | 5 | + = link_to new_project_snippet_path(@project), class: "btn small add_new right", title: "New Snippet" do |
6 | Add new snippet | 6 | Add new snippet |
7 | Share code pastes with others if it cant be in a git repository | 7 | Share code pastes with others if it cant be in a git repository |
8 | %br | 8 | %br |
@@ -17,5 +17,5 @@ | @@ -17,5 +17,5 @@ | ||
17 | = render @snippets.fresh | 17 | = render @snippets.fresh |
18 | - if @snippets.fresh.empty? | 18 | - if @snippets.fresh.empty? |
19 | %tr | 19 | %tr |
20 | - %td{:colspan => 3} | 20 | + %td{colspan: 3} |
21 | %h3.nothing_here_message Nothing here. | 21 | %h3.nothing_here_message Nothing here. |
app/views/snippets/show.html.haml
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | = @snippet.title | 4 | = @snippet.title |
5 | %small= @snippet.file_name | 5 | %small= @snippet.file_name |
6 | - if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user | 6 | - if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user |
7 | - = link_to "Edit", edit_project_snippet_path(@project, @snippet), :class => "btn small right" | 7 | + = link_to "Edit", edit_project_snippet_path(@project, @snippet), class: "btn small right" |
8 | 8 | ||
9 | %br | 9 | %br |
10 | .file_holder | 10 | .file_holder |
@@ -12,9 +12,9 @@ | @@ -12,9 +12,9 @@ | ||
12 | %i.icon-file | 12 | %i.icon-file |
13 | %strong= @snippet.file_name | 13 | %strong= @snippet.file_name |
14 | %span.options | 14 | %span.options |
15 | - = link_to "raw", raw_project_snippet_path(@project, @snippet), :class => "btn very_small", :target => "_blank" | 15 | + = link_to "raw", raw_project_snippet_path(@project, @snippet), class: "btn very_small", target: "_blank" |
16 | .file_content.code | 16 | .file_content.code |
17 | - %div{:class => current_user.dark_scheme ? "black" : ""} | 17 | + %div{class: current_user.dark_scheme ? "black" : ""} |
18 | = raw @snippet.colorize(options: { linenos: 'True'}) | 18 | = raw @snippet.colorize(options: { linenos: 'True'}) |
19 | 19 | ||
20 | -= render "notes/notes", :tid => @snippet.id, :tt => "snippet" | 20 | += render "notes/notes", tid: @snippet.id, tt: "snippet" |
app/views/team_members/_form.html.haml
1 | %h3= "New Team member" | 1 | %h3= "New Team member" |
2 | %hr | 2 | %hr |
3 | -= form_for @team_member, :as => :team_member, :url => project_team_members_path(@project, @team_member) do |f| | 3 | += form_for @team_member, as: :team_member, url: project_team_members_path(@project, @team_member) do |f| |
4 | -if @team_member.errors.any? | 4 | -if @team_member.errors.any? |
5 | .alert-message.block-message.error | 5 | .alert-message.block-message.error |
6 | %ul | 6 | %ul |
@@ -9,17 +9,17 @@ | @@ -9,17 +9,17 @@ | ||
9 | 9 | ||
10 | .clearfix | 10 | .clearfix |
11 | = f.label :user_id, "Name" | 11 | = f.label :user_id, "Name" |
12 | - .input= f.select(:user_id, User.not_in_project(@project).all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" }, { :style => "width:300px" }) | 12 | + .input= f.select(:user_id, User.not_in_project(@project).all.collect {|p| [ p.name, p.id ] }, { include_blank: "Select user" }, { style: "width:300px" }) |
13 | 13 | ||
14 | 14 | ||
15 | .clearfix | 15 | .clearfix |
16 | = f.label :project_access, "Project Access" | 16 | = f.label :project_access, "Project Access" |
17 | - .input= f.select :project_access, options_for_select(Project.access_options, @team_member.project_access), {}, :class => "project-access-select" | 17 | + .input= f.select :project_access, options_for_select(Project.access_options, @team_member.project_access), {}, class: "project-access-select" |
18 | 18 | ||
19 | 19 | ||
20 | .actions | 20 | .actions |
21 | - = f.submit 'Save', :class => "btn primary" | ||
22 | - = link_to "Cancel", team_project_path(@project), :class => "btn" | 21 | + = f.submit 'Save', class: "btn primary" |
22 | + = link_to "Cancel", team_project_path(@project), class: "btn" | ||
23 | 23 | ||
24 | :css | 24 | :css |
25 | form select { | 25 | form select { |
app/views/team_members/_show.html.haml
1 | - user = member.user | 1 | - user = member.user |
2 | - allow_admin = can? current_user, :admin_project, @project | 2 | - allow_admin = can? current_user, :admin_project, @project |
3 | -%tr{:id => dom_id(member), :class => "team_member_row user_#{user.id}"} | 3 | +%tr{id: dom_id(member), class: "team_member_row user_#{user.id}"} |
4 | %td | 4 | %td |
5 | .right | 5 | .right |
6 | - if @project.owner == user | 6 | - if @project.owner == user |
@@ -8,13 +8,13 @@ | @@ -8,13 +8,13 @@ | ||
8 | - if user.blocked | 8 | - if user.blocked |
9 | %span.label Blocked | 9 | %span.label Blocked |
10 | 10 | ||
11 | - = link_to project_team_member_path(@project, member), :title => user.name, :class => "dark" do | ||
12 | - = image_tag gravatar_icon(user.email, 40), :class => "avatar" | ||
13 | - = link_to project_team_member_path(@project, member), :title => user.name, :class => "dark" do | ||
14 | - %strong= truncate(user.name, :lenght => 40) | 11 | + = link_to project_team_member_path(@project, member), title: user.name, class: "dark" do |
12 | + = image_tag gravatar_icon(user.email, 40), class: "avatar" | ||
13 | + = link_to project_team_member_path(@project, member), title: user.name, class: "dark" do | ||
14 | + %strong= truncate(user.name, lenght: 40) | ||
15 | %br | 15 | %br |
16 | %div.cgray= user.email | 16 | %div.cgray= user.email |
17 | 17 | ||
18 | %td | 18 | %td |
19 | - = form_for(member, :as => :team_member, :url => project_team_member_path(@project, member)) do |f| | ||
20 | - = f.select :project_access, options_for_select(UsersProject.access_roles, member.project_access), {}, :class => "medium project-access-select", :disabled => !allow_admin | 19 | + = form_for(member, as: :team_member, url: project_team_member_path(@project, member)) do |f| |
20 | + = f.select :project_access, options_for_select(UsersProject.access_roles, member.project_access), {}, class: "medium project-access-select", disabled: !allow_admin |
app/views/team_members/show.html.haml
@@ -3,9 +3,9 @@ | @@ -3,9 +3,9 @@ | ||
3 | 3 | ||
4 | .team_member_show | 4 | .team_member_show |
5 | - if can? current_user, :admin_project, @project | 5 | - if can? current_user, :admin_project, @project |
6 | - = link_to 'Remove from team', project_team_member_path(:project_id => @project, :id => @team_member.id), :confirm => 'Are you sure?', :method => :delete, :class => "right btn btn-danger" | 6 | + = link_to 'Remove from team', project_team_member_path(project_id: @project, id: @team_member.id), confirm: 'Are you sure?', method: :delete, class: "right btn btn-danger" |
7 | .profile_avatar_holder | 7 | .profile_avatar_holder |
8 | - = image_tag gravatar_icon(user.email, 60), :class => "borders" | 8 | + = image_tag gravatar_icon(user.email, 60), class: "borders" |
9 | %h3 | 9 | %h3 |
10 | = user.name | 10 | = user.name |
11 | %small | 11 | %small |
@@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
14 | %hr | 14 | %hr |
15 | .back_link | 15 | .back_link |
16 | %br | 16 | %br |
17 | - = link_to team_project_path(@project), :class => "" do | 17 | + = link_to team_project_path(@project), class: "" do |
18 | ← To team list | 18 | ← To team list |
19 | %br | 19 | %br |
20 | .row | 20 | .row |
@@ -46,10 +46,10 @@ | @@ -46,10 +46,10 @@ | ||
46 | %tr | 46 | %tr |
47 | %td | 47 | %td |
48 | Project Access: | 48 | Project Access: |
49 | - %small (#{link_to "read more", help_permissions_path, :class => "vlink"}) | 49 | + %small (#{link_to "read more", help_permissions_path, class: "vlink"}) |
50 | %td | 50 | %td |
51 | - = form_for(@team_member, :as => :team_member, :url => project_team_member_path(@project, @team_member)) do |f| | ||
52 | - = f.select :project_access, options_for_select(Project.access_options, @team_member.project_access), {}, :class => "project-access-select", :disabled => !allow_admin | 51 | + = form_for(@team_member, as: :team_member, url: project_team_member_path(@project, @team_member)) do |f| |
52 | + = f.select :project_access, options_for_select(Project.access_options, @team_member.project_access), {}, class: "project-access-select", disabled: !allow_admin | ||
53 | %hr | 53 | %hr |
54 | = render user.recent_events.limit(5) | 54 | = render user.recent_events.limit(5) |
55 | :javascript | 55 | :javascript |
app/views/wikis/_form.html.haml
@@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
9 | .main_box | 9 | .main_box |
10 | .top_box_content | 10 | .top_box_content |
11 | = f.label :title | 11 | = f.label :title |
12 | - .input= f.text_field :title, :class => 'span8' | 12 | + .input= f.text_field :title, class: 'span8' |
13 | = f.hidden_field :slug | 13 | = f.hidden_field :slug |
14 | .middle_box_content | 14 | .middle_box_content |
15 | .input | 15 | .input |
@@ -20,7 +20,7 @@ | @@ -20,7 +20,7 @@ | ||
20 | 20 | ||
21 | .bottom_box_content | 21 | .bottom_box_content |
22 | = f.label :content | 22 | = f.label :content |
23 | - .input= f.text_area :content, :class => 'span8' | 23 | + .input= f.text_area :content, class: 'span8' |
24 | .actions | 24 | .actions |
25 | - = f.submit 'Save', :class => "primary btn" | ||
26 | - = link_to "Cancel", project_wiki_path(@project, :index), :class => "btn" | 25 | + = f.submit 'Save', class: "primary btn" |
26 | + = link_to "Cancel", project_wiki_path(@project, :index), class: "btn" |
app/views/wikis/history.html.haml
@@ -13,7 +13,7 @@ | @@ -13,7 +13,7 @@ | ||
13 | %tr | 13 | %tr |
14 | %td= i + 1 | 14 | %td= i + 1 |
15 | %td | 15 | %td |
16 | - = link_to wiki_page.created_at.to_s(:short), project_wiki_path(@project, wiki_page, :old_page_id => wiki_page.id) | 16 | + = link_to wiki_page.created_at.to_s(:short), project_wiki_path(@project, wiki_page, old_page_id: wiki_page.id) |
17 | (#{time_ago_in_words(wiki_page.created_at)} | 17 | (#{time_ago_in_words(wiki_page.created_at)} |
18 | ago) | 18 | ago) |
19 | %td= wiki_page.user.name | 19 | %td= wiki_page.user.name |
app/views/wikis/pages.html.haml
@@ -10,7 +10,7 @@ | @@ -10,7 +10,7 @@ | ||
10 | - @wikis.each_with_index do |wiki_page, i| | 10 | - @wikis.each_with_index do |wiki_page, i| |
11 | %tr | 11 | %tr |
12 | %td | 12 | %td |
13 | - = link_to wiki_page.title, project_wiki_path(@project, wiki_page, :old_page_id => wiki_page.id) | 13 | + = link_to wiki_page.title, project_wiki_path(@project, wiki_page, old_page_id: wiki_page.id) |
14 | (#{time_ago_in_words(wiki_page.created_at)} | 14 | (#{time_ago_in_words(wiki_page.created_at)} |
15 | ago) | 15 | ago) |
16 | %td= wiki_page.slug | 16 | %td= wiki_page.slug |
app/views/wikis/show.html.haml
1 | %h3.page_title | 1 | %h3.page_title |
2 | = @wiki.title | 2 | = @wiki.title |
3 | %span.right | 3 | %span.right |
4 | - = link_to pages_project_wikis_path(@project), :class => "btn small grouped" do | 4 | + = link_to pages_project_wikis_path(@project), class: "btn small grouped" do |
5 | Pages | 5 | Pages |
6 | - if can? current_user, :write_wiki, @project | 6 | - if can? current_user, :write_wiki, @project |
7 | - = link_to history_project_wiki_path(@project, @wiki), :class => "btn small grouped" do | 7 | + = link_to history_project_wiki_path(@project, @wiki), class: "btn small grouped" do |
8 | History | 8 | History |
9 | - = link_to edit_project_wiki_path(@project, @wiki), :class => "btn small grouped" do | 9 | + = link_to edit_project_wiki_path(@project, @wiki), class: "btn small grouped" do |
10 | %i.icon-edit | 10 | %i.icon-edit |
11 | Edit | 11 | Edit |
12 | %br | 12 | %br |
@@ -17,8 +17,8 @@ | @@ -17,8 +17,8 @@ | ||
17 | 17 | ||
18 | %p.time Last edited by #{@wiki.user.name}, #{time_ago_in_words @wiki.created_at} ago | 18 | %p.time Last edited by #{@wiki.user.name}, #{time_ago_in_words @wiki.created_at} ago |
19 | - if can? current_user, :admin_wiki, @project | 19 | - if can? current_user, :admin_wiki, @project |
20 | - = link_to project_wiki_path(@project, @wiki), :confirm => "Are you sure you want to delete this page?", :method => :delete do | 20 | + = link_to project_wiki_path(@project, @wiki), confirm: "Are you sure you want to delete this page?", method: :delete do |
21 | Delete this page | 21 | Delete this page |
22 | 22 | ||
23 | %hr | 23 | %hr |
24 | -.wiki_notes#notes= render "notes/notes", :tid => @wiki.id, :tt => "wiki" | 24 | +.wiki_notes#notes= render "notes/notes", tid: @wiki.id, tt: "wiki" |
lib/api.rb
@@ -3,7 +3,7 @@ Dir["#{Rails.root}/lib/api/*.rb"].each {|file| require file} | @@ -3,7 +3,7 @@ Dir["#{Rails.root}/lib/api/*.rb"].each {|file| require file} | ||
3 | module Gitlab | 3 | module Gitlab |
4 | class API < Grape::API | 4 | class API < Grape::API |
5 | VERSION = 'v2' | 5 | VERSION = 'v2' |
6 | - version VERSION, :using => :path | 6 | + version VERSION, using: :path |
7 | 7 | ||
8 | rescue_from ActiveRecord::RecordNotFound do | 8 | rescue_from ActiveRecord::RecordNotFound do |
9 | rack_response({'message' => '404 Not found'}.to_json, 404) | 9 | rack_response({'message' => '404 Not found'}.to_json, 404) |
lib/api/entities.rb
@@ -11,8 +11,8 @@ module Gitlab | @@ -11,8 +11,8 @@ module Gitlab | ||
11 | 11 | ||
12 | class Project < Grape::Entity | 12 | class Project < Grape::Entity |
13 | expose :id, :code, :name, :description, :path, :default_branch | 13 | expose :id, :code, :name, :description, :path, :default_branch |
14 | - expose :owner, :using => Entities::UserBasic | ||
15 | - expose :private_flag, :as => :private | 14 | + expose :owner, using: Entities::UserBasic |
15 | + expose :private_flag, as: :private | ||
16 | expose :issues_enabled, :merge_requests_enabled, :wall_enabled, :wiki_enabled, :created_at | 16 | expose :issues_enabled, :merge_requests_enabled, :wall_enabled, :wiki_enabled, :created_at |
17 | end | 17 | end |
18 | 18 | ||
@@ -22,7 +22,7 @@ module Gitlab | @@ -22,7 +22,7 @@ module Gitlab | ||
22 | 22 | ||
23 | class ProjectSnippet < Grape::Entity | 23 | class ProjectSnippet < Grape::Entity |
24 | expose :id, :title, :file_name | 24 | expose :id, :title, :file_name |
25 | - expose :author, :using => Entities::UserBasic | 25 | + expose :author, using: Entities::UserBasic |
26 | expose :expires_at, :updated_at, :created_at | 26 | expose :expires_at, :updated_at, :created_at |
27 | end | 27 | end |
28 | 28 | ||
@@ -34,9 +34,9 @@ module Gitlab | @@ -34,9 +34,9 @@ module Gitlab | ||
34 | expose :id | 34 | expose :id |
35 | expose (:project_id) {|issue| issue.project.id} | 35 | expose (:project_id) {|issue| issue.project.id} |
36 | expose :title, :description | 36 | expose :title, :description |
37 | - expose :label_list, :as => :labels | ||
38 | - expose :milestone, :using => Entities::Milestone | ||
39 | - expose :assignee, :author, :using => Entities::UserBasic | 37 | + expose :label_list, as: :labels |
38 | + expose :milestone, using: Entities::Milestone | ||
39 | + expose :assignee, :author, using: Entities::UserBasic | ||
40 | expose :closed, :updated_at, :created_at | 40 | expose :closed, :updated_at, :created_at |
41 | end | 41 | end |
42 | end | 42 | end |
lib/api/issues.rb
@@ -9,7 +9,7 @@ module Gitlab | @@ -9,7 +9,7 @@ module Gitlab | ||
9 | # Example Request: | 9 | # Example Request: |
10 | # GET /issues | 10 | # GET /issues |
11 | get do | 11 | get do |
12 | - present current_user.issues, :with => Entities::Issue | 12 | + present current_user.issues, with: Entities::Issue |
13 | end | 13 | end |
14 | end | 14 | end |
15 | 15 | ||
@@ -21,7 +21,7 @@ module Gitlab | @@ -21,7 +21,7 @@ module Gitlab | ||
21 | # Example Request: | 21 | # Example Request: |
22 | # GET /projects/:id/issues | 22 | # GET /projects/:id/issues |
23 | get ":id/issues" do | 23 | get ":id/issues" do |
24 | - present user_project.issues, :with => Entities::Issue | 24 | + present user_project.issues, with: Entities::Issue |
25 | end | 25 | end |
26 | 26 | ||
27 | # Get a single project issue | 27 | # Get a single project issue |
@@ -33,7 +33,7 @@ module Gitlab | @@ -33,7 +33,7 @@ module Gitlab | ||
33 | # GET /projects/:id/issues/:issue_id | 33 | # GET /projects/:id/issues/:issue_id |
34 | get ":id/issues/:issue_id" do | 34 | get ":id/issues/:issue_id" do |
35 | @issue = user_project.issues.find(params[:issue_id]) | 35 | @issue = user_project.issues.find(params[:issue_id]) |
36 | - present @issue, :with => Entities::Issue | 36 | + present @issue, with: Entities::Issue |
37 | end | 37 | end |
38 | 38 | ||
39 | # Create a new project issue | 39 | # Create a new project issue |
@@ -49,16 +49,16 @@ module Gitlab | @@ -49,16 +49,16 @@ module Gitlab | ||
49 | # POST /projects/:id/issues | 49 | # POST /projects/:id/issues |
50 | post ":id/issues" do | 50 | post ":id/issues" do |
51 | @issue = user_project.issues.new( | 51 | @issue = user_project.issues.new( |
52 | - :title => params[:title], | ||
53 | - :description => params[:description], | ||
54 | - :assignee_id => params[:assignee_id], | ||
55 | - :milestone_id => params[:milestone_id], | ||
56 | - :label_list => params[:labels] | 52 | + title: params[:title], |
53 | + description: params[:description], | ||
54 | + assignee_id: params[:assignee_id], | ||
55 | + milestone_id: params[:milestone_id], | ||
56 | + label_list: params[:labels] | ||
57 | ) | 57 | ) |
58 | @issue.author = current_user | 58 | @issue.author = current_user |
59 | 59 | ||
60 | if @issue.save | 60 | if @issue.save |
61 | - present @issue, :with => Entities::Issue | 61 | + present @issue, with: Entities::Issue |
62 | else | 62 | else |
63 | error!({'message' => '404 Not found'}, 404) | 63 | error!({'message' => '404 Not found'}, 404) |
64 | end | 64 | end |
@@ -80,16 +80,16 @@ module Gitlab | @@ -80,16 +80,16 @@ module Gitlab | ||
80 | put ":id/issues/:issue_id" do | 80 | put ":id/issues/:issue_id" do |
81 | @issue = user_project.issues.find(params[:issue_id]) | 81 | @issue = user_project.issues.find(params[:issue_id]) |
82 | parameters = { | 82 | parameters = { |
83 | - :title => (params[:title] || @issue.title), | ||
84 | - :description => (params[:description] || @issue.description), | ||
85 | - :assignee_id => (params[:assignee_id] || @issue.assignee_id), | ||
86 | - :milestone_id => (params[:milestone_id] || @issue.milestone_id), | ||
87 | - :label_list => (params[:labels] || @issue.label_list), | ||
88 | - :closed => (params[:closed] || @issue.closed) | 83 | + title: (params[:title] || @issue.title), |
84 | + description: (params[:description] || @issue.description), | ||
85 | + assignee_id: (params[:assignee_id] || @issue.assignee_id), | ||
86 | + milestone_id: (params[:milestone_id] || @issue.milestone_id), | ||
87 | + label_list: (params[:labels] || @issue.label_list), | ||
88 | + closed: (params[:closed] || @issue.closed) | ||
89 | } | 89 | } |
90 | 90 | ||
91 | if @issue.update_attributes(parameters) | 91 | if @issue.update_attributes(parameters) |
92 | - present @issue, :with => Entities::Issue | 92 | + present @issue, with: Entities::Issue |
93 | else | 93 | else |
94 | error!({'message' => '404 Not found'}, 404) | 94 | error!({'message' => '404 Not found'}, 404) |
95 | end | 95 | end |
lib/api/projects.rb
@@ -10,7 +10,7 @@ module Gitlab | @@ -10,7 +10,7 @@ module Gitlab | ||
10 | # GET /projects | 10 | # GET /projects |
11 | get do | 11 | get do |
12 | @projects = current_user.projects | 12 | @projects = current_user.projects |
13 | - present @projects, :with => Entities::Project | 13 | + present @projects, with: Entities::Project |
14 | end | 14 | end |
15 | 15 | ||
16 | # Get a single project | 16 | # Get a single project |
@@ -20,7 +20,7 @@ module Gitlab | @@ -20,7 +20,7 @@ module Gitlab | ||
20 | # Example Request: | 20 | # Example Request: |
21 | # GET /projects/:id | 21 | # GET /projects/:id |
22 | get ":id" do | 22 | get ":id" do |
23 | - present user_project, :with => Entities::Project | 23 | + present user_project, with: Entities::Project |
24 | end | 24 | end |
25 | 25 | ||
26 | # Get a project repository branches | 26 | # Get a project repository branches |
@@ -30,7 +30,7 @@ module Gitlab | @@ -30,7 +30,7 @@ module Gitlab | ||
30 | # Example Request: | 30 | # Example Request: |
31 | # GET /projects/:id/repository/branches | 31 | # GET /projects/:id/repository/branches |
32 | get ":id/repository/branches" do | 32 | get ":id/repository/branches" do |
33 | - present user_project.repo.heads.sort_by(&:name), :with => Entities::RepoObject | 33 | + present user_project.repo.heads.sort_by(&:name), with: Entities::RepoObject |
34 | end | 34 | end |
35 | 35 | ||
36 | # Get a single branch | 36 | # Get a single branch |
@@ -42,7 +42,7 @@ module Gitlab | @@ -42,7 +42,7 @@ module Gitlab | ||
42 | # GET /projects/:id/repository/branches/:branch | 42 | # GET /projects/:id/repository/branches/:branch |
43 | get ":id/repository/branches/:branch" do | 43 | get ":id/repository/branches/:branch" do |
44 | @branch = user_project.repo.heads.find { |item| item.name == params[:branch] } | 44 | @branch = user_project.repo.heads.find { |item| item.name == params[:branch] } |
45 | - present @branch, :with => Entities::RepoObject | 45 | + present @branch, with: Entities::RepoObject |
46 | end | 46 | end |
47 | 47 | ||
48 | # Get a project repository tags | 48 | # Get a project repository tags |
@@ -52,7 +52,7 @@ module Gitlab | @@ -52,7 +52,7 @@ module Gitlab | ||
52 | # Example Request: | 52 | # Example Request: |
53 | # GET /projects/:id/repository/tags | 53 | # GET /projects/:id/repository/tags |
54 | get ":id/repository/tags" do | 54 | get ":id/repository/tags" do |
55 | - present user_project.repo.tags.sort_by(&:name).reverse, :with => Entities::RepoObject | 55 | + present user_project.repo.tags.sort_by(&:name).reverse, with: Entities::RepoObject |
56 | end | 56 | end |
57 | 57 | ||
58 | # Get a project snippet | 58 | # Get a project snippet |
@@ -64,7 +64,7 @@ module Gitlab | @@ -64,7 +64,7 @@ module Gitlab | ||
64 | # GET /projects/:id/snippets/:snippet_id | 64 | # GET /projects/:id/snippets/:snippet_id |
65 | get ":id/snippets/:snippet_id" do | 65 | get ":id/snippets/:snippet_id" do |
66 | @snippet = user_project.snippets.find(params[:snippet_id]) | 66 | @snippet = user_project.snippets.find(params[:snippet_id]) |
67 | - present @snippet, :with => Entities::ProjectSnippet | 67 | + present @snippet, with: Entities::ProjectSnippet |
68 | end | 68 | end |
69 | 69 | ||
70 | # Create a new project snippet | 70 | # Create a new project snippet |
@@ -79,15 +79,15 @@ module Gitlab | @@ -79,15 +79,15 @@ module Gitlab | ||
79 | # POST /projects/:id/snippets | 79 | # POST /projects/:id/snippets |
80 | post ":id/snippets" do | 80 | post ":id/snippets" do |
81 | @snippet = user_project.snippets.new( | 81 | @snippet = user_project.snippets.new( |
82 | - :title => params[:title], | ||
83 | - :file_name => params[:file_name], | ||
84 | - :expires_at => params[:lifetime], | ||
85 | - :content => params[:code] | 82 | + title: params[:title], |
83 | + file_name: params[:file_name], | ||
84 | + expires_at: params[:lifetime], | ||
85 | + content: params[:code] | ||
86 | ) | 86 | ) |
87 | @snippet.author = current_user | 87 | @snippet.author = current_user |
88 | 88 | ||
89 | if @snippet.save | 89 | if @snippet.save |
90 | - present @snippet, :with => Entities::ProjectSnippet | 90 | + present @snippet, with: Entities::ProjectSnippet |
91 | else | 91 | else |
92 | error!({'message' => '404 Not found'}, 404) | 92 | error!({'message' => '404 Not found'}, 404) |
93 | end | 93 | end |
@@ -107,14 +107,14 @@ module Gitlab | @@ -107,14 +107,14 @@ module Gitlab | ||
107 | put ":id/snippets/:snippet_id" do | 107 | put ":id/snippets/:snippet_id" do |
108 | @snippet = user_project.snippets.find(params[:snippet_id]) | 108 | @snippet = user_project.snippets.find(params[:snippet_id]) |
109 | parameters = { | 109 | parameters = { |
110 | - :title => (params[:title] || @snippet.title), | ||
111 | - :file_name => (params[:file_name] || @snippet.file_name), | ||
112 | - :expires_at => (params[:lifetime] || @snippet.expires_at), | ||
113 | - :content => (params[:code] || @snippet.content) | 110 | + title: (params[:title] || @snippet.title), |
111 | + file_name: (params[:file_name] || @snippet.file_name), | ||
112 | + expires_at: (params[:lifetime] || @snippet.expires_at), | ||
113 | + content: (params[:code] || @snippet.content) | ||
114 | } | 114 | } |
115 | 115 | ||
116 | if @snippet.update_attributes(parameters) | 116 | if @snippet.update_attributes(parameters) |
117 | - present @snippet, :with => Entities::ProjectSnippet | 117 | + present @snippet, with: Entities::ProjectSnippet |
118 | else | 118 | else |
119 | error!({'message' => '404 Not found'}, 404) | 119 | error!({'message' => '404 Not found'}, 404) |
120 | end | 120 | end |
lib/api/users.rb
@@ -10,7 +10,7 @@ module Gitlab | @@ -10,7 +10,7 @@ module Gitlab | ||
10 | # GET /users | 10 | # GET /users |
11 | get do | 11 | get do |
12 | @users = User.all | 12 | @users = User.all |
13 | - present @users, :with => Entities::User | 13 | + present @users, with: Entities::User |
14 | end | 14 | end |
15 | 15 | ||
16 | # Get a single user | 16 | # Get a single user |
@@ -21,7 +21,7 @@ module Gitlab | @@ -21,7 +21,7 @@ module Gitlab | ||
21 | # GET /users/:id | 21 | # GET /users/:id |
22 | get ":id" do | 22 | get ":id" do |
23 | @user = User.find(params[:id]) | 23 | @user = User.find(params[:id]) |
24 | - present @user, :with => Entities::User | 24 | + present @user, with: Entities::User |
25 | end | 25 | end |
26 | end | 26 | end |
27 | 27 | ||
@@ -30,7 +30,7 @@ module Gitlab | @@ -30,7 +30,7 @@ module Gitlab | ||
30 | # Example Request: | 30 | # Example Request: |
31 | # GET /user | 31 | # GET /user |
32 | get "/user" do | 32 | get "/user" do |
33 | - present @current_user, :with => Entities::User | 33 | + present @current_user, with: Entities::User |
34 | end | 34 | end |
35 | end | 35 | end |
36 | end | 36 | end |
lib/file_size_validator.rb
1 | class FileSizeValidator < ActiveModel::EachValidator | 1 | class FileSizeValidator < ActiveModel::EachValidator |
2 | - MESSAGES = { :is => :wrong_size, :minimum => :size_too_small, :maximum => :size_too_big }.freeze | ||
3 | - CHECKS = { :is => :==, :minimum => :>=, :maximum => :<= }.freeze | 2 | + MESSAGES = { is: :wrong_size, minimum: :size_too_small, maximum: :size_too_big }.freeze |
3 | + CHECKS = { is: :==, minimum: :>=, maximum: :<= }.freeze | ||
4 | 4 | ||
5 | DEFAULT_TOKENIZER = lambda { |value| value.split(//) } | 5 | DEFAULT_TOKENIZER = lambda { |value| value.split(//) } |
6 | RESERVED_OPTIONS = [:minimum, :maximum, :within, :is, :tokenizer, :too_short, :too_long] | 6 | RESERVED_OPTIONS = [:minimum, :maximum, :within, :is, :tokenizer, :too_short, :too_long] |
lib/gitlab/encode.rb
@@ -19,7 +19,7 @@ module Gitlab | @@ -19,7 +19,7 @@ module Gitlab | ||
19 | # if message is not utf-8 encoding, convert it | 19 | # if message is not utf-8 encoding, convert it |
20 | if detect[:encoding] | 20 | if detect[:encoding] |
21 | message.force_encoding(detect[:encoding]) | 21 | message.force_encoding(detect[:encoding]) |
22 | - message.encode!("utf-8", detect[:encoding], :undef => :replace, :replace => "", :invalid => :replace) | 22 | + message.encode!("utf-8", detect[:encoding], undef: :replace, replace: "", invalid: :replace) |
23 | end | 23 | end |
24 | 24 | ||
25 | # ensure message encoding is utf8 | 25 | # ensure message encoding is utf8 |
lib/graph_commit.rb
@@ -6,7 +6,7 @@ class GraphCommit | @@ -6,7 +6,7 @@ class GraphCommit | ||
6 | 6 | ||
7 | def self.to_graph(project) | 7 | def self.to_graph(project) |
8 | @repo = project.repo | 8 | @repo = project.repo |
9 | - commits = Grit::Commit.find_all(@repo, nil, {:max_count => 650}) | 9 | + commits = Grit::Commit.find_all(@repo, nil, {max_count: 650}) |
10 | 10 | ||
11 | ref_cache = {} | 11 | ref_cache = {} |
12 | 12 |
lib/redcarpet/render/gitlab_html.rb
@@ -11,9 +11,9 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML | @@ -11,9 +11,9 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML | ||
11 | 11 | ||
12 | def block_code(code, language) | 12 | def block_code(code, language) |
13 | if Pygments::Lexer.find(language) | 13 | if Pygments::Lexer.find(language) |
14 | - Pygments.highlight(code, :lexer => language, :options => {:encoding => 'utf-8'}) | 14 | + Pygments.highlight(code, lexer: language, options: {encoding: 'utf-8'}) |
15 | else | 15 | else |
16 | - Pygments.highlight(code, :options => {:encoding => 'utf-8'}) | 16 | + Pygments.highlight(code, options: {encoding: 'utf-8'}) |
17 | end | 17 | end |
18 | end | 18 | end |
19 | 19 |
spec/api/issues_spec.rb
@@ -2,8 +2,8 @@ require 'spec_helper' | @@ -2,8 +2,8 @@ require 'spec_helper' | ||
2 | 2 | ||
3 | describe Gitlab::API do | 3 | describe Gitlab::API do |
4 | let(:user) { Factory :user } | 4 | let(:user) { Factory :user } |
5 | - let!(:project) { Factory :project, :owner => user } | ||
6 | - let!(:issue) { Factory :issue, :author => user, :assignee => user, :project => project } | 5 | + let!(:project) { Factory :project, owner: user } |
6 | + let!(:issue) { Factory :issue, author: user, assignee: user, project: project } | ||
7 | before { project.add_access(user, :read) } | 7 | before { project.add_access(user, :read) } |
8 | 8 | ||
9 | describe "GET /issues" do | 9 | describe "GET /issues" do |
@@ -42,7 +42,7 @@ describe Gitlab::API do | @@ -42,7 +42,7 @@ describe Gitlab::API do | ||
42 | describe "POST /projects/:id/issues" do | 42 | describe "POST /projects/:id/issues" do |
43 | it "should create a new project issue" do | 43 | it "should create a new project issue" do |
44 | post "#{api_prefix}/projects/#{project.code}/issues?private_token=#{user.private_token}", | 44 | post "#{api_prefix}/projects/#{project.code}/issues?private_token=#{user.private_token}", |
45 | - :title => 'new issue', :labels => 'label, label2' | 45 | + title: 'new issue', labels: 'label, label2' |
46 | response.status.should == 201 | 46 | response.status.should == 201 |
47 | json_response['title'].should == 'new issue' | 47 | json_response['title'].should == 'new issue' |
48 | json_response['description'].should be_nil | 48 | json_response['description'].should be_nil |
@@ -53,7 +53,7 @@ describe Gitlab::API do | @@ -53,7 +53,7 @@ describe Gitlab::API do | ||
53 | describe "PUT /projects/:id/issues/:issue_id" do | 53 | describe "PUT /projects/:id/issues/:issue_id" do |
54 | it "should update a project issue" do | 54 | it "should update a project issue" do |
55 | put "#{api_prefix}/projects/#{project.code}/issues/#{issue.id}?private_token=#{user.private_token}", | 55 | put "#{api_prefix}/projects/#{project.code}/issues/#{issue.id}?private_token=#{user.private_token}", |
56 | - :title => 'updated title', :labels => 'label2', :closed => 1 | 56 | + title: 'updated title', labels: 'label2', closed: 1 |
57 | response.status.should == 200 | 57 | response.status.should == 200 |
58 | json_response['title'].should == 'updated title' | 58 | json_response['title'].should == 'updated title' |
59 | json_response['labels'].should == ['label2'] | 59 | json_response['labels'].should == ['label2'] |
spec/api/projects_spec.rb
@@ -2,8 +2,8 @@ require 'spec_helper' | @@ -2,8 +2,8 @@ require 'spec_helper' | ||
2 | 2 | ||
3 | describe Gitlab::API do | 3 | describe Gitlab::API do |
4 | let(:user) { Factory :user } | 4 | let(:user) { Factory :user } |
5 | - let!(:project) { Factory :project, :owner => user } | ||
6 | - let!(:snippet) { Factory :snippet, :author => user, :project => project, :title => 'example' } | 5 | + let!(:project) { Factory :project, owner: user } |
6 | + let!(:snippet) { Factory :snippet, author: user, project: project, title: 'example' } | ||
7 | before { project.add_access(user, :read) } | 7 | before { project.add_access(user, :read) } |
8 | 8 | ||
9 | describe "GET /projects" do | 9 | describe "GET /projects" do |
@@ -83,7 +83,7 @@ describe Gitlab::API do | @@ -83,7 +83,7 @@ describe Gitlab::API do | ||
83 | describe "POST /projects/:id/snippets" do | 83 | describe "POST /projects/:id/snippets" do |
84 | it "should create a new project snippet" do | 84 | it "should create a new project snippet" do |
85 | post "#{api_prefix}/projects/#{project.code}/snippets?private_token=#{user.private_token}", | 85 | post "#{api_prefix}/projects/#{project.code}/snippets?private_token=#{user.private_token}", |
86 | - :title => 'api test', :file_name => 'sample.rb', :code => 'test' | 86 | + title: 'api test', file_name: 'sample.rb', code: 'test' |
87 | response.status.should == 201 | 87 | response.status.should == 201 |
88 | json_response['title'].should == 'api test' | 88 | json_response['title'].should == 'api test' |
89 | end | 89 | end |
@@ -92,7 +92,7 @@ describe Gitlab::API do | @@ -92,7 +92,7 @@ describe Gitlab::API do | ||
92 | describe "PUT /projects/:id/snippets" do | 92 | describe "PUT /projects/:id/snippets" do |
93 | it "should update an existing project snippet" do | 93 | it "should update an existing project snippet" do |
94 | put "#{api_prefix}/projects/#{project.code}/snippets/#{snippet.id}?private_token=#{user.private_token}", | 94 | put "#{api_prefix}/projects/#{project.code}/snippets/#{snippet.id}?private_token=#{user.private_token}", |
95 | - :code => 'updated code' | 95 | + code: 'updated code' |
96 | response.status.should == 200 | 96 | response.status.should == 200 |
97 | json_response['title'].should == 'example' | 97 | json_response['title'].should == 'example' |
98 | snippet.reload.content.should == 'updated code' | 98 | snippet.reload.content.should == 'updated code' |
spec/helpers/gitlab_flavored_markdown_spec.rb
@@ -5,8 +5,8 @@ describe GitlabMarkdownHelper do | @@ -5,8 +5,8 @@ describe GitlabMarkdownHelper do | ||
5 | @project = Project.find_by_path("gitlabhq") || Factory(:project) | 5 | @project = Project.find_by_path("gitlabhq") || Factory(:project) |
6 | @commit = @project.repo.commits.first.parents.first | 6 | @commit = @project.repo.commits.first.parents.first |
7 | @commit = CommitDecorator.decorate(Commit.new(@commit)) | 7 | @commit = CommitDecorator.decorate(Commit.new(@commit)) |
8 | - @other_project = Factory :project, :path => "OtherPath", :code => "OtherCode" | ||
9 | - @fake_user = Factory :user, :name => "fred" | 8 | + @other_project = Factory :project, path: "OtherPath", code: "OtherCode" |
9 | + @fake_user = Factory :user, name: "fred" | ||
10 | end | 10 | end |
11 | 11 | ||
12 | describe "#gfm" do | 12 | describe "#gfm" do |
@@ -18,15 +18,15 @@ describe GitlabMarkdownHelper do | @@ -18,15 +18,15 @@ describe GitlabMarkdownHelper do | ||
18 | 18 | ||
19 | describe "referencing a commit" do | 19 | describe "referencing a commit" do |
20 | it "should link using a full id" do | 20 | it "should link using a full id" do |
21 | - gfm("Reverts changes from #{@commit.id}").should == "Reverts changes from #{link_to @commit.id, project_commit_path(@project, :id => @commit.id), :title => "Commit: #{@commit.author_name} - #{@commit.title}", :class => "gfm gfm-commit "}" | 21 | + gfm("Reverts changes from #{@commit.id}").should == "Reverts changes from #{link_to @commit.id, project_commit_path(@project, id: @commit.id), title: "Commit: #{@commit.author_name} - #{@commit.title}", class: "gfm gfm-commit "}" |
22 | end | 22 | end |
23 | 23 | ||
24 | it "should link using a short id" do | 24 | it "should link using a short id" do |
25 | - gfm("Backported from #{@commit.id[0, 6]}").should == "Backported from #{link_to @commit.id[0, 6], project_commit_path(@project, :id => @commit.id), :title => "Commit: #{@commit.author_name} - #{@commit.title}", :class => "gfm gfm-commit "}" | 25 | + gfm("Backported from #{@commit.id[0, 6]}").should == "Backported from #{link_to @commit.id[0, 6], project_commit_path(@project, id: @commit.id), title: "Commit: #{@commit.author_name} - #{@commit.title}", class: "gfm gfm-commit "}" |
26 | end | 26 | end |
27 | 27 | ||
28 | it "should link with adjecent text" do | 28 | it "should link with adjecent text" do |
29 | - gfm("Reverted (see #{@commit.id})").should == "Reverted (see #{link_to @commit.id, project_commit_path(@project, :id => @commit.id), :title => "Commit: #{@commit.author_name} - #{@commit.title}", :class => "gfm gfm-commit "})" | 29 | + gfm("Reverted (see #{@commit.id})").should == "Reverted (see #{link_to @commit.id, project_commit_path(@project, id: @commit.id), title: "Commit: #{@commit.author_name} - #{@commit.title}", class: "gfm gfm-commit "})" |
30 | end | 30 | end |
31 | 31 | ||
32 | it "should not link with an invalid id" do | 32 | it "should not link with an invalid id" do |
@@ -38,33 +38,33 @@ describe GitlabMarkdownHelper do | @@ -38,33 +38,33 @@ describe GitlabMarkdownHelper do | ||
38 | it "should link using a simple name" do | 38 | it "should link using a simple name" do |
39 | user = Factory :user, name: "barry" | 39 | user = Factory :user, name: "barry" |
40 | @project.users << user | 40 | @project.users << user |
41 | - member = @project.users_projects.where(:user_id => user).first | 41 | + member = @project.users_projects.where(user_id: user).first |
42 | 42 | ||
43 | - gfm("@#{user.name} you are right").should == "#{link_to "@#{user.name}", project_team_member_path(@project, member), :class => "gfm gfm-team_member "} you are right" | 43 | + gfm("@#{user.name} you are right").should == "#{link_to "@#{user.name}", project_team_member_path(@project, member), class: "gfm gfm-team_member "} you are right" |
44 | end | 44 | end |
45 | 45 | ||
46 | it "should link using a name with dots" do | 46 | it "should link using a name with dots" do |
47 | user = Factory :user, name: "alphA.Beta" | 47 | user = Factory :user, name: "alphA.Beta" |
48 | @project.users << user | 48 | @project.users << user |
49 | - member = @project.users_projects.where(:user_id => user).first | 49 | + member = @project.users_projects.where(user_id: user).first |
50 | 50 | ||
51 | - gfm("@#{user.name} you are right").should == "#{link_to "@#{user.name}", project_team_member_path(@project, member), :class => "gfm gfm-team_member "} you are right" | 51 | + gfm("@#{user.name} you are right").should == "#{link_to "@#{user.name}", project_team_member_path(@project, member), class: "gfm gfm-team_member "} you are right" |
52 | end | 52 | end |
53 | 53 | ||
54 | it "should link using name with underscores" do | 54 | it "should link using name with underscores" do |
55 | user = Factory :user, name: "ping_pong_king" | 55 | user = Factory :user, name: "ping_pong_king" |
56 | @project.users << user | 56 | @project.users << user |
57 | - member = @project.users_projects.where(:user_id => user).first | 57 | + member = @project.users_projects.where(user_id: user).first |
58 | 58 | ||
59 | - gfm("@#{user.name} you are right").should == "#{link_to "@#{user.name}", project_team_member_path(@project, member), :class => "gfm gfm-team_member "} you are right" | 59 | + gfm("@#{user.name} you are right").should == "#{link_to "@#{user.name}", project_team_member_path(@project, member), class: "gfm gfm-team_member "} you are right" |
60 | end | 60 | end |
61 | 61 | ||
62 | it "should link with adjecent text" do | 62 | it "should link with adjecent text" do |
63 | - user = Factory.create(:user, :name => "ace") | 63 | + user = Factory.create(:user, name: "ace") |
64 | @project.users << user | 64 | @project.users << user |
65 | - member = @project.users_projects.where(:user_id => user).first | 65 | + member = @project.users_projects.where(user_id: user).first |
66 | 66 | ||
67 | - gfm("Mail the Admin (@#{user.name})").should == "Mail the Admin (#{link_to "@#{user.name}", project_team_member_path(@project, member), :class => "gfm gfm-team_member "})" | 67 | + gfm("Mail the Admin (@#{user.name})").should == "Mail the Admin (#{link_to "@#{user.name}", project_team_member_path(@project, member), class: "gfm gfm-team_member "})" |
68 | end | 68 | end |
69 | 69 | ||
70 | it "should add styles" do | 70 | it "should add styles" do |
@@ -80,16 +80,16 @@ describe GitlabMarkdownHelper do | @@ -80,16 +80,16 @@ describe GitlabMarkdownHelper do | ||
80 | 80 | ||
81 | describe "referencing an issue" do | 81 | describe "referencing an issue" do |
82 | before do | 82 | before do |
83 | - @issue = Factory :issue, :assignee => @fake_user, :author => @fake_user, :project => @project | ||
84 | - @invalid_issue = Factory :issue, :assignee => @fake_user, :author => @fake_user, :project => @other_project | 83 | + @issue = Factory :issue, assignee: @fake_user, author: @fake_user, project: @project |
84 | + @invalid_issue = Factory :issue, assignee: @fake_user, author: @fake_user, project: @other_project | ||
85 | end | 85 | end |
86 | 86 | ||
87 | it "should link using a correct id" do | 87 | it "should link using a correct id" do |
88 | - gfm("Fixes ##{@issue.id}").should == "Fixes #{link_to "##{@issue.id}", project_issue_path(@project, @issue), :title => "Issue: #{@issue.title}", :class => "gfm gfm-issue "}" | 88 | + gfm("Fixes ##{@issue.id}").should == "Fixes #{link_to "##{@issue.id}", project_issue_path(@project, @issue), title: "Issue: #{@issue.title}", class: "gfm gfm-issue "}" |
89 | end | 89 | end |
90 | 90 | ||
91 | it "should link with adjecent text" do | 91 | it "should link with adjecent text" do |
92 | - gfm("This has already been discussed (see ##{@issue.id})").should == "This has already been discussed (see #{link_to "##{@issue.id}", project_issue_path(@project, @issue), :title => "Issue: #{@issue.title}", :class => "gfm gfm-issue "})" | 92 | + gfm("This has already been discussed (see ##{@issue.id})").should == "This has already been discussed (see #{link_to "##{@issue.id}", project_issue_path(@project, @issue), title: "Issue: #{@issue.title}", class: "gfm gfm-issue "})" |
93 | end | 93 | end |
94 | 94 | ||
95 | it "should add styles" do | 95 | it "should add styles" do |
@@ -103,16 +103,16 @@ describe GitlabMarkdownHelper do | @@ -103,16 +103,16 @@ describe GitlabMarkdownHelper do | ||
103 | 103 | ||
104 | describe "referencing a merge request" do | 104 | describe "referencing a merge request" do |
105 | before do | 105 | before do |
106 | - @merge_request = Factory :merge_request, :assignee => @fake_user, :author => @fake_user, :project => @project | ||
107 | - @invalid_merge_request = Factory :merge_request, :assignee => @fake_user, :author => @fake_user, :project => @other_project | 106 | + @merge_request = Factory :merge_request, assignee: @fake_user, author: @fake_user, project: @project |
107 | + @invalid_merge_request = Factory :merge_request, assignee: @fake_user, author: @fake_user, project: @other_project | ||
108 | end | 108 | end |
109 | 109 | ||
110 | it "should link using a correct id" do | 110 | it "should link using a correct id" do |
111 | - gfm("Fixed in !#{@merge_request.id}").should == "Fixed in #{link_to "!#{@merge_request.id}", project_merge_request_path(@project, @merge_request), :title => "Merge Request: #{@merge_request.title}", :class => "gfm gfm-merge_request "}" | 111 | + gfm("Fixed in !#{@merge_request.id}").should == "Fixed in #{link_to "!#{@merge_request.id}", project_merge_request_path(@project, @merge_request), title: "Merge Request: #{@merge_request.title}", class: "gfm gfm-merge_request "}" |
112 | end | 112 | end |
113 | 113 | ||
114 | it "should link with adjecent text" do | 114 | it "should link with adjecent text" do |
115 | - gfm("This has been fixed already (see !#{@merge_request.id})").should == "This has been fixed already (see #{link_to "!#{@merge_request.id}", project_merge_request_path(@project, @merge_request), :title => "Merge Request: #{@merge_request.title}", :class => "gfm gfm-merge_request "})" | 115 | + gfm("This has been fixed already (see !#{@merge_request.id})").should == "This has been fixed already (see #{link_to "!#{@merge_request.id}", project_merge_request_path(@project, @merge_request), title: "Merge Request: #{@merge_request.title}", class: "gfm gfm-merge_request "})" |
116 | end | 116 | end |
117 | 117 | ||
118 | it "should add styles" do | 118 | it "should add styles" do |
@@ -127,17 +127,17 @@ describe GitlabMarkdownHelper do | @@ -127,17 +127,17 @@ describe GitlabMarkdownHelper do | ||
127 | describe "referencing a snippet" do | 127 | describe "referencing a snippet" do |
128 | before do | 128 | before do |
129 | @snippet = Factory.create(:snippet, | 129 | @snippet = Factory.create(:snippet, |
130 | - :title => "Render asset to string", | ||
131 | - :author => @fake_user, | ||
132 | - :project => @project) | 130 | + title: "Render asset to string", |
131 | + author: @fake_user, | ||
132 | + project: @project) | ||
133 | end | 133 | end |
134 | 134 | ||
135 | it "should link using a correct id" do | 135 | it "should link using a correct id" do |
136 | - gfm("Check out $#{@snippet.id}").should == "Check out #{link_to "$#{@snippet.id}", project_snippet_path(@project, @snippet), :title => "Snippet: #{@snippet.title}", :class => "gfm gfm-snippet "}" | 136 | + gfm("Check out $#{@snippet.id}").should == "Check out #{link_to "$#{@snippet.id}", project_snippet_path(@project, @snippet), title: "Snippet: #{@snippet.title}", class: "gfm gfm-snippet "}" |
137 | end | 137 | end |
138 | 138 | ||
139 | it "should link with adjecent text" do | 139 | it "should link with adjecent text" do |
140 | - gfm("I have created a snippet for that ($#{@snippet.id})").should == "I have created a snippet for that (#{link_to "$#{@snippet.id}", project_snippet_path(@project, @snippet), :title => "Snippet: #{@snippet.title}", :class => "gfm gfm-snippet "})" | 140 | + gfm("I have created a snippet for that ($#{@snippet.id})").should == "I have created a snippet for that (#{link_to "$#{@snippet.id}", project_snippet_path(@project, @snippet), title: "Snippet: #{@snippet.title}", class: "gfm gfm-snippet "})" |
141 | end | 141 | end |
142 | 142 | ||
143 | it "should add styles" do | 143 | it "should add styles" do |
@@ -152,12 +152,12 @@ describe GitlabMarkdownHelper do | @@ -152,12 +152,12 @@ describe GitlabMarkdownHelper do | ||
152 | it "should link to multiple things" do | 152 | it "should link to multiple things" do |
153 | user = Factory :user, name: "barry" | 153 | user = Factory :user, name: "barry" |
154 | @project.users << user | 154 | @project.users << user |
155 | - member = @project.users_projects.where(:user_id => user).first | 155 | + member = @project.users_projects.where(user_id: user).first |
156 | 156 | ||
157 | - gfm("Let @#{user.name} fix the *mess* in #{@commit.id}").should == "Let #{link_to "@#{user.name}", project_team_member_path(@project, member), :class => "gfm gfm-team_member "} fix the *mess* in #{link_to @commit.id, project_commit_path(@project, :id => @commit.id), :title => "Commit: #{@commit.author_name} - #{@commit.title}", :class => "gfm gfm-commit "}" | 157 | + gfm("Let @#{user.name} fix the *mess* in #{@commit.id}").should == "Let #{link_to "@#{user.name}", project_team_member_path(@project, member), class: "gfm gfm-team_member "} fix the *mess* in #{link_to @commit.id, project_commit_path(@project, id: @commit.id), title: "Commit: #{@commit.author_name} - #{@commit.title}", class: "gfm gfm-commit "}" |
158 | end | 158 | end |
159 | 159 | ||
160 | - it "should not trip over other stuff", :focus => true do | 160 | + it "should not trip over other stuff", focus: true do |
161 | gfm("_Please_ *stop* 'helping' and all the other b*$#%' you do.").should == "_Please_ *stop* 'helping' and all the other b*$#%' you do." | 161 | gfm("_Please_ *stop* 'helping' and all the other b*$#%' you do.").should == "_Please_ *stop* 'helping' and all the other b*$#%' you do." |
162 | end | 162 | end |
163 | 163 | ||
@@ -166,57 +166,57 @@ describe GitlabMarkdownHelper do | @@ -166,57 +166,57 @@ describe GitlabMarkdownHelper do | ||
166 | end | 166 | end |
167 | 167 | ||
168 | it "should forward HTML options to links" do | 168 | it "should forward HTML options to links" do |
169 | - gfm("fixed in #{@commit.id}", :class => "foo").should have_selector("a.foo") | 169 | + gfm("fixed in #{@commit.id}", class: "foo").should have_selector("a.foo") |
170 | end | 170 | end |
171 | end | 171 | end |
172 | 172 | ||
173 | describe "#link_to_gfm" do | 173 | describe "#link_to_gfm" do |
174 | - let(:issue1) { Factory :issue, :assignee => @fake_user, :author => @fake_user, :project => @project } | ||
175 | - let(:issue2) { Factory :issue, :assignee => @fake_user, :author => @fake_user, :project => @project } | 174 | + let(:issue1) { Factory :issue, assignee: @fake_user, author: @fake_user, project: @project } |
175 | + let(:issue2) { Factory :issue, assignee: @fake_user, author: @fake_user, project: @project } | ||
176 | 176 | ||
177 | it "should handle references nested in links with all the text" do | 177 | it "should handle references nested in links with all the text" do |
178 | - link_to_gfm("This should finally fix ##{issue1.id} and ##{issue2.id} for real", project_commit_path(@project, :id => @commit.id)).should == "#{link_to "This should finally fix ", project_commit_path(@project, :id => @commit.id)}#{link_to "##{issue1.id}", project_issue_path(@project, issue1), :title => "Issue: #{issue1.title}", :class => "gfm gfm-issue "}#{link_to " and ", project_commit_path(@project, :id => @commit.id)}#{link_to "##{issue2.id}", project_issue_path(@project, issue2), :title => "Issue: #{issue2.title}", :class => "gfm gfm-issue "}#{link_to " for real", project_commit_path(@project, :id => @commit.id)}" | 178 | + link_to_gfm("This should finally fix ##{issue1.id} and ##{issue2.id} for real", project_commit_path(@project, id: @commit.id)).should == "#{link_to "This should finally fix ", project_commit_path(@project, id: @commit.id)}#{link_to "##{issue1.id}", project_issue_path(@project, issue1), title: "Issue: #{issue1.title}", class: "gfm gfm-issue "}#{link_to " and ", project_commit_path(@project, id: @commit.id)}#{link_to "##{issue2.id}", project_issue_path(@project, issue2), title: "Issue: #{issue2.title}", class: "gfm gfm-issue "}#{link_to " for real", project_commit_path(@project, id: @commit.id)}" |
179 | end | 179 | end |
180 | 180 | ||
181 | it "should forward HTML options" do | 181 | it "should forward HTML options" do |
182 | - link_to_gfm("This should finally fix ##{issue1.id} for real", project_commit_path(@project, :id => @commit.id), :class => "foo").should have_selector(".foo") | 182 | + link_to_gfm("This should finally fix ##{issue1.id} for real", project_commit_path(@project, id: @commit.id), class: "foo").should have_selector(".foo") |
183 | end | 183 | end |
184 | end | 184 | end |
185 | 185 | ||
186 | describe "#markdown" do | 186 | describe "#markdown" do |
187 | before do | 187 | before do |
188 | - @issue = Factory :issue, :assignee => @fake_user, :author => @fake_user, :project => @project | ||
189 | - @merge_request = Factory :merge_request, :assignee => @fake_user, :author => @fake_user, :project => @project | 188 | + @issue = Factory :issue, assignee: @fake_user, author: @fake_user, project: @project |
189 | + @merge_request = Factory :merge_request, assignee: @fake_user, author: @fake_user, project: @project | ||
190 | @note = Factory.create(:note, | 190 | @note = Factory.create(:note, |
191 | - :note => "Screenshot of the new feature", | ||
192 | - :project => @project, | ||
193 | - :noteable_id => @commit.id, | ||
194 | - :noteable_type => "Commit", | ||
195 | - :attachment => "screenshot123.jpg") | 191 | + note: "Screenshot of the new feature", |
192 | + project: @project, | ||
193 | + noteable_id: @commit.id, | ||
194 | + noteable_type: "Commit", | ||
195 | + attachment: "screenshot123.jpg") | ||
196 | @snippet = Factory.create(:snippet, | 196 | @snippet = Factory.create(:snippet, |
197 | - :title => "Render asset to string", | ||
198 | - :author => @fake_user, | ||
199 | - :project => @project) | 197 | + title: "Render asset to string", |
198 | + author: @fake_user, | ||
199 | + project: @project) | ||
200 | 200 | ||
201 | @other_user = Factory :user, name: "bill" | 201 | @other_user = Factory :user, name: "bill" |
202 | @project.users << @other_user | 202 | @project.users << @other_user |
203 | - @member = @project.users_projects.where(:user_id => @other_user).first | 203 | + @member = @project.users_projects.where(user_id: @other_user).first |
204 | end | 204 | end |
205 | 205 | ||
206 | it "should handle references in paragraphs" do | 206 | it "should handle references in paragraphs" do |
207 | - markdown("\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. #{@commit.id} Nam pulvinar sapien eget odio adipiscing at faucibus orci vestibulum.\n").should == "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. #{link_to @commit.id, project_commit_path(@project, :id => @commit.id), :title => "Commit: #{@commit.author_name} - #{@commit.title}", :class => "gfm gfm-commit "} Nam pulvinar sapien eget odio adipiscing at faucibus orci vestibulum.</p>\n" | 207 | + markdown("\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. #{@commit.id} Nam pulvinar sapien eget odio adipiscing at faucibus orci vestibulum.\n").should == "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. #{link_to @commit.id, project_commit_path(@project, id: @commit.id), title: "Commit: #{@commit.author_name} - #{@commit.title}", class: "gfm gfm-commit "} Nam pulvinar sapien eget odio adipiscing at faucibus orci vestibulum.</p>\n" |
208 | end | 208 | end |
209 | 209 | ||
210 | it "should handle references in headers" do | 210 | it "should handle references in headers" do |
211 | - markdown("\n# Working around ##{@issue.id} for now\n## Apply !#{@merge_request.id}").should == "<h1 id=\"toc_0\">Working around #{link_to "##{@issue.id}", project_issue_path(@project, @issue), :title => "Issue: #{@issue.title}", :class => "gfm gfm-issue "} for now</h1>\n\n<h2 id=\"toc_1\">Apply #{link_to "!#{@merge_request.id}", project_merge_request_path(@project, @merge_request), :title => "Merge Request: #{@merge_request.title}", :class => "gfm gfm-merge_request "}</h2>\n" | 211 | + markdown("\n# Working around ##{@issue.id} for now\n## Apply !#{@merge_request.id}").should == "<h1 id=\"toc_0\">Working around #{link_to "##{@issue.id}", project_issue_path(@project, @issue), title: "Issue: #{@issue.title}", class: "gfm gfm-issue "} for now</h1>\n\n<h2 id=\"toc_1\">Apply #{link_to "!#{@merge_request.id}", project_merge_request_path(@project, @merge_request), title: "Merge Request: #{@merge_request.title}", class: "gfm gfm-merge_request "}</h2>\n" |
212 | end | 212 | end |
213 | 213 | ||
214 | it "should handle references in lists" do | 214 | it "should handle references in lists" do |
215 | - markdown("\n* dark: ##{@issue.id}\n* light by @#{@other_user.name}\n").should == "<ul>\n<li>dark: #{link_to "##{@issue.id}", project_issue_path(@project, @issue), :title => "Issue: #{@issue.title}", :class => "gfm gfm-issue "}</li>\n<li>light by #{link_to "@#{@other_user.name}", project_team_member_path(@project, @member), :class => "gfm gfm-team_member "}</li>\n</ul>\n" | 215 | + markdown("\n* dark: ##{@issue.id}\n* light by @#{@other_user.name}\n").should == "<ul>\n<li>dark: #{link_to "##{@issue.id}", project_issue_path(@project, @issue), title: "Issue: #{@issue.title}", class: "gfm gfm-issue "}</li>\n<li>light by #{link_to "@#{@other_user.name}", project_team_member_path(@project, @member), class: "gfm gfm-team_member "}</li>\n</ul>\n" |
216 | end | 216 | end |
217 | 217 | ||
218 | it "should handle references in <em>" do | 218 | it "should handle references in <em>" do |
219 | - markdown("Apply _!#{@merge_request.id}_ ASAP").should == "<p>Apply <em>#{link_to "!#{@merge_request.id}", project_merge_request_path(@project, @merge_request), :title => "Merge Request: #{@merge_request.title}", :class => "gfm gfm-merge_request "}</em> ASAP</p>\n" | 219 | + markdown("Apply _!#{@merge_request.id}_ ASAP").should == "<p>Apply <em>#{link_to "!#{@merge_request.id}", project_merge_request_path(@project, @merge_request), title: "Merge Request: #{@merge_request.title}", class: "gfm gfm-merge_request "}</em> ASAP</p>\n" |
220 | end | 220 | end |
221 | 221 | ||
222 | it "should leave code blocks untouched" do | 222 | it "should leave code blocks untouched" do |
spec/mailers/notify_spec.rb
@@ -4,7 +4,7 @@ describe Notify do | @@ -4,7 +4,7 @@ describe Notify do | ||
4 | include EmailSpec::Helpers | 4 | include EmailSpec::Helpers |
5 | include EmailSpec::Matchers | 5 | include EmailSpec::Matchers |
6 | 6 | ||
7 | - let(:recipient) { Factory.create(:user, :email => 'recipient@example.com') } | 7 | + let(:recipient) { Factory.create(:user, email: 'recipient@example.com') } |
8 | let(:project) { Factory.create(:project) } | 8 | let(:project) { Factory.create(:project) } |
9 | 9 | ||
10 | shared_examples 'a multiple recipients email' do | 10 | shared_examples 'a multiple recipients email' do |
@@ -15,7 +15,7 @@ describe Notify do | @@ -15,7 +15,7 @@ describe Notify do | ||
15 | 15 | ||
16 | describe 'for new users, the email' do | 16 | describe 'for new users, the email' do |
17 | let(:example_site_path) { root_path } | 17 | let(:example_site_path) { root_path } |
18 | - let(:new_user) { Factory.create(:user, :email => 'newguy@example.com') } | 18 | + let(:new_user) { Factory.create(:user, email: 'newguy@example.com') } |
19 | 19 | ||
20 | subject { Notify.new_user_email(new_user.id, new_user.password) } | 20 | subject { Notify.new_user_email(new_user.id, new_user.password) } |
21 | 21 | ||
@@ -42,8 +42,8 @@ describe Notify do | @@ -42,8 +42,8 @@ describe Notify do | ||
42 | 42 | ||
43 | context 'for a project' do | 43 | context 'for a project' do |
44 | describe 'items that are assignable, the email' do | 44 | describe 'items that are assignable, the email' do |
45 | - let(:assignee) { Factory.create(:user, :email => 'assignee@example.com') } | ||
46 | - let(:previous_assignee) { Factory.create(:user, :name => 'Previous Assignee') } | 45 | + let(:assignee) { Factory.create(:user, email: 'assignee@example.com') } |
46 | + let(:previous_assignee) { Factory.create(:user, name: 'Previous Assignee') } | ||
47 | 47 | ||
48 | shared_examples 'an assignee email' do | 48 | shared_examples 'an assignee email' do |
49 | it 'is sent to the assignee' do | 49 | it 'is sent to the assignee' do |
@@ -52,7 +52,7 @@ describe Notify do | @@ -52,7 +52,7 @@ describe Notify do | ||
52 | end | 52 | end |
53 | 53 | ||
54 | context 'for issues' do | 54 | context 'for issues' do |
55 | - let(:issue) { Factory.create(:issue, :assignee => assignee, :project => project ) } | 55 | + let(:issue) { Factory.create(:issue, assignee: assignee, project: project ) } |
56 | 56 | ||
57 | describe 'that are new' do | 57 | describe 'that are new' do |
58 | subject { Notify.new_issue_email(issue.id) } | 58 | subject { Notify.new_issue_email(issue.id) } |
@@ -94,7 +94,7 @@ describe Notify do | @@ -94,7 +94,7 @@ describe Notify do | ||
94 | end | 94 | end |
95 | 95 | ||
96 | context 'for merge requests' do | 96 | context 'for merge requests' do |
97 | - let(:merge_request) { Factory.create(:merge_request, :assignee => assignee, :project => project) } | 97 | + let(:merge_request) { Factory.create(:merge_request, assignee: assignee, project: project) } |
98 | 98 | ||
99 | describe 'that are new' do | 99 | describe 'that are new' do |
100 | subject { Notify.new_merge_request_email(merge_request.id) } | 100 | subject { Notify.new_merge_request_email(merge_request.id) } |
@@ -146,8 +146,8 @@ describe Notify do | @@ -146,8 +146,8 @@ describe Notify do | ||
146 | end | 146 | end |
147 | 147 | ||
148 | context 'items that are noteable, the email for a note' do | 148 | context 'items that are noteable, the email for a note' do |
149 | - let(:note_author) { Factory.create(:user, :name => 'author_name') } | ||
150 | - let(:note) { Factory.create(:note, :project => project, :author => note_author) } | 149 | + let(:note_author) { Factory.create(:user, name: 'author_name') } |
150 | + let(:note) { Factory.create(:note, project: project, author: note_author) } | ||
151 | 151 | ||
152 | before :each do | 152 | before :each do |
153 | Note.stub(:find).with(note.id).and_return(note) | 153 | Note.stub(:find).with(note.id).and_return(note) |
@@ -168,7 +168,7 @@ describe Notify do | @@ -168,7 +168,7 @@ describe Notify do | ||
168 | end | 168 | end |
169 | 169 | ||
170 | describe 'on a project wall' do | 170 | describe 'on a project wall' do |
171 | - let(:note_on_the_wall_path) { wall_project_path(project, :anchor => "note_#{note.id}") } | 171 | + let(:note_on_the_wall_path) { wall_project_path(project, anchor: "note_#{note.id}") } |
172 | 172 | ||
173 | subject { Notify.note_wall_email(recipient.id, note.id) } | 173 | subject { Notify.note_wall_email(recipient.id, note.id) } |
174 | 174 | ||
@@ -208,8 +208,8 @@ describe Notify do | @@ -208,8 +208,8 @@ describe Notify do | ||
208 | end | 208 | end |
209 | 209 | ||
210 | describe 'on a merge request' do | 210 | describe 'on a merge request' do |
211 | - let(:merge_request) { Factory.create(:merge_request, :project => project) } | ||
212 | - let(:note_on_merge_request_path) { project_merge_request_path(project, merge_request, :anchor => "note_#{note.id}") } | 211 | + let(:merge_request) { Factory.create(:merge_request, project: project) } |
212 | + let(:note_on_merge_request_path) { project_merge_request_path(project, merge_request, anchor: "note_#{note.id}") } | ||
213 | before(:each) { note.stub(:noteable).and_return(merge_request) } | 213 | before(:each) { note.stub(:noteable).and_return(merge_request) } |
214 | 214 | ||
215 | subject { Notify.note_merge_request_email(recipient.id, note.id) } | 215 | subject { Notify.note_merge_request_email(recipient.id, note.id) } |
@@ -226,8 +226,8 @@ describe Notify do | @@ -226,8 +226,8 @@ describe Notify do | ||
226 | end | 226 | end |
227 | 227 | ||
228 | describe 'on an issue' do | 228 | describe 'on an issue' do |
229 | - let(:issue) { Factory.create(:issue, :project => project) } | ||
230 | - let(:note_on_issue_path) { project_issue_path(project, issue, :anchor => "note_#{note.id}") } | 229 | + let(:issue) { Factory.create(:issue, project: project) } |
230 | + let(:note_on_issue_path) { project_issue_path(project, issue, anchor: "note_#{note.id}") } | ||
231 | before(:each) { note.stub(:noteable).and_return(issue) } | 231 | before(:each) { note.stub(:noteable).and_return(issue) } |
232 | 232 | ||
233 | subject { Notify.note_issue_email(recipient.id, note.id) } | 233 | subject { Notify.note_issue_email(recipient.id, note.id) } |
spec/models/activity_observer_spec.rb
@@ -11,7 +11,7 @@ describe ActivityObserver do | @@ -11,7 +11,7 @@ describe ActivityObserver do | ||
11 | describe "Merge Request created" do | 11 | describe "Merge Request created" do |
12 | before do | 12 | before do |
13 | MergeRequest.observers.enable :activity_observer do | 13 | MergeRequest.observers.enable :activity_observer do |
14 | - @merge_request = Factory :merge_request, :project => project | 14 | + @merge_request = Factory :merge_request, project: project |
15 | @event = Event.last | 15 | @event = Event.last |
16 | end | 16 | end |
17 | end | 17 | end |
@@ -24,7 +24,7 @@ describe ActivityObserver do | @@ -24,7 +24,7 @@ describe ActivityObserver do | ||
24 | describe "Issue created" do | 24 | describe "Issue created" do |
25 | before do | 25 | before do |
26 | Issue.observers.enable :activity_observer do | 26 | Issue.observers.enable :activity_observer do |
27 | - @issue = Factory :issue, :project => project | 27 | + @issue = Factory :issue, project: project |
28 | @event = Event.last | 28 | @event = Event.last |
29 | end | 29 | end |
30 | end | 30 | end |
@@ -36,8 +36,8 @@ describe ActivityObserver do | @@ -36,8 +36,8 @@ describe ActivityObserver do | ||
36 | 36 | ||
37 | #describe "Issue commented" do | 37 | #describe "Issue commented" do |
38 | #before do | 38 | #before do |
39 | - #@issue = Factory :issue, :project => project | ||
40 | - #@note = Factory :note, :noteable => @issue, :project => project | 39 | + #@issue = Factory :issue, project: project |
40 | + #@note = Factory :note, noteable: @issue, project: project | ||
41 | #@event = Event.last | 41 | #@event = Event.last |
42 | #end | 42 | #end |
43 | 43 |
spec/models/event_spec.rb
@@ -45,25 +45,25 @@ describe Event do | @@ -45,25 +45,25 @@ describe Event do | ||
45 | @user = project.owner | 45 | @user = project.owner |
46 | 46 | ||
47 | data = { | 47 | data = { |
48 | - :before => "0000000000000000000000000000000000000000", | ||
49 | - :after => "0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e", | ||
50 | - :ref => "refs/heads/master", | ||
51 | - :user_id => @user.id, | ||
52 | - :user_name => @user.name, | ||
53 | - :repository => { | ||
54 | - :name => project.name, | ||
55 | - :url => "localhost/rubinius", | ||
56 | - :description => "", | ||
57 | - :homepage => "localhost/rubinius", | ||
58 | - :private => true | 48 | + before: "0000000000000000000000000000000000000000", |
49 | + after: "0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e", | ||
50 | + ref: "refs/heads/master", | ||
51 | + user_id: @user.id, | ||
52 | + user_name: @user.name, | ||
53 | + repository: { | ||
54 | + name: project.name, | ||
55 | + url: "localhost/rubinius", | ||
56 | + description: "", | ||
57 | + homepage: "localhost/rubinius", | ||
58 | + private: true | ||
59 | } | 59 | } |
60 | } | 60 | } |
61 | 61 | ||
62 | @event = Event.create( | 62 | @event = Event.create( |
63 | - :project => project, | ||
64 | - :action => Event::Pushed, | ||
65 | - :data => data, | ||
66 | - :author_id => @user.id | 63 | + project: project, |
64 | + action: Event::Pushed, | ||
65 | + data: data, | ||
66 | + author_id: @user.id | ||
67 | ) | 67 | ) |
68 | end | 68 | end |
69 | 69 |
spec/models/issue_observer_spec.rb
1 | require 'spec_helper' | 1 | require 'spec_helper' |
2 | 2 | ||
3 | describe IssueObserver do | 3 | describe IssueObserver do |
4 | - let(:some_user) { double(:user, :id => 1) } | ||
5 | - let(:assignee) { double(:user, :id => 2) } | ||
6 | - let(:issue) { double(:issue, :id => 42, :assignee => assignee) } | 4 | + let(:some_user) { double(:user, id: 1) } |
5 | + let(:assignee) { double(:user, id: 2) } | ||
6 | + let(:issue) { double(:issue, id: 42, assignee: assignee) } | ||
7 | 7 | ||
8 | before(:each) { subject.stub(:current_user).and_return(some_user) } | 8 | before(:each) { subject.stub(:current_user).and_return(some_user) } |
9 | 9 | ||
@@ -15,13 +15,13 @@ describe IssueObserver do | @@ -15,13 +15,13 @@ describe IssueObserver do | ||
15 | subject.should_receive(:after_create) | 15 | subject.should_receive(:after_create) |
16 | 16 | ||
17 | Issue.observers.enable :issue_observer do | 17 | Issue.observers.enable :issue_observer do |
18 | - Factory.create(:issue, :project => Factory.create(:project)) | 18 | + Factory.create(:issue, project: Factory.create(:project)) |
19 | end | 19 | end |
20 | end | 20 | end |
21 | 21 | ||
22 | it 'sends an email to the assignee' do | 22 | it 'sends an email to the assignee' do |
23 | Notify.should_receive(:new_issue_email).with(issue.id). | 23 | Notify.should_receive(:new_issue_email).with(issue.id). |
24 | - and_return(double(:deliver => true)) | 24 | + and_return(double(deliver: true)) |
25 | 25 | ||
26 | subject.after_create(issue) | 26 | subject.after_create(issue) |
27 | end | 27 | end |
@@ -42,7 +42,7 @@ describe IssueObserver do | @@ -42,7 +42,7 @@ describe IssueObserver do | ||
42 | end | 42 | end |
43 | 43 | ||
44 | it 'is called when an issue is changed' do | 44 | it 'is called when an issue is changed' do |
45 | - changed = Factory.create(:issue, :project => Factory.create(:project)) | 45 | + changed = Factory.create(:issue, project: Factory.create(:project)) |
46 | subject.should_receive(:after_update) | 46 | subject.should_receive(:after_update) |
47 | 47 | ||
48 | Issue.observers.enable :issue_observer do | 48 | Issue.observers.enable :issue_observer do |
@@ -101,7 +101,7 @@ describe IssueObserver do | @@ -101,7 +101,7 @@ describe IssueObserver do | ||
101 | end | 101 | end |
102 | 102 | ||
103 | describe '#send_reassigned_email' do | 103 | describe '#send_reassigned_email' do |
104 | - let(:previous_assignee) { double(:user, :id => 3) } | 104 | + let(:previous_assignee) { double(:user, id: 3) } |
105 | 105 | ||
106 | before(:each) do | 106 | before(:each) do |
107 | issue.stub(:assignee_id).and_return(assignee.id) | 107 | issue.stub(:assignee_id).and_return(assignee.id) |
@@ -110,7 +110,7 @@ describe IssueObserver do | @@ -110,7 +110,7 @@ describe IssueObserver do | ||
110 | 110 | ||
111 | def it_sends_a_reassigned_email_to(recipient) | 111 | def it_sends_a_reassigned_email_to(recipient) |
112 | Notify.should_receive(:reassigned_issue_email).with(recipient, issue.id, previous_assignee.id). | 112 | Notify.should_receive(:reassigned_issue_email).with(recipient, issue.id, previous_assignee.id). |
113 | - and_return(double(:deliver => true)) | 113 | + and_return(double(deliver: true)) |
114 | end | 114 | end |
115 | 115 | ||
116 | def it_does_not_send_a_reassigned_email_to(recipient) | 116 | def it_does_not_send_a_reassigned_email_to(recipient) |
spec/models/issue_spec.rb
@@ -20,9 +20,9 @@ describe Issue do | @@ -20,9 +20,9 @@ describe Issue do | ||
20 | end | 20 | end |
21 | 21 | ||
22 | subject { Factory.create(:issue, | 22 | subject { Factory.create(:issue, |
23 | - :author => Factory(:user), | ||
24 | - :assignee => Factory(:user), | ||
25 | - :project => Factory.create(:project)) } | 23 | + author: Factory(:user), |
24 | + assignee: Factory(:user), | ||
25 | + project: Factory.create(:project)) } | ||
26 | it { should be_valid } | 26 | it { should be_valid } |
27 | 27 | ||
28 | describe '#is_being_reassigned?' do | 28 | describe '#is_being_reassigned?' do |
@@ -42,10 +42,10 @@ describe Issue do | @@ -42,10 +42,10 @@ describe Issue do | ||
42 | end | 42 | end |
43 | it 'returns false if the closed attribute has changed and is now false' do | 43 | it 'returns false if the closed attribute has changed and is now false' do |
44 | issue = Factory.create(:issue, | 44 | issue = Factory.create(:issue, |
45 | - :closed => true, | ||
46 | - :author => Factory(:user), | ||
47 | - :assignee => Factory(:user), | ||
48 | - :project => Factory.create(:project)) | 45 | + closed: true, |
46 | + author: Factory(:user), | ||
47 | + assignee: Factory(:user), | ||
48 | + project: Factory.create(:project)) | ||
49 | issue.closed = false | 49 | issue.closed = false |
50 | issue.is_being_closed?.should be_false | 50 | issue.is_being_closed?.should be_false |
51 | end | 51 | end |
@@ -58,10 +58,10 @@ describe Issue do | @@ -58,10 +58,10 @@ describe Issue do | ||
58 | describe '#is_being_reopened?' do | 58 | describe '#is_being_reopened?' do |
59 | it 'returns true if the closed attribute has changed and is now false' do | 59 | it 'returns true if the closed attribute has changed and is now false' do |
60 | issue = Factory.create(:issue, | 60 | issue = Factory.create(:issue, |
61 | - :closed => true, | ||
62 | - :author => Factory(:user), | ||
63 | - :assignee => Factory(:user), | ||
64 | - :project => Factory.create(:project)) | 61 | + closed: true, |
62 | + author: Factory(:user), | ||
63 | + assignee: Factory(:user), | ||
64 | + project: Factory.create(:project)) | ||
65 | issue.closed = false | 65 | issue.closed = false |
66 | issue.is_being_reopened?.should be_true | 66 | issue.is_being_reopened?.should be_true |
67 | end | 67 | end |
@@ -78,9 +78,9 @@ describe Issue do | @@ -78,9 +78,9 @@ describe Issue do | ||
78 | let(:project) { Factory(:project) } | 78 | let(:project) { Factory(:project) } |
79 | subject { | 79 | subject { |
80 | Factory.create(:issue, | 80 | Factory.create(:issue, |
81 | - :author => Factory(:user), | ||
82 | - :assignee => Factory(:user), | ||
83 | - :project => project) | 81 | + author: Factory(:user), |
82 | + assignee: Factory(:user), | ||
83 | + project: project) | ||
84 | } | 84 | } |
85 | 85 | ||
86 | it "with no notes has a 0/0 score" do | 86 | it "with no notes has a 0/0 score" do |
@@ -107,8 +107,8 @@ describe Issue do | @@ -107,8 +107,8 @@ describe Issue do | ||
107 | end | 107 | end |
108 | 108 | ||
109 | describe ".search" do | 109 | describe ".search" do |
110 | - let!(:issue) { Factory.create(:issue, :title => "Searchable issue", | ||
111 | - :project => Factory.create(:project)) } | 110 | + let!(:issue) { Factory.create(:issue, title: "Searchable issue", |
111 | + project: Factory.create(:project)) } | ||
112 | 112 | ||
113 | it "matches by title" do | 113 | it "matches by title" do |
114 | Issue.search('able').all.should == [issue] | 114 | Issue.search('able').all.should == [issue] |
spec/models/merge_request_spec.rb
@@ -21,17 +21,17 @@ describe MergeRequest do | @@ -21,17 +21,17 @@ describe MergeRequest do | ||
21 | end | 21 | end |
22 | 22 | ||
23 | it { Factory.create(:merge_request, | 23 | it { Factory.create(:merge_request, |
24 | - :author => Factory(:user), | ||
25 | - :assignee => Factory(:user), | ||
26 | - :project => Factory.create(:project)).should be_valid } | 24 | + author: Factory(:user), |
25 | + assignee: Factory(:user), | ||
26 | + project: Factory.create(:project)).should be_valid } | ||
27 | 27 | ||
28 | describe "plus 1" do | 28 | describe "plus 1" do |
29 | let(:project) { Factory(:project) } | 29 | let(:project) { Factory(:project) } |
30 | subject { | 30 | subject { |
31 | Factory.create(:merge_request, | 31 | Factory.create(:merge_request, |
32 | - :author => Factory(:user), | ||
33 | - :assignee => Factory(:user), | ||
34 | - :project => project) | 32 | + author: Factory(:user), |
33 | + assignee: Factory(:user), | ||
34 | + project: project) | ||
35 | } | 35 | } |
36 | 36 | ||
37 | it "with no notes has a 0/0 score" do | 37 | it "with no notes has a 0/0 score" do |
@@ -58,8 +58,8 @@ describe MergeRequest do | @@ -58,8 +58,8 @@ describe MergeRequest do | ||
58 | end | 58 | end |
59 | 59 | ||
60 | describe ".search" do | 60 | describe ".search" do |
61 | - let!(:issue) { Factory.create(:issue, :title => "Searchable issue", | ||
62 | - :project => Factory.create(:project)) } | 61 | + let!(:issue) { Factory.create(:issue, title: "Searchable issue", |
62 | + project: Factory.create(:project)) } | ||
63 | 63 | ||
64 | it "matches by title" do | 64 | it "matches by title" do |
65 | Issue.search('able').all.should == [issue] | 65 | Issue.search('able').all.should == [issue] |
spec/models/milestone_spec.rb
@@ -26,8 +26,8 @@ describe Milestone do | @@ -26,8 +26,8 @@ describe Milestone do | ||
26 | end | 26 | end |
27 | 27 | ||
28 | let(:project) { Factory :project } | 28 | let(:project) { Factory :project } |
29 | - let(:milestone) { Factory :milestone, :project => project } | ||
30 | - let(:issue) { Factory :issue, :project => project } | 29 | + let(:milestone) { Factory :milestone, project: project } |
30 | + let(:issue) { Factory :issue, project: project } | ||
31 | 31 | ||
32 | it { milestone.should be_valid } | 32 | it { milestone.should be_valid } |
33 | 33 | ||
@@ -39,14 +39,14 @@ describe Milestone do | @@ -39,14 +39,14 @@ describe Milestone do | ||
39 | it { milestone.percent_complete.should == 0 } | 39 | it { milestone.percent_complete.should == 0 } |
40 | 40 | ||
41 | it do | 41 | it do |
42 | - issue.update_attributes :closed => true | 42 | + issue.update_attributes closed: true |
43 | milestone.percent_complete.should == 100 | 43 | milestone.percent_complete.should == 100 |
44 | end | 44 | end |
45 | end | 45 | end |
46 | 46 | ||
47 | describe :expires_at do | 47 | describe :expires_at do |
48 | before do | 48 | before do |
49 | - milestone.update_attributes :due_date => Date.today + 1.day | 49 | + milestone.update_attributes due_date: Date.today + 1.day |
50 | end | 50 | end |
51 | 51 | ||
52 | it { milestone.expires_at.should_not be_nil } | 52 | it { milestone.expires_at.should_not be_nil } |
spec/models/note_spec.rb
@@ -14,7 +14,7 @@ describe Note do | @@ -14,7 +14,7 @@ describe Note do | ||
14 | end | 14 | end |
15 | 15 | ||
16 | it { Factory.create(:note, | 16 | it { Factory.create(:note, |
17 | - :project => project).should be_valid } | 17 | + project: project).should be_valid } |
18 | describe "Scopes" do | 18 | describe "Scopes" do |
19 | it "should have a today named scope that returns ..." do | 19 | it "should have a today named scope that returns ..." do |
20 | Note.today.where_values.should == ["created_at >= '#{Date.today}'"] | 20 | Note.today.where_values.should == ["created_at >= '#{Date.today}'"] |
@@ -44,9 +44,9 @@ describe Note do | @@ -44,9 +44,9 @@ describe Note do | ||
44 | 44 | ||
45 | before do | 45 | before do |
46 | @note = Factory :note, | 46 | @note = Factory :note, |
47 | - :project => project, | ||
48 | - :noteable_id => commit.id, | ||
49 | - :noteable_type => "Commit" | 47 | + project: project, |
48 | + noteable_id: commit.id, | ||
49 | + noteable_type: "Commit" | ||
50 | end | 50 | end |
51 | 51 | ||
52 | it "should save a valid note" do | 52 | it "should save a valid note" do |
@@ -58,10 +58,10 @@ describe Note do | @@ -58,10 +58,10 @@ describe Note do | ||
58 | describe "Pre-line commit notes" do | 58 | describe "Pre-line commit notes" do |
59 | before do | 59 | before do |
60 | @note = Factory :note, | 60 | @note = Factory :note, |
61 | - :project => project, | ||
62 | - :noteable_id => commit.id, | ||
63 | - :noteable_type => "Commit", | ||
64 | - :line_code => "0_16_1" | 61 | + project: project, |
62 | + noteable_id: commit.id, | ||
63 | + noteable_type: "Commit", | ||
64 | + line_code: "0_16_1" | ||
65 | end | 65 | end |
66 | 66 | ||
67 | it "should save a valid note" do | 67 | it "should save a valid note" do |
@@ -72,7 +72,7 @@ describe Note do | @@ -72,7 +72,7 @@ describe Note do | ||
72 | 72 | ||
73 | describe '#create_status_change_note' do | 73 | describe '#create_status_change_note' do |
74 | let(:project) { Factory.create(:project) } | 74 | let(:project) { Factory.create(:project) } |
75 | - let(:thing) { Factory.create(:issue, :project => project) } | 75 | + let(:thing) { Factory.create(:issue, project: project) } |
76 | let(:author) { Factory(:user) } | 76 | let(:author) { Factory(:user) } |
77 | let(:status) { 'new_status' } | 77 | let(:status) { 'new_status' } |
78 | 78 | ||
@@ -92,7 +92,7 @@ describe Note do | @@ -92,7 +92,7 @@ describe Note do | ||
92 | describe :authorization do | 92 | describe :authorization do |
93 | before do | 93 | before do |
94 | @p1 = project | 94 | @p1 = project |
95 | - @p2 = Factory :project, :code => "alien", :path => "gitlabhq_1" | 95 | + @p2 = Factory :project, code: "alien", path: "gitlabhq_1" |
96 | @u1 = Factory :user | 96 | @u1 = Factory :user |
97 | @u2 = Factory :user | 97 | @u2 = Factory :user |
98 | @u3 = Factory :user | 98 | @u3 = Factory :user |
@@ -102,8 +102,8 @@ describe Note do | @@ -102,8 +102,8 @@ describe Note do | ||
102 | 102 | ||
103 | describe :read do | 103 | describe :read do |
104 | before do | 104 | before do |
105 | - @p1.users_projects.create(:user => @u2, :project_access => UsersProject::GUEST) | ||
106 | - @p2.users_projects.create(:user => @u3, :project_access => UsersProject::GUEST) | 105 | + @p1.users_projects.create(user: @u2, project_access: UsersProject::GUEST) |
106 | + @p2.users_projects.create(user: @u3, project_access: UsersProject::GUEST) | ||
107 | end | 107 | end |
108 | 108 | ||
109 | it { @abilities.allowed?(@u1, :read_note, @p1).should be_false } | 109 | it { @abilities.allowed?(@u1, :read_note, @p1).should be_false } |
@@ -113,8 +113,8 @@ describe Note do | @@ -113,8 +113,8 @@ describe Note do | ||
113 | 113 | ||
114 | describe :write do | 114 | describe :write do |
115 | before do | 115 | before do |
116 | - @p1.users_projects.create(:user => @u2, :project_access => UsersProject::DEVELOPER) | ||
117 | - @p2.users_projects.create(:user => @u3, :project_access => UsersProject::DEVELOPER) | 116 | + @p1.users_projects.create(user: @u2, project_access: UsersProject::DEVELOPER) |
117 | + @p2.users_projects.create(user: @u3, project_access: UsersProject::DEVELOPER) | ||
118 | end | 118 | end |
119 | 119 | ||
120 | it { @abilities.allowed?(@u1, :write_note, @p1).should be_false } | 120 | it { @abilities.allowed?(@u1, :write_note, @p1).should be_false } |
@@ -124,9 +124,9 @@ describe Note do | @@ -124,9 +124,9 @@ describe Note do | ||
124 | 124 | ||
125 | describe :admin do | 125 | describe :admin do |
126 | before do | 126 | before do |
127 | - @p1.users_projects.create(:user => @u1, :project_access => UsersProject::REPORTER) | ||
128 | - @p1.users_projects.create(:user => @u2, :project_access => UsersProject::MASTER) | ||
129 | - @p2.users_projects.create(:user => @u3, :project_access => UsersProject::MASTER) | 127 | + @p1.users_projects.create(user: @u1, project_access: UsersProject::REPORTER) |
128 | + @p1.users_projects.create(user: @u2, project_access: UsersProject::MASTER) | ||
129 | + @p2.users_projects.create(user: @u3, project_access: UsersProject::MASTER) | ||
130 | end | 130 | end |
131 | 131 | ||
132 | it { @abilities.allowed?(@u1, :admin_note, @p1).should be_false } | 132 | it { @abilities.allowed?(@u1, :admin_note, @p1).should be_false } |
spec/models/project_hooks_spec.rb
@@ -3,7 +3,7 @@ require 'spec_helper' | @@ -3,7 +3,7 @@ require 'spec_helper' | ||
3 | describe Project, "Hooks" do | 3 | describe Project, "Hooks" do |
4 | let(:project) { Factory :project } | 4 | let(:project) { Factory :project } |
5 | before do | 5 | before do |
6 | - @key = Factory :key, :user => project.owner | 6 | + @key = Factory :key, user: project.owner |
7 | @user = @key.user | 7 | @user = @key.user |
8 | @key_id = @key.identifier | 8 | @key_id = @key.identifier |
9 | end | 9 | end |
spec/models/project_security_spec.rb
@@ -12,7 +12,7 @@ describe Project do | @@ -12,7 +12,7 @@ describe Project do | ||
12 | 12 | ||
13 | describe "read access" do | 13 | describe "read access" do |
14 | before do | 14 | before do |
15 | - @p1.users_projects.create(:project => @p1, :user => @u2, :project_access => UsersProject::REPORTER) | 15 | + @p1.users_projects.create(project: @p1, user: @u2, project_access: UsersProject::REPORTER) |
16 | end | 16 | end |
17 | 17 | ||
18 | it { @abilities.allowed?(@u1, :read_project, @p1).should be_false } | 18 | it { @abilities.allowed?(@u1, :read_project, @p1).should be_false } |
@@ -21,7 +21,7 @@ describe Project do | @@ -21,7 +21,7 @@ describe Project do | ||
21 | 21 | ||
22 | describe "write access" do | 22 | describe "write access" do |
23 | before do | 23 | before do |
24 | - @p1.users_projects.create(:project => @p1, :user => @u2, :project_access => UsersProject::DEVELOPER) | 24 | + @p1.users_projects.create(project: @p1, user: @u2, project_access: UsersProject::DEVELOPER) |
25 | end | 25 | end |
26 | 26 | ||
27 | it { @abilities.allowed?(@u1, :write_project, @p1).should be_false } | 27 | it { @abilities.allowed?(@u1, :write_project, @p1).should be_false } |
@@ -30,8 +30,8 @@ describe Project do | @@ -30,8 +30,8 @@ describe Project do | ||
30 | 30 | ||
31 | describe "admin access" do | 31 | describe "admin access" do |
32 | before do | 32 | before do |
33 | - @p1.users_projects.create(:project => @p1, :user => @u1, :project_access => UsersProject::DEVELOPER) | ||
34 | - @p1.users_projects.create(:project => @p1, :user => @u2, :project_access => UsersProject::MASTER) | 33 | + @p1.users_projects.create(project: @p1, user: @u1, project_access: UsersProject::DEVELOPER) |
34 | + @p1.users_projects.create(project: @p1, user: @u2, project_access: UsersProject::MASTER) | ||
35 | end | 35 | end |
36 | 36 | ||
37 | it { @abilities.allowed?(@u1, :admin_project, @p1).should be_false } | 37 | it { @abilities.allowed?(@u1, :admin_project, @p1).should be_false } |
spec/models/project_spec.rb
@@ -80,17 +80,17 @@ describe Project do | @@ -80,17 +80,17 @@ describe Project do | ||
80 | end | 80 | end |
81 | 81 | ||
82 | it "should return valid url to repo" do | 82 | it "should return valid url to repo" do |
83 | - project = Project.new(:path => "somewhere") | 83 | + project = Project.new(path: "somewhere") |
84 | project.url_to_repo.should == Gitlab.config.ssh_path + "somewhere.git" | 84 | project.url_to_repo.should == Gitlab.config.ssh_path + "somewhere.git" |
85 | end | 85 | end |
86 | 86 | ||
87 | it "should return path to repo" do | 87 | it "should return path to repo" do |
88 | - project = Project.new(:path => "somewhere") | 88 | + project = Project.new(path: "somewhere") |
89 | project.path_to_repo.should == File.join(Rails.root, "tmp", "tests", "somewhere") | 89 | project.path_to_repo.should == File.join(Rails.root, "tmp", "tests", "somewhere") |
90 | end | 90 | end |
91 | 91 | ||
92 | it "returns the full web URL for this repo" do | 92 | it "returns the full web URL for this repo" do |
93 | - project = Project.new(:code => "somewhere") | 93 | + project = Project.new(code: "somewhere") |
94 | project.web_url.should == "#{Gitlab.config.url}/somewhere" | 94 | project.web_url.should == "#{Gitlab.config.url}/somewhere" |
95 | end | 95 | end |
96 | 96 | ||
@@ -101,7 +101,7 @@ describe Project do | @@ -101,7 +101,7 @@ describe Project do | ||
101 | end | 101 | end |
102 | 102 | ||
103 | it "should be invalid repo" do | 103 | it "should be invalid repo" do |
104 | - project = Project.new(:name => "ok_name", :path => "/INVALID_PATH/", :code => "NEOK") | 104 | + project = Project.new(name: "ok_name", path: "/INVALID_PATH/", code: "NEOK") |
105 | project.valid_repo?.should be_false | 105 | project.valid_repo?.should be_false |
106 | end | 106 | end |
107 | end | 107 | end |
@@ -121,7 +121,7 @@ describe Project do | @@ -121,7 +121,7 @@ describe Project do | ||
121 | let(:project) { Factory :project } | 121 | let(:project) { Factory :project } |
122 | 122 | ||
123 | it 'returns the creation date of the project\'s last event if present' do | 123 | it 'returns the creation date of the project\'s last event if present' do |
124 | - last_event = double(:created_at => 'now') | 124 | + last_event = double(created_at: 'now') |
125 | project.stub(:events).and_return( [double, double, last_event] ) | 125 | project.stub(:events).and_return( [double, double, last_event] ) |
126 | project.last_activity_date.should == last_event.created_at | 126 | project.last_activity_date.should == last_event.created_at |
127 | end | 127 | end |
@@ -161,7 +161,7 @@ describe Project do | @@ -161,7 +161,7 @@ describe Project do | ||
161 | end | 161 | end |
162 | 162 | ||
163 | it "should return nil" do | 163 | it "should return nil" do |
164 | - lambda { Project.new(:path => "invalid").repo }.should raise_error(Grit::NoSuchPathError) | 164 | + lambda { Project.new(path: "invalid").repo }.should raise_error(Grit::NoSuchPathError) |
165 | end | 165 | end |
166 | 166 | ||
167 | it "should return nil" do | 167 | it "should return nil" do |
@@ -214,10 +214,10 @@ describe Project do | @@ -214,10 +214,10 @@ describe Project do | ||
214 | 214 | ||
215 | before do | 215 | before do |
216 | @merge_request = Factory :merge_request, | 216 | @merge_request = Factory :merge_request, |
217 | - :project => project, | ||
218 | - :merged => false, | ||
219 | - :closed => false | ||
220 | - @key = Factory :key, :user_id => project.owner.id | 217 | + project: project, |
218 | + merged: false, | ||
219 | + closed: false | ||
220 | + @key = Factory :key, user_id: project.owner.id | ||
221 | end | 221 | end |
222 | 222 | ||
223 | it "should close merge request if last commit from source branch was pushed to target branch" do | 223 | it "should close merge request if last commit from source branch was pushed to target branch" do |
spec/models/protected_branch_spec.rb
@@ -24,7 +24,7 @@ describe ProtectedBranch do | @@ -24,7 +24,7 @@ describe ProtectedBranch do | ||
24 | end | 24 | end |
25 | 25 | ||
26 | describe 'Callbacks' do | 26 | describe 'Callbacks' do |
27 | - subject { ProtectedBranch.new(:project => project, :name => 'branch_name') } | 27 | + subject { ProtectedBranch.new(project: project, name: 'branch_name') } |
28 | 28 | ||
29 | it 'call update_repository after save' do | 29 | it 'call update_repository after save' do |
30 | subject.should_receive(:update_repository) | 30 | subject.should_receive(:update_repository) |
@@ -38,7 +38,7 @@ describe ProtectedBranch do | @@ -38,7 +38,7 @@ describe ProtectedBranch do | ||
38 | end | 38 | end |
39 | 39 | ||
40 | describe '#commit' do | 40 | describe '#commit' do |
41 | - subject { ProtectedBranch.new(:project => project, :name => 'cant_touch_this') } | 41 | + subject { ProtectedBranch.new(project: project, name: 'cant_touch_this') } |
42 | 42 | ||
43 | it 'commits itself to its project' do | 43 | it 'commits itself to its project' do |
44 | project.should_receive(:commit).with('cant_touch_this') | 44 | project.should_receive(:commit).with('cant_touch_this') |
spec/models/system_hook_spec.rb
@@ -12,7 +12,7 @@ describe SystemHook do | @@ -12,7 +12,7 @@ describe SystemHook do | ||
12 | it "project_create hook" do | 12 | it "project_create hook" do |
13 | user = Factory :user | 13 | user = Factory :user |
14 | with_resque do | 14 | with_resque do |
15 | - project = Factory :project_without_owner, :owner => user | 15 | + project = Factory :project_without_owner, owner: user |
16 | end | 16 | end |
17 | WebMock.should have_requested(:post, @system_hook.url).with(body: /project_create/).once | 17 | WebMock.should have_requested(:post, @system_hook.url).with(body: /project_create/).once |
18 | end | 18 | end |
spec/models/user_spec.rb
@@ -18,29 +18,29 @@ describe User do | @@ -18,29 +18,29 @@ describe User do | ||
18 | end | 18 | end |
19 | 19 | ||
20 | it "should return valid identifier" do | 20 | it "should return valid identifier" do |
21 | - user = User.new(:email => "test@mail.com") | 21 | + user = User.new(email: "test@mail.com") |
22 | user.identifier.should == "test_mail_com" | 22 | user.identifier.should == "test_mail_com" |
23 | end | 23 | end |
24 | 24 | ||
25 | it "should return identifier without + sign" do | 25 | it "should return identifier without + sign" do |
26 | - user = User.new(:email => "test+foo@mail.com") | 26 | + user = User.new(email: "test+foo@mail.com") |
27 | user.identifier.should == "test_foo_mail_com" | 27 | user.identifier.should == "test_foo_mail_com" |
28 | end | 28 | end |
29 | 29 | ||
30 | it "should execute callback when force_random_password specified" do | 30 | it "should execute callback when force_random_password specified" do |
31 | - user = User.new(:email => "test@mail.com", :force_random_password => true) | 31 | + user = User.new(email: "test@mail.com", force_random_password: true) |
32 | user.should_receive(:generate_password) | 32 | user.should_receive(:generate_password) |
33 | user.save | 33 | user.save |
34 | end | 34 | end |
35 | 35 | ||
36 | it "should not generate password by default" do | 36 | it "should not generate password by default" do |
37 | - user = Factory(:user, :password => 'abcdefg', :password_confirmation => 'abcdefg') | 37 | + user = Factory(:user, password: 'abcdefg', password_confirmation: 'abcdefg') |
38 | user.password.should == 'abcdefg' | 38 | user.password.should == 'abcdefg' |
39 | end | 39 | end |
40 | 40 | ||
41 | it "should generate password when forcing random password" do | 41 | it "should generate password when forcing random password" do |
42 | Devise.stub(:friendly_token).and_return('123456789') | 42 | Devise.stub(:friendly_token).and_return('123456789') |
43 | - user = User.create(:email => "test1@mail.com", :force_random_password => true) | 43 | + user = User.create(email: "test1@mail.com", force_random_password: true) |
44 | user.password.should == user.password_confirmation | 44 | user.password.should == user.password_confirmation |
45 | user.password.should == '12345678' | 45 | user.password.should == '12345678' |
46 | end | 46 | end |
@@ -54,8 +54,8 @@ describe User do | @@ -54,8 +54,8 @@ describe User do | ||
54 | before do | 54 | before do |
55 | @user = Factory :user | 55 | @user = Factory :user |
56 | @note = Factory :note, | 56 | @note = Factory :note, |
57 | - :author => @user, | ||
58 | - :project => Factory(:project) | 57 | + author: @user, |
58 | + project: Factory(:project) | ||
59 | end | 59 | end |
60 | 60 | ||
61 | it "should destroy all notes with user" do | 61 | it "should destroy all notes with user" do |
spec/requests/admin/admin_hooks_spec.rb
@@ -3,8 +3,8 @@ require 'spec_helper' | @@ -3,8 +3,8 @@ require 'spec_helper' | ||
3 | describe "Admin::Hooks" do | 3 | describe "Admin::Hooks" do |
4 | before do | 4 | before do |
5 | @project = Factory :project, | 5 | @project = Factory :project, |
6 | - :name => "LeGiT", | ||
7 | - :code => "LGT" | 6 | + name: "LeGiT", |
7 | + code: "LGT" | ||
8 | login_as :admin | 8 | login_as :admin |
9 | 9 | ||
10 | @system_hook = Factory :system_hook | 10 | @system_hook = Factory :system_hook |
@@ -30,7 +30,7 @@ describe "Admin::Hooks" do | @@ -30,7 +30,7 @@ describe "Admin::Hooks" do | ||
30 | before do | 30 | before do |
31 | @url = Faker::Internet.uri("http") | 31 | @url = Faker::Internet.uri("http") |
32 | visit admin_hooks_path | 32 | visit admin_hooks_path |
33 | - fill_in "hook_url", :with => @url | 33 | + fill_in "hook_url", with: @url |
34 | expect { click_button "Add System Hook" }.to change(SystemHook, :count).by(1) | 34 | expect { click_button "Add System Hook" }.to change(SystemHook, :count).by(1) |
35 | end | 35 | end |
36 | 36 |
spec/requests/admin/admin_projects_spec.rb
@@ -3,8 +3,8 @@ require 'spec_helper' | @@ -3,8 +3,8 @@ require 'spec_helper' | ||
3 | describe "Admin::Projects" do | 3 | describe "Admin::Projects" do |
4 | before do | 4 | before do |
5 | @project = Factory :project, | 5 | @project = Factory :project, |
6 | - :name => "LeGiT", | ||
7 | - :code => "LGT" | 6 | + name: "LeGiT", |
7 | + code: "LGT" | ||
8 | login_as :admin | 8 | login_as :admin |
9 | end | 9 | end |
10 | 10 | ||
@@ -47,8 +47,8 @@ describe "Admin::Projects" do | @@ -47,8 +47,8 @@ describe "Admin::Projects" do | ||
47 | 47 | ||
48 | describe "Update project" do | 48 | describe "Update project" do |
49 | before do | 49 | before do |
50 | - fill_in "project_name", :with => "Big Bang" | ||
51 | - fill_in "project_code", :with => "BB1" | 50 | + fill_in "project_name", with: "Big Bang" |
51 | + fill_in "project_code", with: "BB1" | ||
52 | click_button "Save Project" | 52 | click_button "Save Project" |
53 | @project.reload | 53 | @project.reload |
54 | end | 54 | end |
@@ -85,9 +85,9 @@ describe "Admin::Projects" do | @@ -85,9 +85,9 @@ describe "Admin::Projects" do | ||
85 | describe "POST /admin/projects" do | 85 | describe "POST /admin/projects" do |
86 | before do | 86 | before do |
87 | visit new_admin_project_path | 87 | visit new_admin_project_path |
88 | - fill_in 'project_name', :with => 'NewProject' | ||
89 | - fill_in 'project_code', :with => 'NPR' | ||
90 | - fill_in 'project_path', :with => 'gitlabhq_1' | 88 | + fill_in 'project_name', with: 'NewProject' |
89 | + fill_in 'project_code', with: 'NPR' | ||
90 | + fill_in 'project_path', with: 'gitlabhq_1' | ||
91 | expect { click_button "Create project" }.to change { Project.count }.by(1) | 91 | expect { click_button "Create project" }.to change { Project.count }.by(1) |
92 | @project = Project.last | 92 | @project = Project.last |
93 | end | 93 | end |
@@ -109,7 +109,7 @@ describe "Admin::Projects" do | @@ -109,7 +109,7 @@ describe "Admin::Projects" do | ||
109 | end | 109 | end |
110 | 110 | ||
111 | it "should create new user" do | 111 | it "should create new user" do |
112 | - select @new_user.name, :from => "user_ids" | 112 | + select @new_user.name, from: "user_ids" |
113 | expect { click_button "Add" }.to change { UsersProject.count }.by(1) | 113 | expect { click_button "Add" }.to change { UsersProject.count }.by(1) |
114 | page.should have_content @new_user.name | 114 | page.should have_content @new_user.name |
115 | current_path.should == admin_project_path(@project) | 115 | current_path.should == admin_project_path(@project) |
spec/requests/admin/admin_users_spec.rb
@@ -22,10 +22,10 @@ describe "Admin::Users" do | @@ -22,10 +22,10 @@ describe "Admin::Users" do | ||
22 | before do | 22 | before do |
23 | @password = "123ABC" | 23 | @password = "123ABC" |
24 | visit new_admin_user_path | 24 | visit new_admin_user_path |
25 | - fill_in "user_name", :with => "Big Bang" | ||
26 | - fill_in "user_email", :with => "bigbang@mail.com" | ||
27 | - fill_in "user_password", :with => @password | ||
28 | - fill_in "user_password_confirmation", :with => @password | 25 | + fill_in "user_name", with: "Big Bang" |
26 | + fill_in "user_email", with: "bigbang@mail.com" | ||
27 | + fill_in "user_password", with: @password | ||
28 | + fill_in "user_password_confirmation", with: @password | ||
29 | end | 29 | end |
30 | 30 | ||
31 | it "should create new user" do | 31 | it "should create new user" do |
@@ -40,7 +40,7 @@ describe "Admin::Users" do | @@ -40,7 +40,7 @@ describe "Admin::Users" do | ||
40 | end | 40 | end |
41 | 41 | ||
42 | it "should call send mail" do | 42 | it "should call send mail" do |
43 | - Notify.should_receive(:new_user_email).and_return(stub(:deliver => true)) | 43 | + Notify.should_receive(:new_user_email).and_return(stub(deliver: true)) |
44 | 44 | ||
45 | User.observers.enable :user_observer do | 45 | User.observers.enable :user_observer do |
46 | click_button "Save" | 46 | click_button "Save" |
@@ -88,8 +88,8 @@ describe "Admin::Users" do | @@ -88,8 +88,8 @@ describe "Admin::Users" do | ||
88 | 88 | ||
89 | describe "Update user" do | 89 | describe "Update user" do |
90 | before do | 90 | before do |
91 | - fill_in "user_name", :with => "Big Bang" | ||
92 | - fill_in "user_email", :with => "bigbang@mail.com" | 91 | + fill_in "user_name", with: "Big Bang" |
92 | + fill_in "user_email", with: "bigbang@mail.com" | ||
93 | check "user_admin" | 93 | check "user_admin" |
94 | click_button "Save" | 94 | click_button "Save" |
95 | end | 95 | end |
@@ -114,7 +114,7 @@ describe "Admin::Users" do | @@ -114,7 +114,7 @@ describe "Admin::Users" do | ||
114 | end | 114 | end |
115 | 115 | ||
116 | it "should create new user" do | 116 | it "should create new user" do |
117 | - select @new_project.name, :from => "project_ids" | 117 | + select @new_project.name, from: "project_ids" |
118 | expect { click_button "Add" }.to change { UsersProject.count }.by(1) | 118 | expect { click_button "Add" }.to change { UsersProject.count }.by(1) |
119 | page.should have_content @new_project.name | 119 | page.should have_content @new_project.name |
120 | current_path.should == admin_user_path(@user) | 120 | current_path.should == admin_user_path(@user) |
spec/requests/atom/dashboard_issues_spec.rb
@@ -7,40 +7,40 @@ describe "User Issues Dashboard" do | @@ -7,40 +7,40 @@ describe "User Issues Dashboard" do | ||
7 | login_as :user | 7 | login_as :user |
8 | 8 | ||
9 | @project1 = Factory :project, | 9 | @project1 = Factory :project, |
10 | - :path => "project1", | ||
11 | - :code => "TEST1" | 10 | + path: "project1", |
11 | + code: "TEST1" | ||
12 | 12 | ||
13 | @project2 = Factory :project, | 13 | @project2 = Factory :project, |
14 | - :path => "project2", | ||
15 | - :code => "TEST2" | 14 | + path: "project2", |
15 | + code: "TEST2" | ||
16 | 16 | ||
17 | @project1.add_access(@user, :read, :write) | 17 | @project1.add_access(@user, :read, :write) |
18 | @project2.add_access(@user, :read, :write) | 18 | @project2.add_access(@user, :read, :write) |
19 | 19 | ||
20 | @issue1 = Factory :issue, | 20 | @issue1 = Factory :issue, |
21 | - :author => @user, | ||
22 | - :assignee => @user, | ||
23 | - :project => @project1 | 21 | + author: @user, |
22 | + assignee: @user, | ||
23 | + project: @project1 | ||
24 | 24 | ||
25 | @issue2 = Factory :issue, | 25 | @issue2 = Factory :issue, |
26 | - :author => @user, | ||
27 | - :assignee => @user, | ||
28 | - :project => @project2 | 26 | + author: @user, |
27 | + assignee: @user, | ||
28 | + project: @project2 | ||
29 | 29 | ||
30 | visit dashboard_issues_path | 30 | visit dashboard_issues_path |
31 | end | 31 | end |
32 | 32 | ||
33 | - describe "atom feed", :js => false do | 33 | + describe "atom feed", js: false do |
34 | it "should render atom feed via private token" do | 34 | it "should render atom feed via private token" do |
35 | logout | 35 | logout |
36 | - visit dashboard_issues_path(:atom, :private_token => @user.private_token) | 36 | + visit dashboard_issues_path(:atom, private_token: @user.private_token) |
37 | 37 | ||
38 | page.response_headers['Content-Type'].should have_content("application/atom+xml") | 38 | page.response_headers['Content-Type'].should have_content("application/atom+xml") |
39 | - page.body.should have_selector("title", :text => "#{@user.name} issues") | ||
40 | - page.body.should have_selector("author email", :text => @issue1.author_email) | ||
41 | - page.body.should have_selector("entry summary", :text => @issue1.title) | ||
42 | - page.body.should have_selector("author email", :text => @issue2.author_email) | ||
43 | - page.body.should have_selector("entry summary", :text => @issue2.title) | 39 | + page.body.should have_selector("title", text: "#{@user.name} issues") |
40 | + page.body.should have_selector("author email", text: @issue1.author_email) | ||
41 | + page.body.should have_selector("entry summary", text: @issue1.title) | ||
42 | + page.body.should have_selector("author email", text: @issue2.author_email) | ||
43 | + page.body.should have_selector("entry summary", text: @issue2.title) | ||
44 | end | 44 | end |
45 | end | 45 | end |
46 | end | 46 | end |
spec/requests/atom/dashboard_spec.rb
@@ -5,7 +5,7 @@ describe "User Dashboard" do | @@ -5,7 +5,7 @@ describe "User Dashboard" do | ||
5 | 5 | ||
6 | describe "GET /" do | 6 | describe "GET /" do |
7 | before do | 7 | before do |
8 | - @project = Factory :project, :owner => @user | 8 | + @project = Factory :project, owner: @user |
9 | @project.add_access(@user, :read) | 9 | @project.add_access(@user, :read) |
10 | visit dashboard_path | 10 | visit dashboard_path |
11 | end | 11 | end |
@@ -13,14 +13,14 @@ describe "User Dashboard" do | @@ -13,14 +13,14 @@ describe "User Dashboard" do | ||
13 | it "should render projects atom feed via private token" do | 13 | it "should render projects atom feed via private token" do |
14 | logout | 14 | logout |
15 | 15 | ||
16 | - visit dashboard_path(:atom, :private_token => @user.private_token) | 16 | + visit dashboard_path(:atom, private_token: @user.private_token) |
17 | page.body.should have_selector("feed title") | 17 | page.body.should have_selector("feed title") |
18 | end | 18 | end |
19 | 19 | ||
20 | it "should not render projects page via private token" do | 20 | it "should not render projects page via private token" do |
21 | logout | 21 | logout |
22 | 22 | ||
23 | - visit dashboard_path(:private_token => @user.private_token) | 23 | + visit dashboard_path(private_token: @user.private_token) |
24 | current_path.should == new_user_session_path | 24 | current_path.should == new_user_session_path |
25 | end | 25 | end |
26 | end | 26 | end |
spec/requests/atom/issues_spec.rb
@@ -11,9 +11,9 @@ describe "Issues" do | @@ -11,9 +11,9 @@ describe "Issues" do | ||
11 | describe "GET /issues" do | 11 | describe "GET /issues" do |
12 | before do | 12 | before do |
13 | @issue = Factory :issue, | 13 | @issue = Factory :issue, |
14 | - :author => @user, | ||
15 | - :assignee => @user, | ||
16 | - :project => project | 14 | + author: @user, |
15 | + assignee: @user, | ||
16 | + project: project | ||
17 | 17 | ||
18 | visit project_issues_path(project) | 18 | visit project_issues_path(project) |
19 | end | 19 | end |
@@ -22,19 +22,19 @@ describe "Issues" do | @@ -22,19 +22,19 @@ describe "Issues" do | ||
22 | visit project_issues_path(project, :atom) | 22 | visit project_issues_path(project, :atom) |
23 | 23 | ||
24 | page.response_headers['Content-Type'].should have_content("application/atom+xml") | 24 | page.response_headers['Content-Type'].should have_content("application/atom+xml") |
25 | - page.body.should have_selector("title", :text => "#{project.name} issues") | ||
26 | - page.body.should have_selector("author email", :text => @issue.author_email) | ||
27 | - page.body.should have_selector("entry summary", :text => @issue.title) | 25 | + page.body.should have_selector("title", text: "#{project.name} issues") |
26 | + page.body.should have_selector("author email", text: @issue.author_email) | ||
27 | + page.body.should have_selector("entry summary", text: @issue.title) | ||
28 | end | 28 | end |
29 | 29 | ||
30 | it "should render atom feed via private token" do | 30 | it "should render atom feed via private token" do |
31 | logout | 31 | logout |
32 | - visit project_issues_path(project, :atom, :private_token => @user.private_token) | 32 | + visit project_issues_path(project, :atom, private_token: @user.private_token) |
33 | 33 | ||
34 | page.response_headers['Content-Type'].should have_content("application/atom+xml") | 34 | page.response_headers['Content-Type'].should have_content("application/atom+xml") |
35 | - page.body.should have_selector("title", :text => "#{project.name} issues") | ||
36 | - page.body.should have_selector("author email", :text => @issue.author_email) | ||
37 | - page.body.should have_selector("entry summary", :text => @issue.title) | 35 | + page.body.should have_selector("title", text: "#{project.name} issues") |
36 | + page.body.should have_selector("author email", text: @issue.author_email) | ||
37 | + page.body.should have_selector("entry summary", text: @issue.title) | ||
38 | end | 38 | end |
39 | end | 39 | end |
40 | end | 40 | end |
spec/requests/gitlab_flavored_markdown_spec.rb
@@ -2,10 +2,10 @@ require 'spec_helper' | @@ -2,10 +2,10 @@ require 'spec_helper' | ||
2 | 2 | ||
3 | describe "Gitlab Flavored Markdown" do | 3 | describe "Gitlab Flavored Markdown" do |
4 | let(:project) { Factory :project } | 4 | let(:project) { Factory :project } |
5 | - let(:issue) { Factory :issue, :project => project } | ||
6 | - let(:merge_request) { Factory :merge_request, :project => project } | 5 | + let(:issue) { Factory :issue, project: project } |
6 | + let(:merge_request) { Factory :merge_request, project: project } | ||
7 | let(:fred) do | 7 | let(:fred) do |
8 | - u = Factory :user, :name => "fred" | 8 | + u = Factory :user, name: "fred" |
9 | project.users << u | 9 | project.users << u |
10 | u | 10 | u |
11 | end | 11 | end |
@@ -19,7 +19,7 @@ describe "Gitlab Flavored Markdown" do | @@ -19,7 +19,7 @@ describe "Gitlab Flavored Markdown" do | ||
19 | @test_file = "gfm_test_file" | 19 | @test_file = "gfm_test_file" |
20 | i.add(@test_file, "foo\nbar\n") | 20 | i.add(@test_file, "foo\nbar\n") |
21 | # add commit with gfm | 21 | # add commit with gfm |
22 | - i.commit("fix ##{issue.id}\n\nask @#{fred.name} for details", :head => @branch_name) | 22 | + i.commit("fix ##{issue.id}\n\nask @#{fred.name} for details", head: @branch_name) |
23 | 23 | ||
24 | # add test tag | 24 | # add test tag |
25 | @tag_name = "gfm-test-tag" | 25 | @tag_name = "gfm-test-tag" |
@@ -27,8 +27,8 @@ describe "Gitlab Flavored Markdown" do | @@ -27,8 +27,8 @@ describe "Gitlab Flavored Markdown" do | ||
27 | end | 27 | end |
28 | after do | 28 | after do |
29 | # delete test branch and tag | 29 | # delete test branch and tag |
30 | - project.repo.git.native(:branch, {:D => true}, @branch_name) | ||
31 | - project.repo.git.native(:tag, {:d => true}, @tag_name) | 30 | + project.repo.git.native(:branch, {D: true}, @branch_name) |
31 | + project.repo.git.native(:tag, {d: true}, @tag_name) | ||
32 | project.repo.gc_auto | 32 | project.repo.gc_auto |
33 | end | 33 | end |
34 | 34 | ||
@@ -42,25 +42,25 @@ describe "Gitlab Flavored Markdown" do | @@ -42,25 +42,25 @@ describe "Gitlab Flavored Markdown" do | ||
42 | 42 | ||
43 | describe "for commits" do | 43 | describe "for commits" do |
44 | it "should render title in commits#index" do | 44 | it "should render title in commits#index" do |
45 | - visit project_commits_path(project, :ref => @branch_name) | 45 | + visit project_commits_path(project, ref: @branch_name) |
46 | 46 | ||
47 | page.should have_link("##{issue.id}") | 47 | page.should have_link("##{issue.id}") |
48 | end | 48 | end |
49 | 49 | ||
50 | it "should render title in commits#show" do | 50 | it "should render title in commits#show" do |
51 | - visit project_commit_path(project, :id => commit.id) | 51 | + visit project_commit_path(project, id: commit.id) |
52 | 52 | ||
53 | page.should have_link("##{issue.id}") | 53 | page.should have_link("##{issue.id}") |
54 | end | 54 | end |
55 | 55 | ||
56 | it "should render description in commits#show" do | 56 | it "should render description in commits#show" do |
57 | - visit project_commit_path(project, :id => commit.id) | 57 | + visit project_commit_path(project, id: commit.id) |
58 | 58 | ||
59 | page.should have_link("@#{fred.name}") | 59 | page.should have_link("@#{fred.name}") |
60 | end | 60 | end |
61 | 61 | ||
62 | - it "should render title in refs#tree", :js => true do | ||
63 | - visit tree_project_ref_path(project, :id => @branch_name) | 62 | + it "should render title in refs#tree", js: true do |
63 | + visit tree_project_ref_path(project, id: @branch_name) | ||
64 | 64 | ||
65 | within(".tree_commit") do | 65 | within(".tree_commit") do |
66 | page.should have_link("##{issue.id}") | 66 | page.should have_link("##{issue.id}") |
@@ -68,7 +68,7 @@ describe "Gitlab Flavored Markdown" do | @@ -68,7 +68,7 @@ describe "Gitlab Flavored Markdown" do | ||
68 | end | 68 | end |
69 | 69 | ||
70 | it "should render title in refs#blame" do | 70 | it "should render title in refs#blame" do |
71 | - visit blame_file_project_ref_path(project, :id => @branch_name, :path => @test_file) | 71 | + visit blame_file_project_ref_path(project, id: @branch_name, path: @test_file) |
72 | 72 | ||
73 | within(".blame_commit") do | 73 | within(".blame_commit") do |
74 | page.should have_link("##{issue.id}") | 74 | page.should have_link("##{issue.id}") |
@@ -92,15 +92,15 @@ describe "Gitlab Flavored Markdown" do | @@ -92,15 +92,15 @@ describe "Gitlab Flavored Markdown" do | ||
92 | describe "for issues" do | 92 | describe "for issues" do |
93 | before do | 93 | before do |
94 | @other_issue = Factory :issue, | 94 | @other_issue = Factory :issue, |
95 | - :author => @user, | ||
96 | - :assignee => @user, | ||
97 | - :project => project | 95 | + author: @user, |
96 | + assignee: @user, | ||
97 | + project: project | ||
98 | @issue = Factory :issue, | 98 | @issue = Factory :issue, |
99 | - :author => @user, | ||
100 | - :assignee => @user, | ||
101 | - :project => project, | ||
102 | - :title => "fix ##{@other_issue.id}", | ||
103 | - :description => "ask @#{fred.name} for details" | 99 | + author: @user, |
100 | + assignee: @user, | ||
101 | + project: project, | ||
102 | + title: "fix ##{@other_issue.id}", | ||
103 | + description: "ask @#{fred.name} for details" | ||
104 | end | 104 | end |
105 | 105 | ||
106 | it "should render subject in issues#index" do | 106 | it "should render subject in issues#index" do |
@@ -126,8 +126,8 @@ describe "Gitlab Flavored Markdown" do | @@ -126,8 +126,8 @@ describe "Gitlab Flavored Markdown" do | ||
126 | describe "for merge requests" do | 126 | describe "for merge requests" do |
127 | before do | 127 | before do |
128 | @merge_request = Factory :merge_request, | 128 | @merge_request = Factory :merge_request, |
129 | - :project => project, | ||
130 | - :title => "fix ##{issue.id}" | 129 | + project: project, |
130 | + title: "fix ##{issue.id}" | ||
131 | end | 131 | end |
132 | 132 | ||
133 | it "should render title in merge_requests#index" do | 133 | it "should render title in merge_requests#index" do |
@@ -147,9 +147,9 @@ describe "Gitlab Flavored Markdown" do | @@ -147,9 +147,9 @@ describe "Gitlab Flavored Markdown" do | ||
147 | describe "for milestones" do | 147 | describe "for milestones" do |
148 | before do | 148 | before do |
149 | @milestone = Factory :milestone, | 149 | @milestone = Factory :milestone, |
150 | - :project => project, | ||
151 | - :title => "fix ##{issue.id}", | ||
152 | - :description => "ask @#{fred.name} for details" | 150 | + project: project, |
151 | + title: "fix ##{issue.id}", | ||
152 | + description: "ask @#{fred.name} for details" | ||
153 | end | 153 | end |
154 | 154 | ||
155 | it "should render title in milestones#index" do | 155 | it "should render title in milestones#index" do |
@@ -173,45 +173,45 @@ describe "Gitlab Flavored Markdown" do | @@ -173,45 +173,45 @@ describe "Gitlab Flavored Markdown" do | ||
173 | 173 | ||
174 | 174 | ||
175 | describe "for notes" do | 175 | describe "for notes" do |
176 | - it "should render in commits#show", :js => true do | ||
177 | - visit project_commit_path(project, :id => commit.id) | ||
178 | - fill_in "note_note", :with => "see ##{issue.id}" | 176 | + it "should render in commits#show", js: true do |
177 | + visit project_commit_path(project, id: commit.id) | ||
178 | + fill_in "note_note", with: "see ##{issue.id}" | ||
179 | click_button "Add Comment" | 179 | click_button "Add Comment" |
180 | 180 | ||
181 | page.should have_link("##{issue.id}") | 181 | page.should have_link("##{issue.id}") |
182 | end | 182 | end |
183 | 183 | ||
184 | - it "should render in issue#show", :js => true do | 184 | + it "should render in issue#show", js: true do |
185 | visit project_issue_path(project, issue) | 185 | visit project_issue_path(project, issue) |
186 | - fill_in "note_note", :with => "see ##{issue.id}" | 186 | + fill_in "note_note", with: "see ##{issue.id}" |
187 | click_button "Add Comment" | 187 | click_button "Add Comment" |
188 | 188 | ||
189 | page.should have_link("##{issue.id}") | 189 | page.should have_link("##{issue.id}") |
190 | end | 190 | end |
191 | 191 | ||
192 | - it "should render in merge_request#show", :js => true do | 192 | + it "should render in merge_request#show", js: true do |
193 | visit project_merge_request_path(project, merge_request) | 193 | visit project_merge_request_path(project, merge_request) |
194 | - fill_in "note_note", :with => "see ##{issue.id}" | 194 | + fill_in "note_note", with: "see ##{issue.id}" |
195 | click_button "Add Comment" | 195 | click_button "Add Comment" |
196 | 196 | ||
197 | page.should have_link("##{issue.id}") | 197 | page.should have_link("##{issue.id}") |
198 | end | 198 | end |
199 | 199 | ||
200 | - it "should render in projects#wall", :js => true do | 200 | + it "should render in projects#wall", js: true do |
201 | visit wall_project_path(project) | 201 | visit wall_project_path(project) |
202 | - fill_in "note_note", :with => "see ##{issue.id}" | 202 | + fill_in "note_note", with: "see ##{issue.id}" |
203 | click_button "Add Comment" | 203 | click_button "Add Comment" |
204 | 204 | ||
205 | page.should have_link("##{issue.id}") | 205 | page.should have_link("##{issue.id}") |
206 | end | 206 | end |
207 | 207 | ||
208 | - it "should render in wikis#index", :js => true do | 208 | + it "should render in wikis#index", js: true do |
209 | visit project_wiki_path(project, :index) | 209 | visit project_wiki_path(project, :index) |
210 | - fill_in "Title", :with => 'Test title' | ||
211 | - fill_in "Content", :with => '[link test](test)' | 210 | + fill_in "Title", with: 'Test title' |
211 | + fill_in "Content", with: '[link test](test)' | ||
212 | click_on "Save" | 212 | click_on "Save" |
213 | 213 | ||
214 | - fill_in "note_note", :with => "see ##{issue.id}" | 214 | + fill_in "note_note", with: "see ##{issue.id}" |
215 | click_button "Add Comment" | 215 | click_button "Add Comment" |
216 | 216 | ||
217 | page.should have_link("##{issue.id}") | 217 | page.should have_link("##{issue.id}") |
@@ -222,8 +222,8 @@ describe "Gitlab Flavored Markdown" do | @@ -222,8 +222,8 @@ describe "Gitlab Flavored Markdown" do | ||
222 | describe "for wikis" do | 222 | describe "for wikis" do |
223 | before do | 223 | before do |
224 | visit project_wiki_path(project, :index) | 224 | visit project_wiki_path(project, :index) |
225 | - fill_in "Title", :with => "Circumvent ##{issue.id}" | ||
226 | - fill_in "Content", :with => "# Other pages\n\n* [Foo](foo)\n* [Bar](bar)\n\nAlso look at ##{issue.id} :-)" | 225 | + fill_in "Title", with: "Circumvent ##{issue.id}" |
226 | + fill_in "Content", with: "# Other pages\n\n* [Foo](foo)\n* [Bar](bar)\n\nAlso look at ##{issue.id} :-)" | ||
227 | click_on "Save" | 227 | click_on "Save" |
228 | end | 228 | end |
229 | 229 |
spec/requests/hooks_spec.rb
@@ -9,7 +9,7 @@ describe "Hooks" do | @@ -9,7 +9,7 @@ describe "Hooks" do | ||
9 | 9 | ||
10 | describe "GET index" do | 10 | describe "GET index" do |
11 | it "should be available" do | 11 | it "should be available" do |
12 | - @hook = Factory :project_hook, :project => @project | 12 | + @hook = Factory :project_hook, project: @project |
13 | visit project_hooks_path(@project) | 13 | visit project_hooks_path(@project) |
14 | page.should have_content "Hooks" | 14 | page.should have_content "Hooks" |
15 | page.should have_content @hook.url | 15 | page.should have_content @hook.url |
@@ -20,7 +20,7 @@ describe "Hooks" do | @@ -20,7 +20,7 @@ describe "Hooks" do | ||
20 | before do | 20 | before do |
21 | @url = Faker::Internet.uri("http") | 21 | @url = Faker::Internet.uri("http") |
22 | visit project_hooks_path(@project) | 22 | visit project_hooks_path(@project) |
23 | - fill_in "hook_url", :with => @url | 23 | + fill_in "hook_url", with: @url |
24 | expect { click_button "Add Web Hook" }.to change(ProjectHook, :count).by(1) | 24 | expect { click_button "Add Web Hook" }.to change(ProjectHook, :count).by(1) |
25 | end | 25 | end |
26 | 26 | ||
@@ -32,7 +32,7 @@ describe "Hooks" do | @@ -32,7 +32,7 @@ describe "Hooks" do | ||
32 | 32 | ||
33 | describe "Test" do | 33 | describe "Test" do |
34 | before do | 34 | before do |
35 | - @hook = Factory :project_hook, :project => @project | 35 | + @hook = Factory :project_hook, project: @project |
36 | stub_request(:post, @hook.url) | 36 | stub_request(:post, @hook.url) |
37 | visit project_hooks_path(@project) | 37 | visit project_hooks_path(@project) |
38 | click_link "Test Hook" | 38 | click_link "Test Hook" |
spec/requests/issues_spec.rb
@@ -11,12 +11,12 @@ describe "Issues" do | @@ -11,12 +11,12 @@ describe "Issues" do | ||
11 | project.add_access(@user2, :read, :write) | 11 | project.add_access(@user2, :read, :write) |
12 | end | 12 | end |
13 | 13 | ||
14 | - describe "Edit issue", :js => true do | 14 | + describe "Edit issue", js: true do |
15 | before do | 15 | before do |
16 | @issue = Factory :issue, | 16 | @issue = Factory :issue, |
17 | - :author => @user, | ||
18 | - :assignee => @user, | ||
19 | - :project => project | 17 | + author: @user, |
18 | + assignee: @user, | ||
19 | + project: project | ||
20 | visit project_issues_path(project) | 20 | visit project_issues_path(project) |
21 | click_link "Edit" | 21 | click_link "Edit" |
22 | end | 22 | end |
@@ -27,8 +27,8 @@ describe "Issues" do | @@ -27,8 +27,8 @@ describe "Issues" do | ||
27 | 27 | ||
28 | describe "fill in" do | 28 | describe "fill in" do |
29 | before do | 29 | before do |
30 | - fill_in "issue_title", :with => "bug 345" | ||
31 | - fill_in "issue_description", :with => "bug description" | 30 | + fill_in "issue_title", with: "bug 345" |
31 | + fill_in "issue_description", with: "bug description" | ||
32 | end | 32 | end |
33 | 33 | ||
34 | it { expect { click_button "Save changes" }.to_not change {Issue.count} } | 34 | it { expect { click_button "Save changes" }.to_not change {Issue.count} } |
@@ -43,14 +43,14 @@ describe "Issues" do | @@ -43,14 +43,14 @@ describe "Issues" do | ||
43 | end | 43 | end |
44 | end | 44 | end |
45 | 45 | ||
46 | - describe "Search issue", :js => true do | 46 | + describe "Search issue", js: true do |
47 | before do | 47 | before do |
48 | ['foobar', 'foobar2', 'gitlab'].each do |title| | 48 | ['foobar', 'foobar2', 'gitlab'].each do |title| |
49 | @issue = Factory :issue, | 49 | @issue = Factory :issue, |
50 | - :author => @user, | ||
51 | - :assignee => @user, | ||
52 | - :project => project, | ||
53 | - :title => title | 50 | + author: @user, |
51 | + assignee: @user, | ||
52 | + project: project, | ||
53 | + title: title | ||
54 | @issue.save | 54 | @issue.save |
55 | end | 55 | end |
56 | end | 56 | end |
@@ -62,7 +62,7 @@ describe "Issues" do | @@ -62,7 +62,7 @@ describe "Issues" do | ||
62 | 62 | ||
63 | visit project_issues_path(project) | 63 | visit project_issues_path(project) |
64 | click_link 'Closed' | 64 | click_link 'Closed' |
65 | - fill_in 'issue_search', :with => 'foobar' | 65 | + fill_in 'issue_search', with: 'foobar' |
66 | 66 | ||
67 | page.should have_content 'foobar' | 67 | page.should have_content 'foobar' |
68 | page.should_not have_content 'foobar2' | 68 | page.should_not have_content 'foobar2' |
@@ -71,7 +71,7 @@ describe "Issues" do | @@ -71,7 +71,7 @@ describe "Issues" do | ||
71 | 71 | ||
72 | it "should search for term and return the correct results" do | 72 | it "should search for term and return the correct results" do |
73 | visit project_issues_path(project) | 73 | visit project_issues_path(project) |
74 | - fill_in 'issue_search', :with => 'foobar' | 74 | + fill_in 'issue_search', with: 'foobar' |
75 | 75 | ||
76 | page.should have_content 'foobar' | 76 | page.should have_content 'foobar' |
77 | page.should have_content 'foobar2' | 77 | page.should have_content 'foobar2' |
@@ -80,8 +80,8 @@ describe "Issues" do | @@ -80,8 +80,8 @@ describe "Issues" do | ||
80 | 80 | ||
81 | it "should return all results if term has been cleared" do | 81 | it "should return all results if term has been cleared" do |
82 | visit project_issues_path(project) | 82 | visit project_issues_path(project) |
83 | - fill_in "issue_search", :with => "foobar" | ||
84 | - # Because fill_in, :with => "" triggers nothing we need to trigger a keyup event | 83 | + fill_in "issue_search", with: "foobar" |
84 | + # Because fill_in, with: "" triggers nothing we need to trigger a keyup event | ||
85 | page.execute_script("$('.issue_search').val('').keyup();"); | 85 | page.execute_script("$('.issue_search').val('').keyup();"); |
86 | 86 | ||
87 | page.should have_content 'foobar' | 87 | page.should have_content 'foobar' |
spec/requests/projects_deploy_keys_spec.rb
@@ -10,7 +10,7 @@ describe "Projects", "DeployKeys" do | @@ -10,7 +10,7 @@ describe "Projects", "DeployKeys" do | ||
10 | 10 | ||
11 | describe "GET /keys" do | 11 | describe "GET /keys" do |
12 | before do | 12 | before do |
13 | - @key = Factory :key, :project => project | 13 | + @key = Factory :key, project: project |
14 | visit project_deploy_keys_path(project) | 14 | visit project_deploy_keys_path(project) |
15 | end | 15 | end |
16 | 16 | ||
@@ -41,8 +41,8 @@ describe "Projects", "DeployKeys" do | @@ -41,8 +41,8 @@ describe "Projects", "DeployKeys" do | ||
41 | 41 | ||
42 | describe "fill in" do | 42 | describe "fill in" do |
43 | before do | 43 | before do |
44 | - fill_in "key_title", :with => "laptop" | ||
45 | - fill_in "key_key", :with => "publickey234=" | 44 | + fill_in "key_title", with: "laptop" |
45 | + fill_in "key_key", with: "publickey234=" | ||
46 | end | 46 | end |
47 | 47 | ||
48 | it { expect { click_button "Save" }.to change {Key.count}.by(1) } | 48 | it { expect { click_button "Save" }.to change {Key.count}.by(1) } |
@@ -57,7 +57,7 @@ describe "Projects", "DeployKeys" do | @@ -57,7 +57,7 @@ describe "Projects", "DeployKeys" do | ||
57 | 57 | ||
58 | describe "Show page" do | 58 | describe "Show page" do |
59 | before do | 59 | before do |
60 | - @key = Factory :key, :project => project | 60 | + @key = Factory :key, project: project |
61 | visit project_deploy_key_path(project, @key) | 61 | visit project_deploy_key_path(project, @key) |
62 | end | 62 | end |
63 | 63 |
spec/requests/projects_spec.rb
@@ -5,7 +5,7 @@ describe "Projects" do | @@ -5,7 +5,7 @@ describe "Projects" do | ||
5 | 5 | ||
6 | describe "GET /projects/show" do | 6 | describe "GET /projects/show" do |
7 | before do | 7 | before do |
8 | - @project = Factory :project, :owner => @user | 8 | + @project = Factory :project, owner: @user |
9 | @project.add_access(@user, :read) | 9 | @project.add_access(@user, :read) |
10 | 10 | ||
11 | visit project_path(@project) | 11 | visit project_path(@project) |
@@ -37,13 +37,13 @@ describe "Projects" do | @@ -37,13 +37,13 @@ describe "Projects" do | ||
37 | 37 | ||
38 | describe "PUT /projects/:id" do | 38 | describe "PUT /projects/:id" do |
39 | before do | 39 | before do |
40 | - @project = Factory :project, :owner => @user | 40 | + @project = Factory :project, owner: @user |
41 | @project.add_access(@user, :admin, :read) | 41 | @project.add_access(@user, :admin, :read) |
42 | 42 | ||
43 | visit edit_project_path(@project) | 43 | visit edit_project_path(@project) |
44 | 44 | ||
45 | - fill_in 'project_name', :with => 'Awesome' | ||
46 | - fill_in 'project_code', :with => 'gitlabhq' | 45 | + fill_in 'project_name', with: 'Awesome' |
46 | + fill_in 'project_code', with: 'gitlabhq' | ||
47 | click_button "Save" | 47 | click_button "Save" |
48 | @project = @project.reload | 48 | @project = @project.reload |
49 | end | 49 | end |
spec/requests/search_spec.rb
@@ -6,7 +6,7 @@ describe "Search" do | @@ -6,7 +6,7 @@ describe "Search" do | ||
6 | @project = Factory :project | 6 | @project = Factory :project |
7 | @project.add_access(@user, :read) | 7 | @project.add_access(@user, :read) |
8 | visit search_path | 8 | visit search_path |
9 | - fill_in "search", :with => @project.name[0..3] | 9 | + fill_in "search", with: @project.name[0..3] |
10 | click_button "Search" | 10 | click_button "Search" |
11 | end | 11 | end |
12 | 12 |
spec/requests/security/project_access_spec.rb
@@ -20,9 +20,9 @@ describe "Application access" do | @@ -20,9 +20,9 @@ describe "Application access" do | ||
20 | @u2 = Factory :user | 20 | @u2 = Factory :user |
21 | @u3 = Factory :user | 21 | @u3 = Factory :user |
22 | # full access | 22 | # full access |
23 | - @project.users_projects.create(:user => @u1, :project_access => UsersProject::MASTER) | 23 | + @project.users_projects.create(user: @u1, project_access: UsersProject::MASTER) |
24 | # readonly | 24 | # readonly |
25 | - @project.users_projects.create(:user => @u3, :project_access => UsersProject::REPORTER) | 25 | + @project.users_projects.create(user: @u3, project_access: UsersProject::REPORTER) |
26 | end | 26 | end |
27 | 27 | ||
28 | describe "GET /project_code" do | 28 | describe "GET /project_code" do |
@@ -83,7 +83,7 @@ describe "Application access" do | @@ -83,7 +83,7 @@ describe "Application access" do | ||
83 | before do | 83 | before do |
84 | @commit = @project.commit | 84 | @commit = @project.commit |
85 | @path = @commit.tree.contents.select { |i| i.is_a?(Grit::Blob)}.first.name | 85 | @path = @commit.tree.contents.select { |i| i.is_a?(Grit::Blob)}.first.name |
86 | - @blob_path = blob_project_ref_path(@project, @commit.id, :path => @path) | 86 | + @blob_path = blob_project_ref_path(@project, @commit.id, path: @path) |
87 | end | 87 | end |
88 | 88 | ||
89 | it { @blob_path.should be_allowed_for @u1 } | 89 | it { @blob_path.should be_allowed_for @u1 } |
spec/requests/snippets_spec.rb
@@ -11,8 +11,8 @@ describe "Snippets" do | @@ -11,8 +11,8 @@ describe "Snippets" do | ||
11 | describe "GET /snippets" do | 11 | describe "GET /snippets" do |
12 | before do | 12 | before do |
13 | @snippet = Factory :snippet, | 13 | @snippet = Factory :snippet, |
14 | - :author => @user, | ||
15 | - :project => project | 14 | + author: @user, |
15 | + project: project | ||
16 | 16 | ||
17 | visit project_snippets_path(project) | 17 | visit project_snippets_path(project) |
18 | end | 18 | end |
@@ -50,9 +50,9 @@ describe "Snippets" do | @@ -50,9 +50,9 @@ describe "Snippets" do | ||
50 | 50 | ||
51 | describe "fill in" do | 51 | describe "fill in" do |
52 | before do | 52 | before do |
53 | - fill_in "snippet_title", :with => "login function" | ||
54 | - fill_in "snippet_file_name", :with => "test.rb" | ||
55 | - fill_in "snippet_content", :with => "def login; end" | 53 | + fill_in "snippet_title", with: "login function" |
54 | + fill_in "snippet_file_name", with: "test.rb" | ||
55 | + fill_in "snippet_content", with: "def login; end" | ||
56 | end | 56 | end |
57 | 57 | ||
58 | it { expect { click_button "Save" }.to change {Snippet.count}.by(1) } | 58 | it { expect { click_button "Save" }.to change {Snippet.count}.by(1) } |
@@ -69,8 +69,8 @@ describe "Snippets" do | @@ -69,8 +69,8 @@ describe "Snippets" do | ||
69 | describe "Edit snippet" do | 69 | describe "Edit snippet" do |
70 | before do | 70 | before do |
71 | @snippet = Factory :snippet, | 71 | @snippet = Factory :snippet, |
72 | - :author => @user, | ||
73 | - :project => project | 72 | + author: @user, |
73 | + project: project | ||
74 | visit project_snippet_path(project, @snippet) | 74 | visit project_snippet_path(project, @snippet) |
75 | click_link "Edit" | 75 | click_link "Edit" |
76 | end | 76 | end |
@@ -81,9 +81,9 @@ describe "Snippets" do | @@ -81,9 +81,9 @@ describe "Snippets" do | ||
81 | 81 | ||
82 | describe "fill in" do | 82 | describe "fill in" do |
83 | before do | 83 | before do |
84 | - fill_in "snippet_title", :with => "login function" | ||
85 | - fill_in "snippet_file_name", :with => "test.rb" | ||
86 | - fill_in "snippet_content", :with => "def login; end" | 84 | + fill_in "snippet_title", with: "login function" |
85 | + fill_in "snippet_file_name", with: "test.rb" | ||
86 | + fill_in "snippet_content", with: "def login; end" | ||
87 | end | 87 | end |
88 | 88 | ||
89 | it { expect { click_button "Save" }.to_not change {Snippet.count} } | 89 | it { expect { click_button "Save" }.to_not change {Snippet.count} } |
spec/spec_helper.rb
@@ -37,7 +37,7 @@ RSpec.configure do |config| | @@ -37,7 +37,7 @@ RSpec.configure do |config| | ||
37 | # instead of true. | 37 | # instead of true. |
38 | config.use_transactional_fixtures = false | 38 | config.use_transactional_fixtures = false |
39 | 39 | ||
40 | - config.before :each, :type => :integration do | 40 | + config.before :each, type: :integration do |
41 | DeviseSessionMock.disable | 41 | DeviseSessionMock.disable |
42 | end | 42 | end |
43 | 43 | ||
@@ -59,7 +59,7 @@ RSpec.configure do |config| | @@ -59,7 +59,7 @@ RSpec.configure do |config| | ||
59 | DatabaseCleaner.clean | 59 | DatabaseCleaner.clean |
60 | end | 60 | end |
61 | 61 | ||
62 | - config.include RSpec::Rails::RequestExampleGroup, :type => :request, :example_group => { | ||
63 | - :file_path => /spec\/api/ | 62 | + config.include RSpec::Rails::RequestExampleGroup, type: :request, example_group: { |
63 | + file_path: /spec\/api/ | ||
64 | } | 64 | } |
65 | end | 65 | end |
spec/support/login.rb
1 | module LoginMacros | 1 | module LoginMacros |
2 | def login_as role | 2 | def login_as role |
3 | - @user = User.create(:email => "user#{User.count}@mail.com", | ||
4 | - :name => "John Smith", | ||
5 | - :password => "123456", | ||
6 | - :password_confirmation => "123456", | ||
7 | - :skype => 'user_skype') | 3 | + @user = User.create(email: "user#{User.count}@mail.com", |
4 | + name: "John Smith", | ||
5 | + password: "123456", | ||
6 | + password_confirmation: "123456", | ||
7 | + skype: 'user_skype') | ||
8 | 8 | ||
9 | if role == :admin | 9 | if role == :admin |
10 | @user.admin = true | 10 | @user.admin = true |
@@ -12,15 +12,15 @@ module LoginMacros | @@ -12,15 +12,15 @@ module LoginMacros | ||
12 | end | 12 | end |
13 | 13 | ||
14 | visit new_user_session_path | 14 | visit new_user_session_path |
15 | - fill_in "user_email", :with => @user.email | ||
16 | - fill_in "user_password", :with => "123456" | 15 | + fill_in "user_email", with: @user.email |
16 | + fill_in "user_password", with: "123456" | ||
17 | click_button "Sign in" | 17 | click_button "Sign in" |
18 | end | 18 | end |
19 | 19 | ||
20 | def login_with(user) | 20 | def login_with(user) |
21 | visit new_user_session_path | 21 | visit new_user_session_path |
22 | - fill_in "user_email", :with => user.email | ||
23 | - fill_in "user_password", :with => "123456" | 22 | + fill_in "user_email", with: user.email |
23 | + fill_in "user_password", with: "123456" | ||
24 | click_button "Sign in" | 24 | click_button "Sign in" |
25 | end | 25 | end |
26 | 26 |
spec/workers/post_receive_spec.rb
@@ -10,7 +10,7 @@ describe PostReceive do | @@ -10,7 +10,7 @@ describe PostReceive do | ||
10 | 10 | ||
11 | context "web hook" do | 11 | context "web hook" do |
12 | let(:project) { Factory.create(:project) } | 12 | let(:project) { Factory.create(:project) } |
13 | - let(:key) { Factory.create(:key, :user => project.owner) } | 13 | + let(:key) { Factory.create(:key, user: project.owner) } |
14 | let(:key_id) { key.identifier } | 14 | let(:key_id) { key.identifier } |
15 | 15 | ||
16 | it "fetches the correct project" do | 16 | it "fetches the correct project" do |