diff options
author | Robert Speicher <rspeicher@gmail.com> | 2012-08-11 02:07:50 +0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2012-08-11 02:25:15 +0400 |
commit | 775418918782d5284000ed0bfea364458c748567 (patch) | |
tree | c31e3633a3bcbed17b000f0165cf35edad41f7ca /app | |
parent | 1413c23c502d5a5cbc9b81f553a245103c1d6e50 (diff) |
Fully embrace Ruby 1.9 hash syntax
Didn't bother with files in db/, config/, or features/
Diffstat (limited to 'app')
213 files changed, 1090 insertions, 1090 deletions
diff --git a/app/contexts/commit_load.rb b/app/contexts/commit_load.rb index bab30d61007..f57c49692ca 100644 --- a/app/contexts/commit_load.rb +++ b/app/contexts/commit_load.rb @@ -1,11 +1,11 @@ class CommitLoad < BaseContext def execute result = { - :commit => nil, - :suppress_diff => false, - :line_notes => [], - :notes_count => 0, - :note => nil + commit: nil, + suppress_diff: false, + line_notes: [], + notes_count: 0, + note: nil } commit = project.commit(params[:id]) diff --git a/app/contexts/issues_bulk_update_context.rb b/app/contexts/issues_bulk_update_context.rb index 0ba779de5ce..7c3c1d4f7c3 100644 --- a/app/contexts/issues_bulk_update_context.rb +++ b/app/contexts/issues_bulk_update_context.rb @@ -12,12 +12,12 @@ class IssuesBulkUpdateContext < BaseContext opts[:assignee_id] = assignee_id if assignee_id.present? opts[:closed] = (status == "closed") if status.present? - issues = Issue.where(:id => issues_ids).all + issues = Issue.where(id: issues_ids).all issues = issues.select { |issue| can?(current_user, :modify_issue, issue) } issues.each { |issue| issue.update_attributes(opts) } { - :count => issues.count, - :success => !issues.count.zero? + count: issues.count, + success: !issues.count.zero? } end end diff --git a/app/controllers/admin/projects_controller.rb b/app/controllers/admin/projects_controller.rb index 17009946383..80d11f03ef0 100644 --- a/app/controllers/admin/projects_controller.rb +++ b/app/controllers/admin/projects_controller.rb @@ -2,7 +2,7 @@ class Admin::ProjectsController < ApplicationController layout "admin" before_filter :authenticate_user! before_filter :authenticate_admin! - before_filter :admin_project, :only => [:edit, :show, :update, :destroy, :team_update] + before_filter :admin_project, only: [:edit, :show, :update, :destroy, :team_update] def index @admin_projects = Project.scoped @@ -36,7 +36,7 @@ class Admin::ProjectsController < ApplicationController if @admin_project.save redirect_to [:admin, @admin_project], notice: 'Project was successfully created.' else - render :action => "new" + render action: "new" end end @@ -50,7 +50,7 @@ class Admin::ProjectsController < ApplicationController if @admin_project.update_attributes(params[:project]) redirect_to [:admin, @admin_project], notice: 'Project was successfully updated.' else - render :action => "edit" + render action: "edit" end end diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index 4b123e4f032..1e8f420b098 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -34,7 +34,7 @@ class Admin::UsersController < ApplicationController def new - @admin_user = User.new(:projects_limit => Gitlab.config.default_projects_limit) + @admin_user = User.new(projects_limit: Gitlab.config.default_projects_limit) end def edit diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 7ea9f320d66..7c1941ec859 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -11,15 +11,15 @@ class ApplicationController < ActionController::Base helper_method :abilities, :can? rescue_from Gitlab::Gitolite::AccessDenied do |exception| - render "errors/gitolite", :layout => "error" + render "errors/gitolite", layout: "error" end rescue_from Encoding::CompatibilityError do |exception| - render "errors/encoding", :layout => "error", :status => 404 + render "errors/encoding", layout: "error", status: 404 end rescue_from ActiveRecord::RecordNotFound do |exception| - render "errors/not_found", :layout => "error", :status => 404 + render "errors/not_found", layout: "error", status: 404 end layout :layout_by_resource @@ -97,15 +97,15 @@ class ApplicationController < ActionController::Base end def access_denied! - render "errors/access_denied", :layout => "error", :status => 404 + render "errors/access_denied", layout: "error", status: 404 end def not_found! - render "errors/not_found", :layout => "error", :status => 404 + render "errors/not_found", layout: "error", status: 404 end def git_not_found! - render "errors/git_not_found", :layout => "error", :status => 404 + render "errors/git_not_found", layout: "error", status: 404 end def method_missing(method_sym, *arguments, &block) @@ -127,7 +127,7 @@ class ApplicationController < ActionController::Base end def render_404 - render :file => File.join(Rails.root, "public", "404"), :layout => false, :status => "404" + render file: File.join(Rails.root, "public", "404"), layout: false, status: "404" end def require_non_empty_project diff --git a/app/controllers/commits_controller.rb b/app/controllers/commits_controller.rb index 05f29da3ddd..861fc3245a9 100644 --- a/app/controllers/commits_controller.rb +++ b/app/controllers/commits_controller.rb @@ -9,7 +9,7 @@ class CommitsController < ApplicationController before_filter :authorize_read_project! before_filter :authorize_code_access! before_filter :require_non_empty_project - before_filter :load_refs, :only => :index # load @branch, @tag & @ref + before_filter :load_refs, only: :index # load @branch, @tag & @ref before_filter :render_full_content def index @@ -22,7 +22,7 @@ class CommitsController < ApplicationController respond_to do |format| format.html # index.html.erb format.js - format.atom { render :layout => false } + format.atom { render layout: false } end end @@ -61,9 +61,9 @@ class CommitsController < ApplicationController send_data( @commit.to_patch, - :type => "text/plain", - :disposition => 'attachment', - :filename => (@commit.id.to_s + ".patch") + type: "text/plain", + disposition: 'attachment', + filename: (@commit.id.to_s + ".patch") ) end end diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index 8508e2454d2..7696e97a7b2 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -9,7 +9,7 @@ class DashboardController < ApplicationController respond_to do |format| format.html format.js - format.atom { render :layout => false } + format.atom { render layout: false } end end @@ -28,7 +28,7 @@ class DashboardController < ApplicationController respond_to do |format| format.html - format.atom { render :layout => false } + format.atom { render layout: false } end end end diff --git a/app/controllers/deploy_keys_controller.rb b/app/controllers/deploy_keys_controller.rb index 9d4e0483d65..82c10512a64 100644 --- a/app/controllers/deploy_keys_controller.rb +++ b/app/controllers/deploy_keys_controller.rb @@ -40,7 +40,7 @@ class DeployKeysController < ApplicationController respond_to do |format| format.html { redirect_to project_deploy_keys_url } - format.js { render :nothing => true } + format.js { render nothing: true } end end end diff --git a/app/controllers/hooks_controller.rb b/app/controllers/hooks_controller.rb index df22b0ba29a..c81e6b05cb3 100644 --- a/app/controllers/hooks_controller.rb +++ b/app/controllers/hooks_controller.rb @@ -6,7 +6,7 @@ class HooksController < ApplicationController # Authorize before_filter :add_project_abilities before_filter :authorize_read_project! - before_filter :authorize_admin_project!, :only => [:new, :create, :destroy] + before_filter :authorize_admin_project!, only: [:new, :create, :destroy] respond_to :html diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 85333b85e3c..a7958b1effa 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -2,7 +2,7 @@ class IssuesController < ApplicationController before_filter :authenticate_user! before_filter :project before_filter :module_enabled - before_filter :issue, :only => [:edit, :update, :destroy, :show] + before_filter :issue, only: [:edit, :update, :destroy, :show] helper_method :issues_filter layout "project" @@ -14,13 +14,13 @@ class IssuesController < ApplicationController before_filter :authorize_read_issue! # Allow write(create) issue - before_filter :authorize_write_issue!, :only => [:new, :create] + before_filter :authorize_write_issue!, only: [:new, :create] # Allow modify issue - before_filter :authorize_modify_issue!, :only => [:close, :edit, :update] + before_filter :authorize_modify_issue!, only: [:close, :edit, :update] # Allow destroy issue - before_filter :authorize_admin_issue!, :only => [:destroy] + before_filter :authorize_admin_issue!, only: [:destroy] respond_to :js, :html @@ -32,7 +32,7 @@ class IssuesController < ApplicationController respond_to do |format| format.html # index.html.erb format.js - format.atom { render :layout => false } + format.atom { render layout: false } end end @@ -46,7 +46,7 @@ class IssuesController < ApplicationController end def show - @note = @project.notes.new(:noteable => @issue) + @note = @project.notes.new(noteable: @issue) respond_to do |format| format.html @@ -66,7 +66,7 @@ class IssuesController < ApplicationController end def update - @issue.update_attributes(params[:issue].merge(:author_id_of_changes => current_user.id)) + @issue.update_attributes(params[:issue].merge(author_id_of_changes: current_user.id)) respond_to do |format| format.js @@ -87,20 +87,20 @@ class IssuesController < ApplicationController respond_to do |format| format.html { redirect_to project_issues_path } - format.js { render :nothing => true } + format.js { render nothing: true } end end def sort return render_404 unless can?(current_user, :admin_issue, @project) - @issues = @project.issues.where(:id => params['issue']) + @issues = @project.issues.where(id: params['issue']) @issues.each do |issue| issue.position = params['issue'].index(issue.id.to_s) + 1 issue.save end - render :nothing => true + render nothing: true end def search @@ -110,12 +110,12 @@ class IssuesController < ApplicationController @issues = @issues.where("title LIKE ?", "%#{terms}%") unless terms.blank? @issues = @issues.page(params[:page]).per(100) - render :partial => 'issues' + render partial: 'issues' end def bulk_update result = IssuesBulkUpdateContext.new(project, current_user, params).execute - redirect_to :back, :notice => "#{result[:count]} issues updated" + redirect_to :back, notice: "#{result[:count]} issues updated" end protected @@ -144,8 +144,8 @@ class IssuesController < ApplicationController else @project.issues.opened end - @issues = @issues.where(:assignee_id => params[:assignee_id]) if params[:assignee_id].present? - @issues = @issues.where(:milestone_id => params[:milestone_id]) if params[:milestone_id].present? + @issues = @issues.where(assignee_id: params[:assignee_id]) if params[:assignee_id].present? + @issues = @issues.where(milestone_id: params[:milestone_id]) if params[:milestone_id].present? @issues = @issues.tagged_with(params[:label_name]) if params[:label_name].present? @issues = @issues.includes(:author, :project).order("updated_at") @issues diff --git a/app/controllers/keys_controller.rb b/app/controllers/keys_controller.rb index ce49e3e72c6..1a25d834e12 100644 --- a/app/controllers/keys_controller.rb +++ b/app/controllers/keys_controller.rb @@ -29,7 +29,7 @@ class KeysController < ApplicationController respond_to do |format| format.html { redirect_to keys_url } - format.js { render :nothing => true } + format.js { render nothing: true } end end end diff --git a/app/controllers/merge_requests_controller.rb b/app/controllers/merge_requests_controller.rb index f9a1c1dd67d..4938a294f60 100644 --- a/app/controllers/merge_requests_controller.rb +++ b/app/controllers/merge_requests_controller.rb @@ -2,9 +2,9 @@ class MergeRequestsController < ApplicationController before_filter :authenticate_user! before_filter :project before_filter :module_enabled - before_filter :merge_request, :only => [:edit, :update, :destroy, :show, :commits, :diffs, :automerge, :automerge_check, :raw] - before_filter :validates_merge_request, :only => [:show, :diffs, :raw] - before_filter :define_show_vars, :only => [:show, :diffs] + before_filter :merge_request, only: [:edit, :update, :destroy, :show, :commits, :diffs, :automerge, :automerge_check, :raw] + before_filter :validates_merge_request, only: [:show, :diffs, :raw] + before_filter :define_show_vars, only: [:show, :diffs] layout "project" # Authorize @@ -14,13 +14,13 @@ class MergeRequestsController < ApplicationController before_filter :authorize_read_merge_request! # Allow write(create) merge_request - before_filter :authorize_write_merge_request!, :only => [:new, :create] + before_filter :authorize_write_merge_request!, only: [:new, :create] # Allow modify merge_request - before_filter :authorize_modify_merge_request!, :only => [:close, :edit, :update, :sort] + before_filter :authorize_modify_merge_request!, only: [:close, :edit, :update, :sort] # Allow destroy merge_request - before_filter :authorize_admin_merge_request!, :only => [:destroy] + before_filter :authorize_admin_merge_request!, only: [:destroy] def index @@ -66,7 +66,7 @@ class MergeRequestsController < ApplicationController end def update - if @merge_request.update_attributes(params[:merge_request].merge(:author_id_of_changes => current_user.id)) + if @merge_request.update_attributes(params[:merge_request].merge(author_id_of_changes: current_user.id)) @merge_request.reload_code @merge_request.mark_as_unchecked redirect_to [@project, @merge_request], notice: 'Merge request was successfully updated.' @@ -79,7 +79,7 @@ class MergeRequestsController < ApplicationController if @merge_request.unchecked? @merge_request.check_if_can_be_merged end - render :json => {:state => @merge_request.human_state} + render json: {state: @merge_request.human_state} end def automerge @@ -138,7 +138,7 @@ class MergeRequestsController < ApplicationController def define_show_vars # Build a note object for comment form - @note = @project.notes.new(:noteable => @merge_request) + @note = @project.notes.new(noteable: @merge_request) # Get commits from repository # or from cache if already merged diff --git a/app/controllers/milestones_controller.rb b/app/controllers/milestones_controller.rb index 1f2490cb6ef..7acb3781fbb 100644 --- a/app/controllers/milestones_controller.rb +++ b/app/controllers/milestones_controller.rb @@ -2,7 +2,7 @@ class MilestonesController < ApplicationController before_filter :authenticate_user! before_filter :project before_filter :module_enabled - before_filter :milestone, :only => [:edit, :update, :destroy, :show] + before_filter :milestone, only: [:edit, :update, :destroy, :show] layout "project" # Authorize @@ -12,7 +12,7 @@ class MilestonesController < ApplicationController before_filter :authorize_read_milestone! # Allow admin milestone - before_filter :authorize_admin_milestone!, :except => [:index, :show] + before_filter :authorize_admin_milestone!, except: [:index, :show] respond_to :html @@ -77,7 +77,7 @@ class MilestonesController < ApplicationController respond_to do |format| format.html { redirect_to project_milestones_path } - format.js { render :nothing => true } + format.js { render nothing: true } end end diff --git a/app/controllers/notes_controller.rb b/app/controllers/notes_controller.rb index 8fac6428a58..f003ea7bf66 100644 --- a/app/controllers/notes_controller.rb +++ b/app/controllers/notes_controller.rb @@ -5,7 +5,7 @@ class NotesController < ApplicationController before_filter :add_project_abilities before_filter :authorize_read_note! - before_filter :authorize_write_note!, :only => [:create] + before_filter :authorize_write_note!, only: [:create] respond_to :js @@ -29,12 +29,12 @@ class NotesController < ApplicationController @note.destroy respond_to do |format| - format.js { render :nothing => true } + format.js { render nothing: true } end end def preview - render :text => view_context.markdown(params[:note]) + render text: view_context.markdown(params[:note]) end protected diff --git a/app/controllers/profile_controller.rb b/app/controllers/profile_controller.rb index 0322a039631..a95a331096a 100644 --- a/app/controllers/profile_controller.rb +++ b/app/controllers/profile_controller.rb @@ -26,7 +26,7 @@ class ProfileController < ApplicationController flash[:notice] = "Password was successfully updated. Please login with it" redirect_to new_user_session_path else - render :action => "password" + render action: "password" end end diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 26b62cba9f9..b596a5a6f8e 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -1,14 +1,14 @@ require File.join(Rails.root, 'lib', 'graph_commit') class ProjectsController < ApplicationController - before_filter :project, :except => [:index, :new, :create] + before_filter :project, except: [:index, :new, :create] layout :determine_layout # Authorize before_filter :add_project_abilities - before_filter :authorize_read_project!, :except => [:index, :new, :create] - before_filter :authorize_admin_project!, :only => [:edit, :update, :destroy] - before_filter :require_non_empty_project, :only => [:blob, :tree, :graph] + before_filter :authorize_read_project!, except: [:index, :new, :create] + before_filter :authorize_admin_project!, only: [:edit, :update, :destroy] + before_filter :require_non_empty_project, only: [:blob, :tree, :graph] def new @project = Project.new @@ -35,7 +35,7 @@ class ProjectsController < ApplicationController def update respond_to do |format| if project.update_attributes(params[:project]) - format.html { redirect_to edit_project_path(project), :notice => 'Project was successfully updated.' } + format.html { redirect_to edit_project_path(project), notice: 'Project was successfully updated.' } format.js else format.html { render action: "edit" } diff --git a/app/controllers/protected_branches_controller.rb b/app/controllers/protected_branches_controller.rb index 0b86f5253ce..78c9c9effa6 100644 --- a/app/controllers/protected_branches_controller.rb +++ b/app/controllers/protected_branches_controller.rb @@ -6,7 +6,7 @@ class ProtectedBranchesController < ApplicationController before_filter :authorize_read_project! before_filter :require_non_empty_project - before_filter :authorize_admin_project!, :only => [:destroy, :create] + before_filter :authorize_admin_project!, only: [:destroy, :create] before_filter :render_full_content layout "project" @@ -26,7 +26,7 @@ class ProtectedBranchesController < ApplicationController respond_to do |format| format.html { redirect_to project_protected_branches_path } - format.js { render :nothing => true } + format.js { render nothing: true } end end end diff --git a/app/controllers/refs_controller.rb b/app/controllers/refs_controller.rb index a261f2a8cf6..3f81a2ca1a3 100644 --- a/app/controllers/refs_controller.rb +++ b/app/controllers/refs_controller.rb @@ -9,7 +9,7 @@ class RefsController < ApplicationController before_filter :require_non_empty_project before_filter :ref - before_filter :define_tree_vars, :only => [:tree, :blob, :blame, :logs_tree] + before_filter :define_tree_vars, only: [:tree, :blob, :blame, :logs_tree] before_filter :render_full_content layout "project" @@ -20,7 +20,7 @@ class RefsController < ApplicationController new_path = if params[:destination] == "tree" tree_project_ref_path(@project, params[:ref]) else - project_commits_path(@project, :ref => params[:ref]) + project_commits_path(@project, ref: params[:ref]) end redirect_to new_path @@ -53,8 +53,8 @@ class RefsController < ApplicationController last_commit = @project.commits(@commit.id, file, 1).last last_commit = CommitDecorator.decorate(last_commit) { - :file_name => content.name, - :commit => last_commit + file_name: content.name, + commit: last_commit } end end @@ -70,9 +70,9 @@ class RefsController < ApplicationController send_data( @tree.data, - :type => mime_type, - :disposition => 'inline', - :filename => @tree.name + type: mime_type, + disposition: 'inline', + filename: @tree.name ) else head(404) diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index 30bcb49bb2e..71e2d92b2b2 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -8,8 +8,8 @@ class SearchController < ApplicationController if query.present? @projects = current_user.projects.search(query).limit(10) - @merge_requests = MergeRequest.where(:project_id => current_user.project_ids).search(query).limit(10) - @issues = Issue.where(:project_id => current_user.project_ids).search(query).limit(10) + @merge_requests = MergeRequest.where(project_id: current_user.project_ids).search(query).limit(10) + @issues = Issue.where(project_id: current_user.project_ids).search(query).limit(10) end end end diff --git a/app/controllers/snippets_controller.rb b/app/controllers/snippets_controller.rb index 3d56bebe2fe..f852e425891 100644 --- a/app/controllers/snippets_controller.rb +++ b/app/controllers/snippets_controller.rb @@ -1,7 +1,7 @@ class SnippetsController < ApplicationController before_filter :authenticate_user! before_filter :project - before_filter :snippet, :only => [:show, :edit, :destroy, :update, :raw] + before_filter :snippet, only: [:show, :edit, :destroy, :update, :raw] layout "project" # Authorize @@ -11,13 +11,13 @@ class SnippetsController < ApplicationController before_filter :authorize_read_snippet! # Allow write(create) snippet - before_filter :authorize_write_snippet!, :only => [:new, :create] + before_filter :authorize_write_snippet!, only: [:new, :create] # Allow modify snippet - before_filter :authorize_modify_snippet!, :only => [:edit, :update] + before_filter :authorize_modify_snippet!, only: [:edit, :update] # Allow destroy snippet - before_filter :authorize_admin_snippet!, :only => [:destroy] + before_filter :authorize_admin_snippet!, only: [:destroy] respond_to :html @@ -55,7 +55,7 @@ class SnippetsController < ApplicationController end def show - @note = @project.notes.new(:noteable => @snippet) + @note = @project.notes.new(noteable: @snippet) render_full_content end @@ -70,9 +70,9 @@ class SnippetsController < ApplicationController def raw send_data( @snippet.content, - :type => "text/plain", - :disposition => 'inline', - :filename => @snippet.file_name + type: "text/plain", + disposition: 'inline', + filename: @snippet.file_name ) end diff --git a/app/controllers/team_members_controller.rb b/app/controllers/team_members_controller.rb index ab51c19e0c8..0cc58c3ec16 100644 --- a/app/controllers/team_members_controller.rb +++ b/app/controllers/team_members_controller.rb @@ -5,7 +5,7 @@ class TeamMembersController < ApplicationController # Authorize before_filter :add_project_abilities before_filter :authorize_read_project! - before_filter :authorize_admin_project!, :except => [:show] + before_filter :authorize_admin_project!, except: [:show] def show @team_member = project.users_projects.find(params[:id]) @@ -41,7 +41,7 @@ class TeamMembersController < ApplicationController respond_to do |format| format.html { redirect_to team_project_path(@project) } - format.js { render :nothing => true } + format.js { render nothing: true } end end end diff --git a/app/controllers/wikis_controller.rb b/app/controllers/wikis_controller.rb index 993abcf8727..55ccfe72116 100644 --- a/app/controllers/wikis_controller.rb +++ b/app/controllers/wikis_controller.rb @@ -2,8 +2,8 @@ class WikisController < ApplicationController before_filter :project before_filter :add_project_abilities before_filter :authorize_read_wiki! - before_filter :authorize_write_wiki!, :only => [:edit, :create, :history] - before_filter :authorize_admin_wiki!, :only => :destroy + before_filter :authorize_write_wiki!, only: [:edit, :create, :history] + before_filter :authorize_admin_wiki!, only: :destroy layout "project" def pages @@ -14,16 +14,16 @@ class WikisController < ApplicationController if params[:old_page_id] @wiki = @project.wikis.find(params[:old_page_id]) else - @wiki = @project.wikis.where(:slug => params[:id]).order("created_at").last + @wiki = @project.wikis.where(slug: params[:id]).order("created_at").last end - @note = @project.notes.new(:noteable => @wiki) + @note = @project.notes.new(noteable: @wiki) if @wiki render 'show' else if can?(current_user, :write_wiki, @project) - @wiki = @project.wikis.new(:slug => params[:id]) + @wiki = @project.wikis.new(slug: params[:id]) render 'edit' else render 'empty' @@ -32,7 +32,7 @@ class WikisController < ApplicationController end def edit - @wiki = @project.wikis.where(:slug => params[:id]).order("created_at").last + @wiki = @project.wikis.where(slug: params[:id]).order("created_at").last @wiki = Wiki.regenerate_from @wiki end @@ -50,11 +50,11 @@ class WikisController < ApplicationController end def history - @wikis = @project.wikis.where(:slug => params[:id]).order("created_at") + @wikis = @project.wikis.where(slug: params[:id]).order("created_at") end def destroy - @wikis = @project.wikis.where(:slug => params[:id]).delete_all + @wikis = @project.wikis.where(slug: params[:id]).delete_all respond_to do |format| format.html { redirect_to project_wiki_path(@project, :index), notice: "Page was successfully deleted" } diff --git a/app/decorators/application_decorator.rb b/app/decorators/application_decorator.rb index 8c35cae98fd..7bc88648c77 100644 --- a/app/decorators/application_decorator.rb +++ b/app/decorators/application_decorator.rb @@ -15,7 +15,7 @@ class ApplicationDecorator < Drapper::Base # # def formatted_timestamp(time) # h.content_tag :span, time.strftime("%a %m/%d/%y"), - # :class => 'timestamp' + # class: 'timestamp' # end # # def created_at diff --git a/app/decorators/event_decorator.rb b/app/decorators/event_decorator.rb index 50aaa615d49..7df9081f045 100644 --- a/app/decorators/event_decorator.rb +++ b/app/decorators/event_decorator.rb @@ -19,7 +19,7 @@ class EventDecorator < ApplicationDecorator elsif self.merge_request? h.project_merge_request_url(self.project, self.merge_request) elsif self.push? - h.project_commits_url(self.project, :ref => self.ref_name) + h.project_commits_url(self.project, ref: self.ref_name) end end end diff --git a/app/decorators/tree_decorator.rb b/app/decorators/tree_decorator.rb index 2b82a42561b..80c48da75bf 100644 --- a/app/decorators/tree_decorator.rb +++ b/app/decorators/tree_decorator.rb @@ -8,14 +8,14 @@ class TreeDecorator < ApplicationDecorator #parts = parts[0...-1] if is_blob? - yield(h.link_to("..", "#", :remote => :true)) if parts.count > max_links + yield(h.link_to("..", "#", remote: :true)) if parts.count > max_links parts.each do |part| part_path = File.join(part_path, part) unless part_path.empty? part_path = part if part_path.empty? next unless parts.last(2).include?(part) if parts.count > max_links - yield(h.link_to(h.truncate(part, :length => 40), h.tree_file_project_ref_path(project, ref, :path => part_path), :remote => :true)) + yield(h.link_to(h.truncate(part, length: 40), h.tree_file_project_ref_path(project, ref, path: part_path), remote: :true)) end end end @@ -30,7 +30,7 @@ class TreeDecorator < ApplicationDecorator end def history_path - h.project_commits_path(project, :path => path, :ref => ref) + h.project_commits_path(project, path: path, ref: ref) end def mb_size diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e1aa14c9f6d..7a9f0e9d494 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -43,23 +43,23 @@ module ApplicationHelper end def search_autocomplete_source - projects = current_user.projects.map{ |p| { :label => p.name, :url => project_path(p) } } + projects = current_user.projects.map{ |p| { label: p.name, url: project_path(p) } } default_nav = [ - { :label => "Profile", :url => profile_path }, - { :label => "Keys", :url => keys_path }, - { :label => "Dashboard", :url => root_path }, - { :label => "Admin", :url => admin_root_path } + { label: "Profile", url: profile_path }, + { label: "Keys", url: keys_path }, + { label: "Dashboard", url: root_path }, + { label: "Admin", url: admin_root_path } ] project_nav = [] if @project && !@project.new_record? project_nav = [ - { :label => "#{@project.name} / Issues", :url => project_issues_path(@project) }, - { :label => "#{@project.name} / Wall", :url => wall_project_path(@project) }, - { :label => "#{@project.name} / Tree", :url => tree_project_ref_path(@project, @project.root_ref) }, - { :label => "#{@project.name} / Commits", :url => project_commits_path(@project) }, - { :label => "#{@project.name} / Team", :url => team_project_path(@project) } + { label: "#{@project.name} / Issues", url: project_issues_path(@project) }, + { label: "#{@project.name} / Wall", url: wall_project_path(@project) }, + { label: "#{@project.name} / Tree", url: tree_project_ref_path(@project, @project.root_ref) }, + { label: "#{@project.name} / Commits", url: project_commits_path(@project) }, + { label: "#{@project.name} / Team", url: team_project_path(@project) } ] end @@ -89,7 +89,7 @@ module ApplicationHelper when :wall; wall_tab? when :wiki; controller.controller_name == "wikis" when :issues; issues_tab? - when :network; current_page?(:controller => "projects", :action => "graph", :id => @project) + when :network; current_page?(controller: "projects", action: "graph", id: @project) when :merge_requests; controller.controller_name == "merge_requests" # Dashboard Area @@ -100,10 +100,10 @@ module ApplicationHelper when :root; current_page?(dashboard_path) || current_page?(root_path) # Profile Area - when :profile; current_page?(:controller => "profile", :action => :show) - when :password; current_page?(:controller => "profile", :action => :password) - when :token; current_page?(:controller => "profile", :action => :token) - when :design; current_page?(:controller => "profile", :action => :design) + when :profile; current_page?(controller: "profile", action: :show) + when :password; current_page?(controller: "profile", action: :password) + when :token; current_page?(controller: "profile", action: :token) + when :design; current_page?(controller: "profile", action: :design) when :ssh_keys; controller.controller_name == "keys" # Admin Area diff --git a/app/helpers/gitlab_markdown_helper.rb b/app/helpers/gitlab_markdown_helper.rb index f839ee5523b..89fc04a2610 100644 --- a/app/helpers/gitlab_markdown_helper.rb +++ b/app/helpers/gitlab_markdown_helper.rb @@ -28,32 +28,32 @@ module GitlabMarkdownHelper # team member: @foo when /^@/ - user = @project.users.where(:name => user_name).first - member = @project.users_projects.where(:user_id => user).first if user - link_to("@#{user_name}", project_team_member_path(@project, member), html_options.merge(:class => "gfm gfm-team_member #{html_options[:class]}")) if member + user = @project.users.where(name: user_name).first + member = @project.users_projects.where(user_id: user).first if user + link_to("@#{user_name}", project_team_member_path(@project, member), html_options.merge(class: "gfm gfm-team_member #{html_options[:class]}")) if member # issue: #123 when /^#/ # avoid HTML entities unless prefix.try(:end_with?, "&") && suffix.try(:start_with?, ";") - issue = @project.issues.where(:id => issue_id).first - 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 + issue = @project.issues.where(id: issue_id).first + 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 end # merge request: !123 when /^!/ - merge_request = @project.merge_requests.where(:id => merge_request_id).first - 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 + merge_request = @project.merge_requests.where(id: merge_request_id).first + 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 # snippet: $123 when /^\$/ - snippet = @project.snippets.where(:id => snippet_id).first - 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 + snippet = @project.snippets.where(id: snippet_id).first + 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 # commit: 123456... when /^\h/ commit = @project.commit(commit_id) - 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 + 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 end # case diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 0982aaccc2e..177ba0c2c90 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -9,7 +9,7 @@ module IssuesHelper tm = project.team_member_by_id(issue.assignee_id) if tm - link_to issue.assignee_name, project_team_member_path(project, tm), :class => "author_link" + link_to issue.assignee_name, project_team_member_path(project, tm), class: "author_link" else issue.assignee_name end @@ -20,7 +20,7 @@ module IssuesHelper tm = project.team_member_by_id(issue.author_id) if tm - link_to issue.author_name, project_team_member_path(project, tm), :class => "author_link" + link_to issue.author_name, project_team_member_path(project, tm), class: "author_link" else issue.author_name end diff --git a/app/helpers/merge_requests_helper.rb b/app/helpers/merge_requests_helper.rb index f9bfc8cdcf6..62ac5e55d43 100644 --- a/app/helpers/merge_requests_helper.rb +++ b/app/helpers/merge_requests_helper.rb @@ -4,7 +4,7 @@ module MergeRequestsHelper tm = project.team_member_by_id(merge_request.assignee_id) if tm - link_to merge_request.assignee_name, project_team_member_path(project, tm), :class => "author_link" + link_to merge_request.assignee_name, project_team_member_path(project, tm), class: "author_link" else merge_request.assignee_name end @@ -15,7 +15,7 @@ module MergeRequestsHelper tm = project.team_member_by_id(merge_request.author_id) if tm - link_to merge_request.author_name, project_team_member_path(project, tm), :class => "author_link" + link_to merge_request.author_name, project_team_member_path(project, tm), class: "author_link" else merge_request.author_name end @@ -24,10 +24,10 @@ module MergeRequestsHelper def new_mr_path_from_push_event(event) new_project_merge_request_path( event.project, - :merge_request => { - :source_branch => event.branch_name, - :target_branch => event.project.root_ref, - :title => event.branch_name.titleize + merge_request: { + source_branch: event.branch_name, + target_branch: event.project.root_ref, + title: event.branch_name.titleize } ) end diff --git a/app/helpers/tab_helper.rb b/app/helpers/tab_helper.rb index fa5ca166d6b..1740864bbb2 100644 --- a/app/helpers/tab_helper.rb +++ b/app/helpers/tab_helper.rb @@ -4,12 +4,12 @@ module TabHelper end def wall_tab? - current_page?(:controller => "projects", :action => "wall", :id => @project) + current_page?(controller: "projects", action: "wall", id: @project) end def project_tab_class [:show, :files, :team, :edit, :update].each do |action| - return "current" if current_page?(:controller => "projects", :action => action, :id => @project) + return "current" if current_page?(controller: "projects", action: action, id: @project) end if ['snippets', 'hooks', 'deploy_keys', 'team_members'].include? controller.controller_name diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb index 7a2fd3d682b..9563fdbca22 100644 --- a/app/mailers/notify.rb +++ b/app/mailers/notify.rb @@ -12,20 +12,20 @@ class Notify < ActionMailer::Base def new_user_email(user_id, password) @user = User.find(user_id) @password = password - mail(:to => @user.email, :subject => "gitlab | Account was created for you") + mail(to: @user.email, subject: "gitlab | Account was created for you") end def new_issue_email(issue_id) @issue = Issue.find(issue_id) @project = @issue.project - mail(:to => @issue.assignee_email, :subject => "gitlab | new issue ##{@issue.id} | #{@issue.title} | #{@project.name}") + mail(to: @issue.assignee_email, subject: "gitlab | new issue ##{@issue.id} | #{@issue.title} | #{@project.name}") end def note_wall_email(recipient_id, note_id) recipient = User.find(recipient_id) @note = Note.find(note_id) @project = @note.project - mail(:to => recipient.email, :subject => "gitlab | #{@project.name}") + mail(to: recipient.email, subject: "gitlab | #{@project.name}") end def note_commit_email(recipient_id, note_id) @@ -34,7 +34,7 @@ class Notify < ActionMailer::Base @commit = @note.target @commit = CommitDecorator.decorate(@commit) @project = @note.project - mail(:to => recipient.email, :subject => "gitlab | note for commit #{@commit.short_id} | #{@commit.title} | #{@project.name}") + mail(to: recipient.email, subject: "gitlab | note for commit #{@commit.short_id} | #{@commit.title} | #{@project.name}") end def note_merge_request_email(recipient_id, note_id) @@ -42,7 +42,7 @@ class Notify < ActionMailer::Base @note = Note.find(note_id) @merge_request = @note.noteable @project = @note.project - mail(:to => recipient.email, :subject => "gitlab | note for merge request !#{@merge_request.id} | #{@project.name}") + mail(to: recipient.email, subject: "gitlab | note for merge request !#{@merge_request.id} | #{@project.name}") end def note_issue_email(recipient_id, note_id) @@ -50,7 +50,7 @@ class Notify < ActionMailer::Base @note = Note.find(note_id) @issue = @note.noteable @project = @note.project - mail(:to => recipient.email, :subject => "gitlab | note for issue ##{@issue.id} | #{@project.name}") + mail(to: recipient.email, subject: "gitlab | note for issue ##{@issue.id} | #{@project.name}") end def note_wiki_email(recipient_id, note_id) @@ -58,13 +58,13 @@ class Notify < ActionMailer::Base @note = Note.find(note_id) @wiki = @note.noteable @project = @note.project - mail(:to => recipient.email, :subject => "gitlab | note for wiki | #{@project.name}") + mail(to: recipient.email, subject: "gitlab | note for wiki | #{@project.name}") end def new_merge_request_email(merge_request_id) @merge_request = MergeRequest.find(merge_request_id) @project = @merge_request.project - mail(:to => @merge_request.assignee_email, :subject => "gitlab | new merge request !#{@merge_request.id} | #{@merge_request.title} | #{@project.name}") + mail(to: @merge_request.assignee_email, subject: "gitlab | new merge request !#{@merge_request.id} | #{@merge_request.title} | #{@project.name}") end def reassigned_merge_request_email(recipient_id, merge_request_id, previous_assignee_id) @@ -72,7 +72,7 @@ class Notify < ActionMailer::Base @merge_request = MergeRequest.find(merge_request_id) @previous_assignee ||= User.find(previous_assignee_id) @project = @merge_request.project - mail(:to => recipient.email, :subject => "gitlab | changed merge request !#{@merge_request.id} | #{@merge_request.title} | #{@project.name}") + mail(to: recipient.email, subject: "gitlab | changed merge request !#{@merge_request.id} | #{@merge_request.title} | #{@project.name}") end def reassigned_issue_email(recipient_id, issue_id, previous_assignee_id) @@ -80,6 +80,6 @@ class Notify < ActionMailer::Base @issue = Issue.find(issue_id) @previous_assignee ||= User.find(previous_assignee_id) @project = @issue.project - mail(:to => recipient.email, :subject => "gitlab | changed issue ##{@issue.id} | #{@issue.title} | #{@project.name}") + mail(to: recipient.email, subject: "gitlab | changed issue ##{@issue.id} | #{@issue.title} | #{@project.name}") end end diff --git a/app/models/commit.rb b/app/models/commit.rb index 71c41350c95..5c6b4d88d96 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -20,7 +20,7 @@ class Commit :tree, :id, :to_patch, - :to => :commit + to: :commit class << self @@ -57,7 +57,7 @@ class Commit def commits_since(repo, date) commits = repo.heads.map do |h| - repo.log(h.name, nil, :since => date).each { |c| Commit.new(c, h) } + repo.log(h.name, nil, since: date).each { |c| Commit.new(c, h) } end.flatten.uniq { |c| c.id } commits.sort! do |x, y| @@ -69,7 +69,7 @@ class Commit def commits(repo, ref, path = nil, limit = nil, offset = nil) if path - repo.log(ref, path, :max_count => limit, :skip => offset) + repo.log(ref, path, max_count: limit, skip: offset) elsif limit && offset repo.commits(ref, limit, offset) else @@ -86,9 +86,9 @@ class Commit last = project.commit(from.try(:strip)) result = { - :commits => [], - :diffs => [], - :commit => nil + commits: [], + diffs: [], + commit: nil } if first && last diff --git a/app/models/event.rb b/app/models/event.rb index c75924e7500..e20b79e2a82 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -12,13 +12,13 @@ class Event < ActiveRecord::Base Merged = 7 belongs_to :project - belongs_to :target, :polymorphic => true + belongs_to :target, polymorphic: true # For Hash only serialize :data scope :recent, order("created_at DESC") - scope :code_push, where(:action => Pushed) + scope :code_push, where(action: Pushed) def self.determine_action(record) if [Issue, MergeRequest].include? record.class @@ -29,7 +29,7 @@ class Event < ActiveRecord::Base end def self.recent_for_user user - where(:project_id => user.projects.map(&:id)).recent + where(project_id: user.projects.map(&:id)).recent end # Next events currently enabled for system @@ -106,9 +106,9 @@ class Event < ActiveRecord::Base end end - delegate :name, :email, :to => :author, :prefix => true, :allow_nil => true - delegate :title, :to => :issue, :prefix => true, :allow_nil => true - delegate :title, :to => :merge_request, :prefix => true, :allow_nil => true + delegate :name, :email, to: :author, prefix: true, allow_nil: true + delegate :title, to: :issue, prefix: true, allow_nil: true + delegate :title, to: :merge_request, prefix: true, allow_nil: true end # == Schema Information # diff --git a/app/models/issue.rb b/app/models/issue.rb index d8ca59c23db..454b13586ac 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -7,7 +7,7 @@ class Issue < ActiveRecord::Base belongs_to :milestone validates :description, - :length => { :within => 0..2000 } + length: { within: 0..2000 } acts_as_list diff --git a/app/models/key.rb b/app/models/key.rb index 6b90b315d82..cfcb1f63c26 100644 --- a/app/models/key.rb +++ b/app/models/key.rb @@ -6,16 +6,16 @@ class Key < ActiveRecord::Base belongs_to :project validates :title, - :presence => true, - :length => { :within => 0..255 } + presence: true, + length: { within: 0..255 } validates :key, - :presence => true, - :length => { :within => 0..5000 } + presence: true, + length: { within: 0..5000 } before_save :set_identifier before_validation :strip_white_space - delegate :name, :email, :to => :user, :prefix => true + delegate :name, :email, to: :user, prefix: true validate :unique_key def strip_white_space @@ -23,7 +23,7 @@ class Key < ActiveRecord::Base end def unique_key - query = Key.where(:key => key) + query = Key.where(key: key) query = query.where('(project_id IS NULL OR project_id = ?)', project_id) if project_id if (query.count > 0) errors.add :key, 'already exist.' diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index a77081c9528..47966d669f6 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -20,7 +20,7 @@ class MergeRequest < ActiveRecord::Base validate :validate_branches def self.find_all_by_branch(branch_name) - where("source_branch like :branch or target_branch like :branch", :branch => branch_name) + where("source_branch like :branch or target_branch like :branch", branch: branch_name) end def human_state @@ -48,7 +48,7 @@ class MergeRequest < ActiveRecord::Base end def mark_as_unchecked - self.update_attributes(:state => UNCHECKED) + self.update_attributes(state: UNCHECKED) end def can_be_merged? @@ -101,11 +101,11 @@ class MergeRequest < ActiveRecord::Base end def merge_event - self.project.events.where(:target_id => self.id, :target_type => "MergeRequest", :action => Event::Merged).last + self.project.events.where(target_id: self.id, target_type: "MergeRequest", action: Event::Merged).last end def closed_event - self.project.events.where(:target_id => self.id, :target_type => "MergeRequest", :action => Event::Closed).last + self.project.events.where(target_id: self.id, target_type: "MergeRequest", action: Event::Closed).last end def commits @@ -128,7 +128,7 @@ class MergeRequest < ActiveRecord::Base end def mark_as_unmergable - self.update_attributes :state => CANNOT_BE_MERGED + self.update_attributes state: CANNOT_BE_MERGED end def reloaded_commits @@ -150,11 +150,11 @@ class MergeRequest < ActiveRecord::Base def merge!(user_id) self.mark_as_merged! Event.create( - :project => self.project, - :action => Event::Merged, - :target_id => self.id, - :target_type => "MergeRequest", - :author_id => user_id + project: self.project, + action: Event::Merged, + target_id: self.id, + target_type: "MergeRequest", + author_id: user_id ) end diff --git a/app/models/milestone.rb b/app/models/milestone.rb index 7fdfe29edc8..592c57f948c 100644 --- a/app/models/milestone.rb +++ b/app/models/milestone.rb @@ -24,7 +24,7 @@ class Milestone < ActiveRecord::Base end def participants - User.where(:id => issues.map(&:assignee_id)) + User.where(id: issues.map(&:assignee_id)) end def percent_complete diff --git a/app/models/note.rb b/app/models/note.rb index 8a26cd05b44..711a4ee6935 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -3,18 +3,18 @@ require 'file_size_validator' class Note < ActiveRecord::Base belongs_to :project - belongs_to :noteable, :polymorphic => true + belongs_to :noteable, polymorphic: true belongs_to :author, - :class_name => "User" + class_name: "User" delegate :name, - :to => :project, - :prefix => true + to: :project, + prefix: true delegate :name, :email, - :to => :author, - :prefix => true + to: :author, + prefix: true attr_protected :author, :author_id attr_accessor :notify @@ -23,19 +23,19 @@ class Note < ActiveRecord::Base validates_presence_of :project validates :note, - :presence => true, - :length => { :within => 0..5000 } + presence: true, + length: { within: 0..5000 } validates :attachment, - :file_size => { - :maximum => 10.megabytes.to_i + file_size: { + maximum: 10.megabytes.to_i } - scope :common, where(:noteable_id => nil) + scope :common, where(noteable_id: nil) - scope :today, where("created_at >= :date", :date => Date.today) - scope :last_week, where("created_at >= :date", :date => (Date.today - 7.days)) - scope :since, lambda { |day| where("created_at >= :date", :date => (day)) } + scope :today, where("created_at >= :date", date: Date.today) + scope :last_week, where("created_at >= :date", date: (Date.today - 7.days)) + scope :since, lambda { |day| where("created_at >= :date", date: (day)) } scope :fresh, order("created_at DESC") scope :inc_author_project, includes(:project, :author) scope :inc_author, includes(:author) @@ -43,11 +43,11 @@ class Note < ActiveRecord::Base mount_uploader :attachment, AttachmentUploader def self.create_status_change_note(noteable, author, status) - create({ :noteable => noteable, - :project => noteable.project, - :author => author, - :note => "_Status changed to #{status}_" }, - :without_protection => true) + create({ noteable: noteable, + project: noteable.project, + author: author, + note: "_Status changed to #{status}_" }, + without_protection: true) end def notify diff --git a/app/models/project.rb b/app/models/project.rb index 3ab44bdffd6..de1911f13b9 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -9,19 +9,19 @@ class Project < ActiveRecord::Base # # Relations # - belongs_to :owner, :class_name => "User" - has_many :users, :through => :users_projects - has_many :events, :dependent => :destroy - has_many :merge_requests, :dependent => :destroy - has_many :issues, :dependent => :destroy, :order => "closed, created_at DESC" - has_many :milestones, :dependent => :destroy - has_many :users_projects, :dependent => :destroy - has_many :notes, :dependent => :destroy - has_many :snippets, :dependent => :destroy - has_many :deploy_keys, :dependent => :destroy, :foreign_key => "project_id", :class_name => "Key" - has_many :hooks, :dependent => :destroy, :class_name => "ProjectHook" - has_many :wikis, :dependent => :destroy - has_many :protected_branches, :dependent => :destroy + belongs_to :owner, class_name: "User" + has_many :users, through: :users_projects + has_many :events, dependent: :destroy + has_many :merge_requests, dependent: :destroy + has_many :issues, dependent: :destroy, order: "closed, created_at DESC" + has_many :milestones, dependent: :destroy + has_many :users_projects, dependent: :destroy + has_many :notes, dependent: :destroy + has_many :snippets, dependent: :destroy + has_many :deploy_keys, dependent: :destroy, foreign_key: "project_id", class_name: "Key" + has_many :hooks, dependent: :destroy, class_name: "ProjectHook" + has_many :wikis, dependent: :destroy + has_many :protected_branches, dependent: :destroy attr_accessor :error_code @@ -33,15 +33,15 @@ class Project < ActiveRecord::Base # # Scopes # - scope :public_only, where(:private_flag => false) - scope :without_user, lambda { |user| where("id not in (:ids)", :ids => user.projects.map(&:id) ) } + scope :public_only, where(private_flag: false) + scope :without_user, lambda { |user| where("id not in (:ids)", ids: user.projects.map(&:id) ) } def self.active joins(:issues, :notes, :merge_requests).order("issues.created_at, notes.created_at, merge_requests.created_at DESC") end def self.search query - where("name like :query or code like :query or path like :query", :query => "%#{query}%") + where("name like :query or code like :query or path like :query", query: "%#{query}%") end def self.create_by_user(params, user) @@ -53,7 +53,7 @@ class Project < ActiveRecord::Base project.save! # Add user as project master - project.users_projects.create!(:project_access => UsersProject::MASTER, :user => user) + project.users_projects.create!(project_access: UsersProject::MASTER, user: user) # when project saved no team member exist so # project repository should be updated after first user add @@ -82,28 +82,28 @@ class Project < ActiveRecord::Base # Validations # validates :name, - :uniqueness => true, - :presence => true, - :length => { :within => 0..255 } + uniqueness: true, + presence: true, + length: { within: 0..255 } validates :path, - :uniqueness => true, - :presence => true, - :format => { :with => /^[a-zA-Z][a-zA-Z0-9_\-\.]*$/, - :message => "only letters, digits & '_' '-' '.' allowed. Letter should be first" }, - :length => { :within => 0..255 } + uniqueness: true, + presence: true, + format: { with: /^[a-zA-Z][a-zA-Z0-9_\-\.]*$/, + message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" }, + length: { within: 0..255 } validates :description, - :length => { :within => 0..2000 } + length: { within: 0..2000 } validates :code, - :presence => true, - :uniqueness => true, - :format => { :with => /^[a-zA-Z][a-zA-Z0-9_\-\.]*$/, - :message => "only letters, digits & '_' '-' '.' allowed. Letter should be first" }, - :length => { :within => 1..255 } + presence: true, + uniqueness: true, + format: { with: /^[a-zA-Z][a-zA-Z0-9_\-\.]*$/, + message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" }, + length: { within: 1..255 } - validates :owner, :presence => true + validates :owner, presence: true validate :check_limit validate :repo_name @@ -134,19 +134,19 @@ class Project < ActiveRecord::Base end def common_notes - notes.where(:noteable_type => ["", nil]).inc_author_project + notes.where(noteable_type: ["", nil]).inc_author_project end def build_commit_note(commit) - notes.new(:noteable_id => commit.id, :noteable_type => "Commit") + notes.new(noteable_id: commit.id, noteable_type: "Commit") end def commit_notes(commit) - notes.where(:noteable_id => commit.id, :noteable_type => "Commit", :line_code => nil) + notes.where(noteable_id: commit.id, noteable_type: "Commit", line_code: nil) end def commit_line_notes(commit) - notes.where(:noteable_id => commit.id, :noteable_type => "Commit").where("line_code is not null") + notes.where(noteable_id: commit.id, noteable_type: "Commit").where("line_code is not null") end def public? diff --git a/app/models/snippet.rb b/app/models/snippet.rb index e5f04bb228b..2c941499f1f 100644 --- a/app/models/snippet.rb +++ b/app/models/snippet.rb @@ -2,29 +2,29 @@ class Snippet < ActiveRecord::Base include Linguist::BlobHelper belongs_to :project - belongs_to :author, :class_name => "User" - has_many :notes, :as => :noteable, :dependent => :destroy + belongs_to :author, class_name: "User" + has_many :notes, as: :noteable, dependent: :destroy delegate :name, :email, - :to => :author, - :prefix => true + to: :author, + prefix: true attr_protected :author, :author_id, :project, :project_id validates_presence_of :project_id validates_presence_of :author_id validates :title, - :presence => true, - :length => { :within => 0..255 } + presence: true, + length: { within: 0..255 } validates :file_name, - :presence => true, - :length => { :within => 0..255 } + presence: true, + length: { within: 0..255 } validates :content, - :presence => true, - :length => { :within => 0..10000 } + presence: true, + length: { within: 0..10000 } scope :fresh, order("created_at DESC") scope :non_expired, where(["expires_at IS NULL OR expires_at > ?", Time.current]) diff --git a/app/models/tree.rb b/app/models/tree.rb index 9d60f83015f..bc95d335520 100644 --- a/app/models/tree.rb +++ b/app/models/tree.rb @@ -11,7 +11,7 @@ class Tree :size, :text?, :colorize, - :to => :tree + to: :tree def initialize(raw_tree, project, ref = nil, path = nil) @project, @ref, @path = project, ref, path, diff --git a/app/models/user.rb b/app/models/user.rb index ff27660a6ee..92c81c83d41 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -11,58 +11,58 @@ class User < ActiveRecord::Base attr_accessor :force_random_password - has_many :users_projects, :dependent => :destroy - has_many :projects, :through => :users_projects - has_many :my_own_projects, :class_name => "Project", :foreign_key => :owner_id - has_many :keys, :dependent => :destroy + has_many :users_projects, dependent: :destroy + has_many :projects, through: :users_projects + has_many :my_own_projects, class_name: "Project", foreign_key: :owner_id + has_many :keys, dependent: :destroy has_many :events, - :class_name => "Event", - :foreign_key => :author_id, - :dependent => :destroy + class_name: "Event", + foreign_key: :author_id, + dependent: :destroy has_many :recent_events, - :class_name => "Event", - :foreign_key => :author_id, - :order => "id DESC" + class_name: "Event", + foreign_key: :author_id, + order: "id DESC" has_many :issues, - :foreign_key => :author_id, - :dependent => :destroy + foreign_key: :author_id, + dependent: :destroy has_many :notes, - :foreign_key => :author_id, - :dependent => :destroy + foreign_key: :author_id, + dependent: :destroy has_many :assigned_issues, - :class_name => "Issue", - :foreign_key => :assignee_id, - :dependent => :destroy + class_name: "Issue", + foreign_key: :assignee_id, + dependent: :destroy has_many :merge_requests, - :foreign_key => :author_id, - :dependent => :destroy + foreign_key: :author_id, + dependent: :destroy has_many :assigned_merge_requests, - :class_name => "MergeRequest", - :foreign_key => :assignee_id, - :dependent => :destroy + class_name: "MergeRequest", + foreign_key: :assignee_id, + dependent: :destroy validates :projects_limit, - :presence => true, - :numericality => {:greater_than_or_equal_to => 0} + presence: true, + numericality: {greater_than_or_equal_to: 0} - validates :bio, :length => { :within => 0..255 } + validates :bio, length: { within: 0..255 } before_save :ensure_authentication_token alias_attribute :private_token, :authentication_token - scope :not_in_project, lambda { |project| where("id not in (:ids)", :ids => project.users.map(&:id) ) } - scope :admins, where(:admin => true) - scope :blocked, where(:blocked => true) - scope :active, where(:blocked => false) + scope :not_in_project, lambda { |project| where("id not in (:ids)", ids: project.users.map(&:id) ) } + scope :admins, where(admin: true) + scope :blocked, where(blocked: true) + scope :active, where(blocked: false) - before_validation :generate_password, :on => :create + before_validation :generate_password, on: :create def generate_password if self.force_random_password @@ -94,17 +94,17 @@ class User < ActiveRecord::Base else password = Devise.friendly_token[0, 8].downcase @user = User.create( - :name => name, - :email => email, - :password => password, - :password_confirmation => password, - :projects_limit => Gitlab.config.default_projects_limit + name: name, + email: email, + password: password, + password_confirmation: password, + projects_limit: Gitlab.config.default_projects_limit ) end end def self.search query - where("name like :query or email like :query", :query => "%#{query}%") + where("name like :query or email like :query", query: "%#{query}%") end end # == Schema Information diff --git a/app/models/users_project.rb b/app/models/users_project.rb index 4ff86290a92..36e6d9045b6 100644 --- a/app/models/users_project.rb +++ b/app/models/users_project.rb @@ -12,18 +12,18 @@ class UsersProject < ActiveRecord::Base after_save :update_repository after_destroy :update_repository - validates_uniqueness_of :user_id, :scope => [:project_id] + validates_uniqueness_of :user_id, scope: [:project_id] validates_presence_of :user_id validates_presence_of :project_id - delegate :name, :email, :to => :user, :prefix => true + delegate :name, :email, to: :user, prefix: true def self.bulk_import(project, user_ids, project_access) UsersProject.transaction do user_ids.each do |user_id| users_project = UsersProject.new( - :project_access => project_access, - :user_id => user_id + project_access: project_access, + user_id: user_id ) users_project.project = project users_project.save @@ -35,7 +35,7 @@ class UsersProject < ActiveRecord::Base UsersProject.transaction do project_ids.each do |project_id| users_project = UsersProject.new( - :project_access => project_access, + project_access: project_access, ) users_project.project_id = project_id users_project.user_id = user.id diff --git a/app/models/wiki.rb b/app/models/wiki.rb index d9ec069d14b..3c4952cd291 100644 --- a/app/models/wiki.rb +++ b/app/models/wiki.rb @@ -1,10 +1,10 @@ class Wiki < ActiveRecord::Base belongs_to :project belongs_to :user - has_many :notes, :as => :noteable, :dependent => :destroy + has_many :notes, as: :noteable, dependent: :destroy - validates :content, :title, :user_id, :presence => true - validates :title, :length => 1..250 + validates :content, :title, :user_id, presence: true + validates :title, length: 1..250 before_update :set_slug diff --git a/app/observers/activity_observer.rb b/app/observers/activity_observer.rb index 324d8207d22..48351bac667 100644 --- a/app/observers/activity_observer.rb +++ b/app/observers/activity_observer.rb @@ -3,22 +3,22 @@ class ActivityObserver < ActiveRecord::Observer def after_create(record) Event.create( - :project => record.project, - :target_id => record.id, - :target_type => record.class.name, - :action => Event.determine_action(record), - :author_id => record.author_id + project: record.project, + target_id: record.id, + target_type: record.class.name, + action: Event.determine_action(record), + author_id: record.author_id ) end def after_save(record) if record.changed.include?("closed") Event.create( - :project => record.project, - :target_id => record.id, - :target_type => record.class.name, - :action => (record.closed ? Event::Closed : Event::Reopened), - :author_id => record.author_id_of_changes + project: record.project, + target_id: record.id, + target_type: record.class.name, + action: (record.closed ? Event::Closed : Event::Reopened), + author_id: record.author_id_of_changes ) end end diff --git a/app/observers/mailer_observer.rb b/app/observers/mailer_observer.rb index b6f5217847a..331aaa35e3d 100644 --- a/app/observers/mailer_observer.rb +++ b/app/observers/mailer_observer.rb @@ -71,7 +71,7 @@ class MailerObserver < ActiveRecord::Observer # Create comment about status changed if target.closed_changed? - note = Note.new(:noteable => target, :project => target.project) + note = Note.new(noteable: target, project: target.project) note.author = current_user note.note = "_Status changed to #{target.closed ? 'closed' : 'reopened'}_" note.save() diff --git a/app/roles/account.rb b/app/roles/account.rb index e77cbe6cb45..63a9b5c51bf 100644 --- a/app/roles/account.rb +++ b/app/roles/account.rb @@ -24,7 +24,7 @@ module Account end def cared_merge_requests - MergeRequest.where("author_id = :id or assignee_id = :id", :id => self.id).opened + MergeRequest.where("author_id = :id or assignee_id = :id", id: self.id).opened end def project_ids @@ -50,7 +50,7 @@ module Account def recent_push project_id = nil # Get push events not earlier than 2 hours ago events = recent_events.code_push.where("created_at > ?", Time.now - 2.hours) - events = events.where(:project_id => project_id) if project_id + events = events.where(project_id: project_id) if project_id # Take only latest one events = events.recent.limit(1).first diff --git a/app/roles/authority.rb b/app/roles/authority.rb index a03b54a3ee7..9d9153db66e 100644 --- a/app/roles/authority.rb +++ b/app/roles/authority.rb @@ -3,56 +3,56 @@ module Authority # Should be rewrited for new access rights def add_access(user, *access) access = if access.include?(:admin) - { :project_access => UsersProject::MASTER } + { project_access: UsersProject::MASTER } elsif access.include?(:write) - { :project_access => UsersProject::DEVELOPER } + { project_access: UsersProject::DEVELOPER } else - { :project_access => UsersProject::REPORTER } + { project_access: UsersProject::REPORTER } end - opts = { :user => user } + opts = { user: user } opts.merge!(access) users_projects.create(opts) end def reset_access(user) - users_projects.where(:project_id => self.id, :user_id => user.id).destroy if self.id + users_projects.where(project_id: self.id, user_id: user.id).destroy if self.id end def repository_readers - keys = Key.joins({:user => :users_projects}). + keys = Key.joins({user: :users_projects}). where("users_projects.project_id = ? AND users_projects.project_access = ?", id, UsersProject::REPORTER) keys.map(&:identifier) + deploy_keys.map(&:identifier) end def repository_writers - keys = Key.joins({:user => :users_projects}). + keys = Key.joins({user: :users_projects}). where("users_projects.project_id = ? AND users_projects.project_access = ?", id, UsersProject::DEVELOPER) keys.map(&:identifier) end def repository_masters - keys = Key.joins({:user => :users_projects}). + keys = Key.joins({user: :users_projects}). where("users_projects.project_id = ? AND users_projects.project_access = ?", id, UsersProject::MASTER) keys.map(&:identifier) end def allow_read_for?(user) - !users_projects.where(:user_id => user.id).empty? + !users_projects.where(user_id: user.id).empty? end def guest_access_for?(user) - !users_projects.where(:user_id => user.id).empty? + !users_projects.where(user_id: user.id).empty? end def report_access_for?(user) - !users_projects.where(:user_id => user.id, :project_access => [UsersProject::REPORTER, UsersProject::DEVELOPER, UsersProject::MASTER]).empty? + !users_projects.where(user_id: user.id, project_access: [UsersProject::REPORTER, UsersProject::DEVELOPER, UsersProject::MASTER]).empty? end def dev_access_for?(user) - !users_projects.where(:user_id => user.id, :project_access => [UsersProject::DEVELOPER, UsersProject::MASTER]).empty? + !users_projects.where(user_id: user.id, project_access: [UsersProject::DEVELOPER, UsersProject::MASTER]).empty? end def master_access_for?(user) - !users_projects.where(:user_id => user.id, :project_access => [UsersProject::MASTER]).empty? || owner_id == user.id + !users_projects.where(user_id: user.id, project_access: [UsersProject::MASTER]).empty? || owner_id == user.id end end diff --git a/app/roles/issue_commonality.rb b/app/roles/issue_commonality.rb index 353d6a5c977..a8fd679df81 100644 --- a/app/roles/issue_commonality.rb +++ b/app/roles/issue_commonality.rb @@ -6,39 +6,39 @@ module IssueCommonality attr_protected :author, :author_id, :project, :project_id belongs_to :project - belongs_to :author, :class_name => "User" - belongs_to :assignee, :class_name => "User" - has_many :notes, :as => :noteable, :dependent => :destroy + belongs_to :author, class_name: "User" + belongs_to :assignee, class_name: "User" + has_many :notes, as: :noteable, dependent: :destroy validates_presence_of :project_id validates_presence_of :author_id validates :title, - :presence => true, - :length => { :within => 0..255 } + presence: true, + length: { within: 0..255 } - scope :opened, where(:closed => false) - scope :closed, where(:closed => true) - scope :assigned, lambda { |u| where(:assignee_id => u.id)} + scope :opened, where(closed: false) + scope :closed, where(closed: true) + scope :assigned, lambda { |u| where(assignee_id: u.id)} delegate :name, :email, - :to => :author, - :prefix => true + to: :author, + prefix: true delegate :name, :email, - :to => :assignee, - :allow_nil => true, - :prefix => true + to: :assignee, + allow_nil: true, + prefix: true attr_accessor :author_id_of_changes end module ClassMethods def search(query) - where("title like :query", :query => "%#{query}%") + where("title like :query", query: "%#{query}%") end end diff --git a/app/roles/project_push.rb b/app/roles/project_push.rb index 44e97b45d8c..02025384e48 100644 --- a/app/roles/project_push.rb +++ b/app/roles/project_push.rb @@ -3,10 +3,10 @@ module ProjectPush data = post_receive_data(oldrev, newrev, ref, user) Event.create( - :project => self, - :action => Event::Pushed, - :data => data, - :author_id => data[:user_id] + project: self, + action: Event::Pushed, + data: data, + author_id: data[:user_id] ) end @@ -20,7 +20,7 @@ module ProjectPush mrs.each { |merge_request| merge_request.reload_code; merge_request.mark_as_unchecked } # Close merge requests - mrs = self.merge_requests.opened.where(:target_branch => branch_name).all + mrs = self.merge_requests.opened.where(target_branch: branch_name).all mrs = mrs.select(&:last_commit).select { |mr| c_ids.include?(mr.last_commit.id) } mrs.each { |merge_request| merge_request.merge!(user.id) } diff --git a/app/roles/ssh_key.rb b/app/roles/ssh_key.rb index f1143c5d065..5e1d2c23d15 100644 --- a/app/roles/ssh_key.rb +++ b/app/roles/ssh_key.rb @@ -9,7 +9,7 @@ module SshKey def repository_delete_key Gitlab::GitHost.system.new.configure do |c| #delete key file is there is no identically deploy keys - if !is_deploy_key || Key.where(:identifier => identifier).count() == 0 + if !is_deploy_key || Key.where(identifier: identifier).count() == 0 c.delete_key(identifier) end c.update_projects(projects) diff --git a/app/roles/team.rb b/app/roles/team.rb index bf3a67027d2..27b1cc65897 100644 --- a/app/roles/team.rb +++ b/app/roles/team.rb @@ -25,8 +25,8 @@ module Team # with passed access role by user id def add_user_id_to_team(user_id, access_role) users_projects.create( - :user_id => user_id, - :project_access => access_role + user_id: user_id, + project_access: access_role ) end diff --git a/app/uploaders/attachment_uploader.rb b/app/uploaders/attachment_uploader.rb index 4ba19ace8d1..bb7dc0dab10 100644 --- a/app/uploaders/attachment_uploader.rb +++ b/app/uploaders/attachment_uploader.rb @@ -23,7 +23,7 @@ class AttachmentUploader < CarrierWave::Uploader::Base # end # Process files as they are uploaded: - # process :scale => [200, 300] + # process scale: [200, 300] # # def scale(width, height) # # do something @@ -31,7 +31,7 @@ class AttachmentUploader < CarrierWave::Uploader::Base # Create different versions of your uploaded files: # version :thumb do - # process :scale => [50, 50] + # process scale: [50, 50] # end # Add a white list of extensions which are allowed to be uploaded. diff --git a/app/views/admin/dashboard/index.html.haml b/app/views/admin/dashboard/index.html.haml index 886943be6de..2e67abfc16d 100644 --- a/app/views/admin/dashboard/index.html.haml +++ b/app/views/admin/dashboard/index.html.haml @@ -5,11 +5,11 @@ Resque Workers .data.padded = link_to admin_resque_path do - %h1{:class => @workers.present? ? "cgreen" : "cred"} + %h1{class: @workers.present? ? "cgreen" : "cred"} = @workers.count %hr %p - %strong{:class => @pending_jobs > 0 ? "cred" : "cgreen"} + %strong{class: @pending_jobs > 0 ? "cred" : "cgreen"} #{@pending_jobs} post receive jobs waiting .span4 @@ -19,7 +19,7 @@ = link_to admin_projects_path do %h1= Project.count %hr - = link_to 'New Project', new_admin_project_path, :class => "btn small" + = link_to 'New Project', new_admin_project_path, class: "btn small" .span4 .ui-box %h5 Users @@ -27,7 +27,7 @@ = link_to admin_users_path do %h1= User.count %hr - = link_to 'New User', new_admin_user_path, :class => "btn small" + = link_to 'New User', new_admin_user_path, class: "btn small" .row diff --git a/app/views/admin/hooks/index.html.haml b/app/views/admin/hooks/index.html.haml index 030e6136b1f..d34acffe9e6 100644 --- a/app/views/admin/hooks/index.html.haml +++ b/app/views/admin/hooks/index.html.haml @@ -3,9 +3,9 @@ Post receive hooks for binding events. %br Read more about system hooks - %strong #{link_to "here", help_system_hooks_path, :class => "vlink"} + %strong #{link_to "here", help_system_hooks_path, class: "vlink"} -= form_for @hook, :as => :hook, :url => admin_hooks_path do |f| += form_for @hook, as: :hook, url: admin_hooks_path do |f| -if @hook.errors.any? .alert-message.block-message.error - @hook.errors.full_messages.each do |msg| @@ -13,9 +13,9 @@ .clearfix = f.label :url, "URL:" .input - = f.text_field :url, :class => "text_field xxlarge" + = f.text_field :url, class: "text_field xxlarge" - = f.submit "Add System Hook", :class => "btn primary" + = f.submit "Add System Hook", class: "btn primary" %hr -if @hooks.any? @@ -33,7 +33,7 @@ %td = link_to admin_hook_path(hook) do %strong= hook.url - = link_to 'Test Hook', admin_hook_test_path(hook), :class => "btn small right" + = link_to 'Test Hook', admin_hook_test_path(hook), class: "btn small right" %td POST %td - = link_to 'Remove', admin_hook_path(hook), :confirm => 'Are you sure?', :method => :delete, :class => "danger btn small right" + = link_to 'Remove', admin_hook_path(hook), confirm: 'Are you sure?', method: :delete, class: "danger btn small right" diff --git a/app/views/admin/projects/_form.html.haml b/app/views/admin/projects/_form.html.haml index 4217defb82b..7cebddf2890 100644 --- a/app/views/admin/projects/_form.html.haml +++ b/app/views/admin/projects/_form.html.haml @@ -9,8 +9,8 @@ = f.label :name do Project name is .input - = f.text_field :name, :placeholder => "Example Project", :class => "xxlarge" - = f.submit project.new_record? ? 'Create project' : 'Save Project', :class => "btn primary" + = f.text_field :name, placeholder: "Example Project", class: "xxlarge" + = f.submit project.new_record? ? 'Create project' : 'Save Project', class: "btn primary" %hr .alert.alert-info @@ -21,7 +21,7 @@ .input .input-prepend %span.add-on= Gitlab.config.ssh_path - = f.text_field :path, :placeholder => "example_project", :disabled => !!project.id + = f.text_field :path, placeholder: "example_project", disabled: !!project.id %span.add-on= ".git" .clearfix = f.label :code do @@ -29,7 +29,7 @@ .input .input-prepend %span.add-on= web_app_url - = f.text_field :code, :placeholder => "example" + = f.text_field :code, placeholder: "example" - unless project.new_record? .clearfix @@ -39,7 +39,7 @@ - if project.repo_exists? .clearfix = f.label :default_branch, "Default Branch" - .input= f.select(:default_branch, project.heads.map(&:name), {}, :style => "width:210px;") + .input= f.select(:default_branch, project.heads.map(&:name), {}, style: "width:210px;") - unless project.new_record? .alert.alert-info @@ -63,7 +63,7 @@ - unless project.new_record? .actions - = f.submit 'Save Project', :class => "btn primary" + = f.submit 'Save Project', class: "btn primary" diff --git a/app/views/admin/projects/edit.html.haml b/app/views/admin/projects/edit.html.haml index 826615f3455..b5255671154 100644 --- a/app/views/admin/projects/edit.html.haml +++ b/app/views/admin/projects/edit.html.haml @@ -1,3 +1,3 @@ %h3.page_title #{@admin_project.name} → Edit project %hr -= render 'form', :project => @admin_project += render 'form', project: @admin_project diff --git a/app/views/admin/projects/index.html.haml b/app/views/admin/projects/index.html.haml index 7218eebb62a..4512bb7e493 100644 --- a/app/views/admin/projects/index.html.haml +++ b/app/views/admin/projects/index.html.haml @@ -1,10 +1,10 @@ %h3 Projects - = link_to 'New Project', new_admin_project_path, :class => "btn small right" + = link_to 'New Project', new_admin_project_path, class: "btn small right" %br -= form_tag admin_projects_path, :method => :get do - = text_field_tag :name, params[:name], :class => "xlarge" - = submit_tag "Search", :class => "btn submit primary" += form_tag admin_projects_path, method: :get do + = text_field_tag :name, params[:name], class: "xlarge" + = submit_tag "Search", class: "btn submit primary" %table.admin-table %thead @@ -21,8 +21,8 @@ %td= link_to project.name, [:admin, project] %td= project.path %td= project.users_projects.count - %td= check_box_tag :post_receive_file, 1, project.has_post_receive_file?, :disabled => true + %td= check_box_tag :post_receive_file, 1, project.has_post_receive_file?, disabled: true %td= last_commit(project) - %td= link_to 'Edit', edit_admin_project_path(project), :id => "edit_#{dom_id(project)}", :class => "btn small" - %td.bgred= link_to 'Destroy', [:admin, project], :confirm => "REMOVE #{project.name}? Are you sure?", :method => :delete, :class => "btn small danger" -= paginate @admin_projects, :theme => "admin" + %td= link_to 'Edit', edit_admin_project_path(project), id: "edit_#{dom_id(project)}", class: "btn small" + %td.bgred= link_to 'Destroy', [:admin, project], confirm: "REMOVE #{project.name}? Are you sure?", method: :delete, class: "btn small danger" += paginate @admin_projects, theme: "admin" diff --git a/app/views/admin/projects/new.html.haml b/app/views/admin/projects/new.html.haml index eadb1f88daa..ac6526bfa4b 100644 --- a/app/views/admin/projects/new.html.haml +++ b/app/views/admin/projects/new.html.haml @@ -1,3 +1,3 @@ %h3.page_title New project %hr -= render 'form', :project => @admin_project += render 'form', project: @admin_project diff --git a/app/views/admin/projects/show.html.haml b/app/views/admin/projects/show.html.haml index 4898d32ea43..5ed56477905 100644 --- a/app/views/admin/projects/show.html.haml +++ b/app/views/admin/projects/show.html.haml @@ -1,6 +1,6 @@ %h3 = @admin_project.name - = link_to 'Edit', edit_admin_project_path(@admin_project), :class => "btn right small" + = link_to 'Edit', edit_admin_project_path(@admin_project), class: "btn right small" %br %table.zebra-striped.table-bordered @@ -33,7 +33,7 @@ %b Post Receive File: %td - = check_box_tag :post_receive_file, 1, @admin_project.has_post_receive_file?, :disabled => true + = check_box_tag :post_receive_file, 1, @admin_project.has_post_receive_file?, disabled: true %br %h3 Team @@ -52,14 +52,14 @@ %tr %td = link_to tm.user_name, admin_user_path(tm.user) - %td= select_tag :tm_project_access, options_for_select(Project.access_options, tm.project_access), :class => "medium project-access-select", :disabled => :disabled - %td= link_to 'Edit Access', edit_admin_team_member_path(tm), :class => "btn small" - %td= link_to 'Remove from team', admin_team_member_path(tm), :confirm => 'Are you sure?', :method => :delete, :class => "btn danger small" + %td= select_tag :tm_project_access, options_for_select(Project.access_options, tm.project_access), class: "medium project-access-select", disabled: :disabled + %td= link_to 'Edit Access', edit_admin_team_member_path(tm), class: "btn small" + %td= link_to 'Remove from team', admin_team_member_path(tm), confirm: 'Are you sure?', method: :delete, class: "btn danger small" %br %h3 Add new team member %br -= form_tag team_update_admin_project_path(@admin_project), :class => "bulk_import", :method => :put do += form_tag team_update_admin_project_path(@admin_project), class: "bulk_import", method: :put do %table.zebra-striped.table-bordered %thead %tr @@ -67,14 +67,14 @@ %th Project Access: %tr - %td= select_tag :user_ids, options_from_collection_for_select(@users , :id, :name), :multiple => true - %td= select_tag :project_access, options_for_select(Project.access_options), :class => "project-access-select" + %td= select_tag :user_ids, options_from_collection_for_select(@users , :id, :name), multiple: true + %td= select_tag :project_access, options_for_select(Project.access_options), class: "project-access-select" %tr - %td= submit_tag 'Add', :class => "btn primary" + %td= submit_tag 'Add', class: "btn primary" %td Read more about project permissions - %strong= link_to "here", help_permissions_path, :class => "vlink" + %strong= link_to "here", help_permissions_path, class: "vlink" :css form select { diff --git a/app/views/admin/resque/show.html.haml b/app/views/admin/resque/show.html.haml index 267129530bd..0375d94bc9d 100644 --- a/app/views/admin/resque/show.html.haml +++ b/app/views/admin/resque/show.html.haml @@ -1,2 +1,2 @@ %h3 Resque -%iframe{:src => "/info/resque", :width => 1168, :height => 600, :style => "border: none"}
\ No newline at end of file +%iframe{src: "/info/resque", width: 1168, height: 600, style: "border: none"}
\ No newline at end of file diff --git a/app/views/admin/team_members/_form.html.haml b/app/views/admin/team_members/_form.html.haml index 034757620ec..6a128de94b2 100644 --- a/app/views/admin/team_members/_form.html.haml +++ b/app/views/admin/team_members/_form.html.haml @@ -1,4 +1,4 @@ -= form_for @admin_team_member, :as => :team_member, :url => admin_team_member_path(@admin_team_member) do |f| += form_for @admin_team_member, as: :team_member, url: admin_team_member_path(@admin_team_member) do |f| -if @admin_team_member.errors.any? .alert-message.block-message.error %ul @@ -8,12 +8,12 @@ .clearfix %label Project Access: .input - = f.select :project_access, options_for_select(Project.access_options, @admin_team_member.project_access), {}, :class => "project-access-select" + = f.select :project_access, options_for_select(Project.access_options, @admin_team_member.project_access), {}, class: "project-access-select" %br .actions - = f.submit 'Save', :class => "btn primary" - = link_to 'Cancel', :back, :class => "btn" + = f.submit 'Save', class: "btn primary" + = link_to 'Cancel', :back, class: "btn" :css form select { diff --git a/app/views/admin/users/_form.html.haml b/app/views/admin/users/_form.html.haml index c1955b321d5..5e68a23f494 100644 --- a/app/views/admin/users/_form.html.haml +++ b/app/views/admin/users/_form.html.haml @@ -22,17 +22,17 @@ -if f.object.new_record? .clearfix - = f.label :admin, :class => "checkbox" do + = f.label :admin, class: "checkbox" do = f.check_box :force_random_password, {}, true, nil %span Generate random password %div.password-fields .clearfix = f.label :password - .input= f.password_field :password, :disabled => f.object.force_random_password + .input= f.password_field :password, disabled: f.object.force_random_password .clearfix = f.label :password_confirmation - .input= f.password_field :password_confirmation, :disabled => f.object.force_random_password + .input= f.password_field :password_confirmation, disabled: f.object.force_random_password %hr .clearfix = f.label :skype @@ -46,27 +46,27 @@ .span6 .clearfix = f.label :projects_limit - .input= f.text_field :projects_limit, :class => "small_input" + .input= f.text_field :projects_limit, class: "small_input" .alert .clearfix %p Make the user a GitLab administrator. - = f.label :admin, :class => "checkbox" do + = f.label :admin, class: "checkbox" do = f.check_box :admin %span Administrator - unless @admin_user.new_record? .alert.alert-error - if @admin_user.blocked %span - = link_to 'Unblock', unblock_admin_user_path(@admin_user), :method => :put, :class => "btn small" + = link_to 'Unblock', unblock_admin_user_path(@admin_user), method: :put, class: "btn small" This user is blocked and is not able to login to GitLab - else %span - = link_to 'Block', block_admin_user_path(@admin_user), :confirm => 'USER WILL BE BLOCKED! Are you sure?', :method => :put, :class => "btn small danger" + = link_to 'Block', block_admin_user_path(@admin_user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn small danger" Blocked users will be removed from all projects & will not be able to login to GitLab. .actions - = f.submit 'Save', :class => "btn primary" + = f.submit 'Save', class: "btn primary" - if @admin_user.new_record? - = link_to 'Cancel', admin_users_path, :class => "btn" + = link_to 'Cancel', admin_users_path, class: "btn" - else - = link_to 'Cancel', admin_user_path(@admin_user), :class => "btn" + = link_to 'Cancel', admin_user_path(@admin_user), class: "btn" diff --git a/app/views/admin/users/index.html.haml b/app/views/admin/users/index.html.haml index 5d5320db0e3..5edca312cc5 100644 --- a/app/views/admin/users/index.html.haml +++ b/app/views/admin/users/index.html.haml @@ -1,22 +1,22 @@ %h3 Users - = link_to 'New User', new_admin_user_path, :class => "btn small right" + = link_to 'New User', new_admin_user_path, class: "btn small right" %br -= form_tag admin_users_path, :method => :get do - = text_field_tag :name, params[:name], :class => "xlarge" - = submit_tag "Search", :class => "btn submit primary" += form_tag admin_users_path, method: :get do + = text_field_tag :name, params[:name], class: "xlarge" + = submit_tag "Search", class: "btn submit primary" %ul.nav.nav-pills - %li{:class => "#{'active' unless params[:filter]}"} + %li{class: "#{'active' unless params[:filter]}"} = link_to "Active", admin_users_path - %li{:class => "#{'active' if params[:filter] == "admins"}"} - = link_to admin_users_path(:filter => "admins") do + %li{class: "#{'active' if params[:filter] == "admins"}"} + = link_to admin_users_path(filter: "admins") do Admins - %li{:class => "#{'active' if params[:filter] == "blocked"}"} - = link_to admin_users_path(:filter => "blocked") do + %li{class: "#{'active' if params[:filter] == "blocked"}"} + = link_to admin_users_path(filter: "blocked") do Blocked - %li{:class => "#{'active' if params[:filter] == "wop"}"} - = link_to admin_users_path(:filter => "wop") do + %li{class: "#{'active' if params[:filter] == "wop"}"} + = link_to admin_users_path(filter: "wop") do Without projects %table.admin-table @@ -31,16 +31,16 @@ - @admin_users.each do |user| %tr - %td= check_box_tag "admin", 1, user.admin, :disabled => :disabled + %td= check_box_tag "admin", 1, user.admin, disabled: :disabled %td= link_to user.name, [:admin, user] %td= user.email %td= user.users_projects.count - %td= link_to 'Edit', edit_admin_user_path(user), :id => "edit_#{dom_id(user)}", :class => "btn small" + %td= link_to 'Edit', edit_admin_user_path(user), id: "edit_#{dom_id(user)}", class: "btn small" %td - if user.blocked - = link_to 'Unblock', unblock_admin_user_path(user), :method => :put, :class => "btn small success" + = link_to 'Unblock', unblock_admin_user_path(user), method: :put, class: "btn small success" - else - = link_to 'Block', block_admin_user_path(user), :confirm => 'USER WILL BE BLOCKED! Are you sure?', :method => :put, :class => "btn small danger" - %td.bgred= link_to 'Destroy', [:admin, user], :confirm => "USER #{user.name} WILL BE REMOVED! Are you sure?", :method => :delete, :class => "btn small danger" + = link_to 'Block', block_admin_user_path(user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn small danger" + %td.bgred= link_to 'Destroy', [:admin, user], confirm: "USER #{user.name} WILL BE REMOVED! Are you sure?", method: :delete, class: "btn small danger" -= paginate @admin_users, :theme => "admin" += paginate @admin_users, theme: "admin" diff --git a/app/views/admin/users/show.html.haml b/app/views/admin/users/show.html.haml index 7510b1446dc..4cca8ed7a4e 100644 --- a/app/views/admin/users/show.html.haml +++ b/app/views/admin/users/show.html.haml @@ -4,7 +4,7 @@ %small Blocked - if @admin_user.admin %small Administrator - = link_to 'Edit', edit_admin_user_path(@admin_user), :class => "btn small right" + = link_to 'Edit', edit_admin_user_path(@admin_user), class: "btn small right" %br @@ -19,12 +19,12 @@ %td %b Admin: - %td= check_box_tag "admin", 1, @admin_user.admin, :disabled => :disabled + %td= check_box_tag "admin", 1, @admin_user.admin, disabled: :disabled %tr %td %b Blocked: - %td= check_box_tag "blocked", 1, @admin_user.blocked, :disabled => :disabled + %td= check_box_tag "blocked", 1, @admin_user.blocked, disabled: :disabled %tr %td %b @@ -56,7 +56,7 @@ %br %h3 Add User to Projects %br -= form_tag team_update_admin_user_path(@admin_user), :class => "bulk_import", :method => :put do += form_tag team_update_admin_user_path(@admin_user), class: "bulk_import", method: :put do %table.table-bordered %thead %tr @@ -64,14 +64,14 @@ %th Project Access: %tr - %td= select_tag :project_ids, options_from_collection_for_select(@projects , :id, :name), :multiple => true - %td= select_tag :project_access, options_for_select(Project.access_options), :class => "project-access-select" + %td= select_tag :project_ids, options_from_collection_for_select(@projects , :id, :name), multiple: true + %td= select_tag :project_access, options_for_select(Project.access_options), class: "project-access-select" %tr - %td= submit_tag 'Add', :class => "btn primary" + %td= submit_tag 'Add', class: "btn primary" %td Read more about project permissions - %strong= link_to "here", help_permissions_path, :class => "vlink" + %strong= link_to "here", help_permissions_path, class: "vlink" %br - if @admin_user.projects.present? @@ -90,9 +90,9 @@ - project = tm.project %tr %td= link_to project.name, admin_project_path(project) - %td= select_tag :tm_project_access, options_for_select(Project.access_options, tm.project_access), :class => "medium project-access-select", :disabled => :disabled - %td= link_to 'Edit Access', edit_admin_team_member_path(tm), :class => "btn small" - %td= link_to 'Remove from team', admin_team_member_path(tm), :confirm => 'Are you sure?', :method => :delete, :class => "btn small danger" + %td= select_tag :tm_project_access, options_for_select(Project.access_options, tm.project_access), class: "medium project-access-select", disabled: :disabled + %td= link_to 'Edit Access', edit_admin_team_member_path(tm), class: "btn small" + %td= link_to 'Remove from team', admin_team_member_path(tm), confirm: 'Are you sure?', method: :delete, class: "btn small danger" :css form select { diff --git a/app/views/commits/_commit.html.haml b/app/views/commits/_commit.html.haml index b4f8f91f563..686a4337b3a 100644 --- a/app/views/commits/_commit.html.haml +++ b/app/views/commits/_commit.html.haml @@ -1,13 +1,13 @@ %li.commit .browse_code_link_holder %p - %strong= link_to "Browse Code »", tree_project_ref_path(@project, commit.id), :class => "right" + %strong= link_to "Browse Code »", tree_project_ref_path(@project, commit.id), class: "right" %p - = link_to commit.short_id(8), project_commit_path(@project, :id => commit.id), :class => "commit_short_id" + = link_to commit.short_id(8), project_commit_path(@project, id: commit.id), class: "commit_short_id" %strong.cgray= commit.author_name – - = image_tag gravatar_icon(commit.author_email), :class => "avatar", :width => 16 - = link_to_gfm truncate(commit.title, :length => 50), project_commit_path(@project, :id => commit.id), :class => "row_title" + = image_tag gravatar_icon(commit.author_email), class: "avatar", width: 16 + = link_to_gfm truncate(commit.title, length: 50), project_commit_path(@project, id: commit.id), class: "row_title" %span.committed_ago = time_ago_in_words(commit.committed_date) diff --git a/app/views/commits/_commit_box.html.haml b/app/views/commits/_commit_box.html.haml index 5edaaf9b274..52f03ba73c3 100644 --- a/app/views/commits/_commit_box.html.haml +++ b/app/views/commits/_commit_box.html.haml @@ -5,10 +5,10 @@ %span.btn.disabled.grouped %i.icon-comment = @notes_count - = link_to patch_project_commit_path(@project, @commit.id), :class => "btn small grouped" do + = link_to patch_project_commit_path(@project, @commit.id), class: "btn small grouped" do %i.icon-download-alt Get Patch - = link_to tree_project_ref_path(@project, @commit.id), :class => "browse-button primary grouped" do + = link_to tree_project_ref_path(@project, @commit.id), class: "browse-button primary grouped" do %strong Browse Code » %h3.commit-title.page_title = gfm @commit.title @@ -18,7 +18,7 @@ .commit-info .row .span4 - = image_tag gravatar_icon(@commit.author_email, 40), :class => "avatar" + = image_tag gravatar_icon(@commit.author_email, 40), class: "avatar" .author %strong= @commit.author_name authored diff --git a/app/views/commits/_diff_head.html.haml b/app/views/commits/_diff_head.html.haml index 11d6ca169d0..710e8857649 100644 --- a/app/views/commits/_diff_head.html.haml +++ b/app/views/commits/_diff_head.html.haml @@ -3,24 +3,24 @@ %li - if diff.deleted_file %span.removed_file - %a{:href => "##{diff.old_path}"} + %a{href: "##{diff.old_path}"} = diff.old_path = image_tag "diff_file_delete.png" - elsif diff.renamed_file %span.moved_file - %a{:href => "##{diff.new_path}"} + %a{href: "##{diff.new_path}"} = diff.old_path = "->" = diff.new_path = image_tag "diff_file_notice.png" - elsif diff.new_file %span.new_file - %a{:href => "##{diff.new_path}"} + %a{href: "##{diff.new_path}"} = diff.new_path = image_tag "diff_file_add.png" - else %span.edit_file - %a{:href => "##{diff.new_path}"} + %a{href: "##{diff.new_path}"} = diff.new_path = image_tag "diff_file_info.png" diff --git a/app/views/commits/_diffs.html.haml b/app/views/commits/_diffs.html.haml index d51561d90f8..b590d64c06e 100644 --- a/app/views/commits/_diffs.html.haml +++ b/app/views/commits/_diffs.html.haml @@ -5,12 +5,12 @@ %p To prevent performance issue we rejected diff information. %p But if you still want to see diff - = link_to "click this link", project_commit_path(@project, @commit.id, :force_show_diff => true), :class => "dark" + = link_to "click this link", project_commit_path(@project, @commit.id, force_show_diff: true), class: "dark" %p.cgray Showing #{pluralize(diffs.count, "changed file")} .file_stats - = render "commits/diff_head", :diffs => diffs + = render "commits/diff_head", diffs: diffs - unless @suppress_diff - diffs.each_with_index do |diff, i| @@ -22,26 +22,26 @@ .diff_file_header - if diff.deleted_file %i.icon-file - %span{:id => "#{diff.old_path}"}= diff.old_path + %span{id: "#{diff.old_path}"}= diff.old_path - else = link_to tree_file_project_ref_path(@project, @commit.id, diff.new_path) do %i.icon-file - %span{:id => "#{diff.new_path}"}= diff.new_path + %span{id: "#{diff.new_path}"}= diff.new_path %br/ .diff_file_content -# Skipp all non non-supported blobs - next unless file.respond_to?('text?') - if file.text? - = render "commits/text_file", :diff => diff, :index => i + = render "commits/text_file", diff: diff, index: i - elsif file.image? - if diff.renamed_file || diff.new_file || diff.deleted_file .diff_file_content_image - %img{:class => image_diff_class(diff), :src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} + %img{class: image_diff_class(diff), src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} - else - old_file = (@commit.prev_commit.tree / diff.old_path) .diff_file_content_image.img_compared - %img{:class => "diff_image_removed", :src => "data:#{file.mime_type};base64,#{Base64.encode64(old_file.data)}"} - %img{:class => "diff_image_added", :src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} + %img{class: "diff_image_removed", src: "data:#{file.mime_type};base64,#{Base64.encode64(old_file.data)}"} + %img{class: "diff_image_added", src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} - else %p.nothing_here_message No preview for this file type diff --git a/app/views/commits/_head.html.haml b/app/views/commits/_head.html.haml index 453ca4eac12..a211329f349 100644 --- a/app/views/commits/_head.html.haml +++ b/app/views/commits/_head.html.haml @@ -1,21 +1,21 @@ %ul.nav.nav-tabs %li - = form_tag switch_project_refs_path(@project), :method => :get, :class => "project-refs-form" do - = select_tag "ref", grouped_options_refs, :onchange => "$(this.form).trigger('submit');", :class => "project-refs-select" + = form_tag switch_project_refs_path(@project), method: :get, class: "project-refs-form" do + = select_tag "ref", grouped_options_refs, onchange: "$(this.form).trigger('submit');", class: "project-refs-select" = hidden_field_tag :destination, "commits" - %li{:class => "#{'active' if current_page?(project_commits_path(@project)) }"} + %li{class: "#{'active' if current_page?(project_commits_path(@project)) }"} = link_to project_commits_path(@project) do Commits - %li{:class => "#{'active' if current_page?(compare_project_commits_path(@project)) }"} + %li{class: "#{'active' if current_page?(compare_project_commits_path(@project)) }"} = link_to compare_project_commits_path(@project) do Compare - %li{:class => "#{branches_tab_class}"} + %li{class: "#{branches_tab_class}"} = link_to project_repository_path(@project) do Branches %span.badge= @project.repo.branch_count - %li{:class => "#{'active' if current_page?(tags_project_repository_path(@project)) }"} + %li{class: "#{'active' if current_page?(tags_project_repository_path(@project)) }"} = link_to tags_project_repository_path(@project) do Tags %span.badge= @project.repo.tag_count @@ -24,8 +24,8 @@ - if current_page?(project_commits_path(@project)) && current_user.private_token %li.right %span.rss-icon - = link_to project_commits_path(@project, :atom, { :private_token => current_user.private_token, :ref => @ref }), :title => "Feed" do - = image_tag "rss_ui.png", :title => "feed" + = link_to project_commits_path(@project, :atom, { private_token: current_user.private_token, ref: @ref }), title: "Feed" do + = image_tag "rss_ui.png", title: "feed" :javascript $(function(){ diff --git a/app/views/commits/_text_file.html.haml b/app/views/commits/_text_file.html.haml index cab066410b4..0f6210f2b5a 100644 --- a/app/views/commits/_text_file.html.haml +++ b/app/views/commits/_text_file.html.haml @@ -2,7 +2,7 @@ - if too_big %a.supp_diff_link Diff suppressed. Click to show -%table{:class => "#{'hide' if too_big}"} +%table{class: "#{'hide' if too_big}"} - each_diff_line(diff.diff.lines.to_a, index) do |line, type, line_code, line_new, line_old| %tr.line_holder - if type == "match" @@ -11,16 +11,16 @@ %td.line_content.matched= line - else %td.old_line - = link_to raw(type == "new" ? " " : line_old), "##{line_code}", :id => line_code + = link_to raw(type == "new" ? " " : line_old), "##{line_code}", id: line_code - if @comments_allowed - = link_to "", "#", :class => "line_note_link", "line_code" => line_code, :title => "Add note for this line" - %td.new_line= link_to raw(type == "old" ? " " : line_new) , "##{line_code}", :id => line_code - %td.line_content{:class => "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw "#{line} " + = link_to "", "#", class: "line_note_link", "line_code" => line_code, title: "Add note for this line" + %td.new_line= link_to raw(type == "old" ? " " : line_new) , "##{line_code}", id: line_code + %td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw "#{line} " - if @comments_allowed - comments = @line_notes.select { |n| n.line_code == line_code }.sort_by(&:created_at).reverse - unless comments.empty? - comments.each_with_index do |note, i| - = render "notes/reply_button", :line_code => line_code if i.zero? - = render "notes/per_line_show", :note => note + = render "notes/reply_button", line_code: line_code if i.zero? + = render "notes/per_line_show", note: note - @line_notes.reject!{ |n| n == note } diff --git a/app/views/commits/compare.html.haml b/app/views/commits/compare.html.haml index 04d8af5459d..be915cd1038 100644 --- a/app/views/commits/compare.html.haml +++ b/app/views/commits/compare.html.haml @@ -14,13 +14,13 @@ %br - = form_tag compare_project_commits_path(@project), :method => :get do + = form_tag compare_project_commits_path(@project), method: :get do .clearfix - = text_field_tag :from, params[:from], :placeholder => "master", :class => "xlarge" + = text_field_tag :from, params[:from], placeholder: "master", class: "xlarge" = "..." - = text_field_tag :to, params[:to], :placeholder => "aa8b4ef", :class => "xlarge" + = text_field_tag :to, params[:to], placeholder: "aa8b4ef", class: "xlarge" .actions - = submit_tag "Compare", :class => "btn btn-primary" + = submit_tag "Compare", class: "btn btn-primary" - unless @commits.empty? @@ -30,7 +30,7 @@ - unless @diffs.empty? %h4 Diff - = render "commits/diffs", :diffs => @diffs + = render "commits/diffs", diffs: @diffs :javascript $(function() { diff --git a/app/views/commits/index.html.haml b/app/views/commits/index.html.haml index 385b4357e4e..11ffdb6afc3 100644 --- a/app/views/commits/index.html.haml +++ b/app/views/commits/index.html.haml @@ -9,12 +9,12 @@ %span.divider \/ %li - %a{:href => "#"}= params[:path].split("/").join(" / ") + %a{href: "#"}= params[:path].split("/").join(" / ") -%div{:id => dom_id(@project)} +%div{id: dom_id(@project)} #commits_list= render "commits" .clear -.loading{ :style => "display:none;"} +.loading{ style: "display:none;"} - if @commits.count == @limit :javascript diff --git a/app/views/commits/index.js.haml b/app/views/commits/index.js.haml index 39b7108c505..797bc14cc1b 100644 --- a/app/views/commits/index.js.haml +++ b/app/views/commits/index.js.haml @@ -1,3 +1,3 @@ :plain - CommitsList.append(#{@commits.count}, "#{escape_javascript(render(:partial => 'commits/commits'))}"); + CommitsList.append(#{@commits.count}, "#{escape_javascript(render(partial: 'commits/commits'))}"); diff --git a/app/views/commits/show.html.haml b/app/views/commits/show.html.haml index 7119bd04b9e..9a483aa2a9a 100644 --- a/app/views/commits/show.html.haml +++ b/app/views/commits/show.html.haml @@ -1,6 +1,6 @@ = render "commits/commit_box" -= render "commits/diffs", :diffs => @commit.diffs -= render "notes/notes", :tid => @commit.id, :tt => "commit" += render "commits/diffs", diffs: @commit.diffs += render "notes/notes", tid: @commit.id, tt: "commit" = render "notes/per_line_form" diff --git a/app/views/dashboard/index.html.haml b/app/views/dashboard/index.html.haml index e1d7781927a..9fea5acb7cd 100644 --- a/app/views/dashboard/index.html.haml +++ b/app/views/dashboard/index.html.haml @@ -6,7 +6,7 @@ %span You wont be able to pull/push project code unless you %strong - = link_to new_key_path, :class => "vlink" do + = link_to new_key_path, class: "vlink" do add new key to your profile - if @events.any? @@ -15,7 +15,7 @@ %h4.nothing_here_message Projects activity will be displayed here .loading.hide .side - = render "events/event_last_push", :event => @last_push + = render "events/event_last_push", event: @last_push .projects_box %h5 Projects @@ -23,23 +23,23 @@ (#{@projects.total_count}) - if current_user.can_create_project? %span.right - = link_to new_project_path, :class => "btn very_small info" do + = link_to new_project_path, class: "btn very_small info" do %i.icon-plus New Project - @projects.each do |project| - = link_to project_path(project), :class => dom_class(project) do + = link_to project_path(project), class: dom_class(project) do %h4 %span.ico.project - = truncate(project.name, :length => 25) + = truncate(project.name, length: 25) %span.right → - .bottom= paginate @projects, :theme => "gitlab" + .bottom= paginate @projects, theme: "gitlab" %hr %div %span.rss-icon - = link_to dashboard_path(:atom, { :private_token => current_user.private_token }) do - = image_tag "rss_ui.png", :title => "feed" + = link_to dashboard_path(:atom, { private_token: current_user.private_token }) do + = image_tag "rss_ui.png", title: "feed" %strong News Feed - else @@ -51,7 +51,7 @@ = current_user.projects_limit projects. Click on button below to add a new one .link_holder - = link_to new_project_path, :class => "btn primary" do + = link_to new_project_path, class: "btn primary" do New Project » - else If you will be added to project - it will be displayed here diff --git a/app/views/dashboard/issues.html.haml b/app/views/dashboard/issues.html.haml index 5b20bffe783..cc488d57e9e 100644 --- a/app/views/dashboard/issues.html.haml +++ b/app/views/dashboard/issues.html.haml @@ -12,8 +12,8 @@ %h5= @project.name %ul.unstyled.issues_table - group[1].each do |issue| - = render(:partial => 'issues/show', :locals => {:issue => issue}) + = render(partial: 'issues/show', locals: {issue: issue}) %hr - = paginate @issues, :theme => "gitlab" + = paginate @issues, theme: "gitlab" - else %h3.nothing_here_message Nothing to show here diff --git a/app/views/dashboard/merge_requests.html.haml b/app/views/dashboard/merge_requests.html.haml index 11176102dcc..23a7e7222d7 100644 --- a/app/views/dashboard/merge_requests.html.haml +++ b/app/views/dashboard/merge_requests.html.haml @@ -10,9 +10,9 @@ - @project = group[0] %h5= @project.name - group[1].each do |merge_request| - = render(:partial => 'merge_requests/merge_request', :locals => {:merge_request => merge_request}) + = render(partial: 'merge_requests/merge_request', locals: {merge_request: merge_request}) %hr - = paginate @merge_requests, :theme => "gitlab" + = paginate @merge_requests, theme: "gitlab" - else %h3.nothing_here_message Nothing to show here diff --git a/app/views/deploy_keys/_form.html.haml b/app/views/deploy_keys/_form.html.haml index 2aa57cdc59b..461f1f5d84a 100644 --- a/app/views/deploy_keys/_form.html.haml +++ b/app/views/deploy_keys/_form.html.haml @@ -1,5 +1,5 @@ %div - = form_for [@project, @key], :url => project_deploy_keys_path do |f| + = form_for [@project, @key], url: project_deploy_keys_path do |f| -if @key.errors.any? .alert-message.block-message.error %ul @@ -11,8 +11,8 @@ .input= f.text_field :title .clearfix = f.label :key - .input= f.text_area :key, :class => "xlarge" + .input= f.text_area :key, class: "xlarge" .actions - = f.submit 'Save', :class => "primary btn" - = link_to "Cancel", project_deploy_keys_path(@project), :class => "btn" + = f.submit 'Save', class: "primary btn" + = link_to "Cancel", project_deploy_keys_path(@project), class: "btn" diff --git a/app/views/deploy_keys/_show.html.haml b/app/views/deploy_keys/_show.html.haml index ff17b3cd66c..a5314ae92ad 100644 --- a/app/views/deploy_keys/_show.html.haml +++ b/app/views/deploy_keys/_show.html.haml @@ -1,6 +1,6 @@ %tr %td - %a{:href => project_deploy_key_path(key.project, key)} + %a{href: project_deploy_key_path(key.project, key)} %strong= key.title %td %span.update-author @@ -8,5 +8,5 @@ = time_ago_in_words(key.created_at) ago %td - = link_to 'Remove', project_deploy_key_path(key.project, key), :confirm => 'Are you sure?', :method => :delete, :class => "danger btn delete-key small right" + = link_to 'Remove', project_deploy_key_path(key.project, key), confirm: 'Are you sure?', method: :delete, class: "danger btn delete-key small right" diff --git a/app/views/deploy_keys/index.html.haml b/app/views/deploy_keys/index.html.haml index 19899de3cf6..0ee9d03b0f5 100644 --- a/app/views/deploy_keys/index.html.haml +++ b/app/views/deploy_keys/index.html.haml @@ -2,10 +2,10 @@ - if can? current_user, :admin_project, @project .alert-message.block-message Deploy keys allow read-only access to repository. - = link_to new_project_deploy_key_path(@project), :class => "btn small", :title => "New Deploy Key" do + = link_to new_project_deploy_key_path(@project), class: "btn small", title: "New Deploy Key" do Add Deploy Key - if @keys.any? %table - @keys.each do |key| - = render(:partial => 'show', :locals => {:key => key}) + = render(partial: 'show', locals: {key: key}) diff --git a/app/views/deploy_keys/show.html.haml b/app/views/deploy_keys/show.html.haml index 16c441bea73..b1e0dc5ce27 100644 --- a/app/views/deploy_keys/show.html.haml +++ b/app/views/deploy_keys/show.html.haml @@ -3,5 +3,5 @@ %hr %pre= @key.key .actions - = link_to 'Remove', project_deploy_key_path(@key.project, @key), :confirm => 'Are you sure?', :method => :delete, :class => "danger btn delete-key" + = link_to 'Remove', project_deploy_key_path(@key.project, @key), confirm: 'Are you sure?', method: :delete, class: "danger btn delete-key" .clear diff --git a/app/views/devise/passwords/edit.html.haml b/app/views/devise/passwords/edit.html.haml index dfd715ac13b..31d355673ab 100644 --- a/app/views/devise/passwords/edit.html.haml +++ b/app/views/devise/passwords/edit.html.haml @@ -1,12 +1,12 @@ -= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put, :class => "login-box" }) do |f| - = image_tag "login-logo.png", :width => "304", :height => "66", :class => "login-logo", :alt => "Login Logo" += form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put, class: "login-box" }) do |f| + = image_tag "login-logo.png", width: "304", height: "66", class: "login-logo", alt: "Login Logo" %h3 Change your password = devise_error_messages! = f.hidden_field :reset_password_token %div - = f.password_field :password, :class => "text top", :placeholder => "New password" + = f.password_field :password, class: "text top", placeholder: "New password" %div - = f.password_field :password_confirmation, :class => "text bottom", :placeholder => "Confirm new password" + = f.password_field :password_confirmation, class: "text bottom", placeholder: "Confirm new password" %div - = f.submit "Change my password", :class => "btn primary" - .right= render :partial => "devise/shared/links" + = f.submit "Change my password", class: "btn primary" + .right= render partial: "devise/shared/links" diff --git a/app/views/errors/access_denied.html.haml b/app/views/errors/access_denied.html.haml index 718663dbee1..644ee03ec9f 100644 --- a/app/views/errors/access_denied.html.haml +++ b/app/views/errors/access_denied.html.haml @@ -2,4 +2,4 @@ %h3 Access Denied %hr %p Youre not allowed to access this page - %p Read more about project permissions #{link_to "here", help_permissions_path, :class => "vlink"} + %p Read more about project permissions #{link_to "here", help_permissions_path, class: "vlink"} diff --git a/app/views/events/_commit.html.haml b/app/views/events/_commit.html.haml index ca0f29e2d6b..15f3bb5a97d 100644 --- a/app/views/events/_commit.html.haml +++ b/app/views/events/_commit.html.haml @@ -1,9 +1,9 @@ - commit = CommitDecorator.decorate(commit) %li.wll.commit %p - = link_to commit.short_id(8), project_commit_path(project, :id => commit.id), :class => "commit_short_id" + = link_to commit.short_id(8), project_commit_path(project, id: commit.id), class: "commit_short_id" %strong.cdark= commit.author_name – - = image_tag gravatar_icon(commit.author_email), :class => "avatar", :width => 16 - = gfm truncate(commit.title, :length => 50), project_commit_path(project, :id => commit.id) rescue "--broken encoding" + = image_tag gravatar_icon(commit.author_email), class: "avatar", width: 16 + = gfm truncate(commit.title, length: 50), project_commit_path(project, id: commit.id) rescue "--broken encoding" diff --git a/app/views/events/_event.html.haml b/app/views/events/_event.html.haml index b3db83c26dd..d49f0382dea 100644 --- a/app/views/events/_event.html.haml +++ b/app/views/events/_event.html.haml @@ -1,13 +1,13 @@ - if event.allowed? - if event.issue? .event_feed - = render "events/event_issue", :event => event + = render "events/event_issue", event: event - elsif event.merge_request? .event_feed - = render "events/event_merge_request", :event => event + = render "events/event_merge_request", event: event - elsif event.push? .event_feed - = render "events/event_push", :event => event + = render "events/event_push", event: event diff --git a/app/views/events/_event_issue.html.haml b/app/views/events/_event_issue.html.haml index 4293be8204e..4d357b7f912 100644 --- a/app/views/events/_event_issue.html.haml +++ b/app/views/events/_event_issue.html.haml @@ -1,6 +1,6 @@ -= image_tag gravatar_icon(event.author_email), :class => "avatar" += image_tag gravatar_icon(event.author_email), class: "avatar" %strong #{event.author_name} -%span.event_label{:class => event.action_name}= event.action_name +%span.event_label{class: event.action_name}= event.action_name issue = link_to project_issue_path(event.project, event.issue) do %strong= truncate event.issue_title diff --git a/app/views/events/_event_last_push.html.haml b/app/views/events/_event_last_push.html.haml index 212ef817e60..4ef927495ae 100644 --- a/app/views/events/_event_last_push.html.haml +++ b/app/views/events/_event_last_push.html.haml @@ -1,13 +1,13 @@ - if show_last_push_widget?(event) .event_lp %div - = image_tag gravatar_icon(event.author_email), :class => "avatar" + = image_tag gravatar_icon(event.author_email), class: "avatar" %span Your pushed to = event.ref_type - = link_to project_commits_path(event.project, :ref => event.ref_name) do - %strong= truncate(event.ref_name, :length => 28) + = link_to project_commits_path(event.project, ref: event.ref_name) do + %strong= truncate(event.ref_name, length: 28) at %strong= link_to event.project.name, event.project - = link_to new_mr_path_from_push_event(event), :title => "New Merge Request", :class => "btn very_small primary" do + = link_to new_mr_path_from_push_event(event), title: "New Merge Request", class: "btn very_small primary" do Create Merge Request diff --git a/app/views/events/_event_merge_request.html.haml b/app/views/events/_event_merge_request.html.haml index 774921a7f2a..ceb39371a3a 100644 --- a/app/views/events/_event_merge_request.html.haml +++ b/app/views/events/_event_merge_request.html.haml @@ -1,8 +1,8 @@ - if event.action_name == "merged" .event_icon= image_tag "event_mr_merged.png" -= image_tag gravatar_icon(event.author_email), :class => "avatar" += image_tag gravatar_icon(event.author_email), class: "avatar" %strong #{event.author_name} -%span.event_label{:class => event.action_name}= event.action_name +%span.event_label{class: event.action_name}= event.action_name merge request = link_to project_merge_request_path(event.project, event.merge_request) do %strong= truncate event.merge_request_title diff --git a/app/views/events/_event_push.html.haml b/app/views/events/_event_push.html.haml index 59d8962bb16..0adcaf9d10e 100644 --- a/app/views/events/_event_push.html.haml +++ b/app/views/events/_event_push.html.haml @@ -1,10 +1,10 @@ %div .event_icon= image_tag "event_push.png" - = image_tag gravatar_icon(event.author_email), :class => "avatar" + = image_tag gravatar_icon(event.author_email), class: "avatar" %strong #{event.author_name} %span.event_label.pushed= event.push_action_name = event.ref_type - = link_to project_commits_path(event.project, :ref => event.ref_name) do + = link_to project_commits_path(event.project, ref: event.ref_name) do %strong= event.ref_name at %strong= link_to event.project.name, event.project @@ -14,17 +14,17 @@ - if event.push_with_commits? - if event.commits_count > 1 - = link_to compare_project_commits_path(event.project, :from => event.parent_commit.id, :to => event.last_commit.id) do + = link_to compare_project_commits_path(event.project, from: event.parent_commit.id, to: event.last_commit.id) do %strong #{event.parent_commit.id[0..7]}...#{event.last_commit.id[0..7]} - project = event.project %ul.unstyled.event_commits - if event.commits_count > 3 - event.commits[0...2].each do |commit| - = render "events/commit", :commit => commit, :project => project + = render "events/commit", commit: commit, project: project %li %br \... and #{event.commits_count - 2} more commits - else - event.commits.each do |commit| - = render "events/commit", :commit => commit, :project => project + = render "events/commit", commit: commit, project: project diff --git a/app/views/help/api.html.haml b/app/views/help/api.html.haml index e184df549de..344f8ade755 100644 --- a/app/views/help/api.html.haml +++ b/app/views/help/api.html.haml @@ -6,13 +6,13 @@ %ol %li - %a{:href => "#README"} README + %a{href: "#README"} README %li - %a{:href => "#projects"} Projects + %a{href: "#projects"} Projects %li - %a{:href => "#users"} Users + %a{href: "#users"} Users %li - %a{:href => "#issues"} Issues + %a{href: "#issues"} Issues .file_holder#README .file_title diff --git a/app/views/hooks/index.html.haml b/app/views/hooks/index.html.haml index 15699fc4390..4e15dc50ee8 100644 --- a/app/views/hooks/index.html.haml +++ b/app/views/hooks/index.html.haml @@ -6,9 +6,9 @@ Post receive hooks for binding events when someone push to repository. %br Read more about web hooks - %strong #{link_to "here", help_web_hooks_path, :class => "vlink"} + %strong #{link_to "here", help_web_hooks_path, class: "vlink"} -= form_for [@project, @hook], :as => :hook, :url => project_hooks_path(@project) do |f| += form_for [@project, @hook], as: :hook, url: project_hooks_path(@project) do |f| -if @hook.errors.any? .alert-message.block-message.error - @hook.errors.full_messages.each do |msg| @@ -16,9 +16,9 @@ .clearfix = f.label :url, "URL:" .input - = f.text_field :url, :class => "text_field xxlarge" + = f.text_field :url, class: "text_field xxlarge" - = f.submit "Add Web Hook", :class => "btn primary" + = f.submit "Add Web Hook", class: "btn primary" %hr -if @hooks.any? @@ -36,7 +36,7 @@ %td = link_to project_hook_path(@project, hook) do %strong= hook.url - = link_to 'Test Hook', test_project_hook_path(@project, hook), :class => "btn small right" + = link_to 'Test Hook', test_project_hook_path(@project, hook), class: "btn small right" %td POST %td - = link_to 'Remove', project_hook_path(@project, hook), :confirm => 'Are you sure?', :method => :delete, :class => "danger btn small right" + = link_to 'Remove', project_hook_path(@project, hook), confirm: 'Are you sure?', method: :delete, class: "danger btn small right" diff --git a/app/views/issues/_form.html.haml b/app/views/issues/_form.html.haml index 4f6f8396661..6139f3d4cbc 100644 --- a/app/views/issues/_form.html.haml +++ b/app/views/issues/_form.html.haml @@ -1,6 +1,6 @@ %div.issue-form-holder %h3= @issue.new_record? ? "New Issue" : "Edit Issue ##{@issue.id}" - = form_for [@project, @issue], :remote => request.xhr? do |f| + = form_for [@project, @issue], remote: request.xhr? do |f| -if @issue.errors.any? .alert-message.block-message.error %ul @@ -12,18 +12,18 @@ = f.label :title do %strong= "Subject *" .input - = f.text_field :title, :maxlength => 255, :class => "xxlarge" + = f.text_field :title, maxlength: 255, class: "xxlarge" .issue_middle_block .issue_assignee = f.label :assignee_id do %i.icon-user Assign to - .input= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select a user" }) + .input= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { include_blank: "Select a user" }) .issue_milestone = f.label :milestone_id do %i.icon-time Milestone - .input= f.select(:milestone_id, @project.milestones.active.all.collect {|p| [ p.title, p.id ] }, { :include_blank => "Select milestone" }) + .input= f.select(:milestone_id, @project.milestones.active.all.collect {|p| [ p.title, p.id ] }, { include_blank: "Select milestone" }) .issue_description .clearfix @@ -31,26 +31,26 @@ %i.icon-tag Labels .input - = f.text_field :label_list, :maxlength => 2000, :class => "xxlarge" + = f.text_field :label_list, maxlength: 2000, class: "xxlarge" %p.hint Separate with comma. .clearfix = f.label :description, "Details" .input - = f.text_area :description, :maxlength => 2000, :class => "xxlarge", :rows => 14 + = f.text_area :description, maxlength: 2000, class: "xxlarge", rows: 14 %p.hint Markdown is enabled. .actions - if @issue.new_record? - = f.submit 'Submit new issue', :class => "primary btn" + = f.submit 'Submit new issue', class: "primary btn" -else - = f.submit 'Save changes', :class => "primary btn" + = f.submit 'Save changes', class: "primary btn" - if request.xhr? - = link_to "Cancel", "#back", :onclick => "backToIssues();", :class => "btn" + = link_to "Cancel", "#back", onclick: "backToIssues();", class: "btn" - else - if @issue.new_record? - = link_to "Cancel", project_issues_path(@project), :class => "btn" + = link_to "Cancel", project_issues_path(@project), class: "btn" - else - = link_to "Cancel", project_issue_path(@project, @issue), :class => "btn" + = link_to "Cancel", project_issue_path(@project, @issue), class: "btn" diff --git a/app/views/issues/_head.html.haml b/app/views/issues/_head.html.haml index 701b0625852..1f6e7d7f81f 100644 --- a/app/views/issues/_head.html.haml +++ b/app/views/issues/_head.html.haml @@ -1,11 +1,11 @@ %ul.nav.nav-tabs - %li{:class => "#{'active' if current_page?(project_issues_path(@project))}"} - = link_to project_issues_path(@project), :class => "tab" do + %li{class: "#{'active' if current_page?(project_issues_path(@project))}"} + = link_to project_issues_path(@project), class: "tab" do Browse Issues - %li{:class => "#{'active' if current_page?(project_milestones_path(@project))}"} - = link_to project_milestones_path(@project), :class => "tab" do + %li{class: "#{'active' if current_page?(project_milestones_path(@project))}"} + = link_to project_milestones_path(@project), class: "tab" do Milestones %li.right %span.rss-icon - = link_to project_issues_path(@project, :atom, { :private_token => current_user.private_token }) do - = image_tag "rss_ui.png", :title => "feed" + = link_to project_issues_path(@project, :atom, { private_token: current_user.private_token }) do + = image_tag "rss_ui.png", title: "feed" diff --git a/app/views/issues/_issues.html.haml b/app/views/issues/_issues.html.haml index fc515ec3b49..f82ae8bde58 100644 --- a/app/views/issues/_issues.html.haml +++ b/app/views/issues/_issues.html.haml @@ -1,10 +1,10 @@ - @issues.each do |issue| - = render(:partial => 'issues/show', :locals => {:issue => issue}) + = render(partial: 'issues/show', locals: {issue: issue}) - if @issues.present? %li.bottom .row - .span7= paginate @issues, :remote => true, :theme => "gitlab" + .span7= paginate @issues, remote: true, theme: "gitlab" .span3.right %span.cgray.right %span.issue_counter #{@issues.total_count} diff --git a/app/views/issues/_show.html.haml b/app/views/issues/_show.html.haml index ed27bddd034..8500cd40a6e 100644 --- a/app/views/issues/_show.html.haml +++ b/app/views/issues/_show.html.haml @@ -1,7 +1,7 @@ -%li.wll{ :id => dom_id(issue), :class => issue_css_classes(issue), :url => project_issue_path(issue.project, issue) } +%li.wll{ id: dom_id(issue), class: issue_css_classes(issue), url: project_issue_path(issue.project, issue) } - if controller.controller_name == 'issues' .issue_check - = check_box_tag dom_id(issue,"selected"), nil, false, 'data-id' => issue.id, :class => "selected_issue", :disabled => !can?(current_user, :modify_issue, issue) + = check_box_tag dom_id(issue,"selected"), nil, false, 'data-id' => issue.id, class: "selected_issue", disabled: !can?(current_user, :modify_issue, issue) .right - issue.labels.each do |label| %span.label.label-issue.grouped @@ -13,19 +13,19 @@ = issue.notes.count - if can? current_user, :modify_issue, issue - if issue.closed - = link_to 'Reopen', project_issue_path(issue.project, issue, :issue => {:closed => false }, :status_only => true), :method => :put, :class => "btn small grouped reopen_issue", :remote => true + = link_to 'Reopen', project_issue_path(issue.project, issue, issue: {closed: false }, status_only: true), method: :put, class: "btn small grouped reopen_issue", remote: true - else - = link_to 'Resolve', project_issue_path(issue.project, issue, :issue => {:closed => true }, :status_only => true), :method => :put, :class => "success btn small grouped close_issue", :remote => true - = link_to edit_project_issue_path(issue.project, issue), :class => "btn small edit-issue-link", :remote => true do + = link_to 'Resolve', project_issue_path(issue.project, issue, issue: {closed: true }, status_only: true), method: :put, class: "success btn small grouped close_issue", remote: true + = link_to edit_project_issue_path(issue.project, issue), class: "btn small edit-issue-link", remote: true do %i.icon-edit Edit - if issue.assignee - = image_tag gravatar_icon(issue.assignee_email), :class => "avatar" + = image_tag gravatar_icon(issue.assignee_email), class: "avatar" - else - = image_tag "no_avatar.png", :class => "avatar" + = image_tag "no_avatar.png", class: "avatar" - %p= link_to_gfm truncate(issue.title, :length => 100), project_issue_path(issue.project, issue), :class => "row_title" + %p= link_to_gfm truncate(issue.title, length: 100), project_issue_path(issue.project, issue), class: "row_title" %span.update-author %small.cdark= "##{issue.id}" diff --git a/app/views/issues/create.js.haml b/app/views/issues/create.js.haml index abf3f6b858b..d90cbf0d30c 100644 --- a/app/views/issues/create.js.haml +++ b/app/views/issues/create.js.haml @@ -1,7 +1,7 @@ - if @issue.valid? :plain switchFromNewIssue(); - $("#issues-table").prepend("#{escape_javascript(render(:partial => 'show', :locals => {:issue => @issue}))}"); + $("#issues-table").prepend("#{escape_javascript(render(partial: 'show', locals: {issue: @issue}))}"); $.ajax({type: "GET", url: location.href, dataType: "script"}); - else :plain diff --git a/app/views/issues/index.html.haml b/app/views/issues/index.html.haml index 27eff501578..f3c743f75c3 100644 --- a/app/views/issues/index.html.haml +++ b/app/views/issues/index.html.haml @@ -6,51 +6,51 @@ .right .span5 - if can? current_user, :write_issue, @project - = link_to new_project_issue_path(@project), :class => "right btn small", :title => "New Issue", :remote => true do + = link_to new_project_issue_path(@project), class: "right btn small", title: "New Issue", remote: true do New Issue - = form_tag search_project_issues_path(@project), :method => :get, :remote => true, :id => "issue_search_form", :class => :right do - = hidden_field_tag :project_id, @project.id, { :id => 'project_id' } + = form_tag search_project_issues_path(@project), method: :get, remote: true, id: "issue_search_form", class: :right do + = hidden_field_tag :project_id, @project.id, { id: 'project_id' } = hidden_field_tag :status, params[:f] - = search_field_tag :issue_search, nil, { :placeholder => 'Search', :class => 'issue_search span3 right neib' } + = search_field_tag :issue_search, nil, { placeholder: 'Search', class: 'issue_search span3 right neib' } .clearfix %div#issues-table-holder.ui-box .title - = check_box_tag "check_all_issues", nil, false, :class => "check_all_issues left" + = check_box_tag "check_all_issues", nil, false, class: "check_all_issues left" .issues_bulk_update.hide - = form_tag bulk_update_project_issues_path(@project), :method => :post do + = form_tag bulk_update_project_issues_path(@project), method: :post do %span.update_issues_text Update selected issues with .left - = select_tag('update[status]', options_for_select(['open', 'closed']), :prompt => "Status") - = select_tag('update[assignee_id]', options_from_collection_for_select(@project.users.all, "id", "name", params[:assignee_id]), :prompt => "Assignee") - = select_tag('update[milestone_id]', options_from_collection_for_select(@project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), :prompt => "Milestone") + = select_tag('update[status]', options_for_select(['open', 'closed']), prompt: "Status") + = select_tag('update[assignee_id]', options_from_collection_for_select(@project.users.all, "id", "name", params[:assignee_id]), prompt: "Assignee") + = select_tag('update[milestone_id]', options_from_collection_for_select(@project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), prompt: "Milestone") = hidden_field_tag 'update[issues_ids]', [] = hidden_field_tag :f, params[:f] - = button_tag "Save", :class => "btn update_selected_issues" + = button_tag "Save", class: "btn update_selected_issues" .issues_filters .left %ul.nav.nav-pills.left - %li{:class => ("active" if (params[:f] == issues_filter[:open] || !params[:f]))} - = link_to project_issues_path(@project, :f => issues_filter[:open], :milestone_id => params[:milestone_id]) do + %li{class: ("active" if (params[:f] == issues_filter[:open] || !params[:f]))} + = link_to project_issues_path(@project, f: issues_filter[:open], milestone_id: params[:milestone_id]) do Open - %li{:class => ("active" if params[:f] == issues_filter[:closed])} - = link_to project_issues_path(@project, :f => issues_filter[:closed], :milestone_id => params[:milestone_id]) do + %li{class: ("active" if params[:f] == issues_filter[:closed])} + = link_to project_issues_path(@project, f: issues_filter[:closed], milestone_id: params[:milestone_id]) do Closed - %li{:class => ("active" if params[:f] == issues_filter[:to_me])} - = link_to project_issues_path(@project, :f => issues_filter[:to_me], :milestone_id => params[:milestone_id]) do + %li{class: ("active" if params[:f] == issues_filter[:to_me])} + = link_to project_issues_path(@project, f: issues_filter[:to_me], milestone_id: params[:milestone_id]) do To Me - %li{:class => ("active" if params[:f] == issues_filter[:all])} - = link_to project_issues_path(@project, :f => issues_filter[:all], :milestone_id => params[:milestone_id]) do + %li{class: ("active" if params[:f] == issues_filter[:all])} + = link_to project_issues_path(@project, f: issues_filter[:all], milestone_id: params[:milestone_id]) do All .right - = form_tag project_issues_path(@project), :method => :get, :class => :right do - = select_tag(:label_name, options_for_select(issue_tags, params[:label_name]), :prompt => "Labels") - = select_tag(:assignee_id, options_from_collection_for_select(@project.users.all, "id", "name", params[:assignee_id]), :prompt => "Assignee") - = select_tag(:milestone_id, options_from_collection_for_select(@project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), :prompt => "Milestone") + = form_tag project_issues_path(@project), method: :get, class: :right do + = select_tag(:label_name, options_for_select(issue_tags, params[:label_name]), prompt: "Labels") + = select_tag(:assignee_id, options_from_collection_for_select(@project.users.all, "id", "name", params[:assignee_id]), prompt: "Assignee") + = select_tag(:milestone_id, options_from_collection_for_select(@project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), prompt: "Milestone") = hidden_field_tag :f, params[:f] .clearfix diff --git a/app/views/issues/show.html.haml b/app/views/issues/show.html.haml index c653377a68d..dce8cf6a59d 100644 --- a/app/views/issues/show.html.haml +++ b/app/views/issues/show.html.haml @@ -8,11 +8,11 @@ %span.right - if can?(current_user, :admin_project, @project) || @issue.author == current_user - if @issue.closed - = link_to 'Reopen', project_issue_path(@project, @issue, :issue => {:closed => false }, :status_only => true), :method => :put, :class => "btn small" + = link_to 'Reopen', project_issue_path(@project, @issue, issue: {closed: false }, status_only: true), method: :put, class: "btn small" - else - = link_to 'Close', project_issue_path(@project, @issue, :issue => {:closed => true }, :status_only => true), :method => :put, :class => "btn small", :title => "Close Issue" + = link_to 'Close', project_issue_path(@project, @issue, issue: {closed: true }, status_only: true), method: :put, class: "btn small", title: "Close Issue" - if can?(current_user, :admin_project, @project) || @issue.author == current_user - = link_to edit_project_issue_path(@project, @issue), :class => "btn small" do + = link_to edit_project_issue_path(@project, @issue), class: "btn small" do %i.icon-edit Edit @@ -35,18 +35,18 @@ .middle_box_content %cite.cgray Created by - = image_tag gravatar_icon(@issue.author_email), :width => 16, :class => "lil_av" + = image_tag gravatar_icon(@issue.author_email), width: 16, class: "lil_av" %strong.author= link_to_issue_author(@issue) - if @issue.assignee %cite.cgray and currently assigned to - = image_tag gravatar_icon(@issue.assignee_email), :width => 16, :class => "lil_av" + = image_tag gravatar_icon(@issue.assignee_email), width: 16, class: "lil_av" %strong.author= link_to_issue_assignee(@issue) - if @issue.milestone - milestone = @issue.milestone %cite.cgray and attached to milestone - %strong= link_to_gfm truncate(milestone.title, :length => 20), project_milestone_path(milestone.project, milestone) + %strong= link_to_gfm truncate(milestone.title, length: 20), project_milestone_path(milestone.project, milestone) .right - @issue.labels.each do |label| @@ -61,4 +61,4 @@ = markdown @issue.description -.issue_notes#notes= render "notes/notes", :tid => @issue.id, :tt => "issue" +.issue_notes#notes= render "notes/notes", tid: @issue.id, tt: "issue" diff --git a/app/views/kaminari/admin/_first_page.html.haml b/app/views/kaminari/admin/_first_page.html.haml index fee8112f6af..41c9c0b3af6 100644 --- a/app/views/kaminari/admin/_first_page.html.haml +++ b/app/views/kaminari/admin/_first_page.html.haml @@ -6,4 +6,4 @@ -# per_page: number of items to fetch per page -# remote: data-remote %span.first - = link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote + = link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, remote: remote diff --git a/app/views/kaminari/admin/_last_page.html.haml b/app/views/kaminari/admin/_last_page.html.haml index 6e41d232b51..b03a206224c 100644 --- a/app/views/kaminari/admin/_last_page.html.haml +++ b/app/views/kaminari/admin/_last_page.html.haml @@ -6,4 +6,4 @@ -# per_page: number of items to fetch per page -# remote: data-remote %span.last - = link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {:remote => remote} + = link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {remote: remote} diff --git a/app/views/kaminari/admin/_next_page.html.haml b/app/views/kaminari/admin/_next_page.html.haml index 76f40e72373..00c5f0b6f4e 100644 --- a/app/views/kaminari/admin/_next_page.html.haml +++ b/app/views/kaminari/admin/_next_page.html.haml @@ -6,4 +6,4 @@ -# per_page: number of items to fetch per page -# remote: data-remote %li.next - = link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote + = link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, rel: 'next', remote: remote diff --git a/app/views/kaminari/admin/_page.html.haml b/app/views/kaminari/admin/_page.html.haml index 5966812934f..a52d883b9a8 100644 --- a/app/views/kaminari/admin/_page.html.haml +++ b/app/views/kaminari/admin/_page.html.haml @@ -6,5 +6,5 @@ -# num_pages: total number of pages -# per_page: number of items to fetch per page -# remote: data-remote -%li{:class => "page#{' active' if page.current?}"} - = link_to page, url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} +%li{class: "page#{' active' if page.current?}"} + = link_to page, url, {remote: remote, rel: page.next? ? 'next' : page.prev? ? 'prev' : nil} diff --git a/app/views/kaminari/admin/_prev_page.html.haml b/app/views/kaminari/admin/_prev_page.html.haml index cef885ee0af..f673abdb3ae 100644 --- a/app/views/kaminari/admin/_prev_page.html.haml +++ b/app/views/kaminari/admin/_prev_page.html.haml @@ -5,5 +5,5 @@ -# num_pages: total number of pages -# per_page: number of items to fetch per page -# remote: data-remote -%li{:class => "prev" } - = link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote +%li{class: "prev" } + = link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, rel: 'prev', remote: remote diff --git a/app/views/kaminari/gitlab/_first_page.html.haml b/app/views/kaminari/gitlab/_first_page.html.haml index fee8112f6af..41c9c0b3af6 100644 --- a/app/views/kaminari/gitlab/_first_page.html.haml +++ b/app/views/kaminari/gitlab/_first_page.html.haml @@ -6,4 +6,4 @@ -# per_page: number of items to fetch per page -# remote: data-remote %span.first - = link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote + = link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, remote: remote diff --git a/app/views/kaminari/gitlab/_last_page.html.haml b/app/views/kaminari/gitlab/_last_page.html.haml index 6e41d232b51..b03a206224c 100644 --- a/app/views/kaminari/gitlab/_last_page.html.haml +++ b/app/views/kaminari/gitlab/_last_page.html.haml @@ -6,4 +6,4 @@ -# per_page: number of items to fetch per page -# remote: data-remote %span.last - = link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {:remote => remote} + = link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {remote: remote} diff --git a/app/views/kaminari/gitlab/_next_page.html.haml b/app/views/kaminari/gitlab/_next_page.html.haml index e87ab4e0534..296cceb080b 100644 --- a/app/views/kaminari/gitlab/_next_page.html.haml +++ b/app/views/kaminari/gitlab/_next_page.html.haml @@ -6,4 +6,4 @@ -# per_page: number of items to fetch per page -# remote: data-remote %span.next - = link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote + = link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, rel: 'next', remote: remote diff --git a/app/views/kaminari/gitlab/_page.html.haml b/app/views/kaminari/gitlab/_page.html.haml index 528bba8f116..19456dcc058 100644 --- a/app/views/kaminari/gitlab/_page.html.haml +++ b/app/views/kaminari/gitlab/_page.html.haml @@ -6,5 +6,5 @@ -# num_pages: total number of pages -# per_page: number of items to fetch per page -# remote: data-remote -%span{:class => "page#{' current' if page.current?}"} - = link_to_unless page.current?, page, url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} +%span{class: "page#{' current' if page.current?}"} + = link_to_unless page.current?, page, url, {remote: remote, rel: page.next? ? 'next' : page.prev? ? 'prev' : nil} diff --git a/app/views/kaminari/gitlab/_prev_page.html.haml b/app/views/kaminari/gitlab/_prev_page.html.haml index 13f0d8adec5..5c2061690ac 100644 --- a/app/views/kaminari/gitlab/_prev_page.html.haml +++ b/app/views/kaminari/gitlab/_prev_page.html.haml @@ -6,4 +6,4 @@ -# per_page: number of items to fetch per page -# remote: data-remote %span.prev - = link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote + = link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, rel: 'prev', remote: remote diff --git a/app/views/keys/_form.html.haml b/app/views/keys/_form.html.haml index c25e8d073b8..ee2eafddf3b 100644 --- a/app/views/keys/_form.html.haml +++ b/app/views/keys/_form.html.haml @@ -11,8 +11,8 @@ .input= f.text_field :title .clearfix = f.label :key - .input= f.text_area :key, :class => [:xxlarge, :thin_area] + .input= f.text_area :key, class: [:xxlarge, :thin_area] .actions - = f.submit 'Save', :class => "primary btn" - = link_to "Cancel", keys_path, :class => "btn" + = f.submit 'Save', class: "primary btn" + = link_to "Cancel", keys_path, class: "btn" diff --git a/app/views/keys/_show.html.haml b/app/views/keys/_show.html.haml index 7035e609f2c..a0af8eea44c 100644 --- a/app/views/keys/_show.html.haml +++ b/app/views/keys/_show.html.haml @@ -9,5 +9,5 @@ = time_ago_in_words(key.created_at) ago %td - = link_to 'Remove', key, :confirm => 'Are you sure?', :method => :delete, :class => "btn small danger delete-key right" + = link_to 'Remove', key, confirm: 'Are you sure?', method: :delete, class: "btn small danger delete-key right" diff --git a/app/views/keys/create.js.haml b/app/views/keys/create.js.haml index b0d7f528be1..1dccf6fdb91 100644 --- a/app/views/keys/create.js.haml +++ b/app/views/keys/create.js.haml @@ -1,7 +1,7 @@ - if @key.valid? :plain $("#new_key_dialog").dialog("close"); - $("#keys-table .data").append("#{escape_javascript(render(:partial => 'show', :locals => {:key => @key}))}"); + $("#keys-table .data").append("#{escape_javascript(render(partial: 'show', locals: {key: @key}))}"); $("#no_ssh_key_defined").hide(); - else :plain diff --git a/app/views/keys/index.html.haml b/app/views/keys/index.html.haml index 35cda178242..04e9e4cbc33 100644 --- a/app/views/keys/index.html.haml +++ b/app/views/keys/index.html.haml @@ -1,6 +1,6 @@ %h3.page_title SSH Keys - = link_to "Add new", new_key_path, :class => "btn small right" + = link_to "Add new", new_key_path, class: "btn small right" %hr %p.slead @@ -14,9 +14,9 @@ %th Added %th - @keys.each do |key| - = render(:partial => 'show', :locals => {:key => key}) + = render(partial: 'show', locals: {key: key}) - if @keys.blank? %tr - %td{:colspan => 3} + %td{colspan: 3} %h3.nothing_here_message There are no SSH keys with access to your account. diff --git a/app/views/keys/show.html.haml b/app/views/keys/show.html.haml index 79f51257fd9..ffd52b96e5a 100644 --- a/app/views/keys/show.html.haml +++ b/app/views/keys/show.html.haml @@ -11,4 +11,4 @@ %pre= @key.key .actions - = link_to 'Remove', @key, :confirm => 'Are you sure?', :method => :delete, :class => "btn danger delete-key" + = link_to 'Remove', @key, confirm: 'Are you sure?', method: :delete, class: "btn danger delete-key" diff --git a/app/views/layouts/_app_menu.html.haml b/app/views/layouts/_app_menu.html.haml index 6575ee99168..025314891f8 100644 --- a/app/views/layouts/_app_menu.html.haml +++ b/app/views/layouts/_app_menu.html.haml @@ -1,19 +1,19 @@ %ul.main_menu - %li.home{:class => tab_class(:root)} - = link_to "Home", root_path, :title => "Home" + %li.home{class: tab_class(:root)} + = link_to "Home", root_path, title: "Home" - %li{:class => tab_class(:dash_issues)} + %li{class: tab_class(:dash_issues)} = link_to dashboard_issues_path do Issues %span.count= current_user.assigned_issues.opened.count - %li{:class => tab_class(:dash_mr)} + %li{class: tab_class(:dash_mr)} = link_to dashboard_merge_requests_path do Merge Requests %span.count= current_user.cared_merge_requests.count - %li{:class => tab_class(:search)} + %li{class: tab_class(:search)} = link_to "Search", search_path - %li{:class => tab_class(:help)} + %li{class: tab_class(:help)} = link_to "Help", help_path diff --git a/app/views/layouts/_flash.html.haml b/app/views/layouts/_flash.html.haml index 2e40f0a6281..86564ad7110 100644 --- a/app/views/layouts/_flash.html.haml +++ b/app/views/layouts/_flash.html.haml @@ -1,6 +1,6 @@ - if alert || notice - text = alert || notice - %div{:style => "display:none", :id => "flash_container"} + %div{style: "display:none", id: "flash_container"} %center %h4= text :javascript diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml index e609557b17a..3a2586a3d38 100644 --- a/app/views/layouts/_head.html.haml +++ b/app/views/layouts/_head.html.haml @@ -1,5 +1,5 @@ %head - %meta{:charset => "utf-8"} + %meta{charset: "utf-8"} %title GitLab = " > #{@project.name}" if @project && !@project.new_record? @@ -9,10 +9,10 @@ -# Atom feed - if controller_name == 'projects' && action_name == 'index' - = auto_discovery_link_tag :atom, projects_url(:atom, :private_token => current_user.private_token), :title => "Dashboard feed" + = auto_discovery_link_tag :atom, projects_url(:atom, private_token: current_user.private_token), title: "Dashboard feed" - if @project && !@project.new_record? - if current_page?(tree_project_ref_path(@project, @project.root_ref)) || current_page?(project_commits_path(@project)) - = 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}") + = 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}") - if request.path == project_issues_path(@project) - = auto_discovery_link_tag(:atom, project_issues_url(@project, :atom, :private_token => current_user.private_token), :title => "#{@project.name} issues") + = auto_discovery_link_tag(:atom, project_issues_url(@project, :atom, private_token: current_user.private_token), title: "#{@project.name} issues") = csrf_meta_tags diff --git a/app/views/layouts/_head_panel.html.haml b/app/views/layouts/_head_panel.html.haml index 9e019021c89..d6247d36b0d 100644 --- a/app/views/layouts/_head_panel.html.haml +++ b/app/views/layouts/_head_panel.html.haml @@ -3,30 +3,30 @@ .container .top_panel_content %div.app_logo - = link_to root_path, :class => "home", :title => "Home" do + = link_to root_path, class: "home", title: "Home" do %h1 GITLAB %span.separator %h1.project_name= title .search - = form_tag search_path, :method => :get do |f| - = text_field_tag "search", nil, :placeholder => "Search", :class => "search-input" + = form_tag search_path, method: :get do |f| + = text_field_tag "search", nil, placeholder: "Search", class: "search-input" .fbtn - if current_user.is_admin? - = link_to admin_root_path, :class => "btn small", :title => "Admin area" do + = link_to admin_root_path, class: "btn small", title: "Admin area" do %i.icon-cog Admin - if current_user.can_create_project? - = link_to new_project_path, :class => "btn small", :title => "Create New Project" do + = link_to new_project_path, class: "btn small", title: "Create New Project" do %i.icon-plus Project .account-box - = link_to profile_path, :class => "pic" do + = link_to profile_path, class: "pic" do = image_tag gravatar_icon(current_user.email) .account-links - = link_to profile_path, :class => "username" do + = link_to profile_path, class: "username" do My profile - = link_to 'Logout', destroy_user_session_path, :class => "logout", :method => :delete + = link_to 'Logout', destroy_user_session_path, class: "logout", method: :delete :javascript $(function(){ diff --git a/app/views/layouts/_project_menu.html.haml b/app/views/layouts/_project_menu.html.haml index 3f58fc5a664..04eaec5accc 100644 --- a/app/views/layouts/_project_menu.html.haml +++ b/app/views/layouts/_project_menu.html.haml @@ -1,37 +1,37 @@ %ul.main_menu - %li.home{:class => project_tab_class} - = link_to @project.code, project_path(@project), :title => "Project" + %li.home{class: project_tab_class} + = link_to @project.code, project_path(@project), title: "Project" - if @project.repo_exists? - if can? current_user, :download_code, @project - %li{:class => tree_tab_class} + %li{class: tree_tab_class} = link_to tree_project_ref_path(@project, @project.root_ref) do Files - %li{:class => commit_tab_class} + %li{class: commit_tab_class} = link_to "Commits", project_commits_path(@project) - %li{:class => tab_class(:network)} + %li{class: tab_class(:network)} = link_to "Network", graph_project_path(@project) - if @project.issues_enabled - %li{:class => tab_class(:issues)} + %li{class: tab_class(:issues)} = link_to project_issues_filter_path(@project) do Issues %span.count.issue_counter= @project.issues.opened.count - if @project.repo_exists? - if @project.merge_requests_enabled - %li{:class => tab_class(:merge_requests)} + %li{class: tab_class(:merge_requests)} = link_to project_merge_requests_path(@project) do Merge Requests %span.count.merge_counter= @project.merge_requests.opened.count - if @project.wall_enabled - %li{:class => tab_class(:wall)} + %li{class: tab_class(:wall)} = link_to wall_project_path(@project) do Wall - if @project.wiki_enabled - %li{:class => tab_class(:wiki)} + %li{class: tab_class(:wiki)} = link_to project_wiki_path(@project, :index) do Wiki diff --git a/app/views/layouts/admin.html.haml b/app/views/layouts/admin.html.haml index 69304edef3a..fa4ec6c938e 100644 --- a/app/views/layouts/admin.html.haml +++ b/app/views/layouts/admin.html.haml @@ -1,22 +1,22 @@ !!! 5 -%html{ :lang => "en"} +%html{ lang: "en"} = render "layouts/head" - %body{:class => "#{app_theme} admin"} + %body{class: "#{app_theme} admin"} = render "layouts/flash" - = render "layouts/head_panel", :title => "Admin area" + = render "layouts/head_panel", title: "Admin area" .container %ul.main_menu - %li.home{:class => tab_class(:admin_root)} + %li.home{class: tab_class(:admin_root)} = link_to "Stats", admin_root_path - %li{:class => tab_class(:admin_projects)} + %li{class: tab_class(:admin_projects)} = link_to "Projects", admin_projects_path - %li{:class => tab_class(:admin_users)} + %li{class: tab_class(:admin_users)} = link_to "Users", admin_users_path - %li{:class => tab_class(:admin_logs)} + %li{class: tab_class(:admin_logs)} = link_to "Logs", admin_logs_path - %li{:class => tab_class(:admin_emails)} + %li{class: tab_class(:admin_emails)} = link_to "Hooks", admin_hooks_path - %li{:class => tab_class(:admin_resque)} + %li{class: tab_class(:admin_resque)} = link_to "Resque", admin_resque_path .content= yield diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 0d5d829e00d..dda10d5d137 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -1,10 +1,10 @@ !!! 5 -%html{ :lang => "en"} +%html{ lang: "en"} = render "layouts/head" - %body{:class => "#{app_theme} application"} + %body{class: "#{app_theme} application"} = render "layouts/flash" - = render "layouts/head_panel", :title => "Dashboard" + = render "layouts/head_panel", title: "Dashboard" .container - = render :partial => "layouts/app_menu" + = render partial: "layouts/app_menu" .content = yield diff --git a/app/views/layouts/devise_layout.html.haml b/app/views/layouts/devise_layout.html.haml index c293734b368..70c4f007ba1 100644 --- a/app/views/layouts/devise_layout.html.haml +++ b/app/views/layouts/devise_layout.html.haml @@ -1,6 +1,6 @@ !!! 5 -%html{ :lang => "en"} +%html{ lang: "en"} = render "layouts/head" %body.ui_basic.login-page - = render :partial => "layouts/flash" + = render partial: "layouts/flash" .container= yield diff --git a/app/views/layouts/error.html.haml b/app/views/layouts/error.html.haml index 943dbe778c4..a512c4a58aa 100644 --- a/app/views/layouts/error.html.haml +++ b/app/views/layouts/error.html.haml @@ -1,9 +1,9 @@ !!! 5 -%html{ :lang => "en"} +%html{ lang: "en"} = render "layouts/head" - %body{:class => "#{app_theme} application"} + %body{class: "#{app_theme} application"} = render "layouts/flash" - = render "layouts/head_panel", :title => "" + = render "layouts/head_panel", title: "" .container .content %br diff --git a/app/views/layouts/notify.html.haml b/app/views/layouts/notify.html.haml index bebcf82dab8..a1938df43a1 100644 --- a/app/views/layouts/notify.html.haml +++ b/app/views/layouts/notify.html.haml @@ -1,6 +1,6 @@ -%html{:lang => "en"} +%html{lang: "en"} %head - %meta{:content => "text/html; charset=utf-8", "http-equiv" => "Content-Type"} + %meta{content: "text/html; charset=utf-8", "http-equiv" => "Content-Type"} %title gitlabhq :css @@ -11,28 +11,28 @@ .content a {color: #0eb6ce; text-decoration: none;} .footer p {font-size: 11px; color:#7d7a7a; margin: 0; padding: 0; font-family: Helvetica, Arial, sans-serif;} .footer a {color: #0eb6ce; text-decoration: none;} - %body{:bgcolor => "#EAEAEA", :style => "margin: 0; padding: 0; background: #EAEAEA"} - %table{:align => "center", :border => "0", :cellpadding => "0", :cellspacing => "0", :style => "padding: 35px 0; background: #EAEAEA;", :width => "100%"} + %body{bgcolor: "#EAEAEA", style: "margin: 0; padding: 0; background: #EAEAEA"} + %table{align: "center", border: "0", cellpadding: "0", cellspacing: "0", style: "padding: 35px 0; background: #EAEAEA;", width: "100%"} %tr - %td{:align => "center", :style => "margin: 0; padding: 0; background: #EAEAEA;"} - %table.header{:align => "center", :border => "0", :cellpadding => "0", :cellspacing => "0", :style => "font-family: Helvetica, Arial, sans-serif; background:#333", :width => "600"} + %td{align: "center", style: "margin: 0; padding: 0; background: #EAEAEA;"} + %table.header{align: "center", border: "0", cellpadding: "0", cellspacing: "0", style: "font-family: Helvetica, Arial, sans-serif; background:#333", width: "600"} %tr - %td{:style => "font-size: 0px;", :width => "20"} + %td{style: "font-size: 0px;", width: "20"} \ - %td{:align => "left", :style => "padding: 18px 0 10px;", :width => "580"} - %h1{:style => "color: #BBBBBB; font: normal 32px Helvetica, Arial, sans-serif; margin: 0; padding: 0; line-height: 40px;"} + %td{align: "left", style: "padding: 18px 0 10px;", width: "580"} + %h1{style: "color: #BBBBBB; font: normal 32px Helvetica, Arial, sans-serif; margin: 0; padding: 0; line-height: 40px;"} gitlab - if @project | #{@project.name} - %table{:align => "center", :bgcolor => "#fff", :border => "0", :cellpadding => "0", :cellspacing => "0", :style => "font-family: Helvetica, Arial, sans-serif; background: #fff;", :width => "600"} + %table{align: "center", bgcolor: "#fff", border: "0", cellpadding: "0", cellspacing: "0", style: "font-family: Helvetica, Arial, sans-serif; background: #fff;", width: "600"} %tr= yield %tr - %td{:align => "left", :colspan => "2", :height => "3", :style => "padding: font-size: 0; line-height: 0; height: 3px;", :width => "600"} - %table.footer{:align => "center", :border => "0", :cellpadding => "0", :cellspacing => "0", :style => "font-family: Helvetica, Arial, sans-serif; line-height: 10px;", :width => "600"} + %td{align: "left", colspan: "2", height: "3", style: "padding: font-size: 0; line-height: 0; height: 3px;", width: "600"} + %table.footer{align: "center", border: "0", cellpadding: "0", cellspacing: "0", style: "font-family: Helvetica, Arial, sans-serif; line-height: 10px;", width: "600"} %tr - %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"} + %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"} %br - %p{:style => "font-size: 11px; color:#7d7a7a; margin: 0; padding: 0; font-family: Helvetica, Arial, sans-serif;"} + %p{style: "font-size: 11px; color:#7d7a7a; margin: 0; padding: 0; font-family: Helvetica, Arial, sans-serif;"} You're receiving this notification because you are a member of the - if @project #{@project.name} diff --git a/app/views/layouts/profile.html.haml b/app/views/layouts/profile.html.haml index 957a68bf482..b624415dfe1 100644 --- a/app/views/layouts/profile.html.haml +++ b/app/views/layouts/profile.html.haml @@ -1,26 +1,26 @@ !!! 5 -%html{ :lang => "en"} +%html{ lang: "en"} = render "layouts/head" - %body{:class => "#{app_theme} profile"} + %body{class: "#{app_theme} profile"} = render "layouts/flash" - = render "layouts/head_panel", :title => "Profile" + = render "layouts/head_panel", title: "Profile" .container %ul.main_menu - %li.home{:class => tab_class(:profile)} + %li.home{class: tab_class(:profile)} = link_to "Profile", profile_path - %li{:class => tab_class(:password)} + %li{class: tab_class(:password)} = link_to "Password", profile_password_path - %li{:class => tab_class(:ssh_keys)} + %li{class: tab_class(:ssh_keys)} = link_to keys_path do SSH Keys %span.count= current_user.keys.count - %li{:class => tab_class(:token)} + %li{class: tab_class(:token)} = link_to "Token", profile_token_path - %li{:class => tab_class(:design)} + %li{class: tab_class(:design)} = link_to "Design", profile_design_path diff --git a/app/views/layouts/project.html.haml b/app/views/layouts/project.html.haml index d9843c65fce..56a947d2a9d 100644 --- a/app/views/layouts/project.html.haml +++ b/app/views/layouts/project.html.haml @@ -1,11 +1,11 @@ !!! 5 -%html{ :lang => "en"} +%html{ lang: "en"} = render "layouts/head" - %body{:class => "#{app_theme} project"} + %body{class: "#{app_theme} project"} = render "layouts/flash" - = render "layouts/head_panel", :title => @project.name + = render "layouts/head_panel", title: @project.name .container - = render :partial => "layouts/project_menu" + = render partial: "layouts/project_menu" .content = yield diff --git a/app/views/merge_requests/_form.html.haml b/app/views/merge_requests/_form.html.haml index 4f20a06fd25..b6c12397d6c 100644 --- a/app/views/merge_requests/_form.html.haml +++ b/app/views/merge_requests/_form.html.haml @@ -1,4 +1,4 @@ -= form_for [@project, @merge_request], :html => { :class => "new_merge_request form-horizontal" } do |f| += form_for [@project, @merge_request], html: { class: "new_merge_request form-horizontal" } do |f| -if @merge_request.errors.any? .alert-message.block-message.error %ul @@ -14,9 +14,9 @@ %h5 From (Head Branch) .body .padded - = f.label :source_branch, "From", :class => "control-label" + = f.label :source_branch, "From", class: "control-label" .controls - = f.select(:source_branch, @project.heads.map(&:name), { :include_blank => "Select branch" }, :style => "width:250px") + = f.select(:source_branch, @project.heads.map(&:name), { include_blank: "Select branch" }, style: "width:250px") .bottom_commit .mr_source_commit @@ -25,9 +25,9 @@ %h5 To (Base Branch) .body .padded - = f.label :target_branch, "To", :class => "control-label" + = f.label :target_branch, "To", class: "control-label" .controls - = f.select(:target_branch, @project.heads.map(&:name), { :include_blank => "Select branch" }, :style => "width:250px") + = f.select(:target_branch, @project.heads.map(&:name), { include_blank: "Select branch" }, style: "width:250px") .bottom_commit .mr_target_commit @@ -38,22 +38,22 @@ .top_box_content = f.label :title do %strong= "Title *" - .input= f.text_field :title, :class => "input-xxlarge pad", :maxlength => 255, :rows => 5 + .input= f.text_field :title, class: "input-xxlarge pad", maxlength: 255, rows: 5 .middle_box_content = f.label :assignee_id do %i.icon-user Assign to - .input= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" }, :style => "width:250px") + .input= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { include_blank: "Select user" }, style: "width:250px") .control-group .form-actions - = f.submit 'Save', :class => "btn-primary btn" + = f.submit 'Save', class: "btn-primary btn" - if @merge_request.new_record? - = link_to project_merge_requests_path(@project), :class => "btn" do + = link_to project_merge_requests_path(@project), class: "btn" do Cancel - else - = link_to project_merge_request_path(@project, @merge_request), :class => "btn" do + = link_to project_merge_request_path(@project, @merge_request), class: "btn" do Cancel diff --git a/app/views/merge_requests/_head.html.haml b/app/views/merge_requests/_head.html.haml index c578c794060..35a86e6511c 100644 --- a/app/views/merge_requests/_head.html.haml +++ b/app/views/merge_requests/_head.html.haml @@ -1,5 +1,5 @@ .top-tabs - = link_to project_merge_requests_path(@project), :class => "tab #{'active' if current_page?(project_merge_requests_path(@project)) }" do + = link_to project_merge_requests_path(@project), class: "tab #{'active' if current_page?(project_merge_requests_path(@project)) }" do %span Merge Requests diff --git a/app/views/merge_requests/_merge_request.html.haml b/app/views/merge_requests/_merge_request.html.haml index 59af97a3cd8..7499609066a 100644 --- a/app/views/merge_requests/_merge_request.html.haml +++ b/app/views/merge_requests/_merge_request.html.haml @@ -1,4 +1,4 @@ -%li.wll{ :class => mr_css_classes(merge_request) } +%li.wll{ class: mr_css_classes(merge_request) } .right .left - if merge_request.merged? @@ -14,9 +14,9 @@ = merge_request.source_branch → = merge_request.target_branch - = image_tag gravatar_icon(merge_request.author_email), :class => "avatar" + = image_tag gravatar_icon(merge_request.author_email), class: "avatar" - %p= link_to_gfm truncate(merge_request.title, :length => 80), project_merge_request_path(merge_request.project, merge_request), :class => "row_title" + %p= link_to_gfm truncate(merge_request.title, length: 80), project_merge_request_path(merge_request.project, merge_request), class: "row_title" %span.update-author %small.cdark= "##{merge_request.id}" diff --git a/app/views/merge_requests/_show.html.haml b/app/views/merge_requests/_show.html.haml index c0b3dd9f5aa..072bf259f46 100644 --- a/app/views/merge_requests/_show.html.haml +++ b/app/views/merge_requests/_show.html.haml @@ -7,16 +7,16 @@ - if @commits.present? %ul.nav.nav-tabs.mr_nav_tabs %li - = link_to "#notes", "data-url" => project_merge_request_path(@project, @merge_request), :class => "merge-notes-tab tab" do + = link_to "#notes", "data-url" => project_merge_request_path(@project, @merge_request), class: "merge-notes-tab tab" do %i.icon-comment Comments %li - = link_to "#diffs", "data-url" => diffs_project_merge_request_path(@project, @merge_request), :class => "merge-diffs-tab tab" do + = link_to "#diffs", "data-url" => diffs_project_merge_request_path(@project, @merge_request), class: "merge-diffs-tab tab" do %i.icon-list-alt Diff -.merge_request_notes#notes{ :class => (controller.action_name == 'show') ? "" : "hide" } - = render("notes/notes", :tid => @merge_request.id, :tt => "merge_request") +.merge_request_notes#notes{ class: (controller.action_name == 'show') ? "" : "hide" } + = render("notes/notes", tid: @merge_request.id, tt: "merge_request") .merge-request-diffs = render "merge_requests/show/diffs" if @diffs .status diff --git a/app/views/merge_requests/branch_from.js.haml b/app/views/merge_requests/branch_from.js.haml index 3e278015b49..156b4f0dc73 100644 --- a/app/views/merge_requests/branch_from.js.haml +++ b/app/views/merge_requests/branch_from.js.haml @@ -1,2 +1,2 @@ :plain - $(".mr_source_commit").html("#{escape_javascript(render 'commits/commit', :commit => @commit)}"); + $(".mr_source_commit").html("#{escape_javascript(render 'commits/commit', commit: @commit)}"); diff --git a/app/views/merge_requests/branch_to.js.haml b/app/views/merge_requests/branch_to.js.haml index 1ab1f6c43a9..8a201d42088 100644 --- a/app/views/merge_requests/branch_to.js.haml +++ b/app/views/merge_requests/branch_to.js.haml @@ -1,3 +1,3 @@ :plain - $(".mr_target_commit").html("#{escape_javascript(render 'commits/commit', :commit => @commit)}"); + $(".mr_target_commit").html("#{escape_javascript(render 'commits/commit', commit: @commit)}"); diff --git a/app/views/merge_requests/commits.js.haml b/app/views/merge_requests/commits.js.haml index 2055aa9b4bd..76322bdb210 100644 --- a/app/views/merge_requests/commits.js.haml +++ b/app/views/merge_requests/commits.js.haml @@ -1,4 +1,4 @@ :plain - $(".merge-request-commits").html("#{escape_javascript(render(:partial => "commits"))}"); + $(".merge-request-commits").html("#{escape_javascript(render(partial: "commits"))}"); diff --git a/app/views/merge_requests/diffs.js.haml b/app/views/merge_requests/diffs.js.haml index 4be5ec132e3..b147e5be71c 100644 --- a/app/views/merge_requests/diffs.js.haml +++ b/app/views/merge_requests/diffs.js.haml @@ -1,4 +1,4 @@ :plain - $(".merge-request-diffs").html("#{escape_javascript(render(:partial => "merge_requests/show/diffs"))}"); + $(".merge-request-diffs").html("#{escape_javascript(render(partial: "merge_requests/show/diffs"))}"); diff --git a/app/views/merge_requests/index.html.haml b/app/views/merge_requests/index.html.haml index 5210b95e3e4..4ad6e5c18ce 100644 --- a/app/views/merge_requests/index.html.haml +++ b/app/views/merge_requests/index.html.haml @@ -1,7 +1,7 @@ %h3.page_title Merge Requests - if can? current_user, :write_issue, @project - = link_to new_project_merge_request_path(@project), :class => "right btn small", :title => "New Merge Request" do + = link_to new_project_merge_request_path(@project), class: "right btn small", title: "New Merge Request" do New Merge Request %br @@ -10,17 +10,17 @@ .ui-box .title %ul.nav.nav-pills - %li{:class => ("active" if (params[:f] == "0" || !params[:f]))} - = link_to project_merge_requests_path(@project, :f => 0) do + %li{class: ("active" if (params[:f] == "0" || !params[:f]))} + = link_to project_merge_requests_path(@project, f: 0) do Open - %li{:class => ("active" if params[:f] == "2")} - = link_to project_merge_requests_path(@project, :f => 2) do + %li{class: ("active" if params[:f] == "2")} + = link_to project_merge_requests_path(@project, f: 2) do Closed - %li{:class => ("active" if params[:f] == "3")} - = link_to project_merge_requests_path(@project, :f => 3) do + %li{class: ("active" if params[:f] == "3")} + = link_to project_merge_requests_path(@project, f: 3) do To Me - %li{:class => ("active" if params[:f] == "1")} - = link_to project_merge_requests_path(@project, :f => 1) do + %li{class: ("active" if params[:f] == "1")} + = link_to project_merge_requests_path(@project, f: 1) do All %ul.unstyled @@ -31,7 +31,7 @@ - if @merge_requests.present? %li.bottom .row - .span7= paginate @merge_requests, :theme => "gitlab" + .span7= paginate @merge_requests, theme: "gitlab" .span4.right %span.cgray.right #{@merge_requests.total_count} merge requests for this filter diff --git a/app/views/merge_requests/show.js.haml b/app/views/merge_requests/show.js.haml index 2922b3bc6f0..7a27b166849 100644 --- a/app/views/merge_requests/show.js.haml +++ b/app/views/merge_requests/show.js.haml @@ -1,2 +1,2 @@ :plain - $(".merge-request-notes").html("#{escape_javascript(render("notes/notes", :tid => @merge_request.id, :tt => "merge_request"))}"); + $(".merge-request-notes").html("#{escape_javascript(render("notes/notes", tid: @merge_request.id, tt: "merge_request"))}"); diff --git a/app/views/merge_requests/show/_commits.html.haml b/app/views/merge_requests/show/_commits.html.haml index d10e8fd597a..d25e707c64e 100644 --- a/app/views/merge_requests/show/_commits.html.haml +++ b/app/views/merge_requests/show/_commits.html.haml @@ -7,19 +7,19 @@ - if @commits.count > 8 %ul.first_mr_commits.unstyled - @commits.first(8).each do |commit| - = render "commits/commit", :commit => commit + = render "commits/commit", commit: commit %li.bottom 8 of #{@commits.count} commits displayed. %strong %a.mr_show_all_commits Click here to show all %ul.all_mr_commits.hide.unstyled - @commits.each do |commit| - = render "commits/commit", :commit => commit + = render "commits/commit", commit: commit - else %ul.unstyled - @commits.each do |commit| - = render "commits/commit", :commit => commit + = render "commits/commit", commit: commit - else %h5 diff --git a/app/views/merge_requests/show/_diffs.html.haml b/app/views/merge_requests/show/_diffs.html.haml index 80776f19132..7685090311a 100644 --- a/app/views/merge_requests/show/_diffs.html.haml +++ b/app/views/merge_requests/show/_diffs.html.haml @@ -1,8 +1,8 @@ - if @merge_request.valid_diffs? - = render "commits/diffs", :diffs => @diffs + = render "commits/diffs", diffs: @diffs - elsif @merge_request.broken_diffs? %h4.nothing_here_message Can't load diff. - You can #{link_to "download MR patch", raw_project_merge_request_path(@project, @merge_request), :class => "vlink"} instead. + You can #{link_to "download MR patch", raw_project_merge_request_path(@project, @merge_request), class: "vlink"} instead. - else %h4.nothing_here_message Nothing to merge diff --git a/app/views/merge_requests/show/_how_to_merge.html.haml b/app/views/merge_requests/show/_how_to_merge.html.haml index 2512d254fe0..c21f2727a47 100644 --- a/app/views/merge_requests/show/_how_to_merge.html.haml +++ b/app/views/merge_requests/show/_how_to_merge.html.haml @@ -1,6 +1,6 @@ %div#modal_merge_info.modal.hide .modal-header - %a.close{:href => "#"} × + %a.close{href: "#"} × %h3 How To Merge .modal-body %pre diff --git a/app/views/merge_requests/show/_mr_accept.html.haml b/app/views/merge_requests/show/_mr_accept.html.haml index c158ef88bba..a6c2afb117c 100644 --- a/app/views/merge_requests/show/_mr_accept.html.haml +++ b/app/views/merge_requests/show/_mr_accept.html.haml @@ -4,29 +4,29 @@ - if @merge_request.open? && @commits.any? && can?(current_user, :accept_mr, @project) - .automerge_widget.can_be_merged{:style => "display:none"} + .automerge_widget.can_be_merged{style: "display:none"} .alert.alert-success %span - = form_for [:automerge, @project, @merge_request], :remote => true, :method => :get do |f| + = form_for [:automerge, @project, @merge_request], remote: true, method: :get do |f| %p You can accept this request automatically. If you still want to do it manually - - %strong= link_to "click here", "#", :class => "how_to_merge_link vlink", :title => "How To Merge" + %strong= link_to "click here", "#", class: "how_to_merge_link vlink", title: "How To Merge" for instructions .accept_group - = f.submit "Accept Merge Request", :class => "btn small success accept_merge_request" + = f.submit "Accept Merge Request", class: "btn small success accept_merge_request" - unless @project.root_ref? @merge_request.source_branch .remove_branch_holder - = label_tag :should_remove_source_branch, :class => "checkbox" do + = label_tag :should_remove_source_branch, class: "checkbox" do = check_box_tag :should_remove_source_branch Remove source-branch .clearfix - .automerge_widget.cannot_be_merged{:style => "display:none"} + .automerge_widget.cannot_be_merged{style: "display:none"} .alert.alert-info %span - = link_to "Show how to merge", "#", :class => "how_to_merge_link btn small padded", :title => "How To Merge" + = link_to "Show how to merge", "#", class: "how_to_merge_link btn small padded", title: "How To Merge" %strong This request cant be merged with GitLab. You should do it manually @@ -36,7 +36,7 @@ %i.icon-refresh Checking for ability to automatically merge… - .automerge_widget.already_cannot_be_merged{:style => "display:none"} + .automerge_widget.already_cannot_be_merged{style: "display:none"} .alert.alert-info %strong This merge request already can not be merged. Try to reload page. diff --git a/app/views/merge_requests/show/_mr_box.html.haml b/app/views/merge_requests/show/_mr_box.html.haml index bb8bf1ceba6..81ab83f3436 100644 --- a/app/views/merge_requests/show/_mr_box.html.haml +++ b/app/views/merge_requests/show/_mr_box.html.haml @@ -10,12 +10,12 @@ .middle_box_content %div %cite.cgray Created at #{@merge_request.created_at.stamp("Aug 21, 2011")} by - = image_tag gravatar_icon(@merge_request.author_email), :width => 16, :class => "lil_av" + = image_tag gravatar_icon(@merge_request.author_email), width: 16, class: "lil_av" %strong.author= link_to_merge_request_author(@merge_request) - if @merge_request.assignee %cite.cgray and currently assigned to - = image_tag gravatar_icon(@merge_request.assignee_email), :width => 16, :class => "lil_av" + = image_tag gravatar_icon(@merge_request.assignee_email), width: 16, class: "lil_av" %strong.author= link_to_merge_request_assignee(@merge_request) diff --git a/app/views/merge_requests/show/_mr_title.html.haml b/app/views/merge_requests/show/_mr_title.html.haml index 3f6060b0645..31fa0779fd2 100644 --- a/app/views/merge_requests/show/_mr_title.html.haml +++ b/app/views/merge_requests/show/_mr_title.html.haml @@ -13,13 +13,13 @@ = "MERGED" - if can?(current_user, :modify_merge_request, @merge_request) - if @merge_request.open? - = link_to raw_project_merge_request_path(@project, @merge_request), :class => "btn grouped" do + = link_to raw_project_merge_request_path(@project, @merge_request), class: "btn grouped" do %i.icon-download-alt Get Patch - = 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" + = 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" - = link_to edit_project_merge_request_path(@project, @merge_request), :class => "btn grouped" do + = link_to edit_project_merge_request_path(@project, @merge_request), class: "btn grouped" do %i.icon-edit Edit diff --git a/app/views/milestones/_form.html.haml b/app/views/milestones/_form.html.haml index 69567eff417..daae58fe1e0 100644 --- a/app/views/milestones/_form.html.haml +++ b/app/views/milestones/_form.html.haml @@ -5,7 +5,7 @@ %hr -= form_for [@project, @milestone], :html => {:class => "new_milestone form-horizontal"} do |f| += form_for [@project, @milestone], html: {class: "new_milestone form-horizontal"} do |f| -if @milestone.errors.any? .alert-message.block-message.error %ul @@ -14,35 +14,35 @@ .row .span6 .control-group - = f.label :title, "Title", :class => "control-label" + = f.label :title, "Title", class: "control-label" .controls - = f.text_field :title, :maxlength => 255, :class => "input-xlarge" + = f.text_field :title, maxlength: 255, class: "input-xlarge" %p.help-block Required .control-group - = f.label :description, "Description", :class => "control-label" + = f.label :description, "Description", class: "control-label" .controls - = f.text_area :description, :maxlength => 2000, :class => "input-xlarge", :rows => 10 + = f.text_area :description, maxlength: 2000, class: "input-xlarge", rows: 10 %p.help-block Markdown is enabled. .span6 .control-group - = f.label :due_date, "Due Date", :class => "control-label" + = f.label :due_date, "Due Date", class: "control-label" .input= f.hidden_field :due_date .controls .datepicker .form-actions - if @milestone.new_record? - = f.submit 'Create milestone', :class => "primary btn" + = f.submit 'Create milestone', class: "primary btn" -else - = f.submit 'Save changes', :class => "primary btn" + = f.submit 'Save changes', class: "primary btn" - if request.xhr? - = link_to "Cancel", "#back", :onclick => "backToIssues();", :class => "btn" + = link_to "Cancel", "#back", onclick: "backToIssues();", class: "btn" - else - if @milestone.new_record? - = link_to "Cancel", project_milestones_path(@project), :class => "btn" + = link_to "Cancel", project_milestones_path(@project), class: "btn" - else - = link_to "Cancel", project_milestone_path(@project, @milestone), :class => "btn" + = link_to "Cancel", project_milestone_path(@project, @milestone), class: "btn" :javascript $(function() { diff --git a/app/views/milestones/_milestone.html.haml b/app/views/milestones/_milestone.html.haml index 06cf6304d40..205b864f80f 100644 --- a/app/views/milestones/_milestone.html.haml +++ b/app/views/milestones/_milestone.html.haml @@ -1,18 +1,18 @@ -%li{:class => "milestone", :id => dom_id(milestone) } +%li{class: "milestone", id: dom_id(milestone) } .right - if milestone.issues.any? %span.btn.small.disabled.grouped= pluralize milestone.issues.count, 'issues' - if milestone.issues.count > 0 - = link_to 'Browse Issues', project_issues_path(milestone.project, :milestone_id => milestone.id), :class => "btn small grouped" + = link_to 'Browse Issues', project_issues_path(milestone.project, milestone_id: milestone.id), class: "btn small grouped" - if can? current_user, :admin_milestone, milestone.project - = link_to 'Edit', edit_project_milestone_path(milestone.project, milestone), :class => "btn small edit-milestone-link grouped" + = link_to 'Edit', edit_project_milestone_path(milestone.project, milestone), class: "btn small edit-milestone-link grouped" %h4 - = link_to_gfm truncate(milestone.title, :length => 100), project_milestone_path(milestone.project, milestone), :class => "row_title" + = link_to_gfm truncate(milestone.title, length: 100), project_milestone_path(milestone.project, milestone), class: "row_title" %small = milestone.expires_at %br .progress.progress-success.span3 - .bar{:style => "width: #{milestone.percent_complete}%;"} + .bar{style: "width: #{milestone.percent_complete}%;"} diff --git a/app/views/milestones/index.html.haml b/app/views/milestones/index.html.haml index ed85166fbb2..ecb008dc144 100644 --- a/app/views/milestones/index.html.haml +++ b/app/views/milestones/index.html.haml @@ -3,23 +3,23 @@ %h3.page_title Milestones - if can? current_user, :admin_milestone, @project - = link_to "New Milestone", new_project_milestone_path(@project), :class => "right btn small", :title => "New Milestone" + = link_to "New Milestone", new_project_milestone_path(@project), class: "right btn small", title: "New Milestone" %br %div.ui-box .title %ul.nav.nav-pills - %li{:class => ("active" if (params[:f] == "0" || !params[:f]))} - = link_to project_milestones_path(@project, :f => 0) do + %li{class: ("active" if (params[:f] == "0" || !params[:f]))} + = link_to project_milestones_path(@project, f: 0) do Active - %li{:class => ("active" if params[:f] == "1")} - = link_to project_milestones_path(@project, :f => 1) do + %li{class: ("active" if params[:f] == "1")} + = link_to project_milestones_path(@project, f: 1) do All %ul.unstyled = render @milestones - if @milestones.present? - %li.bottom= paginate @milestones, :remote => true, :theme => "gitlab" + %li.bottom= paginate @milestones, remote: true, theme: "gitlab" - else %li %h3.nothing_here_message Nothing to show here diff --git a/app/views/milestones/show.html.haml b/app/views/milestones/show.html.haml index 1a731810983..b7da7b668ea 100644 --- a/app/views/milestones/show.html.haml +++ b/app/views/milestones/show.html.haml @@ -4,9 +4,9 @@ = @milestone.expires_at %span.right - = link_to 'Browse Issues', project_issues_path(@milestone.project, :milestone_id => @milestone.id), :class => "btn edit-milestone-link small grouped" + = link_to 'Browse Issues', project_issues_path(@milestone.project, milestone_id: @milestone.id), class: "btn edit-milestone-link small grouped" - if can?(current_user, :admin_milestone, @project) - = link_to edit_project_milestone_path(@project, @milestone), :class => "btn small grouped" do + = link_to edit_project_milestone_path(@project, @milestone), class: "btn small grouped" do %i.icon-edit Edit @@ -32,7 +32,7 @@ – #{@milestone.issues.closed.count} closed .progress.progress-success - .bar{:style => "width: #{@milestone.percent_complete}%;"} + .bar{style: "width: #{@milestone.percent_complete}%;"} - if @milestone.description.present? @@ -51,9 +51,9 @@ = link_to [@project, issue] do %span.badge.badge-info ##{issue.id} – - = link_to_gfm truncate(issue.title, :length => 60), [@project, issue] + = link_to_gfm truncate(issue.title, length: 60), [@project, issue] %br - = paginate @issues, :theme => "gitlab" + = paginate @issues, theme: "gitlab" .span6 %table.admin-table @@ -62,6 +62,6 @@ - @users.each do |user| %tr %td - = image_tag gravatar_icon(user.email, 24), :width => "24" + = image_tag gravatar_icon(user.email, 24), width: "24" = user.name diff --git a/app/views/notes/_create_common.js.haml b/app/views/notes/_create_common.js.haml index 583812bf502..847ff383b7c 100644 --- a/app/views/notes/_create_common.js.haml +++ b/app/views/notes/_create_common.js.haml @@ -2,7 +2,7 @@ :plain $("#new_note .errors").remove(); $('#new_note textarea').val(""); - NoteList.prepend(#{note.id}, "#{escape_javascript(render :partial => "notes/show", :locals => {:note => note})}"); + NoteList.prepend(#{note.id}, "#{escape_javascript(render partial: "notes/show", locals: {note: note})}"); - else :plain $("#new_note").replaceWith("#{escape_javascript(render('form'))}"); diff --git a/app/views/notes/_create_line.js.haml b/app/views/notes/_create_line.js.haml index 9cf085cd613..13809bec1b9 100644 --- a/app/views/notes/_create_line.js.haml +++ b/app/views/notes/_create_line.js.haml @@ -4,5 +4,5 @@ $('#new_note textarea').val(""); $("a.line_note_reply_link[line_code='#{note.line_code}']").closest("tr").remove(); var trEl = $(".#{note.line_code}").parent(); - trEl.after("#{escape_javascript(render :partial => "notes/per_line_show", :locals => {:note => note})}"); - trEl.after("#{escape_javascript(render :partial => "notes/reply_button", :locals => {:line_code => note.line_code})}"); + trEl.after("#{escape_javascript(render partial: "notes/per_line_show", locals: {note: note})}"); + trEl.after("#{escape_javascript(render partial: "notes/reply_button", locals: {line_code: note.line_code})}"); diff --git a/app/views/notes/_form.html.haml b/app/views/notes/_form.html.haml index f5571aede5e..dac026bd23d 100644 --- a/app/views/notes/_form.html.haml +++ b/app/views/notes/_form.html.haml @@ -1,4 +1,4 @@ -= form_for [@project, @note], :remote => "true", :multipart => true do |f| += form_for [@project, @note], remote: "true", multipart: true do |f| %h3.page_title Leave a comment -if @note.errors.any? .alert-message.block-message.error @@ -7,16 +7,16 @@ = f.hidden_field :noteable_id = f.hidden_field :noteable_type - = f.text_area :note, :size => 255 + = f.text_area :note, size: 255 #preview-note.well.hide %p.hint - = link_to "Gitlab Markdown", help_markdown_path, :target => '_blank' + = link_to "Gitlab Markdown", help_markdown_path, target: '_blank' is enabled. - = link_to 'Preview', preview_project_notes_path(@project), :id => 'preview-link' + = link_to 'Preview', preview_project_notes_path(@project), id: 'preview-link' .row.note_advanced_opts.hide .span2 - = f.submit 'Add Comment', :class => "btn primary submit_note", :id => "submit_note" + = f.submit 'Add Comment', class: "btn primary submit_note", id: "submit_note" .span4.notify_opts %h6.left Notify via email: = label_tag :notify do @@ -33,6 +33,6 @@ .input.input_file %a.file_upload.btn.small Upload File - = f.file_field :attachment, :class => "input-file" + = f.file_field :attachment, class: "input-file" %span.hint Any file less than 10 MB diff --git a/app/views/notes/_load.js.haml b/app/views/notes/_load.js.haml index 1f3559670d1..c16a699a1b7 100644 --- a/app/views/notes/_load.js.haml +++ b/app/views/notes/_load.js.haml @@ -1,15 +1,15 @@ - unless @notes.blank? - if params[:last_id] :plain - NoteList.replace("#{escape_javascript(render(:partial => 'notes/notes_list'))}"); + NoteList.replace("#{escape_javascript(render(partial: 'notes/notes_list'))}"); - elsif params[:first_id] :plain - NoteList.append(#{@notes.last.id}, "#{escape_javascript(render(:partial => 'notes/notes_list'))}"); + NoteList.append(#{@notes.last.id}, "#{escape_javascript(render(partial: 'notes/notes_list'))}"); - else :plain - NoteList.setContent(#{@notes.last.id}, #{@notes.first.id}, "#{escape_javascript(render(:partial => 'notes/notes_list'))}"); + NoteList.setContent(#{@notes.last.id}, #{@notes.first.id}, "#{escape_javascript(render(partial: 'notes/notes_list'))}"); - else - if params[:first_id] diff --git a/app/views/notes/_notes_list.html.haml b/app/views/notes/_notes_list.html.haml index 1e4a6bb2b2f..5673988d87d 100644 --- a/app/views/notes/_notes_list.html.haml +++ b/app/views/notes/_notes_list.html.haml @@ -1,4 +1,4 @@ - @notes.each do |note| - next unless note.author - = render :partial => "notes/show", :locals => {:note => note} + = render partial: "notes/show", locals: {note: note} diff --git a/app/views/notes/_per_line_form.html.haml b/app/views/notes/_per_line_form.html.haml index a5a70053480..afb0b30dca3 100644 --- a/app/views/notes/_per_line_form.html.haml +++ b/app/views/notes/_per_line_form.html.haml @@ -1,7 +1,7 @@ -%table{:style => "display:none;"} +%table{style: "display:none;"} %tr.per_line_form - %td{:colspan => 3 } - = form_for [@project, @note], :remote => "true", :multipart => true do |f| + %td{colspan: 3 } + = form_for [@project, @note], remote: "true", multipart: true do |f| %h3.page_title Leave a note %div.span10 -if @note.errors.any? @@ -12,11 +12,11 @@ = f.hidden_field :noteable_id = f.hidden_field :noteable_type = f.hidden_field :line_code - = f.text_area :note, :size => 255 + = f.text_area :note, size: 255 .note_actions .buttons - = f.submit 'Add note', :class => "btn primary submit_note", :id => "submit_note" - = link_to "Cancel", "#", :class => "btn hide-button" + = f.submit 'Add note', class: "btn primary submit_note", id: "submit_note" + = link_to "Cancel", "#", class: "btn hide-button" .options %h6.left Notify via email: .labels diff --git a/app/views/notes/_per_line_show.html.haml b/app/views/notes/_per_line_show.html.haml index e239c618b11..cf1769c0517 100644 --- a/app/views/notes/_per_line_show.html.haml +++ b/app/views/notes/_per_line_show.html.haml @@ -1,5 +1,5 @@ %tr.line_notes_row - %td{:colspan => 3} + %td{colspan: 3} %ul - = render :partial => "notes/show", :locals => {:note => note} + = render partial: "notes/show", locals: {note: note} diff --git a/app/views/notes/_reply_button.html.haml b/app/views/notes/_reply_button.html.haml index db6b35b7ada..c981fb9fc72 100644 --- a/app/views/notes/_reply_button.html.haml +++ b/app/views/notes/_reply_button.html.haml @@ -1,4 +1,4 @@ %tr.line_notes_row.reply - %td{:colspan => 3} + %td{colspan: 3} %i.icon-comment - = link_to "Reply", "#", :class => "line_note_reply_link", "line_code" => line_code, :title => "Add note for this line" + = link_to "Reply", "#", class: "line_note_reply_link", "line_code" => line_code, title: "Add note for this line" diff --git a/app/views/notes/_show.html.haml b/app/views/notes/_show.html.haml index 62aca154bf1..bdb00546114 100644 --- a/app/views/notes/_show.html.haml +++ b/app/views/notes/_show.html.haml @@ -1,5 +1,5 @@ -%li{:id => dom_id(note), :class => "note"} - = image_tag gravatar_icon(note.author.email), :class => "avatar" +%li{id: dom_id(note), class: "note"} + = image_tag gravatar_icon(note.author.email), class: "avatar" %div.note-author %strong= note.author_name = link_to "##{dom_id(note)}", name: dom_id(note) do @@ -7,7 +7,7 @@ = time_ago_in_words(note.updated_at) ago - if(note.author_id == current_user.id) || can?(current_user, :admin_note, @project) - = link_to [@project, note], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "cred delete-note btn very_small" do + = link_to [@project, note], confirm: 'Are you sure?', method: :delete, remote: true, class: "cred delete-note btn very_small" do %i.icon-trash Remove @@ -17,5 +17,5 @@ - if note.attachment.url .right %div.file - = link_to note.attachment_identifier, note.attachment.url, :target => "_blank" + = link_to note.attachment_identifier, note.attachment.url, target: "_blank" .clear diff --git a/app/views/notes/create.js.haml b/app/views/notes/create.js.haml index e87dbcf63c1..8f631f38f79 100644 --- a/app/views/notes/create.js.haml +++ b/app/views/notes/create.js.haml @@ -1,7 +1,7 @@ - if @note.line_code - = render "create_line", :note => @note + = render "create_line", note: @note - else - = render "create_common", :note => @note + = render "create_common", note: @note -# Enable submit button :plain diff --git a/app/views/notify/new_issue_email.html.haml b/app/views/notify/new_issue_email.html.haml index 08eea5538fb..654d6cd12be 100644 --- a/app/views/notify/new_issue_email.html.haml +++ b/app/views/notify/new_issue_email.html.haml @@ -1,15 +1,15 @@ -%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"} - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"} +%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"} + %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"} %tr - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} - %td{:align => "left", :style => "padding: 20px 0 0;"} - %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} + %td{align: "left", style: "padding: 20px 0 0;"} + %h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} New Issue was created and assigned to you. - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} %tr - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} - %td{:align => "left", :style => "padding: 20px 0 0;"} - %h2{:style => "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} + %td{align: "left", style: "padding: 20px 0 0;"} + %h2{style: "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} = "Issue ##{@issue.id}" - = link_to_gfm truncate(@issue.title, :length => 45), project_issue_url(@issue.project, @issue), :title => @issue.title + = link_to_gfm truncate(@issue.title, length: 45), project_issue_url(@issue.project, @issue), title: @issue.title %br diff --git a/app/views/notify/new_merge_request_email.html.haml b/app/views/notify/new_merge_request_email.html.haml index 4bacff5060c..151aac451fb 100644 --- a/app/views/notify/new_merge_request_email.html.haml +++ b/app/views/notify/new_merge_request_email.html.haml @@ -1,18 +1,18 @@ -%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"} - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"} +%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"} + %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"} %tr - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} - %td{:align => "left", :style => "padding: 20px 0 0;"} - %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} + %td{align: "left", style: "padding: 20px 0 0;"} + %h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} = "New Merge Request !#{@merge_request.id}" - = link_to_gfm truncate(@merge_request.title, :length => 16), project_merge_request_url(@merge_request.project, @merge_request) - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + = link_to_gfm truncate(@merge_request.title, length: 16), project_merge_request_url(@merge_request.project, @merge_request) + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} %tr - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} - %td{:style => "padding: 15px 0 15px;", :valign => "top"} - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} + %td{style: "padding: 15px 0 15px;", valign: "top"} + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} Branches: #{@merge_request.source_branch} → #{@merge_request.target_branch} - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} Asignee: #{@merge_request.author_name} → #{@merge_request.assignee_name} %td diff --git a/app/views/notify/new_user_email.html.haml b/app/views/notify/new_user_email.html.haml index b0f198a50fd..d96afc92fe2 100644 --- a/app/views/notify/new_user_email.html.haml +++ b/app/views/notify/new_user_email.html.haml @@ -1,23 +1,23 @@ -%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"} - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"} +%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"} + %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"} %tr - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} - %td{:align => "left", :style => "padding: 20px 0 0;"} - %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} + %td{align: "left", style: "padding: 20px 0 0;"} + %h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} Hi #{@user['name']}! - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} Administrator created account for you. Now you are a member of company gitlab application. - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} %tr - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} - %td{:style => "padding: 15px 0 15px;", :valign => "top"} - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 28px; font-size: 16px;font-family: Helvetica, Arial, sans-serif; "} + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} + %td{style: "padding: 15px 0 15px;", valign: "top"} + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 28px; font-size: 16px;font-family: Helvetica, Arial, sans-serif; "} login.......................................... %code= @user['email'] - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 28px; font-size: 16px;font-family: Helvetica, Arial, sans-serif; "} + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 28px; font-size: 16px;font-family: Helvetica, Arial, sans-serif; "} password.................................. %code= @password - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 28px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 28px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} = link_to "Click here to login", root_url - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} diff --git a/app/views/notify/note_commit_email.html.haml b/app/views/notify/note_commit_email.html.haml index 6994f1a6340..e87f9c120e4 100644 --- a/app/views/notify/note_commit_email.html.haml +++ b/app/views/notify/note_commit_email.html.haml @@ -1,23 +1,23 @@ -%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"} - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"} +%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"} + %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"} %tr - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} - %td{:align => "left", :style => "padding: 20px 0 0;"} - %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} + %td{align: "left", style: "padding: 20px 0 0;"} + %h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} = "New comment for Commit #{@commit.short_id}" - = link_to_gfm truncate(@commit.title, :length => 16), project_commit_url(@note.project, :id => @commit.id, :anchor => "note_#{@note.id}") - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + = link_to_gfm truncate(@commit.title, length: 16), project_commit_url(@note.project, id: @commit.id, anchor: "note_#{@note.id}") + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} %tr - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} - %td{:style => "padding: 15px 0 15px;", :valign => "top"} - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} - %a{:href => "#", :style => "color: #0eb6ce; text-decoration: none;"} #{@note.author_name} + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} + %td{style: "padding: 15px 0 15px;", valign: "top"} + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} + %a{href: "#", style: "color: #0eb6ce; text-decoration: none;"} #{@note.author_name} left next message: %br - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :width => "558"} + %table{border: "0", cellpadding: "0", cellspacing: "0", width: "558"} %tr - %td{:valign => "top"} - %div{ :style => "background:#f5f5f5; padding:20px;border:1px solid #ddd" } + %td{valign: "top"} + %div{ style: "background:#f5f5f5; padding:20px;border:1px solid #ddd" } = markdown(@note.note) - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} diff --git a/app/views/notify/note_issue_email.html.haml b/app/views/notify/note_issue_email.html.haml index 34d9b800c1e..832f5df4463 100644 --- a/app/views/notify/note_issue_email.html.haml +++ b/app/views/notify/note_issue_email.html.haml @@ -1,23 +1,23 @@ -%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"} - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"} +%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"} + %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"} %tr - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} - %td{:align => "left", :style => "padding: 20px 0 0;"} - %h2{:style => "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} + %td{align: "left", style: "padding: 20px 0 0;"} + %h2{style: "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} = "New comment for Issue ##{@issue.id}" - = link_to_gfm truncate(@issue.title, :length => 35), project_issue_url(@issue.project, @issue, :anchor => "note_#{@note.id}") - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + = link_to_gfm truncate(@issue.title, length: 35), project_issue_url(@issue.project, @issue, anchor: "note_#{@note.id}") + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} %tr - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} - %td{:style => "padding: 15px 0 15px;", :valign => "top"} - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} - %a{:href => "#", :style => "color: #0eb6ce; text-decoration: none;"} #{@note.author_name} + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} + %td{style: "padding: 15px 0 15px;", valign: "top"} + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} + %a{href: "#", style: "color: #0eb6ce; text-decoration: none;"} #{@note.author_name} left next message: %br - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :width => "558"} + %table{border: "0", cellpadding: "0", cellspacing: "0", width: "558"} %tr - %td{:valign => "top"} - %div{ :style => "background:#f5f5f5; padding:20px;border:1px solid #ddd" } + %td{valign: "top"} + %div{ style: "background:#f5f5f5; padding:20px;border:1px solid #ddd" } = markdown(@note.note) - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} diff --git a/app/views/notify/note_merge_request_email.html.haml b/app/views/notify/note_merge_request_email.html.haml index 20e7679d4dc..764cd094b76 100644 --- a/app/views/notify/note_merge_request_email.html.haml +++ b/app/views/notify/note_merge_request_email.html.haml @@ -1,23 +1,23 @@ -%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"} - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"} +%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"} + %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"} %tr - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} - %td{:align => "left", :style => "padding: 20px 0 0;"} - %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} + %td{align: "left", style: "padding: 20px 0 0;"} + %h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} = "New comment for Merge Request !#{@merge_request.id}" - = link_to_gfm truncate(@merge_request.title, :length => 16), project_merge_request_url(@merge_request.project, @merge_request, :anchor => "note_#{@note.id}") - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + = link_to_gfm truncate(@merge_request.title, length: 16), project_merge_request_url(@merge_request.project, @merge_request, anchor: "note_#{@note.id}") + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} %tr - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} - %td{:style => "padding: 15px 0 15px;", :valign => "top"} - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} - %a{:href => "#", :style => "color: #0eb6ce; text-decoration: none;"} #{@note.author_name} + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} + %td{style: "padding: 15px 0 15px;", valign: "top"} + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} + %a{href: "#", style: "color: #0eb6ce; text-decoration: none;"} #{@note.author_name} left next message: %br - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :width => "558"} + %table{border: "0", cellpadding: "0", cellspacing: "0", width: "558"} %tr - %td{:valign => "top"} - %div{ :style => "background:#f5f5f5; padding:20px;border:1px solid #ddd" } + %td{valign: "top"} + %div{ style: "background:#f5f5f5; padding:20px;border:1px solid #ddd" } = markdown(@note.note) - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} diff --git a/app/views/notify/note_wall_email.html.haml b/app/views/notify/note_wall_email.html.haml index f62e1f917cd..0661c5801b8 100644 --- a/app/views/notify/note_wall_email.html.haml +++ b/app/views/notify/note_wall_email.html.haml @@ -1,22 +1,22 @@ -%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"} - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"} +%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"} + %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"} %tr - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} - %td{:align => "left", :style => "padding: 20px 0 0;"} - %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} + %td{align: "left", style: "padding: 20px 0 0;"} + %h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} New message on - = link_to "Project Wall", wall_project_url(@note.project, :anchor => "note_#{@note.id}") - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + = link_to "Project Wall", wall_project_url(@note.project, anchor: "note_#{@note.id}") + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} %tr - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} - %td{:style => "padding: 15px 0 15px;", :valign => "top"} - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} - %a{:href => "#", :style => "color: #0eb6ce; text-decoration: none;"} #{@note.author_name} + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} + %td{style: "padding: 15px 0 15px;", valign: "top"} + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} + %a{href: "#", style: "color: #0eb6ce; text-decoration: none;"} #{@note.author_name} left next message: %br - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :width => "558"} + %table{border: "0", cellpadding: "0", cellspacing: "0", width: "558"} %tr - %td{:valign => "top"} - %div{ :style => "background:#f5f5f5; padding:20px;border:1px solid #ddd" } + %td{valign: "top"} + %div{ style: "background:#f5f5f5; padding:20px;border:1px solid #ddd" } = markdown(@note.note) - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} diff --git a/app/views/notify/note_wiki_email.html.haml b/app/views/notify/note_wiki_email.html.haml index 591319515f6..d3840cdac06 100644 --- a/app/views/notify/note_wiki_email.html.haml +++ b/app/views/notify/note_wiki_email.html.haml @@ -1,23 +1,23 @@ -%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"} - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"} +%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"} + %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"} %tr - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} - %td{:align => "left", :style => "padding: 20px 0 0;"} - %h2{:style => "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} + %td{align: "left", style: "padding: 20px 0 0;"} + %h2{style: "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} New comment for Wiki page - = link_to_gfm @wiki.title, project_issue_url(@wiki.project, @wiki, :anchor => "note_#{@note.id}") - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + = link_to_gfm @wiki.title, project_issue_url(@wiki.project, @wiki, anchor: "note_#{@note.id}") + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} %tr - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} - %td{:style => "padding: 15px 0 15px;", :valign => "top"} - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} - %a{:href => "#", :style => "color: #0eb6ce; text-decoration: none;"} #{@note.author_name} + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} + %td{style: "padding: 15px 0 15px;", valign: "top"} + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} + %a{href: "#", style: "color: #0eb6ce; text-decoration: none;"} #{@note.author_name} commented on Wiki page: %br - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :width => "558"} + %table{border: "0", cellpadding: "0", cellspacing: "0", width: "558"} %tr - %td{:valign => "top"} - %div{ :style => "background:#f5f5f5; padding:20px;border:1px solid #ddd" } + %td{valign: "top"} + %div{ style: "background:#f5f5f5; padding:20px;border:1px solid #ddd" } = markdown(@note.note) - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} diff --git a/app/views/notify/reassigned_issue_email.html.haml b/app/views/notify/reassigned_issue_email.html.haml index 26ddc13336a..c7896af3a54 100644 --- a/app/views/notify/reassigned_issue_email.html.haml +++ b/app/views/notify/reassigned_issue_email.html.haml @@ -1,16 +1,16 @@ -%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"} - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"} +%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"} + %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"} %tr - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} - %td{:align => "left", :style => "padding: 20px 0 0;"} - %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} + %td{align: "left", style: "padding: 20px 0 0;"} + %h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} = "Reassigned Issue ##{@issue.id}" - = link_to_gfm truncate(@issue.title, :length => 16), project_issue_url(@issue.project, @issue) - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + = link_to_gfm truncate(@issue.title, length: 16), project_issue_url(@issue.project, @issue) + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} %tr - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} - %td{:style => "padding: 15px 0 15px;", :valign => "top"} - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} + %td{style: "padding: 15px 0 15px;", valign: "top"} + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} Assignee changed from #{@previous_assignee.name} to #{@issue.assignee_name} %td diff --git a/app/views/notify/reassigned_merge_request_email.html.haml b/app/views/notify/reassigned_merge_request_email.html.haml index e9f657c131f..e49b783635c 100644 --- a/app/views/notify/reassigned_merge_request_email.html.haml +++ b/app/views/notify/reassigned_merge_request_email.html.haml @@ -1,16 +1,16 @@ -%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"} - %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"} +%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"} + %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"} %tr - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} - %td{:align => "left", :style => "padding: 20px 0 0;"} - %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} + %td{align: "left", style: "padding: 20px 0 0;"} + %h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} = "Reassigned Merge Request !#{@merge_request.id}" - = link_to_gfm truncate(@merge_request.title, :length => 16), project_merge_request_url(@merge_request.project, @merge_request) - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + = link_to_gfm truncate(@merge_request.title, length: 16), project_merge_request_url(@merge_request.project, @merge_request) + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} %tr - %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} - %td{:style => "padding: 15px 0 15px;", :valign => "top"} - %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} + %td{style: "font-size: 1px; line-height: 1px;", width: "21"} + %td{style: "padding: 15px 0 15px;", valign: "top"} + %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} Assignee changed from #{@previous_assignee.name} to #{@merge_request.assignee_name} %td diff --git a/app/views/profile/design.html.haml b/app/views/profile/design.html.haml index ff6ae7f5778..a3455ced94b 100644 --- a/app/views/profile/design.html.haml +++ b/app/views/profile/design.html.haml @@ -1,4 +1,4 @@ -= form_for @user, :url => profile_update_path, :remote => true, :method => :put do |f| += form_for @user, url: profile_update_path, remote: true, method: :put do |f| %div %h3 Application theme %hr @@ -18,16 +18,16 @@ %h3 Code review %hr .row - %label.span3{:for => "user_dark_scheme_false"} + %label.span3{for: "user_dark_scheme_false"} .thumbnail - = image_tag "white.png", :width => 260, :class => "styled_image" + = image_tag "white.png", width: 260, class: "styled_image" .caption %h5 = f.radio_button :dark_scheme, false White code preview - %label.span3{:for => "user_dark_scheme_true"} + %label.span3{for: "user_dark_scheme_true"} .thumbnail - = image_tag "dark.png", :width => 260, :class => "styled_image" + = image_tag "dark.png", width: 260, class: "styled_image" .caption %h5 = f.radio_button :dark_scheme, true diff --git a/app/views/profile/password.html.haml b/app/views/profile/password.html.haml index 1662f4d9c58..257dacb1ad3 100644 --- a/app/views/profile/password.html.haml +++ b/app/views/profile/password.html.haml @@ -1,6 +1,6 @@ %h3.page_title Password %hr -= form_for @user, :url => profile_password_path, :method => :put do |f| += form_for @user, url: profile_password_path, method: :put do |f| .data %p.slead After successful password update you will be redirected to login page where you should login with new password -if @user.errors.any? @@ -16,4 +16,4 @@ = f.label :password_confirmation .input= f.password_field :password_confirmation .actions - = f.submit 'Save', :class => "btn primary" + = f.submit 'Save', class: "btn primary" diff --git a/app/views/profile/show.html.haml b/app/views/profile/show.html.haml index b26890131bb..95cce2bb6b6 100644 --- a/app/views/profile/show.html.haml +++ b/app/views/profile/show.html.haml @@ -1,5 +1,5 @@ .profile_avatar_holder - = image_tag gravatar_icon(@user.email, 90), :class => "styled_image" + = image_tag gravatar_icon(@user.email, 90), class: "styled_image" %h3.page_title = @user.name %br @@ -9,7 +9,7 @@ %hr -= form_for @user, :url => profile_update_path, :method => :put, :html => { :class => "edit_user form-horizontal" } do |f| += form_for @user, url: profile_update_path, method: :put, html: { class: "edit_user form-horizontal" } do |f| -if @user.errors.any? %div.alert-message.block-message.error %ul @@ -18,30 +18,30 @@ .row .span7 .control-group - = f.label :name, :class => "control-label" + = f.label :name, class: "control-label" .controls - = f.text_field :name, :class => "input-xlarge" + = f.text_field :name, class: "input-xlarge" %span.help-block Enter your name, so people you know can recognize you. .control-group - = f.label :email, :class => "control-label" + = f.label :email, class: "control-label" .controls - = f.text_field :email, :class => "input-xlarge" + = f.text_field :email, class: "input-xlarge" %span.help-block We also use email for avatar detection. %hr .control-group - = f.label :skype, :class => "control-label" - .controls= f.text_field :skype, :class => "input-xlarge" + = f.label :skype, class: "control-label" + .controls= f.text_field :skype, class: "input-xlarge" .control-group - = f.label :linkedin, :class => "control-label" - .controls= f.text_field :linkedin, :class => "input-xlarge" + = f.label :linkedin, class: "control-label" + .controls= f.text_field :linkedin, class: "input-xlarge" .control-group - = f.label :twitter, :class => "control-label" - .controls= f.text_field :twitter, :class => "input-xlarge" + = f.label :twitter, class: "control-label" + .controls= f.text_field :twitter, class: "input-xlarge" .control-group - = f.label :bio, :class => "control-label" + = f.label :bio, class: "control-label" .controls - = f.text_area :bio, :rows => 6, :class => "input-xlarge", :maxlength => 250 + = f.text_area :bio, rows: 6, class: "input-xlarge", maxlength: 250 %span.help-block Tell us about yourself in fewer than 250 characters. .span5.right @@ -56,14 +56,14 @@ of %span= current_user.projects_limit .progress - .bar{:style => "width: #{current_user.projects_limit_percent}%;"} + .bar{style: "width: #{current_user.projects_limit_percent}%;"} %h4 SSH public keys: %small.right %span= link_to current_user.keys.count, keys_path - = link_to "Add Public Key", new_key_path, :class => "btn small right" + = link_to "Add Public Key", new_key_path, class: "btn small right" .form-actions - = f.submit 'Save', :class => "btn-primary btn" + = f.submit 'Save', class: "btn-primary btn" diff --git a/app/views/profile/token.html.haml b/app/views/profile/token.html.haml index 3a0ec90bbef..6c870c364de 100644 --- a/app/views/profile/token.html.haml +++ b/app/views/profile/token.html.haml @@ -3,7 +3,7 @@ %span.cred.right keep it in secret! %hr -= form_for @user, :url => profile_reset_private_token_path, :method => :put do |f| += form_for @user, url: profile_reset_private_token_path, method: :put do |f| .data %p.slead Private token used to access application resources without authentication. @@ -11,13 +11,13 @@ It can be used for atom feed or API %p.cgray - if current_user.private_token - = text_field_tag "token", current_user.private_token, :class => "xxlarge large_text" + = text_field_tag "token", current_user.private_token, class: "xxlarge large_text" - else You don`t have one yet. Click generate to fix it. .actions - if current_user.private_token - = f.submit 'Reset', :confirm => "Are you sure?", :class => "btn" + = f.submit 'Reset', confirm: "Are you sure?", class: "btn" - else - = f.submit 'Generate', :class => "btn primary" + = f.submit 'Generate', class: "btn primary" diff --git a/app/views/projects/_form.html.haml b/app/views/projects/_form.html.haml index 6bc48df9183..ce66b2cf930 100644 --- a/app/views/projects/_form.html.haml +++ b/app/views/projects/_form.html.haml @@ -1,4 +1,4 @@ -= form_for(@project, :remote => true) do |f| += form_for(@project, remote: true) do |f| - if @project.errors.any? .alert-message.block-message.error %ul @@ -8,7 +8,7 @@ = f.label :name do Project name is .input - = f.text_field :name, :placeholder => "Example Project", :class => "xxlarge" + = f.text_field :name, placeholder: "Example Project", class: "xxlarge" %h5.page_title .alert.alert-info @@ -19,19 +19,19 @@ .input .input-prepend %strong - = text_field_tag :ppath, @project.path_to_repo, :class => "xlarge", :disabled => true + = text_field_tag :ppath, @project.path_to_repo, class: "xlarge", disabled: true .clearfix = f.label :code do URL .input .input-prepend %span.add-on= web_app_url - = f.text_field :code, :placeholder => "example" + = f.text_field :code, placeholder: "example" - unless @project.new_record? || @project.heads.empty? .clearfix = f.label :default_branch, "Default Branch" - .input= f.select(:default_branch, @project.heads.map(&:name), {}, :style => "width:210px;") + .input= f.select(:default_branch, @project.heads.map(&:name), {}, style: "width:210px;") - unless @project.new_record? .alert.alert-info @@ -56,8 +56,8 @@ %br .actions - = f.submit 'Save', :class => "btn primary" - = link_to 'Cancel', @project, :class => "btn" + = f.submit 'Save', class: "btn primary" + = link_to 'Cancel', @project, class: "btn" - unless @project.new_record? .right - = link_to 'Remove', @project, :confirm => 'Are you sure?', :method => :delete, :class => "btn danger" + = link_to 'Remove', @project, confirm: 'Are you sure?', method: :delete, class: "btn danger" diff --git a/app/views/projects/_new_form.html.haml b/app/views/projects/_new_form.html.haml index 9f3bfa86b91..5104df83a2c 100644 --- a/app/views/projects/_new_form.html.haml +++ b/app/views/projects/_new_form.html.haml @@ -1,4 +1,4 @@ -= form_for(@project, :remote => true) do |f| += form_for(@project, remote: true) do |f| - if @project.errors.any? .alert-message.block-message.error %span= @project.errors.full_messages.first @@ -6,8 +6,8 @@ = f.label :name do Project name is .input - = f.text_field :name, :placeholder => "Example Project", :class => "xxlarge" - = f.submit 'Create project', :class => "btn primary" + = f.text_field :name, placeholder: "Example Project", class: "xxlarge" + = f.submit 'Create project', class: "btn primary" %hr .alert.alert-info @@ -18,7 +18,7 @@ .input .input-prepend %span.add-on= Gitlab.config.ssh_path - = f.text_field :path, :placeholder => "example_project", :disabled => !@project.new_record? + = f.text_field :path, placeholder: "example_project", disabled: !@project.new_record? %span.add-on= ".git" .clearfix = f.label :code do @@ -26,4 +26,4 @@ .input .input-prepend %span.add-on= web_app_url - = f.text_field :code, :placeholder => "example" + = f.text_field :code, placeholder: "example" diff --git a/app/views/projects/_project_head.html.haml b/app/views/projects/_project_head.html.haml index f3ac3c27ccf..ba64ee7f996 100644 --- a/app/views/projects/_project_head.html.haml +++ b/app/views/projects/_project_head.html.haml @@ -1,29 +1,29 @@ %ul.nav.nav-tabs - %li{ :class => "#{'active' if current_page?(project_path(@project)) }" } - = link_to project_path(@project), :class => "activities-tab tab" do + %li{ class: "#{'active' if current_page?(project_path(@project)) }" } + = link_to project_path(@project), class: "activities-tab tab" do %i.icon-home Show - %li{ :class => " #{'active' if (controller.controller_name == "team_members") || current_page?(team_project_path(@project)) }" } - = link_to team_project_path(@project), :class => "team-tab tab" do + %li{ class: " #{'active' if (controller.controller_name == "team_members") || current_page?(team_project_path(@project)) }" } + = link_to team_project_path(@project), class: "team-tab tab" do %i.icon-user Team - %li{ :class => "#{'active' if current_page?(files_project_path(@project)) }" } - = link_to files_project_path(@project), :class => "files-tab tab " do + %li{ class: "#{'active' if current_page?(files_project_path(@project)) }" } + = link_to files_project_path(@project), class: "files-tab tab " do Attachments - %li{ :class => " #{'active' if (controller.controller_name == "snippets") }" } - = link_to project_snippets_path(@project), :class => "snippets-tab tab" do + %li{ class: " #{'active' if (controller.controller_name == "snippets") }" } + = link_to project_snippets_path(@project), class: "snippets-tab tab" do Snippets - if can? current_user, :admin_project, @project - %li.right{:class => "#{'active' if controller.controller_name == "deploy_keys"}"} + %li.right{class: "#{'active' if controller.controller_name == "deploy_keys"}"} = link_to project_deploy_keys_path(@project) do %span Deploy Keys - %li.right{:class => "#{'active' if controller.controller_name == "hooks" }"} + %li.right{class: "#{'active' if controller.controller_name == "hooks" }"} = link_to project_hooks_path(@project) do %span Hooks - %li.right{ :class => "#{'active' if current_page?(edit_project_path(@project)) }" } - = link_to edit_project_path(@project), :class => "stat-tab tab " do + %li.right{ class: "#{'active' if current_page?(edit_project_path(@project)) }" } + = link_to edit_project_path(@project), class: "stat-tab tab " do %i.icon-edit Edit diff --git a/app/views/projects/_refs.html.haml b/app/views/projects/_refs.html.haml index af15fbdfb3d..804b852340e 100644 --- a/app/views/projects/_refs.html.haml +++ b/app/views/projects/_refs.html.haml @@ -1,5 +1,5 @@ -= form_tag switch_project_refs_path(@project), :method => :get, :class => "project-refs-form" do - = select_tag "ref", grouped_options_refs, :onchange => "this.form.submit();", :class => "project-refs-select" += form_tag switch_project_refs_path(@project), method: :get, class: "project-refs-form" do + = select_tag "ref", grouped_options_refs, onchange: "this.form.submit();", class: "project-refs-select" = hidden_field_tag :destination, destination :javascript diff --git a/app/views/projects/_show.html.haml b/app/views/projects/_show.html.haml index c6755fa730a..e8a5b00dd0e 100644 --- a/app/views/projects/_show.html.haml +++ b/app/views/projects/_show.html.haml @@ -2,9 +2,9 @@ = @project.name %br %div - %a.btn.info{:href => tree_project_ref_path(@project, @project.root_ref)} Browse code + %a.btn.info{href: tree_project_ref_path(@project, @project.root_ref)} Browse code - %a.btn{:href => project_commits_path(@project)} Commits + %a.btn{href: project_commits_path(@project)} Commits %strong.right = link_to project_path(@project) do Switch to project → @@ -13,7 +13,7 @@ .input .input-prepend %span.add-on git clone - = text_field_tag :project_clone, @project.url_to_repo, :class => "xlarge one_click_select git_clone_url" + = text_field_tag :project_clone, @project.url_to_repo, class: "xlarge one_click_select git_clone_url" = simple_format @project.description - unless @events.blank? diff --git a/app/views/projects/_team.html.haml b/app/views/projects/_team.html.haml index 5839346052a..175aea27ed4 100644 --- a/app/views/projects/_team.html.haml +++ b/app/views/projects/_team.html.haml @@ -5,7 +5,7 @@ %th Permissions %tbody - @project.users_projects.each do |up| - = render(:partial => 'team_members/show', :locals => {:member => up}) + = render(partial: 'team_members/show', locals: {member: up}) :javascript diff --git a/app/views/projects/create.js.haml b/app/views/projects/create.js.haml index eeefc1729c8..2f6264a15af 100644 --- a/app/views/projects/create.js.haml +++ b/app/views/projects/create.js.haml @@ -1,6 +1,6 @@ - if @project.saved? :plain - location.href = "#{project_path(@project, :notice => 'Project was successfully created.')}"; + location.href = "#{project_path(@project, notice: 'Project was successfully created.')}"; - else - if @project.git_error? location.href = "#{errors_githost_path}"; diff --git a/app/views/projects/empty.html.haml b/app/views/projects/empty.html.haml index eef113e002b..b8d0dad973c 100644 --- a/app/views/projects/empty.html.haml +++ b/app/views/projects/empty.html.haml @@ -16,7 +16,7 @@ - setup_str = ["git config --global user.name \"#{current_user.name}\"", "git config --global user.email \"#{current_user.email}\""].join("\n") = preserve do - = raw bash_lexer.highlight(setup_str, :lexer => 'bash', :options => {:encoding => 'utf-8'}) + = raw bash_lexer.highlight(setup_str, lexer: 'bash', options: {encoding: 'utf-8'}) %br %br @@ -44,4 +44,4 @@ - if can? current_user, :admin_project, @project .alert-message.block-message.error.prepend-top-20 - = link_to 'Remove project', @project, :confirm => 'Are you sure?', :method => :delete, :class => "btn danger" + = link_to 'Remove project', @project, confirm: 'Are you sure?', method: :delete, class: "btn danger" diff --git a/app/views/projects/files.html.haml b/app/views/projects/files.html.haml index 52424ae4353..68d51df0b56 100644 --- a/app/views/projects/files.html.haml +++ b/app/views/projects/files.html.haml @@ -4,8 +4,8 @@ - @notes.each do |note| %tr %td - %a{:href => note.attachment.url} - = image_tag gravatar_icon(note.author_email), :class => "left", :width => 16 + %a{href: note.attachment.url} + = image_tag gravatar_icon(note.author_email), class: "left", width: 16 = note.attachment_identifier %td diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index 7c5b11e4be0..ebd2c8e4495 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -7,23 +7,23 @@ .input-prepend.project_clone_holder %span.add-on git clone - = link_to "SSH", "#", :class => "btn small active", :"data-clone" => @project.ssh_url_to_repo - = link_to "HTTP", "#", :class => "btn small", :"data-clone" => @project.http_url_to_repo - = text_field_tag :project_clone, @project.url_to_repo, :class => "one_click_select span5" + = link_to "SSH", "#", class: "btn small active", :"data-clone" => @project.ssh_url_to_repo + = link_to "HTTP", "#", class: "btn small", :"data-clone" => @project.http_url_to_repo + = text_field_tag :project_clone, @project.url_to_repo, class: "one_click_select span5" .span4.right .right - if can? current_user, :download_code, @project - = link_to archive_project_repository_path(@project), :class => "btn small grouped" do + = link_to archive_project_repository_path(@project), class: "btn small grouped" do %i.icon-download-alt Download - if @project.merge_requests_enabled && can?(current_user, :write_merge_request, @project) - = link_to new_project_merge_request_path(@project), :title => "New Merge Request", :class => "btn small grouped" do + = link_to new_project_merge_request_path(@project), title: "New Merge Request", class: "btn small grouped" do Merge Request - if @project.issues_enabled && can?(current_user, :write_issue, @project) - = link_to new_project_issue_path(@project), :title => "New Issue", :class => "btn small grouped" do + = link_to new_project_issue_path(@project), title: "New Issue", class: "btn small grouped" do Issue -= render "events/event_last_push", :event => @last_push += render "events/event_last_push", event: @last_push .content_list= render @events :javascript diff --git a/app/views/projects/team.html.haml b/app/views/projects/team.html.haml index 90be041479d..e8a825c741e 100644 --- a/app/views/projects/team.html.haml +++ b/app/views/projects/team.html.haml @@ -5,11 +5,11 @@ - if can? current_user, :admin_team_member, @project %p.slead - = link_to new_project_team_member_path(@project), :class => "btn small right", :title => "New Team Member" do + = link_to new_project_team_member_path(@project), class: "btn small right", title: "New Team Member" do New Team Member Read more about project permissions - %strong= link_to "here", help_permissions_path, :class => "vlink" + %strong= link_to "here", help_permissions_path, class: "vlink" -= render :partial => "team", :locals => {:project => @project} += render partial: "team", locals: {project: @project} diff --git a/app/views/projects/tree.js.haml b/app/views/projects/tree.js.haml index eb08adb1ddd..ba5d53c16a2 100644 --- a/app/views/projects/tree.js.haml +++ b/app/views/projects/tree.js.haml @@ -1,5 +1,5 @@ :plain $("#tree-holder table").hide("slide", { direction: "left" }, 150, function(){ - $("#tree-holder").html("#{escape_javascript(render(:partial => "tree", :locals => {:repo => @repo, :commit => @commit, :tree => @tree}))}"); + $("#tree-holder").html("#{escape_javascript(render(partial: "tree", locals: {repo: @repo, commit: @commit, tree: @tree}))}"); $("#tree-holder table").show("slide", { direction: "right" }, 150); }); diff --git a/app/views/projects/update.js.haml b/app/views/projects/update.js.haml index ee0d36996b5..a961dc39791 100644 --- a/app/views/projects/update.js.haml +++ b/app/views/projects/update.js.haml @@ -1,6 +1,6 @@ - if @project.valid? :plain - location.href = "#{edit_project_path(@project, :notice => 'Project was successfully updated.')}"; + location.href = "#{edit_project_path(@project, notice: 'Project was successfully updated.')}"; - else :plain $('.project_edit_holder').show(); diff --git a/app/views/projects/wall.html.haml b/app/views/projects/wall.html.haml index bd538e8f971..97765d7ac88 100644 --- a/app/views/projects/wall.html.haml +++ b/app/views/projects/wall.html.haml @@ -1,2 +1,2 @@ %div.wall_page - = render "notes/notes", :tid => nil, :tt => "wall" + = render "notes/notes", tid: nil, tt: "wall" diff --git a/app/views/protected_branches/index.html.haml b/app/views/protected_branches/index.html.haml index 586d4f6341f..2b93b0a83db 100644 --- a/app/views/protected_branches/index.html.haml +++ b/app/views/protected_branches/index.html.haml @@ -1,12 +1,12 @@ = render "repositories/branches_head" .alert - %p Protected branches designed to prevent push for all except #{link_to "masters", help_permissions_path, :class => "vlink"}. + %p Protected branches designed to prevent push for all except #{link_to "masters", help_permissions_path, class: "vlink"}. %p This ability allows: %ul %li keep stable branches secured %li forced code review before merge to protected branches - %p Read more about project permissions #{link_to "here", help_permissions_path, :class => "vlink"} + %p Read more about project permissions #{link_to "here", help_permissions_path, class: "vlink"} - if can? current_user, :admin_project, @project = form_for [@project, @protected_branch] do |f| @@ -19,9 +19,9 @@ .entry.clearfix = f.label :name, "Branch" .span3 - = f.select(:name, @project.open_branches.map { |br| [br.name, br.name] } , { :include_blank => "-- Select branch" }, { :class => "span3" }) + = f.select(:name, @project.open_branches.map { |br| [br.name, br.name] } , { include_blank: "-- Select branch" }, { class: "span3" }) - = f.submit 'Protect', :class => "primary btn" + = f.submit 'Protect', class: "primary btn" - unless @branches.empty? %table.admin-table @@ -34,18 +34,18 @@ - @branches.each do |branch| %tr %td - = link_to project_commits_path(@project, :ref => branch.name) do + = link_to project_commits_path(@project, ref: branch.name) do %strong= branch.name - if branch.name == @project.root_ref %span.label default %td = link_to project_commit_path(@project, branch.commit.id) do - = truncate branch.commit.id.to_s, :length => 10 + = truncate branch.commit.id.to_s, length: 10 = time_ago_in_words(branch.commit.committed_date) ago %td - if can? current_user, :admin_project, @project - = link_to 'Unprotect', [@project, branch], :confirm => 'Are you sure?', :method => :delete, :class => "danger btn small" + = link_to 'Unprotect', [@project, branch], confirm: 'Are you sure?', method: :delete, class: "danger btn small" :javascript $('select#protected_branch_name').chosen(); diff --git a/app/views/refs/_head.html.haml b/app/views/refs/_head.html.haml index 16a0cddfa24..8825493a0ec 100644 --- a/app/views/refs/_head.html.haml +++ b/app/views/refs/_head.html.haml @@ -1,10 +1,10 @@ %ul.nav.nav-tabs %li - = form_tag switch_project_refs_path(@project), :method => :get, :class => "project-refs-form", :remote => true do - = select_tag "ref", grouped_options_refs, :onchange => "$(this.form).trigger('submit');", :class => "project-refs-select" + = form_tag switch_project_refs_path(@project), method: :get, class: "project-refs-form", remote: true do + = select_tag "ref", grouped_options_refs, onchange: "$(this.form).trigger('submit');", class: "project-refs-select" = hidden_field_tag :destination, "tree" = hidden_field_tag :path, params[:path] - %li{:class => "#{'active' if (controller.controller_name == "refs") }"} + %li{class: "#{'active' if (controller.controller_name == "refs") }"} = link_to tree_project_ref_path(@project, @ref) do Source diff --git a/app/views/refs/_submodule_item.html.haml b/app/views/refs/_submodule_item.html.haml index 6db49310a08..6b9f5877028 100644 --- a/app/views/refs/_submodule_item.html.haml +++ b/app/views/refs/_submodule_item.html.haml @@ -1,13 +1,13 @@ - url = content.url(@ref) rescue nil - name = content.basename - return unless url -%tr{ :class => "tree-item", :url => url } +%tr{ class: "tree-item", url: url } %td.tree-item-file-name = image_tag "submodule.png" - %strong= truncate(name, :length => 40) + %strong= truncate(name, length: 40) %td %code= content.id[0..10] %td - = link_to truncate(url, :length => 40), url + = link_to truncate(url, length: 40), url diff --git a/app/views/refs/_tree.html.haml b/app/views/refs/_tree.html.haml index ba0bd69116b..6f8175da7a0 100644 --- a/app/views/refs/_tree.html.haml +++ b/app/views/refs/_tree.html.haml @@ -1,7 +1,7 @@ %ul.breadcrumb %li %span.arrow - = link_to tree_project_ref_path(@project, @ref, :path => nil), :remote => true do + = link_to tree_project_ref_path(@project, @ref, path: nil), remote: true do = @project.name - tree.breadcrumbs(6) do |link| \/ @@ -10,32 +10,32 @@ %div.tree_progress #tree-content-holder - if tree.is_blob? - = render :partial => "refs/tree_file", :locals => { :name => tree.name, :content => tree.data, :file => tree } + = render partial: "refs/tree_file", locals: { name: tree.name, content: tree.data, file: tree } - else - contents = tree.contents - %table#tree-slider.bordered-table.table{:class => "table_#{@hex_path}" } + %table#tree-slider.bordered-table.table{class: "table_#{@hex_path}" } %thead %th Name %th Last Update %th Last commit - = link_to "History", tree.history_path, :class => "right" + = link_to "History", tree.history_path, class: "right" - if tree.up_dir? - %tr{ :class => "tree-item", :url => tree.up_dir_path } + %tr{ class: "tree-item", url: tree.up_dir_path } %td.tree-item-file-name = image_tag "file_empty.png" - = link_to "..", tree.up_dir_path, :remote => :true + = link_to "..", tree.up_dir_path, remote: :true %td %td - index = 0 - contents.select{ |i| i.is_a?(Grit::Tree)}.each do |content| - = render :partial => "refs/tree_item", :locals => { :content => content, :index => (index += 1) } + = render partial: "refs/tree_item", locals: { content: content, index: (index += 1) } - contents.select{ |i| i.is_a?(Grit::Blob)}.each do |content| - = render :partial => "refs/tree_item", :locals => { :content => content, :index => (index += 1) } + = render partial: "refs/tree_item", locals: { content: content, index: (index += 1) } - contents.select{ |i| i.is_a?(Grit::Submodule)}.each do |content| - = render :partial => "refs/submodule_item", :locals => { :content => content, :index => (index += 1) } + = render partial: "refs/submodule_item", locals: { content: content, index: (index += 1) } - if content = contents.select{ |c| c.is_a?(Grit::Blob) and c.name =~ /^readme/i }.first .file_holder#README diff --git a/app/views/refs/_tree_commit.html.haml b/app/views/refs/_tree_commit.html.haml index 2c8cd932ada..a5681aa2f61 100644 --- a/app/views/refs/_tree_commit.html.haml +++ b/app/views/refs/_tree_commit.html.haml @@ -1,3 +1,3 @@ - if tm %strong= link_to "[#{tm.user_name}]", project_team_member_path(@project, tm) -= link_to_gfm truncate(content_commit.title, :length => tm ? 30 : 50), project_commit_path(@project, content_commit.id), :class => "tree-commit-link" += link_to_gfm truncate(content_commit.title, length: tm ? 30 : 50), project_commit_path(@project, content_commit.id), class: "tree-commit-link" diff --git a/app/views/refs/_tree_file.html.haml b/app/views/refs/_tree_file.html.haml index d45a03df8aa..b5ed61bb45a 100644 --- a/app/views/refs/_tree_file.html.haml +++ b/app/views/refs/_tree_file.html.haml @@ -5,9 +5,9 @@ = name %small #{file.mode} %span.options - = link_to "raw", blob_project_ref_path(@project, @ref, :path => params[:path]), :class => "btn very_small", :target => "_blank" - = link_to "history", project_commits_path(@project, :path => params[:path], :ref => @ref), :class => "btn very_small" - = link_to "blame", blame_file_project_ref_path(@project, @ref, :path => params[:path]), :class => "btn very_small" + = link_to "raw", blob_project_ref_path(@project, @ref, path: params[:path]), class: "btn very_small", target: "_blank" + = link_to "history", project_commits_path(@project, path: params[:path], ref: @ref), class: "btn very_small" + = link_to "blame", blame_file_project_ref_path(@project, @ref, path: params[:path]), class: "btn very_small" - if file.text? - if name =~ /\.(md|markdown)$/i .file_content.wiki @@ -16,7 +16,7 @@ - else .file_content.code - unless file.empty? - %div{:class => current_user.dark_scheme ? "black" : "white"} + %div{class: current_user.dark_scheme ? "black" : "white"} = preserve do = raw file.colorize(options: { linenos: 'True'}) - else @@ -24,14 +24,14 @@ - elsif file.image? .file_content.image_file - %img{ :src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} + %img{ src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} - else .file_content.blob_file %center - = link_to blob_project_ref_path(@project, @ref, :path => params[:path]) do + = link_to blob_project_ref_path(@project, @ref, path: params[:path]) do %div.padded %br - = image_tag "download.png", :width => 64 + = image_tag "download.png", width: 64 %h3 Download (#{file.mb_size}) diff --git a/app/views/refs/_tree_item.html.haml b/app/views/refs/_tree_item.html.haml index 4ce16b22ddd..2e6bbf6221b 100644 --- a/app/views/refs/_tree_item.html.haml +++ b/app/views/refs/_tree_item.html.haml @@ -1,11 +1,11 @@ - file = tree_full_path(content) -%tr{ :class => "tree-item #{tree_hex_class(content)}", :url => tree_file_project_ref_path(@project, @ref, file) } +%tr{ class: "tree-item #{tree_hex_class(content)}", url: tree_file_project_ref_path(@project, @ref, file) } %td.tree-item-file-name = tree_icon(content) - = link_to truncate(content.name, :length => 40), tree_file_project_ref_path(@project, @ref || @commit.id, file), :remote => :true + = link_to truncate(content.name, length: 40), tree_file_project_ref_path(@project, @ref || @commit.id, file), remote: :true %td.tree_time_ago.cgray - if index == 1 %span.log_loading Loading commit data.. - = image_tag "ajax_loader_tree.gif", :width => 14 + = image_tag "ajax_loader_tree.gif", width: 14 %td.tree_commit diff --git a/app/views/refs/blame.html.haml b/app/views/refs/blame.html.haml index 6d036c94c64..34478d4b491 100644 --- a/app/views/refs/blame.html.haml +++ b/app/views/refs/blame.html.haml @@ -4,7 +4,7 @@ %ul.breadcrumb %li %span.arrow - = link_to tree_project_ref_path(@project, @ref, :path => nil) do + = link_to tree_project_ref_path(@project, @ref, path: nil) do = @project.name - @tree.breadcrumbs(6) do |link| \/ @@ -18,9 +18,9 @@ = @tree.name %small blame %span.options - = link_to "raw", blob_project_ref_path(@project, @ref, :path => params[:path]), :class => "btn very_small", :target => "_blank" - = link_to "history", project_commits_path(@project, :path => params[:path], :ref => @ref), :class => "btn very_small" - = link_to "source", tree_file_project_ref_path(@project, @ref, :path => params[:path]), :class => "btn very_small" + = link_to "raw", blob_project_ref_path(@project, @ref, path: params[:path]), class: "btn very_small", target: "_blank" + = link_to "history", project_commits_path(@project, path: params[:path], ref: @ref), class: "btn very_small" + = link_to "source", tree_file_project_ref_path(@project, @ref, path: params[:path]), class: "btn very_small" .file_content.blame %table - @blame.each do |commit, lines| @@ -32,8 +32,8 @@ = commit.author_name %td.blame_commit - %code= link_to commit.short_id, project_commit_path(@project, :id => commit.id) - = link_to_gfm truncate(commit.title, :length => 30), project_commit_path(@project, :id => commit.id), :class => "row_title" rescue "--broken encoding" + %code= link_to commit.short_id, project_commit_path(@project, id: commit.id) + = link_to_gfm truncate(commit.title, length: 30), project_commit_path(@project, id: commit.id), class: "row_title" rescue "--broken encoding" %td.lines = preserve do %pre diff --git a/app/views/refs/logs_tree.js.haml b/app/views/refs/logs_tree.js.haml index 402f5aa72bc..61ccbaee1fe 100644 --- a/app/views/refs/logs_tree.js.haml +++ b/app/views/refs/logs_tree.js.haml @@ -6,4 +6,4 @@ :plain var row = $("table.table_#{@hex_path} tr.file_#{hexdigest(file_name)}"); row.find("td.tree_time_ago").html('#{escape_javascript(time_ago_in_words(content_commit.committed_date))} ago'); - row.find("td.tree_commit").html('#{escape_javascript(render("tree_commit", :tm => tm, :content_commit => content_commit))}'); + row.find("td.tree_commit").html('#{escape_javascript(render("tree_commit", tm: tm, content_commit: content_commit))}'); diff --git a/app/views/refs/tree.html.haml b/app/views/refs/tree.html.haml index b48f7f91782..181be6426d4 100644 --- a/app/views/refs/tree.html.haml +++ b/app/views/refs/tree.html.haml @@ -1,5 +1,5 @@ = render "head" -#tree-holder= render :partial => "tree", :locals => {:repo => @repo, :commit => @commit, :tree => @tree} +#tree-holder= render partial: "tree", locals: {repo: @repo, commit: @commit, tree: @tree} :javascript $(function() { diff --git a/app/views/refs/tree.js.haml b/app/views/refs/tree.js.haml index 9cf55057a6a..2eccf8c19a6 100644 --- a/app/views/refs/tree.js.haml +++ b/app/views/refs/tree.js.haml @@ -1,6 +1,6 @@ :plain // Load Files list - $("#tree-holder").html("#{escape_javascript(render(:partial => "tree", :locals => {:repo => @repo, :commit => @commit, :tree => @tree}))}"); + $("#tree-holder").html("#{escape_javascript(render(partial: "tree", locals: {repo: @repo, commit: @commit, tree: @tree}))}"); $("#tree-content-holder").show("slide", { direction: "right" }, 150); $('.project-refs-form #path').val("#{params[:path]}"); diff --git a/app/views/repositories/_branch.html.haml b/app/views/repositories/_branch.html.haml index b67c4026a4b..cf8558ec33e 100644 --- a/app/views/repositories/_branch.html.haml +++ b/app/views/repositories/_branch.html.haml @@ -2,20 +2,20 @@ - commit = CommitDecorator.decorate(commit) %tr %td - = link_to project_commits_path(@project, :ref => branch.name) do - %strong= truncate(branch.name, :length => 60) + = link_to project_commits_path(@project, ref: branch.name) do + %strong= truncate(branch.name, length: 60) - if branch.name == @project.root_ref %span.label default %td - = link_to project_commit_path(@project, :id => commit.id) do + = link_to project_commit_path(@project, id: commit.id) do %code= commit.short_id - = image_tag gravatar_icon(commit.author_email), :class => "", :width => 16 - = gfm truncate(commit.title, :length => 40) + = image_tag gravatar_icon(commit.author_email), class: "", width: 16 + = gfm truncate(commit.title, length: 40) %span.update-author.right = time_ago_in_words(commit.committed_date) ago %td - if can? current_user, :download_code, @project - = link_to "Download", archive_project_repository_path(@project, :ref => branch.name), :class => "visible_link download_repo_link" + = link_to "Download", archive_project_repository_path(@project, ref: branch.name), class: "visible_link download_repo_link" diff --git a/app/views/repositories/_branches_head.html.haml b/app/views/repositories/_branches_head.html.haml index 0c94f298270..6afff627b94 100644 --- a/app/views/repositories/_branches_head.html.haml +++ b/app/views/repositories/_branches_head.html.haml @@ -1,11 +1,11 @@ = render "commits/head" %ul.nav.nav-pills - %li{:class => ("active" if current_page?(project_repository_path(@project)))} + %li{class: ("active" if current_page?(project_repository_path(@project)))} = link_to project_repository_path(@project) do Recent - %li{:class => ("active" if current_page?(project_protected_branches_path(@project)))} + %li{class: ("active" if current_page?(project_protected_branches_path(@project)))} = link_to project_protected_branches_path(@project) do Protected - %li{:class => ("active" if current_page?(branches_project_repository_path(@project)))} + %li{class: ("active" if current_page?(branches_project_repository_path(@project)))} = link_to branches_project_repository_path(@project) do All diff --git a/app/views/repositories/_feed.html.haml b/app/views/repositories/_feed.html.haml index a9b9fd0069e..ac4eb483945 100644 --- a/app/views/repositories/_feed.html.haml +++ b/app/views/repositories/_feed.html.haml @@ -2,7 +2,7 @@ - commit = CommitDecorator.new(commit) %tr %td - = link_to project_commits_path(@project, :ref => commit.head.name) do + = link_to project_commits_path(@project, ref: commit.head.name) do %strong = commit.head.name - if commit.head.name == @project.root_ref @@ -12,8 +12,8 @@ %div = link_to project_commits_path(@project, commit.id) do %code= commit.short_id - = image_tag gravatar_icon(commit.author_email), :class => "", :width => 16 - = gfm truncate(commit.title, :length => 40) + = image_tag gravatar_icon(commit.author_email), class: "", width: 16 + = gfm truncate(commit.title, length: 40) %td %span.right.cgray = time_ago_in_words(commit.committed_date) diff --git a/app/views/repositories/branches.html.haml b/app/views/repositories/branches.html.haml index f4cf9193e34..45004bdff43 100644 --- a/app/views/repositories/branches.html.haml +++ b/app/views/repositories/branches.html.haml @@ -9,4 +9,4 @@ %tbody - @branches.each do |branch| - = render "repositories/branch", :branch => branch + = render "repositories/branch", branch: branch diff --git a/app/views/repositories/show.html.haml b/app/views/repositories/show.html.haml index add3324e060..a09cdd6212b 100644 --- a/app/views/repositories/show.html.haml +++ b/app/views/repositories/show.html.haml @@ -7,5 +7,5 @@ %th Last commit %th - @activities.each do |update| - = render "repositories/branch", :branch => update.head + = render "repositories/branch", branch: update.head diff --git a/app/views/repositories/tags.html.haml b/app/views/repositories/tags.html.haml index 8db6c5383cb..7fc2c3bfd2f 100644 --- a/app/views/repositories/tags.html.haml +++ b/app/views/repositories/tags.html.haml @@ -12,12 +12,12 @@ - commit = CommitDecorator.decorate(commit) %tr %td - %strong= link_to tag.name, project_commits_path(@project, :ref => tag.name), :class => "" + %strong= link_to tag.name, project_commits_path(@project, ref: tag.name), class: "" %td = link_to project_commit_path(@project, commit.id) do %code= commit.short_id - = image_tag gravatar_icon(commit.author_email), :class => "", :width => 16 - = gfm truncate(commit.title, :length => 40) + = image_tag gravatar_icon(commit.author_email), class: "", width: 16 + = gfm truncate(commit.title, length: 40) %td %span.update-author.right = time_ago_in_words(commit.committed_date) @@ -25,7 +25,7 @@ %td - if can? current_user, :download_code, @project - = link_to "Download", archive_project_repository_path(@project, :ref => tag.name), :class => "visible_link download_repo_link" + = link_to "Download", archive_project_repository_path(@project, ref: tag.name), class: "visible_link download_repo_link" - else %h3 No tags diff --git a/app/views/search/show.html.haml b/app/views/search/show.html.haml index b93a03af2f1..ed9da1f0753 100644 --- a/app/views/search/show.html.haml +++ b/app/views/search/show.html.haml @@ -1,10 +1,10 @@ -= form_tag search_path, :method => :get do |f| += form_tag search_path, method: :get do |f| .padded = label_tag :search do %strong Looking for .input - = text_field_tag :search, params[:search], :placeholder => "issue 143", :class => "input-xxlarge", :id => "dashboard_search" - = submit_tag 'Search', :class => "btn btn-primary" + = text_field_tag :search, params[:search], placeholder: "issue 143", class: "input-xxlarge", id: "dashboard_search" + = submit_tag 'Search', class: "btn btn-primary" - if params[:search].present? %br %h3 @@ -41,7 +41,7 @@ = link_to [merge_request.project, merge_request] do %span.badge.badge-info ##{merge_request.id} – - %strong.term= truncate merge_request.title, :length => 50 + %strong.term= truncate merge_request.title, length: 50 %strong.right %span.label= merge_request.project.name - if @merge_requests.blank? @@ -59,7 +59,7 @@ = link_to [issue.project, issue] do %span.badge.badge-info ##{issue.id} – - %strong.term= truncate issue.title, :length => 40 + %strong.term= truncate issue.title, length: 40 %strong.right %span.label= issue.project.name - if @issues.blank? diff --git a/app/views/snippets/_form.html.haml b/app/views/snippets/_form.html.haml index c9128f642fc..b8d8c09849d 100644 --- a/app/views/snippets/_form.html.haml +++ b/app/views/snippets/_form.html.haml @@ -10,22 +10,22 @@ .clearfix = f.label :title - .input= f.text_field :title, :placeholder => "Example Snippet" + .input= f.text_field :title, placeholder: "Example Snippet" .clearfix = f.label :file_name - .input= f.text_field :file_name, :placeholder => "example.rb" + .input= f.text_field :file_name, placeholder: "example.rb" .clearfix = f.label "Lifetime" - .input= f.select :expires_at, lifetime_select_options, {}, :style => "width:200px;" + .input= f.select :expires_at, lifetime_select_options, {}, style: "width:200px;" .clearfix = f.label :content, "Code" - .input= f.text_area :content, :class => "span8" + .input= f.text_area :content, class: "span8" .actions - = f.submit 'Save', :class => "primary btn" - = link_to "Cancel", project_snippets_path(@project), :class => " btn" + = f.submit 'Save', class: "primary btn" + = link_to "Cancel", project_snippets_path(@project), class: " btn" - unless @snippet.new_record? - .right= link_to 'Destroy', [@project, @snippet], :confirm => 'Are you sure?', :method => :delete, :class => "btn right danger delete-snippet", :id => "destroy_snippet_#{@snippet.id}" + .right= link_to 'Destroy', [@project, @snippet], confirm: 'Are you sure?', method: :delete, class: "btn right danger delete-snippet", id: "destroy_snippet_#{@snippet.id}" diff --git a/app/views/snippets/_snippet.html.haml b/app/views/snippets/_snippet.html.haml index 0385d753207..a2d3a65e6cb 100644 --- a/app/views/snippets/_snippet.html.haml +++ b/app/views/snippets/_snippet.html.haml @@ -1,7 +1,7 @@ %tr %td - %a{:href => project_snippet_path(snippet.project, snippet)} - %strong= truncate(snippet.title, :length => 60) + %a{href: project_snippet_path(snippet.project, snippet)} + %strong= truncate(snippet.title, length: 60) %td = snippet.file_name %td diff --git a/app/views/snippets/index.html.haml b/app/views/snippets/index.html.haml index a6b07716ccb..2d07921e879 100644 --- a/app/views/snippets/index.html.haml +++ b/app/views/snippets/index.html.haml @@ -2,7 +2,7 @@ - if can? current_user, :write_snippet, @project .alert-message.block-message - = link_to new_project_snippet_path(@project), :class => "btn small add_new right", :title => "New Snippet" do + = link_to new_project_snippet_path(@project), class: "btn small add_new right", title: "New Snippet" do Add new snippet Share code pastes with others if it cant be in a git repository %br @@ -17,5 +17,5 @@ = render @snippets.fresh - if @snippets.fresh.empty? %tr - %td{:colspan => 3} + %td{colspan: 3} %h3.nothing_here_message Nothing here. diff --git a/app/views/snippets/show.html.haml b/app/views/snippets/show.html.haml index b266e4d2156..0800b81d330 100644 --- a/app/views/snippets/show.html.haml +++ b/app/views/snippets/show.html.haml @@ -4,7 +4,7 @@ = @snippet.title %small= @snippet.file_name - if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user - = link_to "Edit", edit_project_snippet_path(@project, @snippet), :class => "btn small right" + = link_to "Edit", edit_project_snippet_path(@project, @snippet), class: "btn small right" %br .file_holder @@ -12,9 +12,9 @@ %i.icon-file %strong= @snippet.file_name %span.options - = link_to "raw", raw_project_snippet_path(@project, @snippet), :class => "btn very_small", :target => "_blank" + = link_to "raw", raw_project_snippet_path(@project, @snippet), class: "btn very_small", target: "_blank" .file_content.code - %div{:class => current_user.dark_scheme ? "black" : ""} + %div{class: current_user.dark_scheme ? "black" : ""} = raw @snippet.colorize(options: { linenos: 'True'}) -= render "notes/notes", :tid => @snippet.id, :tt => "snippet" += render "notes/notes", tid: @snippet.id, tt: "snippet" diff --git a/app/views/team_members/_form.html.haml b/app/views/team_members/_form.html.haml index 1d882e295d9..208794b9ee2 100644 --- a/app/views/team_members/_form.html.haml +++ b/app/views/team_members/_form.html.haml @@ -1,6 +1,6 @@ %h3= "New Team member" %hr -= form_for @team_member, :as => :team_member, :url => project_team_members_path(@project, @team_member) do |f| += form_for @team_member, as: :team_member, url: project_team_members_path(@project, @team_member) do |f| -if @team_member.errors.any? .alert-message.block-message.error %ul @@ -9,17 +9,17 @@ .clearfix = f.label :user_id, "Name" - .input= f.select(:user_id, User.not_in_project(@project).all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" }, { :style => "width:300px" }) + .input= f.select(:user_id, User.not_in_project(@project).all.collect {|p| [ p.name, p.id ] }, { include_blank: "Select user" }, { style: "width:300px" }) .clearfix = f.label :project_access, "Project Access" - .input= f.select :project_access, options_for_select(Project.access_options, @team_member.project_access), {}, :class => "project-access-select" + .input= f.select :project_access, options_for_select(Project.access_options, @team_member.project_access), {}, class: "project-access-select" .actions - = f.submit 'Save', :class => "btn primary" - = link_to "Cancel", team_project_path(@project), :class => "btn" + = f.submit 'Save', class: "btn primary" + = link_to "Cancel", team_project_path(@project), class: "btn" :css form select { diff --git a/app/views/team_members/_show.html.haml b/app/views/team_members/_show.html.haml index 9f023c416ae..f47554c1dad 100644 --- a/app/views/team_members/_show.html.haml +++ b/app/views/team_members/_show.html.haml @@ -1,6 +1,6 @@ - user = member.user - allow_admin = can? current_user, :admin_project, @project -%tr{:id => dom_id(member), :class => "team_member_row user_#{user.id}"} +%tr{id: dom_id(member), class: "team_member_row user_#{user.id}"} %td .right - if @project.owner == user @@ -8,13 +8,13 @@ - if user.blocked %span.label Blocked - = link_to project_team_member_path(@project, member), :title => user.name, :class => "dark" do - = image_tag gravatar_icon(user.email, 40), :class => "avatar" - = link_to project_team_member_path(@project, member), :title => user.name, :class => "dark" do - %strong= truncate(user.name, :lenght => 40) + = link_to project_team_member_path(@project, member), title: user.name, class: "dark" do + = image_tag gravatar_icon(user.email, 40), class: "avatar" + = link_to project_team_member_path(@project, member), title: user.name, class: "dark" do + %strong= truncate(user.name, lenght: 40) %br %div.cgray= user.email %td - = form_for(member, :as => :team_member, :url => project_team_member_path(@project, member)) do |f| - = f.select :project_access, options_for_select(UsersProject.access_roles, member.project_access), {}, :class => "medium project-access-select", :disabled => !allow_admin + = form_for(member, as: :team_member, url: project_team_member_path(@project, member)) do |f| + = f.select :project_access, options_for_select(UsersProject.access_roles, member.project_access), {}, class: "medium project-access-select", disabled: !allow_admin diff --git a/app/views/team_members/show.html.haml b/app/views/team_members/show.html.haml index bcdb5c6f90e..d7e09bced63 100644 --- a/app/views/team_members/show.html.haml +++ b/app/views/team_members/show.html.haml @@ -3,9 +3,9 @@ .team_member_show - if can? current_user, :admin_project, @project - = 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" + = 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" .profile_avatar_holder - = image_tag gravatar_icon(user.email, 60), :class => "borders" + = image_tag gravatar_icon(user.email, 60), class: "borders" %h3 = user.name %small @@ -14,7 +14,7 @@ %hr .back_link %br - = link_to team_project_path(@project), :class => "" do + = link_to team_project_path(@project), class: "" do ← To team list %br .row @@ -46,10 +46,10 @@ %tr %td Project Access: - %small (#{link_to "read more", help_permissions_path, :class => "vlink"}) + %small (#{link_to "read more", help_permissions_path, class: "vlink"}) %td - = form_for(@team_member, :as => :team_member, :url => project_team_member_path(@project, @team_member)) do |f| - = f.select :project_access, options_for_select(Project.access_options, @team_member.project_access), {}, :class => "project-access-select", :disabled => !allow_admin + = form_for(@team_member, as: :team_member, url: project_team_member_path(@project, @team_member)) do |f| + = f.select :project_access, options_for_select(Project.access_options, @team_member.project_access), {}, class: "project-access-select", disabled: !allow_admin %hr = render user.recent_events.limit(5) :javascript diff --git a/app/views/wikis/_form.html.haml b/app/views/wikis/_form.html.haml index 20b5b112819..6b6411be55b 100644 --- a/app/views/wikis/_form.html.haml +++ b/app/views/wikis/_form.html.haml @@ -9,7 +9,7 @@ .main_box .top_box_content = f.label :title - .input= f.text_field :title, :class => 'span8' + .input= f.text_field :title, class: 'span8' = f.hidden_field :slug .middle_box_content .input @@ -20,7 +20,7 @@ .bottom_box_content = f.label :content - .input= f.text_area :content, :class => 'span8' + .input= f.text_area :content, class: 'span8' .actions - = f.submit 'Save', :class => "primary btn" - = link_to "Cancel", project_wiki_path(@project, :index), :class => "btn" + = f.submit 'Save', class: "primary btn" + = link_to "Cancel", project_wiki_path(@project, :index), class: "btn" diff --git a/app/views/wikis/history.html.haml b/app/views/wikis/history.html.haml index f82c681fcde..e31c5dc2426 100644 --- a/app/views/wikis/history.html.haml +++ b/app/views/wikis/history.html.haml @@ -13,7 +13,7 @@ %tr %td= i + 1 %td - = link_to wiki_page.created_at.to_s(:short), project_wiki_path(@project, wiki_page, :old_page_id => wiki_page.id) + = link_to wiki_page.created_at.to_s(:short), project_wiki_path(@project, wiki_page, old_page_id: wiki_page.id) (#{time_ago_in_words(wiki_page.created_at)} ago) %td= wiki_page.user.name diff --git a/app/views/wikis/pages.html.haml b/app/views/wikis/pages.html.haml index c84621193d5..2bfd0deb149 100644 --- a/app/views/wikis/pages.html.haml +++ b/app/views/wikis/pages.html.haml @@ -10,7 +10,7 @@ - @wikis.each_with_index do |wiki_page, i| %tr %td - = link_to wiki_page.title, project_wiki_path(@project, wiki_page, :old_page_id => wiki_page.id) + = link_to wiki_page.title, project_wiki_path(@project, wiki_page, old_page_id: wiki_page.id) (#{time_ago_in_words(wiki_page.created_at)} ago) %td= wiki_page.slug diff --git a/app/views/wikis/show.html.haml b/app/views/wikis/show.html.haml index 579aeb41796..fc2352271d5 100644 --- a/app/views/wikis/show.html.haml +++ b/app/views/wikis/show.html.haml @@ -1,12 +1,12 @@ %h3.page_title = @wiki.title %span.right - = link_to pages_project_wikis_path(@project), :class => "btn small grouped" do + = link_to pages_project_wikis_path(@project), class: "btn small grouped" do Pages - if can? current_user, :write_wiki, @project - = link_to history_project_wiki_path(@project, @wiki), :class => "btn small grouped" do + = link_to history_project_wiki_path(@project, @wiki), class: "btn small grouped" do History - = link_to edit_project_wiki_path(@project, @wiki), :class => "btn small grouped" do + = link_to edit_project_wiki_path(@project, @wiki), class: "btn small grouped" do %i.icon-edit Edit %br @@ -17,8 +17,8 @@ %p.time Last edited by #{@wiki.user.name}, #{time_ago_in_words @wiki.created_at} ago - if can? current_user, :admin_wiki, @project - = link_to project_wiki_path(@project, @wiki), :confirm => "Are you sure you want to delete this page?", :method => :delete do + = link_to project_wiki_path(@project, @wiki), confirm: "Are you sure you want to delete this page?", method: :delete do Delete this page %hr -.wiki_notes#notes= render "notes/notes", :tid => @wiki.id, :tt => "wiki" +.wiki_notes#notes= render "notes/notes", tid: @wiki.id, tt: "wiki" |