Commit 77541891 authored by Robert Speicher's avatar Robert Speicher

Fully embrace Ruby 1.9 hash syntax

Didn't bother with files in db/, config/, or features/
parent 1413c23c
class CommitLoad < BaseContext class CommitLoad < BaseContext
def execute def execute
result = { result = {
:commit => nil, commit: nil,
:suppress_diff => false, suppress_diff: false,
:line_notes => [], line_notes: [],
:notes_count => 0, notes_count: 0,
:note => nil note: nil
} }
commit = project.commit(params[:id]) commit = project.commit(params[:id])
......
...@@ -12,12 +12,12 @@ class IssuesBulkUpdateContext < BaseContext ...@@ -12,12 +12,12 @@ class IssuesBulkUpdateContext < BaseContext
opts[:assignee_id] = assignee_id if assignee_id.present? opts[:assignee_id] = assignee_id if assignee_id.present?
opts[:closed] = (status == "closed") if status.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 = issues.select { |issue| can?(current_user, :modify_issue, issue) }
issues.each { |issue| issue.update_attributes(opts) } issues.each { |issue| issue.update_attributes(opts) }
{ {
:count => issues.count, count: issues.count,
:success => !issues.count.zero? success: !issues.count.zero?
} }
end end
end end
......
...@@ -2,7 +2,7 @@ class Admin::ProjectsController < ApplicationController ...@@ -2,7 +2,7 @@ class Admin::ProjectsController < ApplicationController
layout "admin" layout "admin"
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :authenticate_admin! 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 def index
@admin_projects = Project.scoped @admin_projects = Project.scoped
...@@ -36,7 +36,7 @@ class Admin::ProjectsController < ApplicationController ...@@ -36,7 +36,7 @@ class Admin::ProjectsController < ApplicationController
if @admin_project.save if @admin_project.save
redirect_to [:admin, @admin_project], notice: 'Project was successfully created.' redirect_to [:admin, @admin_project], notice: 'Project was successfully created.'
else else
render :action => "new" render action: "new"
end end
end end
...@@ -50,7 +50,7 @@ class Admin::ProjectsController < ApplicationController ...@@ -50,7 +50,7 @@ class Admin::ProjectsController < ApplicationController
if @admin_project.update_attributes(params[:project]) if @admin_project.update_attributes(params[:project])
redirect_to [:admin, @admin_project], notice: 'Project was successfully updated.' redirect_to [:admin, @admin_project], notice: 'Project was successfully updated.'
else else
render :action => "edit" render action: "edit"
end end
end end
......
...@@ -34,7 +34,7 @@ class Admin::UsersController < ApplicationController ...@@ -34,7 +34,7 @@ class Admin::UsersController < ApplicationController
def new 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 end
def edit def edit
......
...@@ -11,15 +11,15 @@ class ApplicationController < ActionController::Base ...@@ -11,15 +11,15 @@ class ApplicationController < ActionController::Base
helper_method :abilities, :can? helper_method :abilities, :can?
rescue_from Gitlab::Gitolite::AccessDenied do |exception| rescue_from Gitlab::Gitolite::AccessDenied do |exception|
render "errors/gitolite", :layout => "error" render "errors/gitolite", layout: "error"
end end
rescue_from Encoding::CompatibilityError do |exception| rescue_from Encoding::CompatibilityError do |exception|
render "errors/encoding", :layout => "error", :status => 404 render "errors/encoding", layout: "error", status: 404
end end
rescue_from ActiveRecord::RecordNotFound do |exception| rescue_from ActiveRecord::RecordNotFound do |exception|
render "errors/not_found", :layout => "error", :status => 404 render "errors/not_found", layout: "error", status: 404
end end
layout :layout_by_resource layout :layout_by_resource
...@@ -97,15 +97,15 @@ class ApplicationController < ActionController::Base ...@@ -97,15 +97,15 @@ class ApplicationController < ActionController::Base
end end
def access_denied! def access_denied!
render "errors/access_denied", :layout => "error", :status => 404 render "errors/access_denied", layout: "error", status: 404
end end
def not_found! def not_found!
render "errors/not_found", :layout => "error", :status => 404 render "errors/not_found", layout: "error", status: 404
end end
def git_not_found! def git_not_found!
render "errors/git_not_found", :layout => "error", :status => 404 render "errors/git_not_found", layout: "error", status: 404
end end
def method_missing(method_sym, *arguments, &block) def method_missing(method_sym, *arguments, &block)
...@@ -127,7 +127,7 @@ class ApplicationController < ActionController::Base ...@@ -127,7 +127,7 @@ class ApplicationController < ActionController::Base
end end
def render_404 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 end
def require_non_empty_project def require_non_empty_project
......
...@@ -9,7 +9,7 @@ class CommitsController < ApplicationController ...@@ -9,7 +9,7 @@ class CommitsController < ApplicationController
before_filter :authorize_read_project! before_filter :authorize_read_project!
before_filter :authorize_code_access! before_filter :authorize_code_access!
before_filter :require_non_empty_project 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 before_filter :render_full_content
def index def index
...@@ -22,7 +22,7 @@ class CommitsController < ApplicationController ...@@ -22,7 +22,7 @@ class CommitsController < ApplicationController
respond_to do |format| respond_to do |format|
format.html # index.html.erb format.html # index.html.erb
format.js format.js
format.atom { render :layout => false } format.atom { render layout: false }
end end
end end
...@@ -61,9 +61,9 @@ class CommitsController < ApplicationController ...@@ -61,9 +61,9 @@ class CommitsController < ApplicationController
send_data( send_data(
@commit.to_patch, @commit.to_patch,
:type => "text/plain", type: "text/plain",
:disposition => 'attachment', disposition: 'attachment',
:filename => (@commit.id.to_s + ".patch") filename: (@commit.id.to_s + ".patch")
) )
end end
end end
...@@ -9,7 +9,7 @@ class DashboardController < ApplicationController ...@@ -9,7 +9,7 @@ class DashboardController < ApplicationController
respond_to do |format| respond_to do |format|
format.html format.html
format.js format.js
format.atom { render :layout => false } format.atom { render layout: false }
end end
end end
...@@ -28,7 +28,7 @@ class DashboardController < ApplicationController ...@@ -28,7 +28,7 @@ class DashboardController < ApplicationController
respond_to do |format| respond_to do |format|
format.html format.html
format.atom { render :layout => false } format.atom { render layout: false }
end end
end end
end end
...@@ -40,7 +40,7 @@ class DeployKeysController < ApplicationController ...@@ -40,7 +40,7 @@ class DeployKeysController < ApplicationController
respond_to do |format| respond_to do |format|
format.html { redirect_to project_deploy_keys_url } format.html { redirect_to project_deploy_keys_url }
format.js { render :nothing => true } format.js { render nothing: true }
end end
end end
end end
...@@ -6,7 +6,7 @@ class HooksController < ApplicationController ...@@ -6,7 +6,7 @@ class HooksController < ApplicationController
# Authorize # Authorize
before_filter :add_project_abilities before_filter :add_project_abilities
before_filter :authorize_read_project! 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 respond_to :html
......
...@@ -2,7 +2,7 @@ class IssuesController < ApplicationController ...@@ -2,7 +2,7 @@ class IssuesController < ApplicationController
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :project before_filter :project
before_filter :module_enabled before_filter :module_enabled
before_filter :issue, :only => [:edit, :update, :destroy, :show] before_filter :issue, only: [:edit, :update, :destroy, :show]
helper_method :issues_filter helper_method :issues_filter
layout "project" layout "project"
...@@ -14,13 +14,13 @@ class IssuesController < ApplicationController ...@@ -14,13 +14,13 @@ class IssuesController < ApplicationController
before_filter :authorize_read_issue! before_filter :authorize_read_issue!
# Allow write(create) issue # Allow write(create) issue
before_filter :authorize_write_issue!, :only => [:new, :create] before_filter :authorize_write_issue!, only: [:new, :create]
# Allow modify issue # Allow modify issue
before_filter :authorize_modify_issue!, :only => [:close, :edit, :update] before_filter :authorize_modify_issue!, only: [:close, :edit, :update]
# Allow destroy issue # Allow destroy issue
before_filter :authorize_admin_issue!, :only => [:destroy] before_filter :authorize_admin_issue!, only: [:destroy]
respond_to :js, :html respond_to :js, :html
...@@ -32,7 +32,7 @@ class IssuesController < ApplicationController ...@@ -32,7 +32,7 @@ class IssuesController < ApplicationController
respond_to do |format| respond_to do |format|
format.html # index.html.erb format.html # index.html.erb
format.js format.js
format.atom { render :layout => false } format.atom { render layout: false }
end end
end end
...@@ -46,7 +46,7 @@ class IssuesController < ApplicationController ...@@ -46,7 +46,7 @@ class IssuesController < ApplicationController
end end
def show def show
@note = @project.notes.new(:noteable => @issue) @note = @project.notes.new(noteable: @issue)
respond_to do |format| respond_to do |format|
format.html format.html
...@@ -66,7 +66,7 @@ class IssuesController < ApplicationController ...@@ -66,7 +66,7 @@ class IssuesController < ApplicationController
end end
def update 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| respond_to do |format|
format.js format.js
...@@ -87,20 +87,20 @@ class IssuesController < ApplicationController ...@@ -87,20 +87,20 @@ class IssuesController < ApplicationController
respond_to do |format| respond_to do |format|
format.html { redirect_to project_issues_path } format.html { redirect_to project_issues_path }
format.js { render :nothing => true } format.js { render nothing: true }
end end
end end
def sort def sort
return render_404 unless can?(current_user, :admin_issue, @project) 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| @issues.each do |issue|
issue.position = params['issue'].index(issue.id.to_s) + 1 issue.position = params['issue'].index(issue.id.to_s) + 1
issue.save issue.save
end end
render :nothing => true render nothing: true
end end
def search def search
...@@ -110,12 +110,12 @@ class IssuesController < ApplicationController ...@@ -110,12 +110,12 @@ class IssuesController < ApplicationController
@issues = @issues.where("title LIKE ?", "%#{terms}%") unless terms.blank? @issues = @issues.where("title LIKE ?", "%#{terms}%") unless terms.blank?
@issues = @issues.page(params[:page]).per(100) @issues = @issues.page(params[:page]).per(100)
render :partial => 'issues' render partial: 'issues'
end end
def bulk_update def bulk_update
result = IssuesBulkUpdateContext.new(project, current_user, params).execute 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 end
protected protected
...@@ -144,8 +144,8 @@ class IssuesController < ApplicationController ...@@ -144,8 +144,8 @@ class IssuesController < ApplicationController
else @project.issues.opened else @project.issues.opened
end end
@issues = @issues.where(:assignee_id => params[:assignee_id]) if params[:assignee_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.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.tagged_with(params[:label_name]) if params[:label_name].present?
@issues = @issues.includes(:author, :project).order("updated_at") @issues = @issues.includes(:author, :project).order("updated_at")
@issues @issues
......
...@@ -29,7 +29,7 @@ class KeysController < ApplicationController ...@@ -29,7 +29,7 @@ class KeysController < ApplicationController
respond_to do |format| respond_to do |format|
format.html { redirect_to keys_url } format.html { redirect_to keys_url }
format.js { render :nothing => true } format.js { render nothing: true }
end end
end end
end end
...@@ -2,9 +2,9 @@ class MergeRequestsController < ApplicationController ...@@ -2,9 +2,9 @@ class MergeRequestsController < ApplicationController
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :project before_filter :project
before_filter :module_enabled before_filter :module_enabled
before_filter :merge_request, :only => [:edit, :update, :destroy, :show, :commits, :diffs, :automerge, :automerge_check, :raw] 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 :validates_merge_request, only: [:show, :diffs, :raw]
before_filter :define_show_vars, :only => [:show, :diffs] before_filter :define_show_vars, only: [:show, :diffs]
layout "project" layout "project"
# Authorize # Authorize
...@@ -14,13 +14,13 @@ class MergeRequestsController < ApplicationController ...@@ -14,13 +14,13 @@ class MergeRequestsController < ApplicationController
before_filter :authorize_read_merge_request! before_filter :authorize_read_merge_request!
# Allow write(create) 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 # 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 # Allow destroy merge_request
before_filter :authorize_admin_merge_request!, :only => [:destroy] before_filter :authorize_admin_merge_request!, only: [:destroy]
def index def index
...@@ -66,7 +66,7 @@ class MergeRequestsController < ApplicationController ...@@ -66,7 +66,7 @@ class MergeRequestsController < ApplicationController
end end
def update 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.reload_code
@merge_request.mark_as_unchecked @merge_request.mark_as_unchecked
redirect_to [@project, @merge_request], notice: 'Merge request was successfully updated.' redirect_to [@project, @merge_request], notice: 'Merge request was successfully updated.'
...@@ -79,7 +79,7 @@ class MergeRequestsController < ApplicationController ...@@ -79,7 +79,7 @@ class MergeRequestsController < ApplicationController
if @merge_request.unchecked? if @merge_request.unchecked?
@merge_request.check_if_can_be_merged @merge_request.check_if_can_be_merged
end end
render :json => {:state => @merge_request.human_state} render json: {state: @merge_request.human_state}
end end
def automerge def automerge
...@@ -138,7 +138,7 @@ class MergeRequestsController < ApplicationController ...@@ -138,7 +138,7 @@ class MergeRequestsController < ApplicationController
def define_show_vars def define_show_vars
# Build a note object for comment form # 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 # Get commits from repository
# or from cache if already merged # or from cache if already merged
......
...@@ -2,7 +2,7 @@ class MilestonesController < ApplicationController ...@@ -2,7 +2,7 @@ class MilestonesController < ApplicationController
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :project before_filter :project
before_filter :module_enabled before_filter :module_enabled
before_filter :milestone, :only => [:edit, :update, :destroy, :show] before_filter :milestone, only: [:edit, :update, :destroy, :show]
layout "project" layout "project"
# Authorize # Authorize
...@@ -12,7 +12,7 @@ class MilestonesController < ApplicationController ...@@ -12,7 +12,7 @@ class MilestonesController < ApplicationController
before_filter :authorize_read_milestone! before_filter :authorize_read_milestone!
# Allow admin milestone # Allow admin milestone
before_filter :authorize_admin_milestone!, :except => [:index, :show] before_filter :authorize_admin_milestone!, except: [:index, :show]
respond_to :html respond_to :html
...@@ -77,7 +77,7 @@ class MilestonesController < ApplicationController ...@@ -77,7 +77,7 @@ class MilestonesController < ApplicationController
respond_to do |format| respond_to do |format|
format.html { redirect_to project_milestones_path } format.html { redirect_to project_milestones_path }
format.js { render :nothing => true } format.js { render nothing: true }
end end
end end
......
...@@ -5,7 +5,7 @@ class NotesController < ApplicationController ...@@ -5,7 +5,7 @@ class NotesController < ApplicationController
before_filter :add_project_abilities before_filter :add_project_abilities
before_filter :authorize_read_note! before_filter :authorize_read_note!
before_filter :authorize_write_note!, :only => [:create] before_filter :authorize_write_note!, only: [:create]
respond_to :js respond_to :js
...@@ -29,12 +29,12 @@ class NotesController < ApplicationController ...@@ -29,12 +29,12 @@ class NotesController < ApplicationController
@note.destroy @note.destroy
respond_to do |format| respond_to do |format|
format.js { render :nothing => true } format.js { render nothing: true }
end end
end end
def preview def preview
render :text => view_context.markdown(params[:note]) render text: view_context.markdown(params[:note])
end end
protected protected
......
...@@ -26,7 +26,7 @@ class ProfileController < ApplicationController ...@@ -26,7 +26,7 @@ class ProfileController < ApplicationController
flash[:notice] = "Password was successfully updated. Please login with it" flash[:notice] = "Password was successfully updated. Please login with it"
redirect_to new_user_session_path redirect_to new_user_session_path
else else
render :action => "password" render action: "password"
end end
end end
......
require File.join(Rails.root, 'lib', 'graph_commit') require File.join(Rails.root, 'lib', 'graph_commit')
class ProjectsController < ApplicationController class ProjectsController < ApplicationController
before_filter :project, :except => [:index, :new, :create] before_filter :project, except: [:index, :new, :create]
layout :determine_layout layout :determine_layout
# Authorize # Authorize
before_filter :add_project_abilities before_filter :add_project_abilities
before_filter :authorize_read_project!, :except => [:index, :new, :create] before_filter :authorize_read_project!, except: [:index, :new, :create]
before_filter :authorize_admin_project!, :only => [:edit, :update, :destroy] before_filter :authorize_admin_project!, only: [:edit, :update, :destroy]
before_filter :require_non_empty_project, :only => [:blob, :tree, :graph] before_filter :require_non_empty_project, only: [:blob, :tree, :graph]
def new def new
@project = Project.new @project = Project.new
...@@ -35,7 +35,7 @@ class ProjectsController < ApplicationController ...@@ -35,7 +35,7 @@ class ProjectsController < ApplicationController
def update def update
respond_to do |format| respond_to do |format|
if project.update_attributes(params[:project]) 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 format.js
else else
format.html { render action: "edit" } format.html { render action: "edit" }
......
...@@ -6,7 +6,7 @@ class ProtectedBranchesController < ApplicationController ...@@ -6,7 +6,7 @@ class ProtectedBranchesController < ApplicationController
before_filter :authorize_read_project! before_filter :authorize_read_project!
before_filter :require_non_empty_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 before_filter :render_full_content
layout "project" layout "project"
...@@ -26,7 +26,7 @@ class ProtectedBranchesController < ApplicationController ...@@ -26,7 +26,7 @@ class ProtectedBranchesController < ApplicationController
respond_to do |format| respond_to do |format|
format.html { redirect_to project_protected_branches_path } format.html { redirect_to project_protected_branches_path }
format.js { render :nothing => true } format.js { render nothing: true }
end end
end end
end end
...@@ -9,7 +9,7 @@ class RefsController < ApplicationController ...@@ -9,7 +9,7 @@ class RefsController < ApplicationController
before_filter :require_non_empty_project before_filter :require_non_empty_project
before_filter :ref 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 before_filter :render_full_content
layout "project" layout "project"
...@@ -20,7 +20,7 @@ class RefsController < ApplicationController ...@@ -20,7 +20,7 @@ class RefsController < ApplicationController
new_path = if params[:destination] == "tree" new_path = if params[:destination] == "tree"
tree_project_ref_path(@project, params[:ref]) tree_project_ref_path(@project, params[:ref])
else else
project_commits_path(@project, :ref => params[:ref]) project_commits_path(@project, ref: params[:ref])
end end
redirect_to new_path redirect_to new_path
...@@ -53,8 +53,8 @@ class RefsController < ApplicationController ...@@ -53,8 +53,8 @@ class RefsController < ApplicationController
last_commit = @project.commits(@commit.id, file, 1).last last_commit = @project.commits(@commit.id, file, 1).last
last_commit = CommitDecorator.decorate(last_commit) last_commit = CommitDecorator.decorate(last_commit)
{ {
:file_name => content.name, file_name: content.name,
:commit => last_commit commit: last_commit
} }
end end
end end
...@@ -70,9 +70,9 @@ class RefsController < ApplicationController ...@@ -70,9 +70,9 @@ class RefsController < ApplicationController
send_data( send_data(
@tree.data, @tree.data,
:type => mime_type, type: mime_type,
:disposition => 'inline', disposition: 'inline',
:filename => @tree.name filename: @tree.name
) )
else else
head(404) head(404)
......
...@@ -8,8 +8,8 @@ class SearchController < ApplicationController ...@@ -8,8 +8,8 @@ class SearchController < ApplicationController
if query.present? if query.present?
@projects = current_user.projects.search(query).limit(10) @projects = current_user.projects.search(query).limit(10)
@merge_requests = MergeRequest.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) @issues = Issue.where(project_id: current_user.project_ids).search(query).limit(10)
end end
end end
end end
class SnippetsController < ApplicationController class SnippetsController < ApplicationController
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :project before_filter :project
before_filter :snippet, :only => [:show, :edit, :destroy, :update, :raw] before_filter :snippet, only: [:show, :edit, :destroy, :update, :raw]
layout "project" layout "project"
# Authorize # Authorize
...@@ -11,13 +11,13 @@ class SnippetsController < ApplicationController ...@@ -11,13 +11,13 @@ class SnippetsController < ApplicationController
before_filter :authorize_read_snippet! before_filter :authorize_read_snippet!
# Allow write(create) snippet # Allow write(create) snippet
before_filter :authorize_write_snippet!, :only => [:new, :create] before_filter :authorize_write_snippet!, only: [:new, :create]
# Allow modify snippet # Allow modify snippet
before_filter :authorize_modify_snippet!, :only => [:edit, :update] before_filter :authorize_modify_snippet!, only: [:edit, :update]
# Allow destroy snippet # Allow destroy snippet
before_filter :authorize_admin_snippet!, :only => [:destroy] before_filter :authorize_admin_snippet!, only: [:destroy]
respond_to :html respond_to :html
...@@ -55,7 +55,7 @@ class SnippetsController < ApplicationController ...@@ -55,7 +55,7 @@ class SnippetsController < ApplicationController
end end
def show def show
@note = @project.notes.new(:noteable => @snippet) @note = @project.notes.new(noteable: @snippet)
render_full_content render_full_content
end end
...@@ -70,9 +70,9 @@ class SnippetsController < ApplicationController ...@@ -70,9 +70,9 @@ class SnippetsController < ApplicationController
def raw def raw
send_data( send_data(
@snippet.content, @snippet.content,
:type => "text/plain", type: "text/plain",
:disposition => 'inline', disposition: 'inline',
:filename => @snippet.file_name filename: @snippet.file_name
) )
end end
......
...@@ -5,7 +5,7 @@ class TeamMembersController < ApplicationController ...@@ -5,7 +5,7 @@ class TeamMembersController < ApplicationController
# Authorize # Authorize
before_filter :add_project_abilities before_filter :add_project_abilities
before_filter :authorize_read_project! before_filter :authorize_read_project!
before_filter :authorize_admin_project!, :except => [:show] before_filter :authorize_admin_project!, except: [:show]
def show def show
@team_member = project.users_projects.find(params[:id]) @team_member = project.users_projects.find(params[:id])
...@@ -41,7 +41,7 @@ class TeamMembersController < ApplicationController ...@@ -41,7 +41,7 @@ class TeamMembersController < ApplicationController
respond_to do |format| respond_to do |format|
format.html { redirect_to team_project_path(@project) } format.html { redirect_to team_project_path(@project) }
format.js { render :nothing => true } format.js { render nothing: true }
end end
end end
end end
...@@ -2,8 +2,8 @@ class WikisController < ApplicationController ...@@ -2,8 +2,8 @@ class WikisController < ApplicationController
before_filter :project before_filter :project
before_filter :add_project_abilities before_filter :add_project_abilities
before_filter :authorize_read_wiki! before_filter :authorize_read_wiki!
before_filter :authorize_write_wiki!, :only => [:edit, :create, :history] before_filter :authorize_write_wiki!, only: [:edit, :create, :history]
before_filter :authorize_admin_wiki!, :only => :destroy before_filter :authorize_admin_wiki!, only: :destroy
layout "project" layout "project"
def pages def pages
...@@ -14,16 +14,16 @@ class WikisController < ApplicationController ...@@ -14,16 +14,16 @@ class WikisController < ApplicationController
if params[:old_page_id] if params[:old_page_id]
@wiki = @project.wikis.find(params[:old_page_id]) @wiki = @project.wikis.find(params[:old_page_id])
else else
@wiki = @project.wikis.where(:slug => params[:id]).order("created_at").last @wiki = @project.wikis.where(slug: params[:id]).order("created_at").last
end end
@note = @project.notes.new(:noteable => @wiki) @note = @project.notes.new(noteable: @wiki)
if @wiki if @wiki
render 'show' render 'show'
else else
if can?(current_user, :write_wiki, @project) if can?(current_user, :write_wiki, @project)
@wiki = @project.wikis.new(:slug => params[:id]) @wiki = @project.wikis.new(slug: params[:id])
render 'edit' render 'edit'
else else
render 'empty' render 'empty'
...@@ -32,7 +32,7 @@ class WikisController < ApplicationController ...@@ -32,7 +32,7 @@ class WikisController < ApplicationController
end end
def edit 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 @wiki = Wiki.regenerate_from @wiki
end end
...@@ -50,11 +50,11 @@ class WikisController < ApplicationController ...@@ -50,11 +50,11 @@ class WikisController < ApplicationController
end end
def history def history
@wikis = @project.wikis.where(:slug => params[:id]).order("created_at") @wikis = @project.wikis.where(slug: params[:id]).order("created_at")
end end
def destroy def destroy
@wikis = @project.wikis.where(:slug => params[:id]).delete_all @wikis = @project.wikis.where(slug: params[:id]).delete_all
respond_to do |format| respond_to do |format|
format.html { redirect_to project_wiki_path(@project, :index), notice: "Page was successfully deleted" } format.html { redirect_to project_wiki_path(@project, :index), notice: "Page was successfully deleted" }
......
...@@ -15,7 +15,7 @@ class ApplicationDecorator < Drapper::Base ...@@ -15,7 +15,7 @@ class ApplicationDecorator < Drapper::Base
# #
# def formatted_timestamp(time) # def formatted_timestamp(time)
# h.content_tag :span, time.strftime("%a %m/%d/%y"), # h.content_tag :span, time.strftime("%a %m/%d/%y"),
# :class => 'timestamp' # class: 'timestamp'
# end # end
# #
# def created_at # def created_at
......
...@@ -19,7 +19,7 @@ class EventDecorator < ApplicationDecorator ...@@ -19,7 +19,7 @@ class EventDecorator < ApplicationDecorator
elsif self.merge_request? elsif self.merge_request?
h.project_merge_request_url(self.project, self.merge_request) h.project_merge_request_url(self.project, self.merge_request)
elsif self.push? 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 end
end end
...@@ -8,14 +8,14 @@ class TreeDecorator < ApplicationDecorator ...@@ -8,14 +8,14 @@ class TreeDecorator < ApplicationDecorator
#parts = parts[0...-1] if is_blob? #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| parts.each do |part|
part_path = File.join(part_path, part) unless part_path.empty? part_path = File.join(part_path, part) unless part_path.empty?
part_path = part if part_path.empty? part_path = part if part_path.empty?
next unless parts.last(2).include?(part) if parts.count > max_links 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 end
end end
...@@ -30,7 +30,7 @@ class TreeDecorator < ApplicationDecorator ...@@ -30,7 +30,7 @@ class TreeDecorator < ApplicationDecorator
end end
def history_path def history_path
h.project_commits_path(project, :path => path, :ref => ref) h.project_commits_path(project, path: path, ref: ref)
end end
def mb_size def mb_size
......
...@@ -43,23 +43,23 @@ module ApplicationHelper ...@@ -43,23 +43,23 @@ module ApplicationHelper
end end
def search_autocomplete_source 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 = [ default_nav = [
{ :label => "Profile", :url => profile_path }, { label: "Profile", url: profile_path },
{ :label => "Keys", :url => keys_path }, { label: "Keys", url: keys_path },
{ :label => "Dashboard", :url => root_path }, { label: "Dashboard", url: root_path },
{ :label => "Admin", :url => admin_root_path } { label: "Admin", url: admin_root_path }
] ]
project_nav = [] project_nav = []
if @project && !@project.new_record? if @project && !@project.new_record?
project_nav = [ project_nav = [
{ :label => "#{@project.name} / Issues", :url => project_issues_path(@project) }, { label: "#{@project.name} / Issues", url: project_issues_path(@project) },
{ :label => "#{@project.name} / Wall", :url => wall_project_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} / Tree", url: tree_project_ref_path(@project, @project.root_ref) },
{ :label => "#{@project.name} / Commits", :url => project_commits_path(@project) }, { label: "#{@project.name} / Commits", url: project_commits_path(@project) },
{ :label => "#{@project.name} / Team", :url => team_project_path(@project) } { label: "#{@project.name} / Team", url: team_project_path(@project) }
] ]
end end
...@@ -89,7 +89,7 @@ module ApplicationHelper ...@@ -89,7 +89,7 @@ module ApplicationHelper
when :wall; wall_tab? when :wall; wall_tab?
when :wiki; controller.controller_name == "wikis" when :wiki; controller.controller_name == "wikis"
when :issues; issues_tab? 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" when :merge_requests; controller.controller_name == "merge_requests"
# Dashboard Area # Dashboard Area
...@@ -100,10 +100,10 @@ module ApplicationHelper ...@@ -100,10 +100,10 @@ module ApplicationHelper
when :root; current_page?(dashboard_path) || current_page?(root_path) when :root; current_page?(dashboard_path) || current_page?(root_path)
# Profile Area # Profile Area
when :profile; current_page?(:controller => "profile", :action => :show) when :profile; current_page?(controller: "profile", action: :show)
when :password; current_page?(:controller => "profile", :action => :password) when :password; current_page?(controller: "profile", action: :password)
when :token; current_page?(:controller => "profile", :action => :token) when :token; current_page?(controller: "profile", action: :token)
when :design; current_page?(:controller => "profile", :action => :design) when :design; current_page?(controller: "profile", action: :design)
when :ssh_keys; controller.controller_name == "keys" when :ssh_keys; controller.controller_name == "keys"
# Admin Area # Admin Area
......
...@@ -28,32 +28,32 @@ module GitlabMarkdownHelper ...@@ -28,32 +28,32 @@ module GitlabMarkdownHelper
# team member: @foo # team member: @foo
when /^@/ when /^@/
user = @project.users.where(:name => user_name).first user = @project.users.where(name: user_name).first
member = @project.users_projects.where(:user_id => user).first if user 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 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 # issue: #123
when /^#/ when /^#/
# avoid HTML entities # avoid HTML entities
unless prefix.try(:end_with?, "&") && suffix.try(:start_with?, ";") unless prefix.try(:end_with?, "&") && suffix.try(:start_with?, ";")
issue = @project.issues.where(:id => issue_id).first 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 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 end
# merge request: !123 # merge request: !123
when /^!/ when /^!/
merge_request = @project.merge_requests.where(:id => merge_request_id).first 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 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 # snippet: $123
when /^\$/ when /^\$/
snippet = @project.snippets.where(:id => snippet_id).first 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 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... # commit: 123456...
when /^\h/ when /^\h/
commit = @project.commit(commit_id) 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 end # case
......
...@@ -9,7 +9,7 @@ module IssuesHelper ...@@ -9,7 +9,7 @@ module IssuesHelper
tm = project.team_member_by_id(issue.assignee_id) tm = project.team_member_by_id(issue.assignee_id)
if tm 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 else
issue.assignee_name issue.assignee_name
end end
...@@ -20,7 +20,7 @@ module IssuesHelper ...@@ -20,7 +20,7 @@ module IssuesHelper
tm = project.team_member_by_id(issue.author_id) tm = project.team_member_by_id(issue.author_id)
if tm 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 else
issue.author_name issue.author_name
end end
......
...@@ -4,7 +4,7 @@ module MergeRequestsHelper ...@@ -4,7 +4,7 @@ module MergeRequestsHelper
tm = project.team_member_by_id(merge_request.assignee_id) tm = project.team_member_by_id(merge_request.assignee_id)
if tm 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 else
merge_request.assignee_name merge_request.assignee_name
end end
...@@ -15,7 +15,7 @@ module MergeRequestsHelper ...@@ -15,7 +15,7 @@ module MergeRequestsHelper
tm = project.team_member_by_id(merge_request.author_id) tm = project.team_member_by_id(merge_request.author_id)
if tm 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 else
merge_request.author_name merge_request.author_name
end end
...@@ -24,10 +24,10 @@ module MergeRequestsHelper ...@@ -24,10 +24,10 @@ module MergeRequestsHelper
def new_mr_path_from_push_event(event) def new_mr_path_from_push_event(event)
new_project_merge_request_path( new_project_merge_request_path(
event.project, event.project,
:merge_request => { merge_request: {
:source_branch => event.branch_name, source_branch: event.branch_name,
:target_branch => event.project.root_ref, target_branch: event.project.root_ref,
:title => event.branch_name.titleize title: event.branch_name.titleize
} }
) )
end end
......
...@@ -4,12 +4,12 @@ module TabHelper ...@@ -4,12 +4,12 @@ module TabHelper
end end
def wall_tab? def wall_tab?
current_page?(:controller => "projects", :action => "wall", :id => @project) current_page?(controller: "projects", action: "wall", id: @project)
end end
def project_tab_class def project_tab_class
[:show, :files, :team, :edit, :update].each do |action| [: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 end
if ['snippets', 'hooks', 'deploy_keys', 'team_members'].include? controller.controller_name if ['snippets', 'hooks', 'deploy_keys', 'team_members'].include? controller.controller_name
......
...@@ -12,20 +12,20 @@ class Notify < ActionMailer::Base ...@@ -12,20 +12,20 @@ class Notify < ActionMailer::Base
def new_user_email(user_id, password) def new_user_email(user_id, password)
@user = User.find(user_id) @user = User.find(user_id)
@password = password @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 end
def new_issue_email(issue_id) def new_issue_email(issue_id)
@issue = Issue.find(issue_id) @issue = Issue.find(issue_id)
@project = @issue.project @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 end
def note_wall_email(recipient_id, note_id) def note_wall_email(recipient_id, note_id)
recipient = User.find(recipient_id) recipient = User.find(recipient_id)
@note = Note.find(note_id) @note = Note.find(note_id)
@project = @note.project @project = @note.project
mail(:to => recipient.email, :subject => "gitlab | #{@project.name}") mail(to: recipient.email, subject: "gitlab | #{@project.name}")
end end
def note_commit_email(recipient_id, note_id) def note_commit_email(recipient_id, note_id)
...@@ -34,7 +34,7 @@ class Notify < ActionMailer::Base ...@@ -34,7 +34,7 @@ class Notify < ActionMailer::Base
@commit = @note.target @commit = @note.target
@commit = CommitDecorator.decorate(@commit) @commit = CommitDecorator.decorate(@commit)
@project = @note.project @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 end
def note_merge_request_email(recipient_id, note_id) def note_merge_request_email(recipient_id, note_id)
...@@ -42,7 +42,7 @@ class Notify < ActionMailer::Base ...@@ -42,7 +42,7 @@ class Notify < ActionMailer::Base
@note = Note.find(note_id) @note = Note.find(note_id)
@merge_request = @note.noteable @merge_request = @note.noteable
@project = @note.project @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 end
def note_issue_email(recipient_id, note_id) def note_issue_email(recipient_id, note_id)
...@@ -50,7 +50,7 @@ class Notify < ActionMailer::Base ...@@ -50,7 +50,7 @@ class Notify < ActionMailer::Base
@note = Note.find(note_id) @note = Note.find(note_id)
@issue = @note.noteable @issue = @note.noteable
@project = @note.project @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 end
def note_wiki_email(recipient_id, note_id) def note_wiki_email(recipient_id, note_id)
...@@ -58,13 +58,13 @@ class Notify < ActionMailer::Base ...@@ -58,13 +58,13 @@ class Notify < ActionMailer::Base
@note = Note.find(note_id) @note = Note.find(note_id)
@wiki = @note.noteable @wiki = @note.noteable
@project = @note.project @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 end
def new_merge_request_email(merge_request_id) def new_merge_request_email(merge_request_id)
@merge_request = MergeRequest.find(merge_request_id) @merge_request = MergeRequest.find(merge_request_id)
@project = @merge_request.project @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 end
def reassigned_merge_request_email(recipient_id, merge_request_id, previous_assignee_id) def reassigned_merge_request_email(recipient_id, merge_request_id, previous_assignee_id)
...@@ -72,7 +72,7 @@ class Notify < ActionMailer::Base ...@@ -72,7 +72,7 @@ class Notify < ActionMailer::Base
@merge_request = MergeRequest.find(merge_request_id) @merge_request = MergeRequest.find(merge_request_id)
@previous_assignee ||= User.find(previous_assignee_id) @previous_assignee ||= User.find(previous_assignee_id)
@project = @merge_request.project @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 end
def reassigned_issue_email(recipient_id, issue_id, previous_assignee_id) def reassigned_issue_email(recipient_id, issue_id, previous_assignee_id)
...@@ -80,6 +80,6 @@ class Notify < ActionMailer::Base ...@@ -80,6 +80,6 @@ class Notify < ActionMailer::Base
@issue = Issue.find(issue_id) @issue = Issue.find(issue_id)
@previous_assignee ||= User.find(previous_assignee_id) @previous_assignee ||= User.find(previous_assignee_id)
@project = @issue.project @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
end end
...@@ -20,7 +20,7 @@ class Commit ...@@ -20,7 +20,7 @@ class Commit
:tree, :tree,
:id, :id,
:to_patch, :to_patch,
:to => :commit to: :commit
class << self class << self
...@@ -57,7 +57,7 @@ class Commit ...@@ -57,7 +57,7 @@ class Commit
def commits_since(repo, date) def commits_since(repo, date)
commits = repo.heads.map do |h| 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 } end.flatten.uniq { |c| c.id }
commits.sort! do |x, y| commits.sort! do |x, y|
...@@ -69,7 +69,7 @@ class Commit ...@@ -69,7 +69,7 @@ class Commit
def commits(repo, ref, path = nil, limit = nil, offset = nil) def commits(repo, ref, path = nil, limit = nil, offset = nil)
if path if path
repo.log(ref, path, :max_count => limit, :skip => offset) repo.log(ref, path, max_count: limit, skip: offset)
elsif limit && offset elsif limit && offset
repo.commits(ref, limit, offset) repo.commits(ref, limit, offset)
else else
...@@ -86,9 +86,9 @@ class Commit ...@@ -86,9 +86,9 @@ class Commit
last = project.commit(from.try(:strip)) last = project.commit(from.try(:strip))
result = { result = {
:commits => [], commits: [],
:diffs => [], diffs: [],
:commit => nil commit: nil
} }
if first && last if first && last
......
...@@ -12,13 +12,13 @@ class Event < ActiveRecord::Base ...@@ -12,13 +12,13 @@ class Event < ActiveRecord::Base
Merged = 7 Merged = 7
belongs_to :project belongs_to :project
belongs_to :target, :polymorphic => true belongs_to :target, polymorphic: true
# For Hash only # For Hash only
serialize :data serialize :data
scope :recent, order("created_at DESC") scope :recent, order("created_at DESC")
scope :code_push, where(:action => Pushed) scope :code_push, where(action: Pushed)
def self.determine_action(record) def self.determine_action(record)
if [Issue, MergeRequest].include? record.class if [Issue, MergeRequest].include? record.class
...@@ -29,7 +29,7 @@ class Event < ActiveRecord::Base ...@@ -29,7 +29,7 @@ class Event < ActiveRecord::Base
end end
def self.recent_for_user user def self.recent_for_user user
where(:project_id => user.projects.map(&:id)).recent where(project_id: user.projects.map(&:id)).recent
end end
# Next events currently enabled for system # Next events currently enabled for system
...@@ -106,9 +106,9 @@ class Event < ActiveRecord::Base ...@@ -106,9 +106,9 @@ class Event < ActiveRecord::Base
end end
end end
delegate :name, :email, :to => :author, :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: :issue, prefix: true, allow_nil: true
delegate :title, :to => :merge_request, :prefix => true, :allow_nil => true delegate :title, to: :merge_request, prefix: true, allow_nil: true
end end
# == Schema Information # == Schema Information
# #
......
...@@ -7,7 +7,7 @@ class Issue < ActiveRecord::Base ...@@ -7,7 +7,7 @@ class Issue < ActiveRecord::Base
belongs_to :milestone belongs_to :milestone
validates :description, validates :description,
:length => { :within => 0..2000 } length: { within: 0..2000 }
acts_as_list acts_as_list
......
...@@ -6,16 +6,16 @@ class Key < ActiveRecord::Base ...@@ -6,16 +6,16 @@ class Key < ActiveRecord::Base
belongs_to :project belongs_to :project
validates :title, validates :title,
:presence => true, presence: true,
:length => { :within => 0..255 } length: { within: 0..255 }
validates :key, validates :key,
:presence => true, presence: true,
:length => { :within => 0..5000 } length: { within: 0..5000 }
before_save :set_identifier before_save :set_identifier
before_validation :strip_white_space before_validation :strip_white_space
delegate :name, :email, :to => :user, :prefix => true delegate :name, :email, to: :user, prefix: true
validate :unique_key validate :unique_key
def strip_white_space def strip_white_space
...@@ -23,7 +23,7 @@ class Key < ActiveRecord::Base ...@@ -23,7 +23,7 @@ class Key < ActiveRecord::Base
end end
def unique_key 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 query = query.where('(project_id IS NULL OR project_id = ?)', project_id) if project_id
if (query.count > 0) if (query.count > 0)
errors.add :key, 'already exist.' errors.add :key, 'already exist.'
......
...@@ -20,7 +20,7 @@ class MergeRequest < ActiveRecord::Base ...@@ -20,7 +20,7 @@ class MergeRequest < ActiveRecord::Base
validate :validate_branches validate :validate_branches
def self.find_all_by_branch(branch_name) 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 end
def human_state def human_state
...@@ -48,7 +48,7 @@ class MergeRequest < ActiveRecord::Base ...@@ -48,7 +48,7 @@ class MergeRequest < ActiveRecord::Base
end end
def mark_as_unchecked def mark_as_unchecked
self.update_attributes(:state => UNCHECKED) self.update_attributes(state: UNCHECKED)
end end
def can_be_merged? def can_be_merged?
...@@ -101,11 +101,11 @@ class MergeRequest < ActiveRecord::Base ...@@ -101,11 +101,11 @@ class MergeRequest < ActiveRecord::Base
end end
def merge_event 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 end
def closed_event 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 end
def commits def commits
...@@ -128,7 +128,7 @@ class MergeRequest < ActiveRecord::Base ...@@ -128,7 +128,7 @@ class MergeRequest < ActiveRecord::Base
end end
def mark_as_unmergable def mark_as_unmergable
self.update_attributes :state => CANNOT_BE_MERGED self.update_attributes state: CANNOT_BE_MERGED
end end
def reloaded_commits def reloaded_commits
...@@ -150,11 +150,11 @@ class MergeRequest < ActiveRecord::Base ...@@ -150,11 +150,11 @@ class MergeRequest < ActiveRecord::Base
def merge!(user_id) def merge!(user_id)
self.mark_as_merged! self.mark_as_merged!
Event.create( Event.create(
:project => self.project, project: self.project,
:action => Event::Merged, action: Event::Merged,
:target_id => self.id, target_id: self.id,
:target_type => "MergeRequest", target_type: "MergeRequest",
:author_id => user_id author_id: user_id
) )
end end
......
...@@ -24,7 +24,7 @@ class Milestone < ActiveRecord::Base ...@@ -24,7 +24,7 @@ class Milestone < ActiveRecord::Base
end end
def participants def participants
User.where(:id => issues.map(&:assignee_id)) User.where(id: issues.map(&:assignee_id))
end end
def percent_complete def percent_complete
......
...@@ -3,18 +3,18 @@ require 'file_size_validator' ...@@ -3,18 +3,18 @@ require 'file_size_validator'
class Note < ActiveRecord::Base class Note < ActiveRecord::Base
belongs_to :project belongs_to :project
belongs_to :noteable, :polymorphic => true belongs_to :noteable, polymorphic: true
belongs_to :author, belongs_to :author,
:class_name => "User" class_name: "User"
delegate :name, delegate :name,
:to => :project, to: :project,
:prefix => true prefix: true
delegate :name, delegate :name,
:email, :email,
:to => :author, to: :author,
:prefix => true prefix: true
attr_protected :author, :author_id attr_protected :author, :author_id
attr_accessor :notify attr_accessor :notify
...@@ -23,19 +23,19 @@ class Note < ActiveRecord::Base ...@@ -23,19 +23,19 @@ class Note < ActiveRecord::Base
validates_presence_of :project validates_presence_of :project
validates :note, validates :note,
:presence => true, presence: true,
:length => { :within => 0..5000 } length: { within: 0..5000 }
validates :attachment, validates :attachment,
:file_size => { file_size: {
:maximum => 10.megabytes.to_i 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 :today, where("created_at >= :date", date: Date.today)
scope :last_week, where("created_at >= :date", :date => (Date.today - 7.days)) scope :last_week, where("created_at >= :date", date: (Date.today - 7.days))
scope :since, lambda { |day| where("created_at >= :date", :date => (day)) } scope :since, lambda { |day| where("created_at >= :date", date: (day)) }
scope :fresh, order("created_at DESC") scope :fresh, order("created_at DESC")
scope :inc_author_project, includes(:project, :author) scope :inc_author_project, includes(:project, :author)
scope :inc_author, includes(:author) scope :inc_author, includes(:author)
...@@ -43,11 +43,11 @@ class Note < ActiveRecord::Base ...@@ -43,11 +43,11 @@ class Note < ActiveRecord::Base
mount_uploader :attachment, AttachmentUploader mount_uploader :attachment, AttachmentUploader
def self.create_status_change_note(noteable, author, status) def self.create_status_change_note(noteable, author, status)
create({ :noteable => noteable, create({ noteable: noteable,
:project => noteable.project, project: noteable.project,
:author => author, author: author,
:note => "_Status changed to #{status}_" }, note: "_Status changed to #{status}_" },
:without_protection => true) without_protection: true)
end end
def notify def notify
......
...@@ -9,19 +9,19 @@ class Project < ActiveRecord::Base ...@@ -9,19 +9,19 @@ class Project < ActiveRecord::Base
# #
# Relations # Relations
# #
belongs_to :owner, :class_name => "User" belongs_to :owner, class_name: "User"
has_many :users, :through => :users_projects has_many :users, through: :users_projects
has_many :events, :dependent => :destroy has_many :events, dependent: :destroy
has_many :merge_requests, :dependent => :destroy has_many :merge_requests, dependent: :destroy
has_many :issues, :dependent => :destroy, :order => "closed, created_at DESC" has_many :issues, dependent: :destroy, order: "closed, created_at DESC"
has_many :milestones, :dependent => :destroy has_many :milestones, dependent: :destroy
has_many :users_projects, :dependent => :destroy has_many :users_projects, dependent: :destroy
has_many :notes, :dependent => :destroy has_many :notes, dependent: :destroy
has_many :snippets, :dependent => :destroy has_many :snippets, dependent: :destroy
has_many :deploy_keys, :dependent => :destroy, :foreign_key => "project_id", :class_name => "Key" has_many :deploy_keys, dependent: :destroy, foreign_key: "project_id", class_name: "Key"
has_many :hooks, :dependent => :destroy, :class_name => "ProjectHook" has_many :hooks, dependent: :destroy, class_name: "ProjectHook"
has_many :wikis, :dependent => :destroy has_many :wikis, dependent: :destroy
has_many :protected_branches, :dependent => :destroy has_many :protected_branches, dependent: :destroy
attr_accessor :error_code attr_accessor :error_code
...@@ -33,15 +33,15 @@ class Project < ActiveRecord::Base ...@@ -33,15 +33,15 @@ class Project < ActiveRecord::Base
# #
# Scopes # Scopes
# #
scope :public_only, where(:private_flag => false) scope :public_only, where(private_flag: false)
scope :without_user, lambda { |user| where("id not in (:ids)", :ids => user.projects.map(&:id) ) } scope :without_user, lambda { |user| where("id not in (:ids)", ids: user.projects.map(&:id) ) }
def self.active def self.active
joins(:issues, :notes, :merge_requests).order("issues.created_at, notes.created_at, merge_requests.created_at DESC") joins(:issues, :notes, :merge_requests).order("issues.created_at, notes.created_at, merge_requests.created_at DESC")
end end
def self.search query 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 end
def self.create_by_user(params, user) def self.create_by_user(params, user)
...@@ -53,7 +53,7 @@ class Project < ActiveRecord::Base ...@@ -53,7 +53,7 @@ class Project < ActiveRecord::Base
project.save! project.save!
# Add user as project master # 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 # when project saved no team member exist so
# project repository should be updated after first user add # project repository should be updated after first user add
...@@ -82,28 +82,28 @@ class Project < ActiveRecord::Base ...@@ -82,28 +82,28 @@ class Project < ActiveRecord::Base
# Validations # Validations
# #
validates :name, validates :name,
:uniqueness => true, uniqueness: true,
:presence => true, presence: true,
:length => { :within => 0..255 } length: { within: 0..255 }
validates :path, validates :path,
:uniqueness => true, uniqueness: true,
:presence => true, presence: true,
:format => { :with => /^[a-zA-Z][a-zA-Z0-9_\-\.]*$/, format: { with: /^[a-zA-Z][a-zA-Z0-9_\-\.]*$/,
:message => "only letters, digits & '_' '-' '.' allowed. Letter should be first" }, message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" },
:length => { :within => 0..255 } length: { within: 0..255 }
validates :description, validates :description,
:length => { :within => 0..2000 } length: { within: 0..2000 }
validates :code, validates :code,
:presence => true, presence: true,
:uniqueness => true, uniqueness: true,
:format => { :with => /^[a-zA-Z][a-zA-Z0-9_\-\.]*$/, format: { with: /^[a-zA-Z][a-zA-Z0-9_\-\.]*$/,
:message => "only letters, digits & '_' '-' '.' allowed. Letter should be first" }, message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" },
:length => { :within => 1..255 } length: { within: 1..255 }
validates :owner, :presence => true validates :owner, presence: true
validate :check_limit validate :check_limit
validate :repo_name validate :repo_name
...@@ -134,19 +134,19 @@ class Project < ActiveRecord::Base ...@@ -134,19 +134,19 @@ class Project < ActiveRecord::Base
end end
def common_notes def common_notes
notes.where(:noteable_type => ["", nil]).inc_author_project notes.where(noteable_type: ["", nil]).inc_author_project
end end
def build_commit_note(commit) def build_commit_note(commit)
notes.new(:noteable_id => commit.id, :noteable_type => "Commit") notes.new(noteable_id: commit.id, noteable_type: "Commit")
end end
def commit_notes(commit) 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 end
def commit_line_notes(commit) 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 end
def public? def public?
......
...@@ -2,29 +2,29 @@ class Snippet < ActiveRecord::Base ...@@ -2,29 +2,29 @@ class Snippet < ActiveRecord::Base
include Linguist::BlobHelper include Linguist::BlobHelper
belongs_to :project belongs_to :project
belongs_to :author, :class_name => "User" belongs_to :author, class_name: "User"
has_many :notes, :as => :noteable, :dependent => :destroy has_many :notes, as: :noteable, dependent: :destroy
delegate :name, delegate :name,
:email, :email,
:to => :author, to: :author,
:prefix => true prefix: true
attr_protected :author, :author_id, :project, :project_id attr_protected :author, :author_id, :project, :project_id
validates_presence_of :project_id validates_presence_of :project_id
validates_presence_of :author_id validates_presence_of :author_id
validates :title, validates :title,
:presence => true, presence: true,
:length => { :within => 0..255 } length: { within: 0..255 }
validates :file_name, validates :file_name,
:presence => true, presence: true,
:length => { :within => 0..255 } length: { within: 0..255 }
validates :content, validates :content,
:presence => true, presence: true,
:length => { :within => 0..10000 } length: { within: 0..10000 }
scope :fresh, order("created_at DESC") scope :fresh, order("created_at DESC")
scope :non_expired, where(["expires_at IS NULL OR expires_at > ?", Time.current]) scope :non_expired, where(["expires_at IS NULL OR expires_at > ?", Time.current])
......
...@@ -11,7 +11,7 @@ class Tree ...@@ -11,7 +11,7 @@ class Tree
:size, :size,
:text?, :text?,
:colorize, :colorize,
:to => :tree to: :tree
def initialize(raw_tree, project, ref = nil, path = nil) def initialize(raw_tree, project, ref = nil, path = nil)
@project, @ref, @path = project, ref, path, @project, @ref, @path = project, ref, path,
......
...@@ -11,58 +11,58 @@ class User < ActiveRecord::Base ...@@ -11,58 +11,58 @@ class User < ActiveRecord::Base
attr_accessor :force_random_password attr_accessor :force_random_password
has_many :users_projects, :dependent => :destroy has_many :users_projects, dependent: :destroy
has_many :projects, :through => :users_projects has_many :projects, through: :users_projects
has_many :my_own_projects, :class_name => "Project", :foreign_key => :owner_id has_many :my_own_projects, class_name: "Project", foreign_key: :owner_id
has_many :keys, :dependent => :destroy has_many :keys, dependent: :destroy
has_many :events, has_many :events,
:class_name => "Event", class_name: "Event",
:foreign_key => :author_id, foreign_key: :author_id,
:dependent => :destroy dependent: :destroy
has_many :recent_events, has_many :recent_events,
:class_name => "Event", class_name: "Event",
:foreign_key => :author_id, foreign_key: :author_id,
:order => "id DESC" order: "id DESC"
has_many :issues, has_many :issues,
:foreign_key => :author_id, foreign_key: :author_id,
:dependent => :destroy dependent: :destroy
has_many :notes, has_many :notes,
:foreign_key => :author_id, foreign_key: :author_id,
:dependent => :destroy dependent: :destroy
has_many :assigned_issues, has_many :assigned_issues,
:class_name => "Issue", class_name: "Issue",
:foreign_key => :assignee_id, foreign_key: :assignee_id,
:dependent => :destroy dependent: :destroy
has_many :merge_requests, has_many :merge_requests,
:foreign_key => :author_id, foreign_key: :author_id,
:dependent => :destroy dependent: :destroy
has_many :assigned_merge_requests, has_many :assigned_merge_requests,
:class_name => "MergeRequest", class_name: "MergeRequest",
:foreign_key => :assignee_id, foreign_key: :assignee_id,
:dependent => :destroy dependent: :destroy
validates :projects_limit, validates :projects_limit,
:presence => true, presence: true,
:numericality => {:greater_than_or_equal_to => 0} numericality: {greater_than_or_equal_to: 0}
validates :bio, :length => { :within => 0..255 } validates :bio, length: { within: 0..255 }
before_save :ensure_authentication_token before_save :ensure_authentication_token
alias_attribute :private_token, :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 :not_in_project, lambda { |project| where("id not in (:ids)", ids: project.users.map(&:id) ) }
scope :admins, where(:admin => true) scope :admins, where(admin: true)
scope :blocked, where(:blocked => true) scope :blocked, where(blocked: true)
scope :active, where(:blocked => false) scope :active, where(blocked: false)
before_validation :generate_password, :on => :create before_validation :generate_password, on: :create
def generate_password def generate_password
if self.force_random_password if self.force_random_password
...@@ -94,17 +94,17 @@ class User < ActiveRecord::Base ...@@ -94,17 +94,17 @@ class User < ActiveRecord::Base
else else
password = Devise.friendly_token[0, 8].downcase password = Devise.friendly_token[0, 8].downcase
@user = User.create( @user = User.create(
:name => name, name: name,
:email => email, email: email,
:password => password, password: password,
:password_confirmation => password, password_confirmation: password,
:projects_limit => Gitlab.config.default_projects_limit projects_limit: Gitlab.config.default_projects_limit
) )
end end
end end
def self.search query 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
end end
# == Schema Information # == Schema Information
......
...@@ -12,18 +12,18 @@ class UsersProject < ActiveRecord::Base ...@@ -12,18 +12,18 @@ class UsersProject < ActiveRecord::Base
after_save :update_repository after_save :update_repository
after_destroy :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 :user_id
validates_presence_of :project_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) def self.bulk_import(project, user_ids, project_access)
UsersProject.transaction do UsersProject.transaction do
user_ids.each do |user_id| user_ids.each do |user_id|
users_project = UsersProject.new( users_project = UsersProject.new(
:project_access => project_access, project_access: project_access,
:user_id => user_id user_id: user_id
) )
users_project.project = project users_project.project = project
users_project.save users_project.save
...@@ -35,7 +35,7 @@ class UsersProject < ActiveRecord::Base ...@@ -35,7 +35,7 @@ class UsersProject < ActiveRecord::Base
UsersProject.transaction do UsersProject.transaction do
project_ids.each do |project_id| project_ids.each do |project_id|
users_project = UsersProject.new( users_project = UsersProject.new(
:project_access => project_access, project_access: project_access,
) )
users_project.project_id = project_id users_project.project_id = project_id
users_project.user_id = user.id users_project.user_id = user.id
......
class Wiki < ActiveRecord::Base class Wiki < ActiveRecord::Base
belongs_to :project belongs_to :project
belongs_to :user 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 :content, :title, :user_id, presence: true
validates :title, :length => 1..250 validates :title, length: 1..250
before_update :set_slug before_update :set_slug
......
...@@ -3,22 +3,22 @@ class ActivityObserver < ActiveRecord::Observer ...@@ -3,22 +3,22 @@ class ActivityObserver < ActiveRecord::Observer
def after_create(record) def after_create(record)
Event.create( Event.create(
:project => record.project, project: record.project,
:target_id => record.id, target_id: record.id,
:target_type => record.class.name, target_type: record.class.name,
:action => Event.determine_action(record), action: Event.determine_action(record),
:author_id => record.author_id author_id: record.author_id
) )
end end
def after_save(record) def after_save(record)
if record.changed.include?("closed") if record.changed.include?("closed")
Event.create( Event.create(
:project => record.project, project: record.project,
:target_id => record.id, target_id: record.id,
:target_type => record.class.name, target_type: record.class.name,
:action => (record.closed ? Event::Closed : Event::Reopened), action: (record.closed ? Event::Closed : Event::Reopened),
:author_id => record.author_id_of_changes author_id: record.author_id_of_changes
) )
end end
end end
......
...@@ -71,7 +71,7 @@ class MailerObserver < ActiveRecord::Observer ...@@ -71,7 +71,7 @@ class MailerObserver < ActiveRecord::Observer
# Create comment about status changed # Create comment about status changed
if target.closed_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.author = current_user
note.note = "_Status changed to #{target.closed ? 'closed' : 'reopened'}_" note.note = "_Status changed to #{target.closed ? 'closed' : 'reopened'}_"
note.save() note.save()
......
...@@ -24,7 +24,7 @@ module Account ...@@ -24,7 +24,7 @@ module Account
end end
def cared_merge_requests 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 end
def project_ids def project_ids
...@@ -50,7 +50,7 @@ module Account ...@@ -50,7 +50,7 @@ module Account
def recent_push project_id = nil def recent_push project_id = nil
# Get push events not earlier than 2 hours ago # Get push events not earlier than 2 hours ago
events = recent_events.code_push.where("created_at > ?", Time.now - 2.hours) 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 # Take only latest one
events = events.recent.limit(1).first events = events.recent.limit(1).first
......
...@@ -3,56 +3,56 @@ module Authority ...@@ -3,56 +3,56 @@ module Authority
# Should be rewrited for new access rights # Should be rewrited for new access rights
def add_access(user, *access) def add_access(user, *access)
access = if access.include?(:admin) access = if access.include?(:admin)
{ :project_access => UsersProject::MASTER } { project_access: UsersProject::MASTER }
elsif access.include?(:write) elsif access.include?(:write)
{ :project_access => UsersProject::DEVELOPER } { project_access: UsersProject::DEVELOPER }
else else
{ :project_access => UsersProject::REPORTER } { project_access: UsersProject::REPORTER }
end end
opts = { :user => user } opts = { user: user }
opts.merge!(access) opts.merge!(access)
users_projects.create(opts) users_projects.create(opts)
end end
def reset_access(user) 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 end
def repository_readers 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) where("users_projects.project_id = ? AND users_projects.project_access = ?", id, UsersProject::REPORTER)
keys.map(&:identifier) + deploy_keys.map(&:identifier) keys.map(&:identifier) + deploy_keys.map(&:identifier)
end end
def repository_writers 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) where("users_projects.project_id = ? AND users_projects.project_access = ?", id, UsersProject::DEVELOPER)
keys.map(&:identifier) keys.map(&:identifier)
end end
def repository_masters 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) where("users_projects.project_id = ? AND users_projects.project_access = ?", id, UsersProject::MASTER)
keys.map(&:identifier) keys.map(&:identifier)
end end
def allow_read_for?(user) def allow_read_for?(user)
!users_projects.where(:user_id => user.id).empty? !users_projects.where(user_id: user.id).empty?
end end
def guest_access_for?(user) def guest_access_for?(user)
!users_projects.where(:user_id => user.id).empty? !users_projects.where(user_id: user.id).empty?
end end
def report_access_for?(user) 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 end
def dev_access_for?(user) 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 end
def master_access_for?(user) 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
end end
...@@ -6,39 +6,39 @@ module IssueCommonality ...@@ -6,39 +6,39 @@ module IssueCommonality
attr_protected :author, :author_id, :project, :project_id attr_protected :author, :author_id, :project, :project_id
belongs_to :project belongs_to :project
belongs_to :author, :class_name => "User" belongs_to :author, class_name: "User"
belongs_to :assignee, :class_name => "User" belongs_to :assignee, class_name: "User"
has_many :notes, :as => :noteable, :dependent => :destroy has_many :notes, as: :noteable, dependent: :destroy
validates_presence_of :project_id validates_presence_of :project_id
validates_presence_of :author_id validates_presence_of :author_id
validates :title, validates :title,
:presence => true, presence: true,
:length => { :within => 0..255 } length: { within: 0..255 }
scope :opened, where(:closed => false) scope :opened, where(closed: false)
scope :closed, where(:closed => true) scope :closed, where(closed: true)
scope :assigned, lambda { |u| where(:assignee_id => u.id)} scope :assigned, lambda { |u| where(assignee_id: u.id)}
delegate :name, delegate :name,
:email, :email,
:to => :author, to: :author,
:prefix => true prefix: true
delegate :name, delegate :name,
:email, :email,
:to => :assignee, to: :assignee,
:allow_nil => true, allow_nil: true,
:prefix => true prefix: true
attr_accessor :author_id_of_changes attr_accessor :author_id_of_changes
end end
module ClassMethods module ClassMethods
def search(query) def search(query)
where("title like :query", :query => "%#{query}%") where("title like :query", query: "%#{query}%")
end end
end end
......
...@@ -3,10 +3,10 @@ module ProjectPush ...@@ -3,10 +3,10 @@ module ProjectPush
data = post_receive_data(oldrev, newrev, ref, user) data = post_receive_data(oldrev, newrev, ref, user)
Event.create( Event.create(
:project => self, project: self,
:action => Event::Pushed, action: Event::Pushed,
:data => data, data: data,
:author_id => data[:user_id] author_id: data[:user_id]
) )
end end
...@@ -20,7 +20,7 @@ module ProjectPush ...@@ -20,7 +20,7 @@ module ProjectPush
mrs.each { |merge_request| merge_request.reload_code; merge_request.mark_as_unchecked } mrs.each { |merge_request| merge_request.reload_code; merge_request.mark_as_unchecked }
# Close merge requests # 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 = mrs.select(&:last_commit).select { |mr| c_ids.include?(mr.last_commit.id) }
mrs.each { |merge_request| merge_request.merge!(user.id) } mrs.each { |merge_request| merge_request.merge!(user.id) }
......
...@@ -9,7 +9,7 @@ module SshKey ...@@ -9,7 +9,7 @@ module SshKey
def repository_delete_key def repository_delete_key
Gitlab::GitHost.system.new.configure do |c| Gitlab::GitHost.system.new.configure do |c|
#delete key file is there is no identically deploy keys #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) c.delete_key(identifier)
end end
c.update_projects(projects) c.update_projects(projects)
......
...@@ -25,8 +25,8 @@ module Team ...@@ -25,8 +25,8 @@ module Team
# with passed access role by user id # with passed access role by user id
def add_user_id_to_team(user_id, access_role) def add_user_id_to_team(user_id, access_role)
users_projects.create( users_projects.create(
:user_id => user_id, user_id: user_id,
:project_access => access_role project_access: access_role
) )
end end
......
...@@ -23,7 +23,7 @@ class AttachmentUploader < CarrierWave::Uploader::Base ...@@ -23,7 +23,7 @@ class AttachmentUploader < CarrierWave::Uploader::Base
# end # end
# Process files as they are uploaded: # Process files as they are uploaded:
# process :scale => [200, 300] # process scale: [200, 300]
# #
# def scale(width, height) # def scale(width, height)
# # do something # # do something
...@@ -31,7 +31,7 @@ class AttachmentUploader < CarrierWave::Uploader::Base ...@@ -31,7 +31,7 @@ class AttachmentUploader < CarrierWave::Uploader::Base
# Create different versions of your uploaded files: # Create different versions of your uploaded files:
# version :thumb do # version :thumb do
# process :scale => [50, 50] # process scale: [50, 50]
# end # end
# Add a white list of extensions which are allowed to be uploaded. # Add a white list of extensions which are allowed to be uploaded.
......
...@@ -5,11 +5,11 @@ ...@@ -5,11 +5,11 @@
Resque Workers Resque Workers
.data.padded .data.padded
= link_to admin_resque_path do = link_to admin_resque_path do
%h1{:class => @workers.present? ? "cgreen" : "cred"} %h1{class: @workers.present? ? "cgreen" : "cred"}
= @workers.count = @workers.count
%hr %hr
%p %p
%strong{:class => @pending_jobs > 0 ? "cred" : "cgreen"} %strong{class: @pending_jobs > 0 ? "cred" : "cgreen"}
#{@pending_jobs} post receive jobs waiting #{@pending_jobs} post receive jobs waiting
.span4 .span4
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
= link_to admin_projects_path do = link_to admin_projects_path do
%h1= Project.count %h1= Project.count
%hr %hr
= link_to 'New Project', new_admin_project_path, :class => "btn small" = link_to 'New Project', new_admin_project_path, class: "btn small"
.span4 .span4
.ui-box .ui-box
%h5 Users %h5 Users
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
= link_to admin_users_path do = link_to admin_users_path do
%h1= User.count %h1= User.count
%hr %hr
= link_to 'New User', new_admin_user_path, :class => "btn small" = link_to 'New User', new_admin_user_path, class: "btn small"
.row .row
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
Post receive hooks for binding events. Post receive hooks for binding events.
%br %br
Read more about system hooks 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? -if @hook.errors.any?
.alert-message.block-message.error .alert-message.block-message.error
- @hook.errors.full_messages.each do |msg| - @hook.errors.full_messages.each do |msg|
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
.clearfix .clearfix
= f.label :url, "URL:" = f.label :url, "URL:"
.input .input
= f.text_field :url, :class => "text_field xxlarge" = f.text_field :url, class: "text_field xxlarge"
&nbsp; &nbsp;
= f.submit "Add System Hook", :class => "btn primary" = f.submit "Add System Hook", class: "btn primary"
%hr %hr
-if @hooks.any? -if @hooks.any?
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
%td %td
= link_to admin_hook_path(hook) do = link_to admin_hook_path(hook) do
%strong= hook.url %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 POST
%td %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"
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
= f.label :name do = f.label :name do
Project name is Project name is
.input .input
= f.text_field :name, :placeholder => "Example Project", :class => "xxlarge" = f.text_field :name, placeholder: "Example Project", class: "xxlarge"
= f.submit project.new_record? ? 'Create project' : 'Save Project', :class => "btn primary" = f.submit project.new_record? ? 'Create project' : 'Save Project', class: "btn primary"
%hr %hr
.alert.alert-info .alert.alert-info
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
.input .input
.input-prepend .input-prepend
%span.add-on= Gitlab.config.ssh_path %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" %span.add-on= ".git"
.clearfix .clearfix
= f.label :code do = f.label :code do
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
.input .input
.input-prepend .input-prepend
%span.add-on= web_app_url %span.add-on= web_app_url
= f.text_field :code, :placeholder => "example" = f.text_field :code, placeholder: "example"
- unless project.new_record? - unless project.new_record?
.clearfix .clearfix
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
- if project.repo_exists? - if project.repo_exists?
.clearfix .clearfix
= f.label :default_branch, "Default Branch" = 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? - unless project.new_record?
.alert.alert-info .alert.alert-info
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
- unless project.new_record? - unless project.new_record?
.actions .actions
= f.submit 'Save Project', :class => "btn primary" = f.submit 'Save Project', class: "btn primary"
......
%h3.page_title #{@admin_project.name} &rarr; Edit project %h3.page_title #{@admin_project.name} &rarr; Edit project
%hr %hr
= render 'form', :project => @admin_project = render 'form', project: @admin_project
%h3 %h3
Projects 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 %br
= form_tag admin_projects_path, :method => :get do = form_tag admin_projects_path, method: :get do
= text_field_tag :name, params[:name], :class => "xlarge" = text_field_tag :name, params[:name], class: "xlarge"
= submit_tag "Search", :class => "btn submit primary" = submit_tag "Search", class: "btn submit primary"
%table.admin-table %table.admin-table
%thead %thead
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
%td= link_to project.name, [:admin, project] %td= link_to project.name, [:admin, project]
%td= project.path %td= project.path
%td= project.users_projects.count %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= last_commit(project)
%td= link_to 'Edit', edit_admin_project_path(project), :id => "edit_#{dom_id(project)}", :class => "btn small" %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" %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" = paginate @admin_projects, theme: "admin"
%h3.page_title New project %h3.page_title New project
%hr %hr
= render 'form', :project => @admin_project = render 'form', project: @admin_project
%h3 %h3
= @admin_project.name = @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 %br
%table.zebra-striped.table-bordered %table.zebra-striped.table-bordered
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
%b %b
Post Receive File: Post Receive File:
%td %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 %br
%h3 %h3
Team Team
...@@ -52,14 +52,14 @@ ...@@ -52,14 +52,14 @@
%tr %tr
%td %td
= link_to tm.user_name, admin_user_path(tm.user) = 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= 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 '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= link_to 'Remove from team', admin_team_member_path(tm), confirm: 'Are you sure?', method: :delete, class: "btn danger small"
%br %br
%h3 Add new team member %h3 Add new team member
%br %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 %table.zebra-striped.table-bordered
%thead %thead
%tr %tr
...@@ -67,14 +67,14 @@ ...@@ -67,14 +67,14 @@
%th Project Access: %th Project Access:
%tr %tr
%td= select_tag :user_ids, options_from_collection_for_select(@users , :id, :name), :multiple => true %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 :project_access, options_for_select(Project.access_options), class: "project-access-select"
%tr %tr
%td= submit_tag 'Add', :class => "btn primary" %td= submit_tag 'Add', class: "btn primary"
%td %td
Read more about project permissions Read more about project permissions
%strong= link_to "here", help_permissions_path, :class => "vlink" %strong= link_to "here", help_permissions_path, class: "vlink"
:css :css
form select { form select {
......
%h3 Resque %h3 Resque
%iframe{:src => "/info/resque", :width => 1168, :height => 600, :style => "border: none"} %iframe{src: "/info/resque", width: 1168, height: 600, style: "border: none"}
\ No newline at end of file \ No newline at end of file
= form_for @admin_team_member, :as => :team_member, :url => admin_team_member_path(@admin_team_member) do |f| = form_for @admin_team_member, as: :team_member, url: admin_team_member_path(@admin_team_member) do |f|
-if @admin_team_member.errors.any? -if @admin_team_member.errors.any?
.alert-message.block-message.error .alert-message.block-message.error
%ul %ul
...@@ -8,12 +8,12 @@ ...@@ -8,12 +8,12 @@
.clearfix .clearfix
%label Project Access: %label Project Access:
.input .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 %br
.actions .actions
= f.submit 'Save', :class => "btn primary" = f.submit 'Save', class: "btn primary"
= link_to 'Cancel', :back, :class => "btn" = link_to 'Cancel', :back, class: "btn"
:css :css
form select { form select {
......
...@@ -22,17 +22,17 @@ ...@@ -22,17 +22,17 @@
-if f.object.new_record? -if f.object.new_record?
.clearfix .clearfix
= f.label :admin, :class => "checkbox" do = f.label :admin, class: "checkbox" do
= f.check_box :force_random_password, {}, true, nil = f.check_box :force_random_password, {}, true, nil
%span Generate random password %span Generate random password
%div.password-fields %div.password-fields
.clearfix .clearfix
= f.label :password = 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 .clearfix
= f.label :password_confirmation = 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 %hr
.clearfix .clearfix
= f.label :skype = f.label :skype
...@@ -46,27 +46,27 @@ ...@@ -46,27 +46,27 @@
.span6 .span6
.clearfix .clearfix
= f.label :projects_limit = f.label :projects_limit
.input= f.text_field :projects_limit, :class => "small_input" .input= f.text_field :projects_limit, class: "small_input"
.alert .alert
.clearfix .clearfix
%p Make the user a GitLab administrator. %p Make the user a GitLab administrator.
= f.label :admin, :class => "checkbox" do = f.label :admin, class: "checkbox" do
= f.check_box :admin = f.check_box :admin
%span Administrator %span Administrator
- unless @admin_user.new_record? - unless @admin_user.new_record?
.alert.alert-error .alert.alert-error
- if @admin_user.blocked - if @admin_user.blocked
%span %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 This user is blocked and is not able to login to GitLab
- else - else
%span %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 &amp; will not be able to login to GitLab. Blocked users will be removed from all projects &amp; will not be able to login to GitLab.
.actions .actions
= f.submit 'Save', :class => "btn primary" = f.submit 'Save', class: "btn primary"
- if @admin_user.new_record? - if @admin_user.new_record?
= link_to 'Cancel', admin_users_path, :class => "btn" = link_to 'Cancel', admin_users_path, class: "btn"
- else - else
= link_to 'Cancel', admin_user_path(@admin_user), :class => "btn" = link_to 'Cancel', admin_user_path(@admin_user), class: "btn"
%h3 %h3
Users 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 %br
= form_tag admin_users_path, :method => :get do = form_tag admin_users_path, method: :get do
= text_field_tag :name, params[:name], :class => "xlarge" = text_field_tag :name, params[:name], class: "xlarge"
= submit_tag "Search", :class => "btn submit primary" = submit_tag "Search", class: "btn submit primary"
%ul.nav.nav-pills %ul.nav.nav-pills
%li{:class => "#{'active' unless params[:filter]}"} %li{class: "#{'active' unless params[:filter]}"}
= link_to "Active", admin_users_path = link_to "Active", admin_users_path
%li{:class => "#{'active' if params[:filter] == "admins"}"} %li{class: "#{'active' if params[:filter] == "admins"}"}
= link_to admin_users_path(:filter => "admins") do = link_to admin_users_path(filter: "admins") do
Admins Admins
%li{:class => "#{'active' if params[:filter] == "blocked"}"} %li{class: "#{'active' if params[:filter] == "blocked"}"}
= link_to admin_users_path(:filter => "blocked") do = link_to admin_users_path(filter: "blocked") do
Blocked Blocked
%li{:class => "#{'active' if params[:filter] == "wop"}"} %li{class: "#{'active' if params[:filter] == "wop"}"}
= link_to admin_users_path(:filter => "wop") do = link_to admin_users_path(filter: "wop") do
Without projects Without projects
%table.admin-table %table.admin-table
...@@ -31,16 +31,16 @@ ...@@ -31,16 +31,16 @@
- @admin_users.each do |user| - @admin_users.each do |user|
%tr %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= link_to user.name, [:admin, user]
%td= user.email %td= user.email
%td= user.users_projects.count %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 %td
- if user.blocked - 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 - else
= link_to 'Block', block_admin_user_path(user), :confirm => 'USER WILL BE BLOCKED! Are you sure?', :method => :put, :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" %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"
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
%small Blocked %small Blocked
- if @admin_user.admin - if @admin_user.admin
%small Administrator %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 %br
...@@ -19,12 +19,12 @@ ...@@ -19,12 +19,12 @@
%td %td
%b %b
Admin: Admin:
%td= check_box_tag "admin", 1, @admin_user.admin, :disabled => :disabled %td= check_box_tag "admin", 1, @admin_user.admin, disabled: :disabled
%tr %tr
%td %td
%b %b
Blocked: Blocked:
%td= check_box_tag "blocked", 1, @admin_user.blocked, :disabled => :disabled %td= check_box_tag "blocked", 1, @admin_user.blocked, disabled: :disabled
%tr %tr
%td %td
%b %b
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
%br %br
%h3 Add User to Projects %h3 Add User to Projects
%br %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 %table.table-bordered
%thead %thead
%tr %tr
...@@ -64,14 +64,14 @@ ...@@ -64,14 +64,14 @@
%th Project Access: %th Project Access:
%tr %tr
%td= select_tag :project_ids, options_from_collection_for_select(@projects , :id, :name), :multiple => true %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_access, options_for_select(Project.access_options), class: "project-access-select"
%tr %tr
%td= submit_tag 'Add', :class => "btn primary" %td= submit_tag 'Add', class: "btn primary"
%td %td
Read more about project permissions Read more about project permissions
%strong= link_to "here", help_permissions_path, :class => "vlink" %strong= link_to "here", help_permissions_path, class: "vlink"
%br %br
- if @admin_user.projects.present? - if @admin_user.projects.present?
...@@ -90,9 +90,9 @@ ...@@ -90,9 +90,9 @@
- project = tm.project - project = tm.project
%tr %tr
%td= link_to project.name, admin_project_path(project) %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= 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 '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= link_to 'Remove from team', admin_team_member_path(tm), confirm: 'Are you sure?', method: :delete, class: "btn small danger"
:css :css
form select { form select {
......
%li.commit %li.commit
.browse_code_link_holder .browse_code_link_holder
%p %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 %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 %strong.cgray= commit.author_name
&ndash; &ndash;
= image_tag gravatar_icon(commit.author_email), :class => "avatar", :width => 16 = 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" = link_to_gfm truncate(commit.title, length: 50), project_commit_path(@project, id: commit.id), class: "row_title"
%span.committed_ago %span.committed_ago
= time_ago_in_words(commit.committed_date) = time_ago_in_words(commit.committed_date)
......
...@@ -5,10 +5,10 @@ ...@@ -5,10 +5,10 @@
%span.btn.disabled.grouped %span.btn.disabled.grouped
%i.icon-comment %i.icon-comment
= @notes_count = @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 %i.icon-download-alt
Get Patch 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 » %strong Browse Code »
%h3.commit-title.page_title %h3.commit-title.page_title
= gfm @commit.title = gfm @commit.title
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
.commit-info .commit-info
.row .row
.span4 .span4
= image_tag gravatar_icon(@commit.author_email, 40), :class => "avatar" = image_tag gravatar_icon(@commit.author_email, 40), class: "avatar"
.author .author
%strong= @commit.author_name %strong= @commit.author_name
authored authored
......
...@@ -3,24 +3,24 @@ ...@@ -3,24 +3,24 @@
%li %li
- if diff.deleted_file - if diff.deleted_file
%span.removed_file %span.removed_file
%a{:href => "##{diff.old_path}"} %a{href: "##{diff.old_path}"}
= diff.old_path = diff.old_path
= image_tag "diff_file_delete.png" = image_tag "diff_file_delete.png"
- elsif diff.renamed_file - elsif diff.renamed_file
%span.moved_file %span.moved_file
%a{:href => "##{diff.new_path}"} %a{href: "##{diff.new_path}"}
= diff.old_path = diff.old_path
= "->" = "->"
= diff.new_path = diff.new_path
= image_tag "diff_file_notice.png" = image_tag "diff_file_notice.png"
- elsif diff.new_file - elsif diff.new_file
%span.new_file %span.new_file
%a{:href => "##{diff.new_path}"} %a{href: "##{diff.new_path}"}
= diff.new_path = diff.new_path
= image_tag "diff_file_add.png" = image_tag "diff_file_add.png"
- else - else
%span.edit_file %span.edit_file
%a{:href => "##{diff.new_path}"} %a{href: "##{diff.new_path}"}
= diff.new_path = diff.new_path
= image_tag "diff_file_info.png" = image_tag "diff_file_info.png"
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
%p To prevent performance issue we rejected diff information. %p To prevent performance issue we rejected diff information.
%p %p
But if you still want to see diff 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 %p.cgray
Showing #{pluralize(diffs.count, "changed file")} Showing #{pluralize(diffs.count, "changed file")}
.file_stats .file_stats
= render "commits/diff_head", :diffs => diffs = render "commits/diff_head", diffs: diffs
- unless @suppress_diff - unless @suppress_diff
- diffs.each_with_index do |diff, i| - diffs.each_with_index do |diff, i|
...@@ -22,26 +22,26 @@ ...@@ -22,26 +22,26 @@
.diff_file_header .diff_file_header
- if diff.deleted_file - if diff.deleted_file
%i.icon-file %i.icon-file
%span{:id => "#{diff.old_path}"}= diff.old_path %span{id: "#{diff.old_path}"}= diff.old_path
- else - else
= link_to tree_file_project_ref_path(@project, @commit.id, diff.new_path) do = link_to tree_file_project_ref_path(@project, @commit.id, diff.new_path) do
%i.icon-file %i.icon-file
%span{:id => "#{diff.new_path}"}= diff.new_path %span{id: "#{diff.new_path}"}= diff.new_path
%br/ %br/
.diff_file_content .diff_file_content
-# Skipp all non non-supported blobs -# Skipp all non non-supported blobs
- next unless file.respond_to?('text?') - next unless file.respond_to?('text?')
- if file.text? - if file.text?
= render "commits/text_file", :diff => diff, :index => i = render "commits/text_file", diff: diff, index: i
- elsif file.image? - elsif file.image?
- if diff.renamed_file || diff.new_file || diff.deleted_file - if diff.renamed_file || diff.new_file || diff.deleted_file
.diff_file_content_image .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 - else
- old_file = (@commit.prev_commit.tree / diff.old_path) - old_file = (@commit.prev_commit.tree / diff.old_path)
.diff_file_content_image.img_compared .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_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_added", src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
- else - else
%p.nothing_here_message No preview for this file type %p.nothing_here_message No preview for this file type
%ul.nav.nav-tabs %ul.nav.nav-tabs
%li %li
= form_tag switch_project_refs_path(@project), :method => :get, :class => "project-refs-form" do = 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" = select_tag "ref", grouped_options_refs, onchange: "$(this.form).trigger('submit');", class: "project-refs-select"
= hidden_field_tag :destination, "commits" = 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 = link_to project_commits_path(@project) do
Commits 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 = link_to compare_project_commits_path(@project) do
Compare Compare
%li{:class => "#{branches_tab_class}"} %li{class: "#{branches_tab_class}"}
= link_to project_repository_path(@project) do = link_to project_repository_path(@project) do
Branches Branches
%span.badge= @project.repo.branch_count %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 = link_to tags_project_repository_path(@project) do
Tags Tags
%span.badge= @project.repo.tag_count %span.badge= @project.repo.tag_count
...@@ -24,8 +24,8 @@ ...@@ -24,8 +24,8 @@
- if current_page?(project_commits_path(@project)) && current_user.private_token - if current_page?(project_commits_path(@project)) && current_user.private_token
%li.right %li.right
%span.rss-icon %span.rss-icon
= link_to project_commits_path(@project, :atom, { :private_token => current_user.private_token, :ref => @ref }), :title => "Feed" do = 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" = image_tag "rss_ui.png", title: "feed"
:javascript :javascript
$(function(){ $(function(){
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
- if too_big - if too_big
%a.supp_diff_link Diff suppressed. Click to show %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| - each_diff_line(diff.diff.lines.to_a, index) do |line, type, line_code, line_new, line_old|
%tr.line_holder %tr.line_holder
- if type == "match" - if type == "match"
...@@ -11,16 +11,16 @@ ...@@ -11,16 +11,16 @@
%td.line_content.matched= line %td.line_content.matched= line
- else - else
%td.old_line %td.old_line
= link_to raw(type == "new" ? "&nbsp;" : line_old), "##{line_code}", :id => line_code = link_to raw(type == "new" ? "&nbsp;" : line_old), "##{line_code}", id: line_code
- if @comments_allowed - if @comments_allowed
= link_to "", "#", :class => "line_note_link", "line_code" => line_code, :title => "Add note for this 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" ? "&nbsp;" : line_new) , "##{line_code}", :id => line_code %td.new_line= link_to raw(type == "old" ? "&nbsp;" : line_new) , "##{line_code}", id: line_code
%td.line_content{:class => "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw "#{line} &nbsp;" %td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw "#{line} &nbsp;"
- if @comments_allowed - if @comments_allowed
- comments = @line_notes.select { |n| n.line_code == line_code }.sort_by(&:created_at).reverse - comments = @line_notes.select { |n| n.line_code == line_code }.sort_by(&:created_at).reverse
- unless comments.empty? - unless comments.empty?
- comments.each_with_index do |note, i| - comments.each_with_index do |note, i|
= render "notes/reply_button", :line_code => line_code if i.zero? = render "notes/reply_button", line_code: line_code if i.zero?
= render "notes/per_line_show", :note => note = render "notes/per_line_show", note: note
- @line_notes.reject!{ |n| n == note } - @line_notes.reject!{ |n| n == note }
...@@ -14,13 +14,13 @@ ...@@ -14,13 +14,13 @@
%br %br
= form_tag compare_project_commits_path(@project), :method => :get do = form_tag compare_project_commits_path(@project), method: :get do
.clearfix .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 .actions
= submit_tag "Compare", :class => "btn btn-primary" = submit_tag "Compare", class: "btn btn-primary"
- unless @commits.empty? - unless @commits.empty?
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
- unless @diffs.empty? - unless @diffs.empty?
%h4 Diff %h4 Diff
= render "commits/diffs", :diffs => @diffs = render "commits/diffs", diffs: @diffs
:javascript :javascript
$(function() { $(function() {
......
...@@ -9,12 +9,12 @@ ...@@ -9,12 +9,12 @@
%span.divider %span.divider
\/ \/
%li %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" #commits_list= render "commits"
.clear .clear
.loading{ :style => "display:none;"} .loading{ style: "display:none;"}
- if @commits.count == @limit - if @commits.count == @limit
:javascript :javascript
......
:plain :plain
CommitsList.append(#{@commits.count}, "#{escape_javascript(render(:partial => 'commits/commits'))}"); CommitsList.append(#{@commits.count}, "#{escape_javascript(render(partial: 'commits/commits'))}");
= render "commits/commit_box" = render "commits/commit_box"
= render "commits/diffs", :diffs => @commit.diffs = render "commits/diffs", diffs: @commit.diffs
= render "notes/notes", :tid => @commit.id, :tt => "commit" = render "notes/notes", tid: @commit.id, tt: "commit"
= render "notes/per_line_form" = render "notes/per_line_form"
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
%span %span
You wont be able to pull/push project code unless you You wont be able to pull/push project code unless you
%strong %strong
= link_to new_key_path, :class => "vlink" do = link_to new_key_path, class: "vlink" do
add new key add new key
to your profile to your profile
- if @events.any? - if @events.any?
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
%h4.nothing_here_message Projects activity will be displayed here %h4.nothing_here_message Projects activity will be displayed here
.loading.hide .loading.hide
.side .side
= render "events/event_last_push", :event => @last_push = render "events/event_last_push", event: @last_push
.projects_box .projects_box
%h5 %h5
Projects Projects
...@@ -23,23 +23,23 @@ ...@@ -23,23 +23,23 @@
(#{@projects.total_count}) (#{@projects.total_count})
- if current_user.can_create_project? - if current_user.can_create_project?
%span.right %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 %i.icon-plus
New Project New Project
- @projects.each do |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 %h4
%span.ico.project %span.ico.project
= truncate(project.name, :length => 25) = truncate(project.name, length: 25)
%span.right %span.right
&rarr; &rarr;
.bottom= paginate @projects, :theme => "gitlab" .bottom= paginate @projects, theme: "gitlab"
%hr %hr
%div %div
%span.rss-icon %span.rss-icon
= link_to dashboard_path(:atom, { :private_token => current_user.private_token }) do = link_to dashboard_path(:atom, { private_token: current_user.private_token }) do
= image_tag "rss_ui.png", :title => "feed" = image_tag "rss_ui.png", title: "feed"
%strong News Feed %strong News Feed
- else - else
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
= current_user.projects_limit = current_user.projects_limit
projects. Click on button below to add a new one projects. Click on button below to add a new one
.link_holder .link_holder
= link_to new_project_path, :class => "btn primary" do = link_to new_project_path, class: "btn primary" do
New Project » New Project »
- else - else
If you will be added to project - it will be displayed here If you will be added to project - it will be displayed here
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
%h5= @project.name %h5= @project.name
%ul.unstyled.issues_table %ul.unstyled.issues_table
- group[1].each do |issue| - group[1].each do |issue|
= render(:partial => 'issues/show', :locals => {:issue => issue}) = render(partial: 'issues/show', locals: {issue: issue})
%hr %hr
= paginate @issues, :theme => "gitlab" = paginate @issues, theme: "gitlab"
- else - else
%h3.nothing_here_message Nothing to show here %h3.nothing_here_message Nothing to show here
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
- @project = group[0] - @project = group[0]
%h5= @project.name %h5= @project.name
- group[1].each do |merge_request| - 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 %hr
= paginate @merge_requests, :theme => "gitlab" = paginate @merge_requests, theme: "gitlab"
- else - else
%h3.nothing_here_message Nothing to show here %h3.nothing_here_message Nothing to show here
%div %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? -if @key.errors.any?
.alert-message.block-message.error .alert-message.block-message.error
%ul %ul
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
.input= f.text_field :title .input= f.text_field :title
.clearfix .clearfix
= f.label :key = f.label :key
.input= f.text_area :key, :class => "xlarge" .input= f.text_area :key, class: "xlarge"
.actions .actions
= f.submit 'Save', :class => "primary btn" = f.submit 'Save', class: "primary btn"
= link_to "Cancel", project_deploy_keys_path(@project), :class => "btn" = link_to "Cancel", project_deploy_keys_path(@project), class: "btn"
%tr %tr
%td %td
%a{:href => project_deploy_key_path(key.project, key)} %a{href: project_deploy_key_path(key.project, key)}
%strong= key.title %strong= key.title
%td %td
%span.update-author %span.update-author
...@@ -8,5 +8,5 @@ ...@@ -8,5 +8,5 @@
= time_ago_in_words(key.created_at) = time_ago_in_words(key.created_at)
ago ago
%td %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"
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
- if can? current_user, :admin_project, @project - if can? current_user, :admin_project, @project
.alert-message.block-message .alert-message.block-message
Deploy keys allow read-only access to repository. 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 Add Deploy Key
- if @keys.any? - if @keys.any?
%table %table
- @keys.each do |key| - @keys.each do |key|
= render(:partial => 'show', :locals => {:key => key}) = render(partial: 'show', locals: {key: key})
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
%hr %hr
%pre= @key.key %pre= @key.key
.actions .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 .clear
= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put, :class => "login-box" }) do |f| = 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" = image_tag "login-logo.png", width: "304", height: "66", class: "login-logo", alt: "Login Logo"
%h3 Change your password %h3 Change your password
= devise_error_messages! = devise_error_messages!
= f.hidden_field :reset_password_token = f.hidden_field :reset_password_token
%div %div
= f.password_field :password, :class => "text top", :placeholder => "New password" = f.password_field :password, class: "text top", placeholder: "New password"
%div %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 %div
= f.submit "Change my password", :class => "btn primary" = f.submit "Change my password", class: "btn primary"
.right= render :partial => "devise/shared/links" .right= render partial: "devise/shared/links"
...@@ -2,4 +2,4 @@ ...@@ -2,4 +2,4 @@
%h3 Access Denied %h3 Access Denied
%hr %hr
%p Youre not allowed to access this page %p Youre not allowed to access this page
%p Read more about project permissions #{link_to "here", help_permissions_path, :class => "vlink"} %p Read more about project permissions #{link_to "here", help_permissions_path, class: "vlink"}
- commit = CommitDecorator.decorate(commit) - commit = CommitDecorator.decorate(commit)
%li.wll.commit %li.wll.commit
%p %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 %strong.cdark= commit.author_name
&ndash; &ndash;
= image_tag gravatar_icon(commit.author_email), :class => "avatar", :width => 16 = 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" = gfm truncate(commit.title, length: 50), project_commit_path(project, id: commit.id) rescue "--broken encoding"
- if event.allowed? - if event.allowed?
- if event.issue? - if event.issue?
.event_feed .event_feed
= render "events/event_issue", :event => event = render "events/event_issue", event: event
- elsif event.merge_request? - elsif event.merge_request?
.event_feed .event_feed
= render "events/event_merge_request", :event => event = render "events/event_merge_request", event: event
- elsif event.push? - elsif event.push?
.event_feed .event_feed
= render "events/event_push", :event => event = render "events/event_push", event: event
= image_tag gravatar_icon(event.author_email), :class => "avatar" = image_tag gravatar_icon(event.author_email), class: "avatar"
%strong #{event.author_name} %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 issue
= link_to project_issue_path(event.project, event.issue) do = link_to project_issue_path(event.project, event.issue) do
%strong= truncate event.issue_title %strong= truncate event.issue_title
......
- if show_last_push_widget?(event) - if show_last_push_widget?(event)
.event_lp .event_lp
%div %div
= image_tag gravatar_icon(event.author_email), :class => "avatar" = image_tag gravatar_icon(event.author_email), class: "avatar"
%span Your pushed to %span Your pushed to
= event.ref_type = 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= truncate(event.ref_name, :length => 28) %strong= truncate(event.ref_name, length: 28)
at at
%strong= link_to event.project.name, event.project %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 Create Merge Request
- if event.action_name == "merged" - if event.action_name == "merged"
.event_icon= image_tag "event_mr_merged.png" .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} %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 merge request
= link_to project_merge_request_path(event.project, event.merge_request) do = link_to project_merge_request_path(event.project, event.merge_request) do
%strong= truncate event.merge_request_title %strong= truncate event.merge_request_title
......
%div %div
.event_icon= image_tag "event_push.png" .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} %strong #{event.author_name}
%span.event_label.pushed= event.push_action_name %span.event_label.pushed= event.push_action_name
= event.ref_type = 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 %strong= event.ref_name
at at
%strong= link_to event.project.name, event.project %strong= link_to event.project.name, event.project
...@@ -14,17 +14,17 @@ ...@@ -14,17 +14,17 @@
- if event.push_with_commits? - if event.push_with_commits?
- if event.commits_count > 1 - 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]} %strong #{event.parent_commit.id[0..7]}...#{event.last_commit.id[0..7]}
- project = event.project - project = event.project
%ul.unstyled.event_commits %ul.unstyled.event_commits
- if event.commits_count > 3 - if event.commits_count > 3
- event.commits[0...2].each do |commit| - event.commits[0...2].each do |commit|
= render "events/commit", :commit => commit, :project => project = render "events/commit", commit: commit, project: project
%li %li
%br %br
\... and #{event.commits_count - 2} more commits \... and #{event.commits_count - 2} more commits
- else - else
- event.commits.each do |commit| - event.commits.each do |commit|
= render "events/commit", :commit => commit, :project => project = render "events/commit", commit: commit, project: project
...@@ -6,13 +6,13 @@ ...@@ -6,13 +6,13 @@
%ol %ol
%li %li
%a{:href => "#README"} README %a{href: "#README"} README
%li %li
%a{:href => "#projects"} Projects %a{href: "#projects"} Projects
%li %li
%a{:href => "#users"} Users %a{href: "#users"} Users
%li %li
%a{:href => "#issues"} Issues %a{href: "#issues"} Issues
.file_holder#README .file_holder#README
.file_title .file_title
......
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
Post receive hooks for binding events when someone push to repository. Post receive hooks for binding events when someone push to repository.
%br %br
Read more about web hooks 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? -if @hook.errors.any?
.alert-message.block-message.error .alert-message.block-message.error
- @hook.errors.full_messages.each do |msg| - @hook.errors.full_messages.each do |msg|
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
.clearfix .clearfix
= f.label :url, "URL:" = f.label :url, "URL:"
.input .input
= f.text_field :url, :class => "text_field xxlarge" = f.text_field :url, class: "text_field xxlarge"
&nbsp; &nbsp;
= f.submit "Add Web Hook", :class => "btn primary" = f.submit "Add Web Hook", class: "btn primary"
%hr %hr
-if @hooks.any? -if @hooks.any?
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
%td %td
= link_to project_hook_path(@project, hook) do = link_to project_hook_path(@project, hook) do
%strong= hook.url %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 POST
%td %td
= link_to 'Remove', project_hook_path(@project, hook), :confirm => 'Are you sure?', :method => :delete, :class => "danger btn small right" = link_to 'Remove', project_hook_path(@project, hook), confirm: 'Are you sure?', method: :delete, class: "danger btn small right"
%div.issue-form-holder %div.issue-form-holder
%h3= @issue.new_record? ? "New Issue" : "Edit Issue ##{@issue.id}" %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? -if @issue.errors.any?
.alert-message.block-message.error .alert-message.block-message.error
%ul %ul
...@@ -12,18 +12,18 @@ ...@@ -12,18 +12,18 @@
= f.label :title do = f.label :title do
%strong= "Subject *" %strong= "Subject *"
.input .input
= f.text_field :title, :maxlength => 255, :class => "xxlarge" = f.text_field :title, maxlength: 255, class: "xxlarge"
.issue_middle_block .issue_middle_block
.issue_assignee .issue_assignee
= f.label :assignee_id do = f.label :assignee_id do
%i.icon-user %i.icon-user
Assign to 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 .issue_milestone
= f.label :milestone_id do = f.label :milestone_id do
%i.icon-time %i.icon-time
Milestone 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 .issue_description
.clearfix .clearfix
...@@ -31,26 +31,26 @@ ...@@ -31,26 +31,26 @@
%i.icon-tag %i.icon-tag
Labels Labels
.input .input
= f.text_field :label_list, :maxlength => 2000, :class => "xxlarge" = f.text_field :label_list, maxlength: 2000, class: "xxlarge"
%p.hint Separate with comma. %p.hint Separate with comma.
.clearfix .clearfix
= f.label :description, "Details" = f.label :description, "Details"
.input .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. %p.hint Markdown is enabled.
.actions .actions
- if @issue.new_record? - if @issue.new_record?
= f.submit 'Submit new issue', :class => "primary btn" = f.submit 'Submit new issue', class: "primary btn"
-else -else
= f.submit 'Save changes', :class => "primary btn" = f.submit 'Save changes', class: "primary btn"
- if request.xhr? - if request.xhr?
= link_to "Cancel", "#back", :onclick => "backToIssues();", :class => "btn" = link_to "Cancel", "#back", onclick: "backToIssues();", class: "btn"
- else - else
- if @issue.new_record? - if @issue.new_record?
= link_to "Cancel", project_issues_path(@project), :class => "btn" = link_to "Cancel", project_issues_path(@project), class: "btn"
- else - else
= link_to "Cancel", project_issue_path(@project, @issue), :class => "btn" = link_to "Cancel", project_issue_path(@project, @issue), class: "btn"
%ul.nav.nav-tabs %ul.nav.nav-tabs
%li{:class => "#{'active' if current_page?(project_issues_path(@project))}"} %li{class: "#{'active' if current_page?(project_issues_path(@project))}"}
= link_to project_issues_path(@project), :class => "tab" do = link_to project_issues_path(@project), class: "tab" do
Browse Issues Browse Issues
%li{:class => "#{'active' if current_page?(project_milestones_path(@project))}"} %li{class: "#{'active' if current_page?(project_milestones_path(@project))}"}
= link_to project_milestones_path(@project), :class => "tab" do = link_to project_milestones_path(@project), class: "tab" do
Milestones Milestones
%li.right %li.right
%span.rss-icon %span.rss-icon
= link_to project_issues_path(@project, :atom, { :private_token => current_user.private_token }) do = link_to project_issues_path(@project, :atom, { private_token: current_user.private_token }) do
= image_tag "rss_ui.png", :title => "feed" = image_tag "rss_ui.png", title: "feed"
- @issues.each do |issue| - @issues.each do |issue|
= render(:partial => 'issues/show', :locals => {:issue => issue}) = render(partial: 'issues/show', locals: {issue: issue})
- if @issues.present? - if @issues.present?
%li.bottom %li.bottom
.row .row
.span7= paginate @issues, :remote => true, :theme => "gitlab" .span7= paginate @issues, remote: true, theme: "gitlab"
.span3.right .span3.right
%span.cgray.right %span.cgray.right
%span.issue_counter #{@issues.total_count} %span.issue_counter #{@issues.total_count}
......
%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' - if controller.controller_name == 'issues'
.issue_check .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 .right
- issue.labels.each do |label| - issue.labels.each do |label|
%span.label.label-issue.grouped %span.label.label-issue.grouped
...@@ -13,19 +13,19 @@ ...@@ -13,19 +13,19 @@
= issue.notes.count = issue.notes.count
- if can? current_user, :modify_issue, issue - if can? current_user, :modify_issue, issue
- if issue.closed - 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 - 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 '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 edit_project_issue_path(issue.project, issue), class: "btn small edit-issue-link", remote: true do
%i.icon-edit %i.icon-edit
Edit Edit
- if issue.assignee - if issue.assignee
= image_tag gravatar_icon(issue.assignee_email), :class => "avatar" = image_tag gravatar_icon(issue.assignee_email), class: "avatar"
- else - 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 %span.update-author
%small.cdark= "##{issue.id}" %small.cdark= "##{issue.id}"
......
- if @issue.valid? - if @issue.valid?
:plain :plain
switchFromNewIssue(); 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"}); $.ajax({type: "GET", url: location.href, dataType: "script"});
- else - else
:plain :plain
......
...@@ -6,51 +6,51 @@ ...@@ -6,51 +6,51 @@
.right .right
.span5 .span5
- if can? current_user, :write_issue, @project - 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 New Issue
= form_tag search_project_issues_path(@project), :method => :get, :remote => true, :id => "issue_search_form", :class => :right do = 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 :project_id, @project.id, { id: 'project_id' }
= hidden_field_tag :status, params[:f] = 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 .clearfix
%div#issues-table-holder.ui-box %div#issues-table-holder.ui-box
.title .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 .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 &nbsp; %span.update_issues_text Update selected issues with &nbsp;
.left .left
= select_tag('update[status]', options_for_select(['open', 'closed']), :prompt => "Status") = 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[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[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 'update[issues_ids]', []
= hidden_field_tag :f, params[:f] = hidden_field_tag :f, params[:f]
= button_tag "Save", :class => "btn update_selected_issues" = button_tag "Save", class: "btn update_selected_issues"
.issues_filters .issues_filters
.left .left
%ul.nav.nav-pills.left %ul.nav.nav-pills.left
%li{:class => ("active" if (params[:f] == issues_filter[:open] || !params[:f]))} %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 = link_to project_issues_path(@project, f: issues_filter[:open], milestone_id: params[:milestone_id]) do
Open Open
%li{:class => ("active" if params[:f] == issues_filter[:closed])} %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 = link_to project_issues_path(@project, f: issues_filter[:closed], milestone_id: params[:milestone_id]) do
Closed Closed
%li{:class => ("active" if params[:f] == issues_filter[:to_me])} %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 = link_to project_issues_path(@project, f: issues_filter[:to_me], milestone_id: params[:milestone_id]) do
To Me To Me
%li{:class => ("active" if params[:f] == issues_filter[:all])} %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 = link_to project_issues_path(@project, f: issues_filter[:all], milestone_id: params[:milestone_id]) do
All All
.right .right
= form_tag project_issues_path(@project), :method => :get, :class => :right do = 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(: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(: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") = 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] = hidden_field_tag :f, params[:f]
.clearfix .clearfix
......
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
%span.right %span.right
- if can?(current_user, :admin_project, @project) || @issue.author == current_user - if can?(current_user, :admin_project, @project) || @issue.author == current_user
- if @issue.closed - 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 - 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 - 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 %i.icon-edit
Edit Edit
...@@ -35,18 +35,18 @@ ...@@ -35,18 +35,18 @@
.middle_box_content .middle_box_content
%cite.cgray Created by %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) %strong.author= link_to_issue_author(@issue)
- if @issue.assignee - if @issue.assignee
%cite.cgray and currently assigned to %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) %strong.author= link_to_issue_assignee(@issue)
- if @issue.milestone - if @issue.milestone
- milestone = @issue.milestone - milestone = @issue.milestone
%cite.cgray and attached to 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 .right
- @issue.labels.each do |label| - @issue.labels.each do |label|
...@@ -61,4 +61,4 @@ ...@@ -61,4 +61,4 @@
= markdown @issue.description = 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"
...@@ -6,4 +6,4 @@ ...@@ -6,4 +6,4 @@
-# per_page: number of items to fetch per page -# per_page: number of items to fetch per page
-# remote: data-remote -# remote: data-remote
%span.first %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
...@@ -6,4 +6,4 @@ ...@@ -6,4 +6,4 @@
-# per_page: number of items to fetch per page -# per_page: number of items to fetch per page
-# remote: data-remote -# remote: data-remote
%span.last %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}
...@@ -6,4 +6,4 @@ ...@@ -6,4 +6,4 @@
-# per_page: number of items to fetch per page -# per_page: number of items to fetch per page
-# remote: data-remote -# remote: data-remote
%li.next %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
...@@ -6,5 +6,5 @@ ...@@ -6,5 +6,5 @@
-# num_pages: total number of pages -# num_pages: total number of pages
-# per_page: number of items to fetch per page -# per_page: number of items to fetch per page
-# remote: data-remote -# remote: data-remote
%li{:class => "page#{' active' if page.current?}"} %li{class: "page#{' active' if page.current?}"}
= link_to page, url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} = link_to page, url, {remote: remote, rel: page.next? ? 'next' : page.prev? ? 'prev' : nil}
...@@ -5,5 +5,5 @@ ...@@ -5,5 +5,5 @@
-# num_pages: total number of pages -# num_pages: total number of pages
-# per_page: number of items to fetch per page -# per_page: number of items to fetch per page
-# remote: data-remote -# remote: data-remote
%li{:class => "prev" } %li{class: "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
...@@ -6,4 +6,4 @@ ...@@ -6,4 +6,4 @@
-# per_page: number of items to fetch per page -# per_page: number of items to fetch per page
-# remote: data-remote -# remote: data-remote
%span.first %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
...@@ -6,4 +6,4 @@ ...@@ -6,4 +6,4 @@
-# per_page: number of items to fetch per page -# per_page: number of items to fetch per page
-# remote: data-remote -# remote: data-remote
%span.last %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}
...@@ -6,4 +6,4 @@ ...@@ -6,4 +6,4 @@
-# per_page: number of items to fetch per page -# per_page: number of items to fetch per page
-# remote: data-remote -# remote: data-remote
%span.next %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
...@@ -6,5 +6,5 @@ ...@@ -6,5 +6,5 @@
-# num_pages: total number of pages -# num_pages: total number of pages
-# per_page: number of items to fetch per page -# per_page: number of items to fetch per page
-# remote: data-remote -# remote: data-remote
%span{:class => "page#{' current' if page.current?}"} %span{class: "page#{' current' if page.current?}"}
= link_to_unless page.current?, page, url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} = link_to_unless page.current?, page, url, {remote: remote, rel: page.next? ? 'next' : page.prev? ? 'prev' : nil}
...@@ -6,4 +6,4 @@ ...@@ -6,4 +6,4 @@
-# per_page: number of items to fetch per page -# per_page: number of items to fetch per page
-# remote: data-remote -# remote: data-remote
%span.prev %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
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
.input= f.text_field :title .input= f.text_field :title
.clearfix .clearfix
= f.label :key = f.label :key
.input= f.text_area :key, :class => [:xxlarge, :thin_area] .input= f.text_area :key, class: [:xxlarge, :thin_area]
.actions .actions
= f.submit 'Save', :class => "primary btn" = f.submit 'Save', class: "primary btn"
= link_to "Cancel", keys_path, :class => "btn" = link_to "Cancel", keys_path, class: "btn"
...@@ -9,5 +9,5 @@ ...@@ -9,5 +9,5 @@
= time_ago_in_words(key.created_at) = time_ago_in_words(key.created_at)
ago ago
%td %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"
- if @key.valid? - if @key.valid?
:plain :plain
$("#new_key_dialog").dialog("close"); $("#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(); $("#no_ssh_key_defined").hide();
- else - else
:plain :plain
......
%h3.page_title %h3.page_title
SSH Keys 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 %hr
%p.slead %p.slead
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
%th Added %th Added
%th %th
- @keys.each do |key| - @keys.each do |key|
= render(:partial => 'show', :locals => {:key => key}) = render(partial: 'show', locals: {key: key})
- if @keys.blank? - if @keys.blank?
%tr %tr
%td{:colspan => 3} %td{colspan: 3}
%h3.nothing_here_message There are no SSH keys with access to your account. %h3.nothing_here_message There are no SSH keys with access to your account.
...@@ -11,4 +11,4 @@ ...@@ -11,4 +11,4 @@
%pre= @key.key %pre= @key.key
.actions .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"
%ul.main_menu %ul.main_menu
%li.home{:class => tab_class(:root)} %li.home{class: tab_class(:root)}
= link_to "Home", root_path, :title => "Home" = 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 = link_to dashboard_issues_path do
Issues Issues
%span.count= current_user.assigned_issues.opened.count %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 = link_to dashboard_merge_requests_path do
Merge Requests Merge Requests
%span.count= current_user.cared_merge_requests.count %span.count= current_user.cared_merge_requests.count
%li{:class => tab_class(:search)} %li{class: tab_class(:search)}
= link_to "Search", search_path = link_to "Search", search_path
%li{:class => tab_class(:help)} %li{class: tab_class(:help)}
= link_to "Help", help_path = link_to "Help", help_path
- if alert || notice - if alert || notice
- text = alert || notice - text = alert || notice
%div{:style => "display:none", :id => "flash_container"} %div{style: "display:none", id: "flash_container"}
%center %center
%h4= text %h4= text
:javascript :javascript
......
%head %head
%meta{:charset => "utf-8"} %meta{charset: "utf-8"}
%title %title
GitLab GitLab
= " > #{@project.name}" if @project && !@project.new_record? = " > #{@project.name}" if @project && !@project.new_record?
...@@ -9,10 +9,10 @@ ...@@ -9,10 +9,10 @@
-# Atom feed -# Atom feed
- if controller_name == 'projects' && action_name == 'index' - 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 @project && !@project.new_record?
- if current_page?(tree_project_ref_path(@project, @project.root_ref)) || current_page?(project_commits_path(@project)) - 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) - 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 = csrf_meta_tags
...@@ -3,30 +3,30 @@ ...@@ -3,30 +3,30 @@
.container .container
.top_panel_content .top_panel_content
%div.app_logo %div.app_logo
= link_to root_path, :class => "home", :title => "Home" do = link_to root_path, class: "home", title: "Home" do
%h1 %h1
GITLAB GITLAB
%span.separator %span.separator
%h1.project_name= title %h1.project_name= title
.search .search
= form_tag search_path, :method => :get do |f| = form_tag search_path, method: :get do |f|
= text_field_tag "search", nil, :placeholder => "Search", :class => "search-input" = text_field_tag "search", nil, placeholder: "Search", class: "search-input"
.fbtn .fbtn
- if current_user.is_admin? - 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 %i.icon-cog
Admin Admin
- if current_user.can_create_project? - 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 %i.icon-plus
Project Project
.account-box .account-box
= link_to profile_path, :class => "pic" do = link_to profile_path, class: "pic" do
= image_tag gravatar_icon(current_user.email) = image_tag gravatar_icon(current_user.email)
.account-links .account-links
= link_to profile_path, :class => "username" do = link_to profile_path, class: "username" do
My profile 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 :javascript
$(function(){ $(function(){
......
%ul.main_menu %ul.main_menu
%li.home{:class => project_tab_class} %li.home{class: project_tab_class}
= link_to @project.code, project_path(@project), :title => "Project" = link_to @project.code, project_path(@project), title: "Project"
- if @project.repo_exists? - if @project.repo_exists?
- if can? current_user, :download_code, @project - 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 = link_to tree_project_ref_path(@project, @project.root_ref) do
Files Files
%li{:class => commit_tab_class} %li{class: commit_tab_class}
= link_to "Commits", project_commits_path(@project) = link_to "Commits", project_commits_path(@project)
%li{:class => tab_class(:network)} %li{class: tab_class(:network)}
= link_to "Network", graph_project_path(@project) = link_to "Network", graph_project_path(@project)
- if @project.issues_enabled - if @project.issues_enabled
%li{:class => tab_class(:issues)} %li{class: tab_class(:issues)}
= link_to project_issues_filter_path(@project) do = link_to project_issues_filter_path(@project) do
Issues Issues
%span.count.issue_counter= @project.issues.opened.count %span.count.issue_counter= @project.issues.opened.count
- if @project.repo_exists? - if @project.repo_exists?
- if @project.merge_requests_enabled - 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 = link_to project_merge_requests_path(@project) do
Merge Requests Merge Requests
%span.count.merge_counter= @project.merge_requests.opened.count %span.count.merge_counter= @project.merge_requests.opened.count
- if @project.wall_enabled - if @project.wall_enabled
%li{:class => tab_class(:wall)} %li{class: tab_class(:wall)}
= link_to wall_project_path(@project) do = link_to wall_project_path(@project) do
Wall Wall
- if @project.wiki_enabled - if @project.wiki_enabled
%li{:class => tab_class(:wiki)} %li{class: tab_class(:wiki)}
= link_to project_wiki_path(@project, :index) do = link_to project_wiki_path(@project, :index) do
Wiki Wiki
!!! 5 !!! 5
%html{ :lang => "en"} %html{ lang: "en"}
= render "layouts/head" = render "layouts/head"
%body{:class => "#{app_theme} admin"} %body{class: "#{app_theme} admin"}
= render "layouts/flash" = render "layouts/flash"
= render "layouts/head_panel", :title => "Admin area" = render "layouts/head_panel", title: "Admin area"
.container .container
%ul.main_menu %ul.main_menu
%li.home{:class => tab_class(:admin_root)} %li.home{class: tab_class(:admin_root)}
= link_to "Stats", admin_root_path = link_to "Stats", admin_root_path
%li{:class => tab_class(:admin_projects)} %li{class: tab_class(:admin_projects)}
= link_to "Projects", admin_projects_path = link_to "Projects", admin_projects_path
%li{:class => tab_class(:admin_users)} %li{class: tab_class(:admin_users)}
= link_to "Users", admin_users_path = link_to "Users", admin_users_path
%li{:class => tab_class(:admin_logs)} %li{class: tab_class(:admin_logs)}
= link_to "Logs", admin_logs_path = link_to "Logs", admin_logs_path
%li{:class => tab_class(:admin_emails)} %li{class: tab_class(:admin_emails)}
= link_to "Hooks", admin_hooks_path = link_to "Hooks", admin_hooks_path
%li{:class => tab_class(:admin_resque)} %li{class: tab_class(:admin_resque)}
= link_to "Resque", admin_resque_path = link_to "Resque", admin_resque_path
.content= yield .content= yield
!!! 5 !!! 5
%html{ :lang => "en"} %html{ lang: "en"}
= render "layouts/head" = render "layouts/head"
%body{:class => "#{app_theme} application"} %body{class: "#{app_theme} application"}
= render "layouts/flash" = render "layouts/flash"
= render "layouts/head_panel", :title => "Dashboard" = render "layouts/head_panel", title: "Dashboard"
.container .container
= render :partial => "layouts/app_menu" = render partial: "layouts/app_menu"
.content .content
= yield = yield
!!! 5 !!! 5
%html{ :lang => "en"} %html{ lang: "en"}
= render "layouts/head" = render "layouts/head"
%body.ui_basic.login-page %body.ui_basic.login-page
= render :partial => "layouts/flash" = render partial: "layouts/flash"
.container= yield .container= yield
!!! 5 !!! 5
%html{ :lang => "en"} %html{ lang: "en"}
= render "layouts/head" = render "layouts/head"
%body{:class => "#{app_theme} application"} %body{class: "#{app_theme} application"}
= render "layouts/flash" = render "layouts/flash"
= render "layouts/head_panel", :title => "" = render "layouts/head_panel", title: ""
.container .container
.content .content
%br %br
......
%html{:lang => "en"} %html{lang: "en"}
%head %head
%meta{:content => "text/html; charset=utf-8", "http-equiv" => "Content-Type"} %meta{content: "text/html; charset=utf-8", "http-equiv" => "Content-Type"}
%title %title
gitlabhq gitlabhq
:css :css
...@@ -11,28 +11,28 @@ ...@@ -11,28 +11,28 @@
.content a {color: #0eb6ce; text-decoration: none;} .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 p {font-size: 11px; color:#7d7a7a; margin: 0; padding: 0; font-family: Helvetica, Arial, sans-serif;}
.footer a {color: #0eb6ce; text-decoration: none;} .footer a {color: #0eb6ce; text-decoration: none;}
%body{:bgcolor => "#EAEAEA", :style => "margin: 0; padding: 0; background: #EAEAEA"} %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%"} %table{align: "center", border: "0", cellpadding: "0", cellspacing: "0", style: "padding: 35px 0; background: #EAEAEA;", width: "100%"}
%tr %tr
%td{:align => "center", :style => "margin: 0; padding: 0; background: #EAEAEA;"} %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"} %table.header{align: "center", border: "0", cellpadding: "0", cellspacing: "0", style: "font-family: Helvetica, Arial, sans-serif; background:#333", width: "600"}
%tr %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"} %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;"} %h1{style: "color: #BBBBBB; font: normal 32px Helvetica, Arial, sans-serif; margin: 0; padding: 0; line-height: 40px;"}
gitlab gitlab
- if @project - if @project
| #{@project.name} | #{@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= yield
%tr %tr
%td{:align => "left", :colspan => "2", :height => "3", :style => "padding: font-size: 0; line-height: 0; height: 3px;", :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"} %table.footer{align: "center", border: "0", cellpadding: "0", cellspacing: "0", style: "font-family: Helvetica, Arial, sans-serif; line-height: 10px;", width: "600"}
%tr %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 %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 You're receiving this notification because you are a member of the
- if @project - if @project
#{@project.name} #{@project.name}
......
!!! 5 !!! 5
%html{ :lang => "en"} %html{ lang: "en"}
= render "layouts/head" = render "layouts/head"
%body{:class => "#{app_theme} profile"} %body{class: "#{app_theme} profile"}
= render "layouts/flash" = render "layouts/flash"
= render "layouts/head_panel", :title => "Profile" = render "layouts/head_panel", title: "Profile"
.container .container
%ul.main_menu %ul.main_menu
%li.home{:class => tab_class(:profile)} %li.home{class: tab_class(:profile)}
= link_to "Profile", profile_path = link_to "Profile", profile_path
%li{:class => tab_class(:password)} %li{class: tab_class(:password)}
= link_to "Password", profile_password_path = link_to "Password", profile_password_path
%li{:class => tab_class(:ssh_keys)} %li{class: tab_class(:ssh_keys)}
= link_to keys_path do = link_to keys_path do
SSH Keys SSH Keys
%span.count= current_user.keys.count %span.count= current_user.keys.count
%li{:class => tab_class(:token)} %li{class: tab_class(:token)}
= link_to "Token", profile_token_path = link_to "Token", profile_token_path
%li{:class => tab_class(:design)} %li{class: tab_class(:design)}
= link_to "Design", profile_design_path = link_to "Design", profile_design_path
......
!!! 5 !!! 5
%html{ :lang => "en"} %html{ lang: "en"}
= render "layouts/head" = render "layouts/head"
%body{:class => "#{app_theme} project"} %body{class: "#{app_theme} project"}
= render "layouts/flash" = render "layouts/flash"
= render "layouts/head_panel", :title => @project.name = render "layouts/head_panel", title: @project.name
.container .container
= render :partial => "layouts/project_menu" = render partial: "layouts/project_menu"
.content .content
= yield = yield
= 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? -if @merge_request.errors.any?
.alert-message.block-message.error .alert-message.block-message.error
%ul %ul
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
%h5 From (Head Branch) %h5 From (Head Branch)
.body .body
.padded .padded
= f.label :source_branch, "From", :class => "control-label" = f.label :source_branch, "From", class: "control-label"
.controls .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 .bottom_commit
.mr_source_commit .mr_source_commit
...@@ -25,9 +25,9 @@ ...@@ -25,9 +25,9 @@
%h5 To (Base Branch) %h5 To (Base Branch)
.body .body
.padded .padded
= f.label :target_branch, "To", :class => "control-label" = f.label :target_branch, "To", class: "control-label"
.controls .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 .bottom_commit
.mr_target_commit .mr_target_commit
...@@ -38,22 +38,22 @@ ...@@ -38,22 +38,22 @@
.top_box_content .top_box_content
= f.label :title do = f.label :title do
%strong= "Title *" %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 .middle_box_content
= f.label :assignee_id do = f.label :assignee_id do
%i.icon-user %i.icon-user
Assign to 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 .control-group
.form-actions .form-actions
= f.submit 'Save', :class => "btn-primary btn" = f.submit 'Save', class: "btn-primary btn"
- if @merge_request.new_record? - 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 Cancel
- else - 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 Cancel
......
.top-tabs .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 %span
Merge Requests Merge Requests
%li.wll{ :class => mr_css_classes(merge_request) } %li.wll{ class: mr_css_classes(merge_request) }
.right .right
.left .left
- if merge_request.merged? - if merge_request.merged?
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
= merge_request.source_branch = merge_request.source_branch
&rarr; &rarr;
= merge_request.target_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 %span.update-author
%small.cdark= "##{merge_request.id}" %small.cdark= "##{merge_request.id}"
......
...@@ -7,16 +7,16 @@ ...@@ -7,16 +7,16 @@
- if @commits.present? - if @commits.present?
%ul.nav.nav-tabs.mr_nav_tabs %ul.nav.nav-tabs.mr_nav_tabs
%li %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 %i.icon-comment
Comments Comments
%li %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 %i.icon-list-alt
Diff Diff
.merge_request_notes#notes{ :class => (controller.action_name == 'show') ? "" : "hide" } .merge_request_notes#notes{ class: (controller.action_name == 'show') ? "" : "hide" }
= render("notes/notes", :tid => @merge_request.id, :tt => "merge_request") = render("notes/notes", tid: @merge_request.id, tt: "merge_request")
.merge-request-diffs .merge-request-diffs
= render "merge_requests/show/diffs" if @diffs = render "merge_requests/show/diffs" if @diffs
.status .status
......
:plain :plain
$(".mr_source_commit").html("#{escape_javascript(render 'commits/commit', :commit => @commit)}"); $(".mr_source_commit").html("#{escape_javascript(render 'commits/commit', commit: @commit)}");
:plain :plain
$(".mr_target_commit").html("#{escape_javascript(render 'commits/commit', :commit => @commit)}"); $(".mr_target_commit").html("#{escape_javascript(render 'commits/commit', commit: @commit)}");
:plain :plain
$(".merge-request-commits").html("#{escape_javascript(render(:partial => "commits"))}"); $(".merge-request-commits").html("#{escape_javascript(render(partial: "commits"))}");
:plain :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"))}");
%h3.page_title %h3.page_title
Merge Requests Merge Requests
- if can? current_user, :write_issue, @project - 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 New Merge Request
%br %br
...@@ -10,17 +10,17 @@ ...@@ -10,17 +10,17 @@
.ui-box .ui-box
.title .title
%ul.nav.nav-pills %ul.nav.nav-pills
%li{:class => ("active" if (params[:f] == "0" || !params[:f]))} %li{class: ("active" if (params[:f] == "0" || !params[:f]))}
= link_to project_merge_requests_path(@project, :f => 0) do = link_to project_merge_requests_path(@project, f: 0) do
Open Open
%li{:class => ("active" if params[:f] == "2")} %li{class: ("active" if params[:f] == "2")}
= link_to project_merge_requests_path(@project, :f => 2) do = link_to project_merge_requests_path(@project, f: 2) do
Closed Closed
%li{:class => ("active" if params[:f] == "3")} %li{class: ("active" if params[:f] == "3")}
= link_to project_merge_requests_path(@project, :f => 3) do = link_to project_merge_requests_path(@project, f: 3) do
To Me To Me
%li{:class => ("active" if params[:f] == "1")} %li{class: ("active" if params[:f] == "1")}
= link_to project_merge_requests_path(@project, :f => 1) do = link_to project_merge_requests_path(@project, f: 1) do
All All
%ul.unstyled %ul.unstyled
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
- if @merge_requests.present? - if @merge_requests.present?
%li.bottom %li.bottom
.row .row
.span7= paginate @merge_requests, :theme => "gitlab" .span7= paginate @merge_requests, theme: "gitlab"
.span4.right .span4.right
%span.cgray.right #{@merge_requests.total_count} merge requests for this filter %span.cgray.right #{@merge_requests.total_count} merge requests for this filter
:plain :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"))}");
...@@ -7,19 +7,19 @@ ...@@ -7,19 +7,19 @@
- if @commits.count > 8 - if @commits.count > 8
%ul.first_mr_commits.unstyled %ul.first_mr_commits.unstyled
- @commits.first(8).each do |commit| - @commits.first(8).each do |commit|
= render "commits/commit", :commit => commit = render "commits/commit", commit: commit
%li.bottom %li.bottom
8 of #{@commits.count} commits displayed. 8 of #{@commits.count} commits displayed.
%strong %strong
%a.mr_show_all_commits Click here to show all %a.mr_show_all_commits Click here to show all
%ul.all_mr_commits.hide.unstyled %ul.all_mr_commits.hide.unstyled
- @commits.each do |commit| - @commits.each do |commit|
= render "commits/commit", :commit => commit = render "commits/commit", commit: commit
- else - else
%ul.unstyled %ul.unstyled
- @commits.each do |commit| - @commits.each do |commit|
= render "commits/commit", :commit => commit = render "commits/commit", commit: commit
- else - else
%h5 %h5
......
- if @merge_request.valid_diffs? - if @merge_request.valid_diffs?
= render "commits/diffs", :diffs => @diffs = render "commits/diffs", diffs: @diffs
- elsif @merge_request.broken_diffs? - elsif @merge_request.broken_diffs?
%h4.nothing_here_message %h4.nothing_here_message
Can't load diff. 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 - else
%h4.nothing_here_message Nothing to merge %h4.nothing_here_message Nothing to merge
%div#modal_merge_info.modal.hide %div#modal_merge_info.modal.hide
.modal-header .modal-header
%a.close{:href => "#"} × %a.close{href: "#"} ×
%h3 How To Merge %h3 How To Merge
.modal-body .modal-body
%pre %pre
......
...@@ -4,29 +4,29 @@ ...@@ -4,29 +4,29 @@
- if @merge_request.open? && @commits.any? && can?(current_user, :accept_mr, @project) - 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 .alert.alert-success
%span %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 %p
You can accept this request automatically. You can accept this request automatically.
If you still want to do it manually - 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 for instructions
.accept_group .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 - unless @project.root_ref? @merge_request.source_branch
.remove_branch_holder .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 = check_box_tag :should_remove_source_branch
Remove source-branch Remove source-branch
.clearfix .clearfix
.automerge_widget.cannot_be_merged{:style => "display:none"} .automerge_widget.cannot_be_merged{style: "display:none"}
.alert.alert-info .alert.alert-info
%span %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"
&nbsp; &nbsp;
%strong This request cant be merged with GitLab. You should do it manually %strong This request cant be merged with GitLab. You should do it manually
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
%i.icon-refresh %i.icon-refresh
Checking for ability to automatically merge… 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 .alert.alert-info
%strong This merge request already can not be merged. Try to reload page. %strong This merge request already can not be merged. Try to reload page.
...@@ -10,12 +10,12 @@ ...@@ -10,12 +10,12 @@
.middle_box_content .middle_box_content
%div %div
%cite.cgray Created at #{@merge_request.created_at.stamp("Aug 21, 2011")} by %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) %strong.author= link_to_merge_request_author(@merge_request)
- if @merge_request.assignee - if @merge_request.assignee
%cite.cgray and currently assigned to %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) %strong.author= link_to_merge_request_assignee(@merge_request)
......
...@@ -13,13 +13,13 @@ ...@@ -13,13 +13,13 @@
= "MERGED" = "MERGED"
- if can?(current_user, :modify_merge_request, @merge_request) - if can?(current_user, :modify_merge_request, @merge_request)
- if @merge_request.open? - 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 %i.icon-download-alt
Get Patch 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 %i.icon-edit
Edit Edit
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
%hr %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? -if @milestone.errors.any?
.alert-message.block-message.error .alert-message.block-message.error
%ul %ul
...@@ -14,35 +14,35 @@ ...@@ -14,35 +14,35 @@
.row .row
.span6 .span6
.control-group .control-group
= f.label :title, "Title", :class => "control-label" = f.label :title, "Title", class: "control-label"
.controls .controls
= f.text_field :title, :maxlength => 255, :class => "input-xlarge" = f.text_field :title, maxlength: 255, class: "input-xlarge"
%p.help-block Required %p.help-block Required
.control-group .control-group
= f.label :description, "Description", :class => "control-label" = f.label :description, "Description", class: "control-label"
.controls .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. %p.help-block Markdown is enabled.
.span6 .span6
.control-group .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 .input= f.hidden_field :due_date
.controls .controls
.datepicker .datepicker
.form-actions .form-actions
- if @milestone.new_record? - if @milestone.new_record?
= f.submit 'Create milestone', :class => "primary btn" = f.submit 'Create milestone', class: "primary btn"
-else -else
= f.submit 'Save changes', :class => "primary btn" = f.submit 'Save changes', class: "primary btn"
- if request.xhr? - if request.xhr?
= link_to "Cancel", "#back", :onclick => "backToIssues();", :class => "btn" = link_to "Cancel", "#back", onclick: "backToIssues();", class: "btn"
- else - else
- if @milestone.new_record? - if @milestone.new_record?
= link_to "Cancel", project_milestones_path(@project), :class => "btn" = link_to "Cancel", project_milestones_path(@project), class: "btn"
- else - else
= link_to "Cancel", project_milestone_path(@project, @milestone), :class => "btn" = link_to "Cancel", project_milestone_path(@project, @milestone), class: "btn"
:javascript :javascript
$(function() { $(function() {
......
%li{:class => "milestone", :id => dom_id(milestone) } %li{class: "milestone", id: dom_id(milestone) }
.right .right
- if milestone.issues.any? - if milestone.issues.any?
%span.btn.small.disabled.grouped= pluralize milestone.issues.count, 'issues' %span.btn.small.disabled.grouped= pluralize milestone.issues.count, 'issues'
- if milestone.issues.count > 0 - 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 - 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 %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 %small
= milestone.expires_at = milestone.expires_at
%br %br
.progress.progress-success.span3 .progress.progress-success.span3
.bar{:style => "width: #{milestone.percent_complete}%;"} .bar{style: "width: #{milestone.percent_complete}%;"}
&nbsp; &nbsp;
...@@ -3,23 +3,23 @@ ...@@ -3,23 +3,23 @@
%h3.page_title %h3.page_title
Milestones Milestones
- if can? current_user, :admin_milestone, @project - 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 %br
%div.ui-box %div.ui-box
.title .title
%ul.nav.nav-pills %ul.nav.nav-pills
%li{:class => ("active" if (params[:f] == "0" || !params[:f]))} %li{class: ("active" if (params[:f] == "0" || !params[:f]))}
= link_to project_milestones_path(@project, :f => 0) do = link_to project_milestones_path(@project, f: 0) do
Active Active
%li{:class => ("active" if params[:f] == "1")} %li{class: ("active" if params[:f] == "1")}
= link_to project_milestones_path(@project, :f => 1) do = link_to project_milestones_path(@project, f: 1) do
All All
%ul.unstyled %ul.unstyled
= render @milestones = render @milestones
- if @milestones.present? - if @milestones.present?
%li.bottom= paginate @milestones, :remote => true, :theme => "gitlab" %li.bottom= paginate @milestones, remote: true, theme: "gitlab"
- else - else
%li %li
%h3.nothing_here_message Nothing to show here %h3.nothing_here_message Nothing to show here
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
= @milestone.expires_at = @milestone.expires_at
%span.right %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) - 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 %i.icon-edit
Edit Edit
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
&ndash; &ndash;
#{@milestone.issues.closed.count} closed #{@milestone.issues.closed.count} closed
.progress.progress-success .progress.progress-success
.bar{:style => "width: #{@milestone.percent_complete}%;"} .bar{style: "width: #{@milestone.percent_complete}%;"}
- if @milestone.description.present? - if @milestone.description.present?
...@@ -51,9 +51,9 @@ ...@@ -51,9 +51,9 @@
= link_to [@project, issue] do = link_to [@project, issue] do
%span.badge.badge-info ##{issue.id} %span.badge.badge-info ##{issue.id}
&ndash; &ndash;
= link_to_gfm truncate(issue.title, :length => 60), [@project, issue] = link_to_gfm truncate(issue.title, length: 60), [@project, issue]
%br %br
= paginate @issues, :theme => "gitlab" = paginate @issues, theme: "gitlab"
.span6 .span6
%table.admin-table %table.admin-table
...@@ -62,6 +62,6 @@ ...@@ -62,6 +62,6 @@
- @users.each do |user| - @users.each do |user|
%tr %tr
%td %td
= image_tag gravatar_icon(user.email, 24), :width => "24" = image_tag gravatar_icon(user.email, 24), width: "24"
&nbsp; &nbsp;
= user.name = user.name
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
:plain :plain
$("#new_note .errors").remove(); $("#new_note .errors").remove();
$('#new_note textarea').val(""); $('#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 - else
:plain :plain
$("#new_note").replaceWith("#{escape_javascript(render('form'))}"); $("#new_note").replaceWith("#{escape_javascript(render('form'))}");
......
...@@ -4,5 +4,5 @@ ...@@ -4,5 +4,5 @@
$('#new_note textarea').val(""); $('#new_note textarea').val("");
$("a.line_note_reply_link[line_code='#{note.line_code}']").closest("tr").remove(); $("a.line_note_reply_link[line_code='#{note.line_code}']").closest("tr").remove();
var trEl = $(".#{note.line_code}").parent(); 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/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/reply_button", locals: {line_code: note.line_code})}");
= 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 %h3.page_title Leave a comment
-if @note.errors.any? -if @note.errors.any?
.alert-message.block-message.error .alert-message.block-message.error
...@@ -7,16 +7,16 @@ ...@@ -7,16 +7,16 @@
= f.hidden_field :noteable_id = f.hidden_field :noteable_id
= f.hidden_field :noteable_type = f.hidden_field :noteable_type
= f.text_area :note, :size => 255 = f.text_area :note, size: 255
#preview-note.well.hide #preview-note.well.hide
%p.hint %p.hint
= link_to "Gitlab Markdown", help_markdown_path, :target => '_blank' = link_to "Gitlab Markdown", help_markdown_path, target: '_blank'
is enabled. 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 .row.note_advanced_opts.hide
.span2 .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 .span4.notify_opts
%h6.left Notify via email: %h6.left Notify via email:
= label_tag :notify do = label_tag :notify do
...@@ -33,6 +33,6 @@ ...@@ -33,6 +33,6 @@
.input.input_file .input.input_file
%a.file_upload.btn.small Upload 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 %span.hint Any file less than 10 MB
- unless @notes.blank? - unless @notes.blank?
- if params[:last_id] - if params[:last_id]
:plain :plain
NoteList.replace("#{escape_javascript(render(:partial => 'notes/notes_list'))}"); NoteList.replace("#{escape_javascript(render(partial: 'notes/notes_list'))}");
- elsif params[:first_id] - elsif params[:first_id]
:plain :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 - else
:plain :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 - else
- if params[:first_id] - if params[:first_id]
......
- @notes.each do |note| - @notes.each do |note|
- next unless note.author - next unless note.author
= render :partial => "notes/show", :locals => {:note => note} = render partial: "notes/show", locals: {note: note}
%table{:style => "display:none;"} %table{style: "display:none;"}
%tr.per_line_form %tr.per_line_form
%td{:colspan => 3 } %td{colspan: 3 }
= 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 note %h3.page_title Leave a note
%div.span10 %div.span10
-if @note.errors.any? -if @note.errors.any?
...@@ -12,11 +12,11 @@ ...@@ -12,11 +12,11 @@
= f.hidden_field :noteable_id = f.hidden_field :noteable_id
= f.hidden_field :noteable_type = f.hidden_field :noteable_type
= f.hidden_field :line_code = f.hidden_field :line_code
= f.text_area :note, :size => 255 = f.text_area :note, size: 255
.note_actions .note_actions
.buttons .buttons
= f.submit 'Add note', :class => "btn primary submit_note", :id => "submit_note" = f.submit 'Add note', class: "btn primary submit_note", id: "submit_note"
= link_to "Cancel", "#", :class => "btn hide-button" = link_to "Cancel", "#", class: "btn hide-button"
.options .options
%h6.left Notify via email: %h6.left Notify via email:
.labels .labels
......
%tr.line_notes_row %tr.line_notes_row
%td{:colspan => 3} %td{colspan: 3}
%ul %ul
= render :partial => "notes/show", :locals => {:note => note} = render partial: "notes/show", locals: {note: note}
%tr.line_notes_row.reply %tr.line_notes_row.reply
%td{:colspan => 3} %td{colspan: 3}
%i.icon-comment %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"
%li{:id => dom_id(note), :class => "note"} %li{id: dom_id(note), class: "note"}
= image_tag gravatar_icon(note.author.email), :class => "avatar" = image_tag gravatar_icon(note.author.email), class: "avatar"
%div.note-author %div.note-author
%strong= note.author_name %strong= note.author_name
= link_to "##{dom_id(note)}", name: dom_id(note) do = link_to "##{dom_id(note)}", name: dom_id(note) do
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
= time_ago_in_words(note.updated_at) = time_ago_in_words(note.updated_at)
ago ago
- if(note.author_id == current_user.id) || can?(current_user, :admin_note, @project) - 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 %i.icon-trash
Remove Remove
...@@ -17,5 +17,5 @@ ...@@ -17,5 +17,5 @@
- if note.attachment.url - if note.attachment.url
.right .right
%div.file %div.file
= link_to note.attachment_identifier, note.attachment.url, :target => "_blank" = link_to note.attachment_identifier, note.attachment.url, target: "_blank"
.clear .clear
- if @note.line_code - if @note.line_code
= render "create_line", :note => @note = render "create_line", note: @note
- else - else
= render "create_common", :note => @note = render "create_common", note: @note
-# Enable submit button -# Enable submit button
:plain :plain
......
%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :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"} %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"}
%tr %tr
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
%td{:align => "left", :style => "padding: 20px 0 0;"} %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; "} %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. 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 %tr
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
%td{:align => "left", :style => "padding: 20px 0 0;"} %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; "} %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}" = "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 %br
%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :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"} %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"}
%tr %tr
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
%td{:align => "left", :style => "padding: 20px 0 0;"} %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; "} %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}" = "New Merge Request !#{@merge_request.id}"
= link_to_gfm truncate(@merge_request.title, :length => 16), project_merge_request_url(@merge_request.project, @merge_request) = 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"} %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
%tr %tr
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
%td{:style => "padding: 15px 0 15px;", :valign => "top"} %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; "} %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} &rarr; #{@merge_request.target_branch} Branches: #{@merge_request.source_branch} &rarr; #{@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} &rarr; #{@merge_request.assignee_name} Asignee: #{@merge_request.author_name} &rarr; #{@merge_request.assignee_name}
%td %td
%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :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"} %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"}
%tr %tr
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
%td{:align => "left", :style => "padding: 20px 0 0;"} %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; "} %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']}! 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. 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 %tr
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
%td{:style => "padding: 15px 0 15px;", :valign => "top"} %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; "} %p{style: "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 28px; font-size: 16px;font-family: Helvetica, Arial, sans-serif; "}
login.......................................... login..........................................
%code= @user['email'] %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.................................. password..................................
%code= @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 = 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"}
%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :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"} %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"}
%tr %tr
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
%td{:align => "left", :style => "padding: 20px 0 0;"} %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; "} %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}" = "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}") = 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"} %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
%tr %tr
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
%td{:style => "padding: 15px 0 15px;", :valign => "top"} %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; "} %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} %a{href: "#", style: "color: #0eb6ce; text-decoration: none;"} #{@note.author_name}
left next message: left next message:
%br %br
%table{:border => "0", :cellpadding => "0", :cellspacing => "0", :width => "558"} %table{border: "0", cellpadding: "0", cellspacing: "0", width: "558"}
%tr %tr
%td{:valign => "top"} %td{valign: "top"}
%div{ :style => "background:#f5f5f5; padding:20px;border:1px solid #ddd" } %div{ style: "background:#f5f5f5; padding:20px;border:1px solid #ddd" }
= markdown(@note.note) = markdown(@note.note)
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :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"} %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"}
%tr %tr
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
%td{:align => "left", :style => "padding: 20px 0 0;"} %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; "} %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}" = "New comment for Issue ##{@issue.id}"
= link_to_gfm truncate(@issue.title, :length => 35), project_issue_url(@issue.project, @issue, :anchor => "note_#{@note.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"} %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
%tr %tr
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
%td{:style => "padding: 15px 0 15px;", :valign => "top"} %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; "} %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} %a{href: "#", style: "color: #0eb6ce; text-decoration: none;"} #{@note.author_name}
left next message: left next message:
%br %br
%table{:border => "0", :cellpadding => "0", :cellspacing => "0", :width => "558"} %table{border: "0", cellpadding: "0", cellspacing: "0", width: "558"}
%tr %tr
%td{:valign => "top"} %td{valign: "top"}
%div{ :style => "background:#f5f5f5; padding:20px;border:1px solid #ddd" } %div{ style: "background:#f5f5f5; padding:20px;border:1px solid #ddd" }
= markdown(@note.note) = markdown(@note.note)
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :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"} %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"}
%tr %tr
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
%td{:align => "left", :style => "padding: 20px 0 0;"} %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; "} %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}" = "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}") = 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"} %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
%tr %tr
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
%td{:style => "padding: 15px 0 15px;", :valign => "top"} %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; "} %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} %a{href: "#", style: "color: #0eb6ce; text-decoration: none;"} #{@note.author_name}
left next message: left next message:
%br %br
%table{:border => "0", :cellpadding => "0", :cellspacing => "0", :width => "558"} %table{border: "0", cellpadding: "0", cellspacing: "0", width: "558"}
%tr %tr
%td{:valign => "top"} %td{valign: "top"}
%div{ :style => "background:#f5f5f5; padding:20px;border:1px solid #ddd" } %div{ style: "background:#f5f5f5; padding:20px;border:1px solid #ddd" }
= markdown(@note.note) = markdown(@note.note)
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :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"} %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"}
%tr %tr
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
%td{:align => "left", :style => "padding: 20px 0 0;"} %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; "} %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 New message on
= link_to "Project Wall", wall_project_url(@note.project, :anchor => "note_#{@note.id}") = link_to "Project Wall", wall_project_url(@note.project, anchor: "note_#{@note.id}")
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
%tr %tr
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
%td{:style => "padding: 15px 0 15px;", :valign => "top"} %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; "} %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} %a{href: "#", style: "color: #0eb6ce; text-decoration: none;"} #{@note.author_name}
left next message: left next message:
%br %br
%table{:border => "0", :cellpadding => "0", :cellspacing => "0", :width => "558"} %table{border: "0", cellpadding: "0", cellspacing: "0", width: "558"}
%tr %tr
%td{:valign => "top"} %td{valign: "top"}
%div{ :style => "background:#f5f5f5; padding:20px;border:1px solid #ddd" } %div{ style: "background:#f5f5f5; padding:20px;border:1px solid #ddd" }
= markdown(@note.note) = markdown(@note.note)
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :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"} %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"}
%tr %tr
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
%td{:align => "left", :style => "padding: 20px 0 0;"} %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; "} %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 New comment for Wiki page
= link_to_gfm @wiki.title, project_issue_url(@wiki.project, @wiki, :anchor => "note_#{@note.id}") = 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"} %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
%tr %tr
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
%td{:style => "padding: 15px 0 15px;", :valign => "top"} %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; "} %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} %a{href: "#", style: "color: #0eb6ce; text-decoration: none;"} #{@note.author_name}
commented on Wiki page: commented on Wiki page:
%br %br
%table{:border => "0", :cellpadding => "0", :cellspacing => "0", :width => "558"} %table{border: "0", cellpadding: "0", cellspacing: "0", width: "558"}
%tr %tr
%td{:valign => "top"} %td{valign: "top"}
%div{ :style => "background:#f5f5f5; padding:20px;border:1px solid #ddd" } %div{ style: "background:#f5f5f5; padding:20px;border:1px solid #ddd" }
= markdown(@note.note) = markdown(@note.note)
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :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"} %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"}
%tr %tr
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
%td{:align => "left", :style => "padding: 20px 0 0;"} %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; "} %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}" = "Reassigned Issue ##{@issue.id}"
= link_to_gfm truncate(@issue.title, :length => 16), project_issue_url(@issue.project, @issue) = link_to_gfm truncate(@issue.title, length: 16), project_issue_url(@issue.project, @issue)
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
%tr %tr
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
%td{:style => "padding: 15px 0 15px;", :valign => "top"} %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; "} %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} Assignee changed from #{@previous_assignee.name} to #{@issue.assignee_name}
%td %td
%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :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"} %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"}
%tr %tr
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
%td{:align => "left", :style => "padding: 20px 0 0;"} %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; "} %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}" = "Reassigned Merge Request !#{@merge_request.id}"
= link_to_gfm truncate(@merge_request.title, :length => 16), project_merge_request_url(@merge_request.project, @merge_request) = 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"} %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
%tr %tr
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
%td{:style => "padding: 15px 0 15px;", :valign => "top"} %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; "} %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} Assignee changed from #{@previous_assignee.name} to #{@merge_request.assignee_name}
%td %td
= 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 %div
%h3 Application theme %h3 Application theme
%hr %hr
...@@ -18,16 +18,16 @@ ...@@ -18,16 +18,16 @@
%h3 Code review %h3 Code review
%hr %hr
.row .row
%label.span3{:for => "user_dark_scheme_false"} %label.span3{for: "user_dark_scheme_false"}
.thumbnail .thumbnail
= image_tag "white.png", :width => 260, :class => "styled_image" = image_tag "white.png", width: 260, class: "styled_image"
.caption .caption
%h5 %h5
= f.radio_button :dark_scheme, false = f.radio_button :dark_scheme, false
White code preview White code preview
%label.span3{:for => "user_dark_scheme_true"} %label.span3{for: "user_dark_scheme_true"}
.thumbnail .thumbnail
= image_tag "dark.png", :width => 260, :class => "styled_image" = image_tag "dark.png", width: 260, class: "styled_image"
.caption .caption
%h5 %h5
= f.radio_button :dark_scheme, true = f.radio_button :dark_scheme, true
......
%h3.page_title Password %h3.page_title Password
%hr %hr
= form_for @user, :url => profile_password_path, :method => :put do |f| = form_for @user, url: profile_password_path, method: :put do |f|
.data .data
%p.slead After successful password update you will be redirected to login page where you should login with new password %p.slead After successful password update you will be redirected to login page where you should login with new password
-if @user.errors.any? -if @user.errors.any?
...@@ -16,4 +16,4 @@ ...@@ -16,4 +16,4 @@
= f.label :password_confirmation = f.label :password_confirmation
.input= f.password_field :password_confirmation .input= f.password_field :password_confirmation
.actions .actions
= f.submit 'Save', :class => "btn primary" = f.submit 'Save', class: "btn primary"
.profile_avatar_holder .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 %h3.page_title
= @user.name = @user.name
%br %br
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
%hr %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? -if @user.errors.any?
%div.alert-message.block-message.error %div.alert-message.block-message.error
%ul %ul
...@@ -18,30 +18,30 @@ ...@@ -18,30 +18,30 @@
.row .row
.span7 .span7
.control-group .control-group
= f.label :name, :class => "control-label" = f.label :name, class: "control-label"
.controls .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. %span.help-block Enter your name, so people you know can recognize you.
.control-group .control-group
= f.label :email, :class => "control-label" = f.label :email, class: "control-label"
.controls .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. %span.help-block We also use email for avatar detection.
%hr %hr
.control-group .control-group
= f.label :skype, :class => "control-label" = f.label :skype, class: "control-label"
.controls= f.text_field :skype, :class => "input-xlarge" .controls= f.text_field :skype, class: "input-xlarge"
.control-group .control-group
= f.label :linkedin, :class => "control-label" = f.label :linkedin, class: "control-label"
.controls= f.text_field :linkedin, :class => "input-xlarge" .controls= f.text_field :linkedin, class: "input-xlarge"
.control-group .control-group
= f.label :twitter, :class => "control-label" = f.label :twitter, class: "control-label"
.controls= f.text_field :twitter, :class => "input-xlarge" .controls= f.text_field :twitter, class: "input-xlarge"
.control-group .control-group
= f.label :bio, :class => "control-label" = f.label :bio, class: "control-label"
.controls .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. %span.help-block Tell us about yourself in fewer than 250 characters.
.span5.right .span5.right
...@@ -56,14 +56,14 @@ ...@@ -56,14 +56,14 @@
of of
%span= current_user.projects_limit %span= current_user.projects_limit
.progress .progress
.bar{:style => "width: #{current_user.projects_limit_percent}%;"} .bar{style: "width: #{current_user.projects_limit_percent}%;"}
%h4 %h4
SSH public keys: SSH public keys:
%small.right %small.right
%span= link_to current_user.keys.count, keys_path %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 .form-actions
= f.submit 'Save', :class => "btn-primary btn" = f.submit 'Save', class: "btn-primary btn"
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
%span.cred.right %span.cred.right
keep it in secret! keep it in secret!
%hr %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 .data
%p.slead %p.slead
Private token used to access application resources without authentication. Private token used to access application resources without authentication.
...@@ -11,13 +11,13 @@ ...@@ -11,13 +11,13 @@
It can be used for atom feed or API It can be used for atom feed or API
%p.cgray %p.cgray
- if current_user.private_token - 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 - else
You don`t have one yet. Click generate to fix it. You don`t have one yet. Click generate to fix it.
.actions .actions
- if current_user.private_token - if current_user.private_token
= f.submit 'Reset', :confirm => "Are you sure?", :class => "btn" = f.submit 'Reset', confirm: "Are you sure?", class: "btn"
- else - else
= f.submit 'Generate', :class => "btn primary" = f.submit 'Generate', class: "btn primary"
= form_for(@project, :remote => true) do |f| = form_for(@project, remote: true) do |f|
- if @project.errors.any? - if @project.errors.any?
.alert-message.block-message.error .alert-message.block-message.error
%ul %ul
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
= f.label :name do = f.label :name do
Project name is Project name is
.input .input
= f.text_field :name, :placeholder => "Example Project", :class => "xxlarge" = f.text_field :name, placeholder: "Example Project", class: "xxlarge"
%h5.page_title %h5.page_title
.alert.alert-info .alert.alert-info
...@@ -19,19 +19,19 @@ ...@@ -19,19 +19,19 @@
.input .input
.input-prepend .input-prepend
%strong %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 .clearfix
= f.label :code do = f.label :code do
URL URL
.input .input
.input-prepend .input-prepend
%span.add-on= web_app_url %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? - unless @project.new_record? || @project.heads.empty?
.clearfix .clearfix
= f.label :default_branch, "Default Branch" = 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? - unless @project.new_record?
.alert.alert-info .alert.alert-info
...@@ -56,8 +56,8 @@ ...@@ -56,8 +56,8 @@
%br %br
.actions .actions
= f.submit 'Save', :class => "btn primary" = f.submit 'Save', class: "btn primary"
= link_to 'Cancel', @project, :class => "btn" = link_to 'Cancel', @project, class: "btn"
- unless @project.new_record? - unless @project.new_record?
.right .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"
= form_for(@project, :remote => true) do |f| = form_for(@project, remote: true) do |f|
- if @project.errors.any? - if @project.errors.any?
.alert-message.block-message.error .alert-message.block-message.error
%span= @project.errors.full_messages.first %span= @project.errors.full_messages.first
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
= f.label :name do = f.label :name do
Project name is Project name is
.input .input
= f.text_field :name, :placeholder => "Example Project", :class => "xxlarge" = f.text_field :name, placeholder: "Example Project", class: "xxlarge"
= f.submit 'Create project', :class => "btn primary" = f.submit 'Create project', class: "btn primary"
%hr %hr
.alert.alert-info .alert.alert-info
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
.input .input
.input-prepend .input-prepend
%span.add-on= Gitlab.config.ssh_path %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" %span.add-on= ".git"
.clearfix .clearfix
= f.label :code do = f.label :code do
...@@ -26,4 +26,4 @@ ...@@ -26,4 +26,4 @@
.input .input
.input-prepend .input-prepend
%span.add-on= web_app_url %span.add-on= web_app_url
= f.text_field :code, :placeholder => "example" = f.text_field :code, placeholder: "example"
%ul.nav.nav-tabs %ul.nav.nav-tabs
%li{ :class => "#{'active' if current_page?(project_path(@project)) }" } %li{ class: "#{'active' if current_page?(project_path(@project)) }" }
= link_to project_path(@project), :class => "activities-tab tab" do = link_to project_path(@project), class: "activities-tab tab" do
%i.icon-home %i.icon-home
Show Show
%li{ :class => " #{'active' if (controller.controller_name == "team_members") || current_page?(team_project_path(@project)) }" } %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 = link_to team_project_path(@project), class: "team-tab tab" do
%i.icon-user %i.icon-user
Team Team
%li{ :class => "#{'active' if current_page?(files_project_path(@project)) }" } %li{ class: "#{'active' if current_page?(files_project_path(@project)) }" }
= link_to files_project_path(@project), :class => "files-tab tab " do = link_to files_project_path(@project), class: "files-tab tab " do
Attachments Attachments
%li{ :class => " #{'active' if (controller.controller_name == "snippets") }" } %li{ class: " #{'active' if (controller.controller_name == "snippets") }" }
= link_to project_snippets_path(@project), :class => "snippets-tab tab" do = link_to project_snippets_path(@project), class: "snippets-tab tab" do
Snippets Snippets
- if can? current_user, :admin_project, @project - 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 = link_to project_deploy_keys_path(@project) do
%span %span
Deploy Keys 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 = link_to project_hooks_path(@project) do
%span %span
Hooks Hooks
%li.right{ :class => "#{'active' if current_page?(edit_project_path(@project)) }" } %li.right{ class: "#{'active' if current_page?(edit_project_path(@project)) }" }
= link_to edit_project_path(@project), :class => "stat-tab tab " do = link_to edit_project_path(@project), class: "stat-tab tab " do
%i.icon-edit %i.icon-edit
Edit Edit
= form_tag switch_project_refs_path(@project), :method => :get, :class => "project-refs-form" do = 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" = select_tag "ref", grouped_options_refs, onchange: "this.form.submit();", class: "project-refs-select"
= hidden_field_tag :destination, destination = hidden_field_tag :destination, destination
:javascript :javascript
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
= @project.name = @project.name
%br %br
%div %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
&nbsp; &nbsp;
%a.btn{:href => project_commits_path(@project)} Commits %a.btn{href: project_commits_path(@project)} Commits
%strong.right %strong.right
= link_to project_path(@project) do = link_to project_path(@project) do
Switch to project &rarr; Switch to project &rarr;
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
.input .input
.input-prepend .input-prepend
%span.add-on git clone %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 = simple_format @project.description
- unless @events.blank? - unless @events.blank?
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
%th Permissions %th Permissions
%tbody %tbody
- @project.users_projects.each do |up| - @project.users_projects.each do |up|
= render(:partial => 'team_members/show', :locals => {:member => up}) = render(partial: 'team_members/show', locals: {member: up})
:javascript :javascript
......
- if @project.saved? - if @project.saved?
:plain :plain
location.href = "#{project_path(@project, :notice => 'Project was successfully created.')}"; location.href = "#{project_path(@project, notice: 'Project was successfully created.')}";
- else - else
- if @project.git_error? - if @project.git_error?
location.href = "#{errors_githost_path}"; location.href = "#{errors_githost_path}";
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
- setup_str = ["git config --global user.name \"#{current_user.name}\"", - setup_str = ["git config --global user.name \"#{current_user.name}\"",
"git config --global user.email \"#{current_user.email}\""].join("\n") "git config --global user.email \"#{current_user.email}\""].join("\n")
= preserve do = 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
%br %br
...@@ -44,4 +44,4 @@ ...@@ -44,4 +44,4 @@
- if can? current_user, :admin_project, @project - if can? current_user, :admin_project, @project
.alert-message.block-message.error.prepend-top-20 .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"
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
- @notes.each do |note| - @notes.each do |note|
%tr %tr
%td %td
%a{:href => note.attachment.url} %a{href: note.attachment.url}
= image_tag gravatar_icon(note.author_email), :class => "left", :width => 16 = image_tag gravatar_icon(note.author_email), class: "left", width: 16
&nbsp; &nbsp;
= note.attachment_identifier = note.attachment_identifier
%td %td
......
...@@ -7,23 +7,23 @@ ...@@ -7,23 +7,23 @@
.input-prepend.project_clone_holder .input-prepend.project_clone_holder
%span.add-on git clone %span.add-on git clone
= link_to "SSH", "#", :class => "btn small active", :"data-clone" => @project.ssh_url_to_repo = 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 = 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" = text_field_tag :project_clone, @project.url_to_repo, class: "one_click_select span5"
.span4.right .span4.right
.right .right
- if can? current_user, :download_code, @project - 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 %i.icon-download-alt
Download Download
- if @project.merge_requests_enabled && can?(current_user, :write_merge_request, @project) - 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 Merge Request
- if @project.issues_enabled && can?(current_user, :write_issue, @project) - 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 Issue
= render "events/event_last_push", :event => @last_push = render "events/event_last_push", event: @last_push
.content_list= render @events .content_list= render @events
:javascript :javascript
......
...@@ -5,11 +5,11 @@ ...@@ -5,11 +5,11 @@
- if can? current_user, :admin_team_member, @project - if can? current_user, :admin_team_member, @project
%p.slead %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 New Team Member
Read more about project permissions 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}
:plain :plain
$("#tree-holder table").hide("slide", { direction: "left" }, 150, function(){ $("#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); $("#tree-holder table").show("slide", { direction: "right" }, 150);
}); });
- if @project.valid? - if @project.valid?
:plain :plain
location.href = "#{edit_project_path(@project, :notice => 'Project was successfully updated.')}"; location.href = "#{edit_project_path(@project, notice: 'Project was successfully updated.')}";
- else - else
:plain :plain
$('.project_edit_holder').show(); $('.project_edit_holder').show();
......
%div.wall_page %div.wall_page
= render "notes/notes", :tid => nil, :tt => "wall" = render "notes/notes", tid: nil, tt: "wall"
= render "repositories/branches_head" = render "repositories/branches_head"
.alert .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: %p This ability allows:
%ul %ul
%li keep stable branches secured %li keep stable branches secured
%li forced code review before merge to protected branches %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 - if can? current_user, :admin_project, @project
= form_for [@project, @protected_branch] do |f| = form_for [@project, @protected_branch] do |f|
...@@ -19,9 +19,9 @@ ...@@ -19,9 +19,9 @@
.entry.clearfix .entry.clearfix
= f.label :name, "Branch" = f.label :name, "Branch"
.span3 .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" })
&nbsp; &nbsp;
= f.submit 'Protect', :class => "primary btn" = f.submit 'Protect', class: "primary btn"
- unless @branches.empty? - unless @branches.empty?
%table.admin-table %table.admin-table
...@@ -34,18 +34,18 @@ ...@@ -34,18 +34,18 @@
- @branches.each do |branch| - @branches.each do |branch|
%tr %tr
%td %td
= link_to project_commits_path(@project, :ref => branch.name) do = link_to project_commits_path(@project, ref: branch.name) do
%strong= branch.name %strong= branch.name
- if branch.name == @project.root_ref - if branch.name == @project.root_ref
%span.label default %span.label default
%td %td
= link_to project_commit_path(@project, branch.commit.id) do = 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) = time_ago_in_words(branch.commit.committed_date)
ago ago
%td %td
- if can? current_user, :admin_project, @project - 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 :javascript
$('select#protected_branch_name').chosen(); $('select#protected_branch_name').chosen();
%ul.nav.nav-tabs %ul.nav.nav-tabs
%li %li
= form_tag switch_project_refs_path(@project), :method => :get, :class => "project-refs-form", :remote => true do = 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" = select_tag "ref", grouped_options_refs, onchange: "$(this.form).trigger('submit');", class: "project-refs-select"
= hidden_field_tag :destination, "tree" = hidden_field_tag :destination, "tree"
= hidden_field_tag :path, params[:path] = 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 = link_to tree_project_ref_path(@project, @ref) do
Source Source
- url = content.url(@ref) rescue nil - url = content.url(@ref) rescue nil
- name = content.basename - name = content.basename
- return unless url - return unless url
%tr{ :class => "tree-item", :url => url } %tr{ class: "tree-item", url: url }
%td.tree-item-file-name %td.tree-item-file-name
= image_tag "submodule.png" = image_tag "submodule.png"
%strong= truncate(name, :length => 40) %strong= truncate(name, length: 40)
%td %td
%code= content.id[0..10] %code= content.id[0..10]
%td %td
= link_to truncate(url, :length => 40), url = link_to truncate(url, length: 40), url
%ul.breadcrumb %ul.breadcrumb
%li %li
%span.arrow %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 = @project.name
- tree.breadcrumbs(6) do |link| - tree.breadcrumbs(6) do |link|
\/ \/
...@@ -10,32 +10,32 @@ ...@@ -10,32 +10,32 @@
%div.tree_progress %div.tree_progress
#tree-content-holder #tree-content-holder
- if tree.is_blob? - 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 - else
- contents = tree.contents - contents = tree.contents
%table#tree-slider.bordered-table.table{:class => "table_#{@hex_path}" } %table#tree-slider.bordered-table.table{class: "table_#{@hex_path}" }
%thead %thead
%th Name %th Name
%th Last Update %th Last Update
%th %th
Last commit Last commit
= link_to "History", tree.history_path, :class => "right" = link_to "History", tree.history_path, class: "right"
- if tree.up_dir? - 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 %td.tree-item-file-name
= image_tag "file_empty.png" = image_tag "file_empty.png"
= link_to "..", tree.up_dir_path, :remote => :true = link_to "..", tree.up_dir_path, remote: :true
%td %td
%td %td
- index = 0 - index = 0
- contents.select{ |i| i.is_a?(Grit::Tree)}.each do |content| - 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| - 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| - 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 - if content = contents.select{ |c| c.is_a?(Grit::Blob) and c.name =~ /^readme/i }.first
.file_holder#README .file_holder#README
......
- if tm - if tm
%strong= link_to "[#{tm.user_name}]", project_team_member_path(@project, 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"
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
= name = name
%small #{file.mode} %small #{file.mode}
%span.options %span.options
= link_to "raw", blob_project_ref_path(@project, @ref, :path => params[:path]), :class => "btn very_small", :target => "_blank" = 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 "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 "blame", blame_file_project_ref_path(@project, @ref, path: params[:path]), class: "btn very_small"
- if file.text? - if file.text?
- if name =~ /\.(md|markdown)$/i - if name =~ /\.(md|markdown)$/i
.file_content.wiki .file_content.wiki
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
- else - else
.file_content.code .file_content.code
- unless file.empty? - unless file.empty?
%div{:class => current_user.dark_scheme ? "black" : "white"} %div{class: current_user.dark_scheme ? "black" : "white"}
= preserve do = preserve do
= raw file.colorize(options: { linenos: 'True'}) = raw file.colorize(options: { linenos: 'True'})
- else - else
...@@ -24,14 +24,14 @@ ...@@ -24,14 +24,14 @@
- elsif file.image? - elsif file.image?
.file_content.image_file .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 - else
.file_content.blob_file .file_content.blob_file
%center %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 %div.padded
%br %br
= image_tag "download.png", :width => 64 = image_tag "download.png", width: 64
%h3 %h3
Download (#{file.mb_size}) Download (#{file.mb_size})
- file = tree_full_path(content) - 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 %td.tree-item-file-name
= tree_icon(content) = 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 %td.tree_time_ago.cgray
- if index == 1 - if index == 1
%span.log_loading %span.log_loading
Loading commit data.. Loading commit data..
= image_tag "ajax_loader_tree.gif", :width => 14 = image_tag "ajax_loader_tree.gif", width: 14
%td.tree_commit %td.tree_commit
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
%ul.breadcrumb %ul.breadcrumb
%li %li
%span.arrow %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 = @project.name
- @tree.breadcrumbs(6) do |link| - @tree.breadcrumbs(6) do |link|
\/ \/
...@@ -18,9 +18,9 @@ ...@@ -18,9 +18,9 @@
= @tree.name = @tree.name
%small blame %small blame
%span.options %span.options
= link_to "raw", blob_project_ref_path(@project, @ref, :path => params[:path]), :class => "btn very_small", :target => "_blank" = 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 "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 "source", tree_file_project_ref_path(@project, @ref, path: params[:path]), class: "btn very_small"
.file_content.blame .file_content.blame
%table %table
- @blame.each do |commit, lines| - @blame.each do |commit, lines|
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
= commit.author_name = commit.author_name
%td.blame_commit %td.blame_commit
&nbsp; &nbsp;
%code= link_to commit.short_id, project_commit_path(@project, :id => commit.id) %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" = link_to_gfm truncate(commit.title, length: 30), project_commit_path(@project, id: commit.id), class: "row_title" rescue "--broken encoding"
%td.lines %td.lines
= preserve do = preserve do
%pre %pre
......
...@@ -6,4 +6,4 @@ ...@@ -6,4 +6,4 @@
:plain :plain
var row = $("table.table_#{@hex_path} tr.file_#{hexdigest(file_name)}"); 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_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))}');
= render "head" = 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 :javascript
$(function() { $(function() {
......
:plain :plain
// Load Files list // 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); $("#tree-content-holder").show("slide", { direction: "right" }, 150);
$('.project-refs-form #path').val("#{params[:path]}"); $('.project-refs-form #path').val("#{params[:path]}");
......
...@@ -2,20 +2,20 @@ ...@@ -2,20 +2,20 @@
- commit = CommitDecorator.decorate(commit) - commit = CommitDecorator.decorate(commit)
%tr %tr
%td %td
= link_to project_commits_path(@project, :ref => branch.name) do = link_to project_commits_path(@project, ref: branch.name) do
%strong= truncate(branch.name, :length => 60) %strong= truncate(branch.name, length: 60)
- if branch.name == @project.root_ref - if branch.name == @project.root_ref
%span.label default %span.label default
%td %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 %code= commit.short_id
= image_tag gravatar_icon(commit.author_email), :class => "", :width => 16 = image_tag gravatar_icon(commit.author_email), class: "", width: 16
= gfm truncate(commit.title, :length => 40) = gfm truncate(commit.title, length: 40)
%span.update-author.right %span.update-author.right
= time_ago_in_words(commit.committed_date) = time_ago_in_words(commit.committed_date)
ago ago
%td %td
- if can? current_user, :download_code, @project - 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"
= render "commits/head" = render "commits/head"
%ul.nav.nav-pills %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 = link_to project_repository_path(@project) do
Recent 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 = link_to project_protected_branches_path(@project) do
Protected 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 = link_to branches_project_repository_path(@project) do
All All
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
- commit = CommitDecorator.new(commit) - commit = CommitDecorator.new(commit)
%tr %tr
%td %td
= link_to project_commits_path(@project, :ref => commit.head.name) do = link_to project_commits_path(@project, ref: commit.head.name) do
%strong %strong
= commit.head.name = commit.head.name
- if commit.head.name == @project.root_ref - if commit.head.name == @project.root_ref
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
%div %div
= link_to project_commits_path(@project, commit.id) do = link_to project_commits_path(@project, commit.id) do
%code= commit.short_id %code= commit.short_id
= image_tag gravatar_icon(commit.author_email), :class => "", :width => 16 = image_tag gravatar_icon(commit.author_email), class: "", width: 16
= gfm truncate(commit.title, :length => 40) = gfm truncate(commit.title, length: 40)
%td %td
%span.right.cgray %span.right.cgray
= time_ago_in_words(commit.committed_date) = time_ago_in_words(commit.committed_date)
......
...@@ -9,4 +9,4 @@ ...@@ -9,4 +9,4 @@
%tbody %tbody
- @branches.each do |branch| - @branches.each do |branch|
= render "repositories/branch", :branch => branch = render "repositories/branch", branch: branch
...@@ -7,5 +7,5 @@ ...@@ -7,5 +7,5 @@
%th Last commit %th Last commit
%th %th
- @activities.each do |update| - @activities.each do |update|
= render "repositories/branch", :branch => update.head = render "repositories/branch", branch: update.head
...@@ -12,12 +12,12 @@ ...@@ -12,12 +12,12 @@
- commit = CommitDecorator.decorate(commit) - commit = CommitDecorator.decorate(commit)
%tr %tr
%td %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 %td
= link_to project_commit_path(@project, commit.id) do = link_to project_commit_path(@project, commit.id) do
%code= commit.short_id %code= commit.short_id
= image_tag gravatar_icon(commit.author_email), :class => "", :width => 16 = image_tag gravatar_icon(commit.author_email), class: "", width: 16
= gfm truncate(commit.title, :length => 40) = gfm truncate(commit.title, length: 40)
%td %td
%span.update-author.right %span.update-author.right
= time_ago_in_words(commit.committed_date) = time_ago_in_words(commit.committed_date)
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
&nbsp; &nbsp;
%td %td
- if can? current_user, :download_code, @project - 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 - else
%h3 No tags %h3 No tags
= form_tag search_path, :method => :get do |f| = form_tag search_path, method: :get do |f|
.padded .padded
= label_tag :search do = label_tag :search do
%strong Looking for %strong Looking for
.input .input
= text_field_tag :search, params[:search], :placeholder => "issue 143", :class => "input-xxlarge", :id => "dashboard_search" = text_field_tag :search, params[:search], placeholder: "issue 143", class: "input-xxlarge", id: "dashboard_search"
= submit_tag 'Search', :class => "btn btn-primary" = submit_tag 'Search', class: "btn btn-primary"
- if params[:search].present? - if params[:search].present?
%br %br
%h3 %h3
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
= link_to [merge_request.project, merge_request] do = link_to [merge_request.project, merge_request] do
%span.badge.badge-info ##{merge_request.id} %span.badge.badge-info ##{merge_request.id}
&ndash; &ndash;
%strong.term= truncate merge_request.title, :length => 50 %strong.term= truncate merge_request.title, length: 50
%strong.right %strong.right
%span.label= merge_request.project.name %span.label= merge_request.project.name
- if @merge_requests.blank? - if @merge_requests.blank?
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
= link_to [issue.project, issue] do = link_to [issue.project, issue] do
%span.badge.badge-info ##{issue.id} %span.badge.badge-info ##{issue.id}
&ndash; &ndash;
%strong.term= truncate issue.title, :length => 40 %strong.term= truncate issue.title, length: 40
%strong.right %strong.right
%span.label= issue.project.name %span.label= issue.project.name
- if @issues.blank? - if @issues.blank?
......
...@@ -10,22 +10,22 @@ ...@@ -10,22 +10,22 @@
.clearfix .clearfix
= f.label :title = f.label :title
.input= f.text_field :title, :placeholder => "Example Snippet" .input= f.text_field :title, placeholder: "Example Snippet"
.clearfix .clearfix
= f.label :file_name = f.label :file_name
.input= f.text_field :file_name, :placeholder => "example.rb" .input= f.text_field :file_name, placeholder: "example.rb"
.clearfix .clearfix
= f.label "Lifetime" = 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 .clearfix
= f.label :content, "Code" = f.label :content, "Code"
.input= f.text_area :content, :class => "span8" .input= f.text_area :content, class: "span8"
.actions .actions
= f.submit 'Save', :class => "primary btn" = f.submit 'Save', class: "primary btn"
= link_to "Cancel", project_snippets_path(@project), :class => " btn" = link_to "Cancel", project_snippets_path(@project), class: " btn"
- unless @snippet.new_record? - 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}"
......
%tr %tr
%td %td
%a{:href => project_snippet_path(snippet.project, snippet)} %a{href: project_snippet_path(snippet.project, snippet)}
%strong= truncate(snippet.title, :length => 60) %strong= truncate(snippet.title, length: 60)
%td %td
= snippet.file_name = snippet.file_name
%td %td
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
- if can? current_user, :write_snippet, @project - if can? current_user, :write_snippet, @project
.alert-message.block-message .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 Add new snippet
Share code pastes with others if it cant be in a git repository Share code pastes with others if it cant be in a git repository
%br %br
...@@ -17,5 +17,5 @@ ...@@ -17,5 +17,5 @@
= render @snippets.fresh = render @snippets.fresh
- if @snippets.fresh.empty? - if @snippets.fresh.empty?
%tr %tr
%td{:colspan => 3} %td{colspan: 3}
%h3.nothing_here_message Nothing here. %h3.nothing_here_message Nothing here.
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
= @snippet.title = @snippet.title
%small= @snippet.file_name %small= @snippet.file_name
- if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user - 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 %br
.file_holder .file_holder
...@@ -12,9 +12,9 @@ ...@@ -12,9 +12,9 @@
%i.icon-file %i.icon-file
%strong= @snippet.file_name %strong= @snippet.file_name
%span.options %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 .file_content.code
%div{:class => current_user.dark_scheme ? "black" : ""} %div{class: current_user.dark_scheme ? "black" : ""}
= raw @snippet.colorize(options: { linenos: 'True'}) = raw @snippet.colorize(options: { linenos: 'True'})
= render "notes/notes", :tid => @snippet.id, :tt => "snippet" = render "notes/notes", tid: @snippet.id, tt: "snippet"
%h3= "New Team member" %h3= "New Team member"
%hr %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? -if @team_member.errors.any?
.alert-message.block-message.error .alert-message.block-message.error
%ul %ul
...@@ -9,17 +9,17 @@ ...@@ -9,17 +9,17 @@
.clearfix .clearfix
= f.label :user_id, "Name" = 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 .clearfix
= f.label :project_access, "Project Access" = 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 .actions
= f.submit 'Save', :class => "btn primary" = f.submit 'Save', class: "btn primary"
= link_to "Cancel", team_project_path(@project), :class => "btn" = link_to "Cancel", team_project_path(@project), class: "btn"
:css :css
form select { form select {
......
- user = member.user - user = member.user
- allow_admin = can? current_user, :admin_project, @project - 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 %td
.right .right
- if @project.owner == user - if @project.owner == user
...@@ -8,13 +8,13 @@ ...@@ -8,13 +8,13 @@
- if user.blocked - if user.blocked
%span.label Blocked %span.label Blocked
= link_to project_team_member_path(@project, member), :title => user.name, :class => "dark" do = link_to project_team_member_path(@project, member), title: user.name, class: "dark" do
= image_tag gravatar_icon(user.email, 40), :class => "avatar" = image_tag gravatar_icon(user.email, 40), class: "avatar"
= link_to project_team_member_path(@project, member), :title => user.name, :class => "dark" do = link_to project_team_member_path(@project, member), title: user.name, class: "dark" do
%strong= truncate(user.name, :lenght => 40) %strong= truncate(user.name, lenght: 40)
%br %br
%div.cgray= user.email %div.cgray= user.email
%td %td
= form_for(member, :as => :team_member, :url => project_team_member_path(@project, member)) do |f| = 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 = f.select :project_access, options_for_select(UsersProject.access_roles, member.project_access), {}, class: "medium project-access-select", disabled: !allow_admin
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
.team_member_show .team_member_show
- if can? current_user, :admin_project, @project - 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 .profile_avatar_holder
= image_tag gravatar_icon(user.email, 60), :class => "borders" = image_tag gravatar_icon(user.email, 60), class: "borders"
%h3 %h3
= user.name = user.name
%small %small
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
%hr %hr
.back_link .back_link
%br %br
= link_to team_project_path(@project), :class => "" do = link_to team_project_path(@project), class: "" do
&larr; To team list &larr; To team list
%br %br
.row .row
...@@ -46,10 +46,10 @@ ...@@ -46,10 +46,10 @@
%tr %tr
%td %td
Project Access: Project Access:
%small (#{link_to "read more", help_permissions_path, :class => "vlink"}) %small (#{link_to "read more", help_permissions_path, class: "vlink"})
%td %td
= form_for(@team_member, :as => :team_member, :url => project_team_member_path(@project, @team_member)) do |f| = 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 = f.select :project_access, options_for_select(Project.access_options, @team_member.project_access), {}, class: "project-access-select", disabled: !allow_admin
%hr %hr
= render user.recent_events.limit(5) = render user.recent_events.limit(5)
:javascript :javascript
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
.main_box .main_box
.top_box_content .top_box_content
= f.label :title = f.label :title
.input= f.text_field :title, :class => 'span8' .input= f.text_field :title, class: 'span8'
= f.hidden_field :slug = f.hidden_field :slug
.middle_box_content .middle_box_content
.input .input
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
.bottom_box_content .bottom_box_content
= f.label :content = f.label :content
.input= f.text_area :content, :class => 'span8' .input= f.text_area :content, class: 'span8'
.actions .actions
= f.submit 'Save', :class => "primary btn" = f.submit 'Save', class: "primary btn"
= link_to "Cancel", project_wiki_path(@project, :index), :class => "btn" = link_to "Cancel", project_wiki_path(@project, :index), class: "btn"
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
%tr %tr
%td= i + 1 %td= i + 1
%td %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)} (#{time_ago_in_words(wiki_page.created_at)}
ago) ago)
%td= wiki_page.user.name %td= wiki_page.user.name
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
- @wikis.each_with_index do |wiki_page, i| - @wikis.each_with_index do |wiki_page, i|
%tr %tr
%td %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)} (#{time_ago_in_words(wiki_page.created_at)}
ago) ago)
%td= wiki_page.slug %td= wiki_page.slug
......
%h3.page_title %h3.page_title
= @wiki.title = @wiki.title
%span.right %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 Pages
- if can? current_user, :write_wiki, @project - 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 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 %i.icon-edit
Edit Edit
%br %br
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
%p.time Last edited by #{@wiki.user.name}, #{time_ago_in_words @wiki.created_at} ago %p.time Last edited by #{@wiki.user.name}, #{time_ago_in_words @wiki.created_at} ago
- if can? current_user, :admin_wiki, @project - 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 Delete this page
%hr %hr
.wiki_notes#notes= render "notes/notes", :tid => @wiki.id, :tt => "wiki" .wiki_notes#notes= render "notes/notes", tid: @wiki.id, tt: "wiki"
...@@ -3,7 +3,7 @@ Dir["#{Rails.root}/lib/api/*.rb"].each {|file| require file} ...@@ -3,7 +3,7 @@ Dir["#{Rails.root}/lib/api/*.rb"].each {|file| require file}
module Gitlab module Gitlab
class API < Grape::API class API < Grape::API
VERSION = 'v2' VERSION = 'v2'
version VERSION, :using => :path version VERSION, using: :path
rescue_from ActiveRecord::RecordNotFound do rescue_from ActiveRecord::RecordNotFound do
rack_response({'message' => '404 Not found'}.to_json, 404) rack_response({'message' => '404 Not found'}.to_json, 404)
......
...@@ -11,8 +11,8 @@ module Gitlab ...@@ -11,8 +11,8 @@ module Gitlab
class Project < Grape::Entity class Project < Grape::Entity
expose :id, :code, :name, :description, :path, :default_branch expose :id, :code, :name, :description, :path, :default_branch
expose :owner, :using => Entities::UserBasic expose :owner, using: Entities::UserBasic
expose :private_flag, :as => :private expose :private_flag, as: :private
expose :issues_enabled, :merge_requests_enabled, :wall_enabled, :wiki_enabled, :created_at expose :issues_enabled, :merge_requests_enabled, :wall_enabled, :wiki_enabled, :created_at
end end
...@@ -22,7 +22,7 @@ module Gitlab ...@@ -22,7 +22,7 @@ module Gitlab
class ProjectSnippet < Grape::Entity class ProjectSnippet < Grape::Entity
expose :id, :title, :file_name expose :id, :title, :file_name
expose :author, :using => Entities::UserBasic expose :author, using: Entities::UserBasic
expose :expires_at, :updated_at, :created_at expose :expires_at, :updated_at, :created_at
end end
...@@ -34,9 +34,9 @@ module Gitlab ...@@ -34,9 +34,9 @@ module Gitlab
expose :id expose :id
expose (:project_id) {|issue| issue.project.id} expose (:project_id) {|issue| issue.project.id}
expose :title, :description expose :title, :description
expose :label_list, :as => :labels expose :label_list, as: :labels
expose :milestone, :using => Entities::Milestone expose :milestone, using: Entities::Milestone
expose :assignee, :author, :using => Entities::UserBasic expose :assignee, :author, using: Entities::UserBasic
expose :closed, :updated_at, :created_at expose :closed, :updated_at, :created_at
end end
end end
......
...@@ -9,7 +9,7 @@ module Gitlab ...@@ -9,7 +9,7 @@ module Gitlab
# Example Request: # Example Request:
# GET /issues # GET /issues
get do get do
present current_user.issues, :with => Entities::Issue present current_user.issues, with: Entities::Issue
end end
end end
...@@ -21,7 +21,7 @@ module Gitlab ...@@ -21,7 +21,7 @@ module Gitlab
# Example Request: # Example Request:
# GET /projects/:id/issues # GET /projects/:id/issues
get ":id/issues" do get ":id/issues" do
present user_project.issues, :with => Entities::Issue present user_project.issues, with: Entities::Issue
end end
# Get a single project issue # Get a single project issue
...@@ -33,7 +33,7 @@ module Gitlab ...@@ -33,7 +33,7 @@ module Gitlab
# GET /projects/:id/issues/:issue_id # GET /projects/:id/issues/:issue_id
get ":id/issues/:issue_id" do get ":id/issues/:issue_id" do
@issue = user_project.issues.find(params[:issue_id]) @issue = user_project.issues.find(params[:issue_id])
present @issue, :with => Entities::Issue present @issue, with: Entities::Issue
end end
# Create a new project issue # Create a new project issue
...@@ -49,16 +49,16 @@ module Gitlab ...@@ -49,16 +49,16 @@ module Gitlab
# POST /projects/:id/issues # POST /projects/:id/issues
post ":id/issues" do post ":id/issues" do
@issue = user_project.issues.new( @issue = user_project.issues.new(
:title => params[:title], title: params[:title],
:description => params[:description], description: params[:description],
:assignee_id => params[:assignee_id], assignee_id: params[:assignee_id],
:milestone_id => params[:milestone_id], milestone_id: params[:milestone_id],
:label_list => params[:labels] label_list: params[:labels]
) )
@issue.author = current_user @issue.author = current_user
if @issue.save if @issue.save
present @issue, :with => Entities::Issue present @issue, with: Entities::Issue
else else
error!({'message' => '404 Not found'}, 404) error!({'message' => '404 Not found'}, 404)
end end
...@@ -80,16 +80,16 @@ module Gitlab ...@@ -80,16 +80,16 @@ module Gitlab
put ":id/issues/:issue_id" do put ":id/issues/:issue_id" do
@issue = user_project.issues.find(params[:issue_id]) @issue = user_project.issues.find(params[:issue_id])
parameters = { parameters = {
:title => (params[:title] || @issue.title), title: (params[:title] || @issue.title),
:description => (params[:description] || @issue.description), description: (params[:description] || @issue.description),
:assignee_id => (params[:assignee_id] || @issue.assignee_id), assignee_id: (params[:assignee_id] || @issue.assignee_id),
:milestone_id => (params[:milestone_id] || @issue.milestone_id), milestone_id: (params[:milestone_id] || @issue.milestone_id),
:label_list => (params[:labels] || @issue.label_list), label_list: (params[:labels] || @issue.label_list),
:closed => (params[:closed] || @issue.closed) closed: (params[:closed] || @issue.closed)
} }
if @issue.update_attributes(parameters) if @issue.update_attributes(parameters)
present @issue, :with => Entities::Issue present @issue, with: Entities::Issue
else else
error!({'message' => '404 Not found'}, 404) error!({'message' => '404 Not found'}, 404)
end end
......
...@@ -10,7 +10,7 @@ module Gitlab ...@@ -10,7 +10,7 @@ module Gitlab
# GET /projects # GET /projects
get do get do
@projects = current_user.projects @projects = current_user.projects
present @projects, :with => Entities::Project present @projects, with: Entities::Project
end end
# Get a single project # Get a single project
...@@ -20,7 +20,7 @@ module Gitlab ...@@ -20,7 +20,7 @@ module Gitlab
# Example Request: # Example Request:
# GET /projects/:id # GET /projects/:id
get ":id" do get ":id" do
present user_project, :with => Entities::Project present user_project, with: Entities::Project
end end
# Get a project repository branches # Get a project repository branches
...@@ -30,7 +30,7 @@ module Gitlab ...@@ -30,7 +30,7 @@ module Gitlab
# Example Request: # Example Request:
# GET /projects/:id/repository/branches # GET /projects/:id/repository/branches
get ":id/repository/branches" do get ":id/repository/branches" do
present user_project.repo.heads.sort_by(&:name), :with => Entities::RepoObject present user_project.repo.heads.sort_by(&:name), with: Entities::RepoObject
end end
# Get a single branch # Get a single branch
...@@ -42,7 +42,7 @@ module Gitlab ...@@ -42,7 +42,7 @@ module Gitlab
# GET /projects/:id/repository/branches/:branch # GET /projects/:id/repository/branches/:branch
get ":id/repository/branches/:branch" do get ":id/repository/branches/:branch" do
@branch = user_project.repo.heads.find { |item| item.name == params[:branch] } @branch = user_project.repo.heads.find { |item| item.name == params[:branch] }
present @branch, :with => Entities::RepoObject present @branch, with: Entities::RepoObject
end end
# Get a project repository tags # Get a project repository tags
...@@ -52,7 +52,7 @@ module Gitlab ...@@ -52,7 +52,7 @@ module Gitlab
# Example Request: # Example Request:
# GET /projects/:id/repository/tags # GET /projects/:id/repository/tags
get ":id/repository/tags" do get ":id/repository/tags" do
present user_project.repo.tags.sort_by(&:name).reverse, :with => Entities::RepoObject present user_project.repo.tags.sort_by(&:name).reverse, with: Entities::RepoObject
end end
# Get a project snippet # Get a project snippet
...@@ -64,7 +64,7 @@ module Gitlab ...@@ -64,7 +64,7 @@ module Gitlab
# GET /projects/:id/snippets/:snippet_id # GET /projects/:id/snippets/:snippet_id
get ":id/snippets/:snippet_id" do get ":id/snippets/:snippet_id" do
@snippet = user_project.snippets.find(params[:snippet_id]) @snippet = user_project.snippets.find(params[:snippet_id])
present @snippet, :with => Entities::ProjectSnippet present @snippet, with: Entities::ProjectSnippet
end end
# Create a new project snippet # Create a new project snippet
...@@ -79,15 +79,15 @@ module Gitlab ...@@ -79,15 +79,15 @@ module Gitlab
# POST /projects/:id/snippets # POST /projects/:id/snippets
post ":id/snippets" do post ":id/snippets" do
@snippet = user_project.snippets.new( @snippet = user_project.snippets.new(
:title => params[:title], title: params[:title],
:file_name => params[:file_name], file_name: params[:file_name],
:expires_at => params[:lifetime], expires_at: params[:lifetime],
:content => params[:code] content: params[:code]
) )
@snippet.author = current_user @snippet.author = current_user
if @snippet.save if @snippet.save
present @snippet, :with => Entities::ProjectSnippet present @snippet, with: Entities::ProjectSnippet
else else
error!({'message' => '404 Not found'}, 404) error!({'message' => '404 Not found'}, 404)
end end
...@@ -107,14 +107,14 @@ module Gitlab ...@@ -107,14 +107,14 @@ module Gitlab
put ":id/snippets/:snippet_id" do put ":id/snippets/:snippet_id" do
@snippet = user_project.snippets.find(params[:snippet_id]) @snippet = user_project.snippets.find(params[:snippet_id])
parameters = { parameters = {
:title => (params[:title] || @snippet.title), title: (params[:title] || @snippet.title),
:file_name => (params[:file_name] || @snippet.file_name), file_name: (params[:file_name] || @snippet.file_name),
:expires_at => (params[:lifetime] || @snippet.expires_at), expires_at: (params[:lifetime] || @snippet.expires_at),
:content => (params[:code] || @snippet.content) content: (params[:code] || @snippet.content)
} }
if @snippet.update_attributes(parameters) if @snippet.update_attributes(parameters)
present @snippet, :with => Entities::ProjectSnippet present @snippet, with: Entities::ProjectSnippet
else else
error!({'message' => '404 Not found'}, 404) error!({'message' => '404 Not found'}, 404)
end end
......
...@@ -10,7 +10,7 @@ module Gitlab ...@@ -10,7 +10,7 @@ module Gitlab
# GET /users # GET /users
get do get do
@users = User.all @users = User.all
present @users, :with => Entities::User present @users, with: Entities::User
end end
# Get a single user # Get a single user
...@@ -21,7 +21,7 @@ module Gitlab ...@@ -21,7 +21,7 @@ module Gitlab
# GET /users/:id # GET /users/:id
get ":id" do get ":id" do
@user = User.find(params[:id]) @user = User.find(params[:id])
present @user, :with => Entities::User present @user, with: Entities::User
end end
end end
...@@ -30,7 +30,7 @@ module Gitlab ...@@ -30,7 +30,7 @@ module Gitlab
# Example Request: # Example Request:
# GET /user # GET /user
get "/user" do get "/user" do
present @current_user, :with => Entities::User present @current_user, with: Entities::User
end end
end end
end end
class FileSizeValidator < ActiveModel::EachValidator class FileSizeValidator < ActiveModel::EachValidator
MESSAGES = { :is => :wrong_size, :minimum => :size_too_small, :maximum => :size_too_big }.freeze MESSAGES = { is: :wrong_size, minimum: :size_too_small, maximum: :size_too_big }.freeze
CHECKS = { :is => :==, :minimum => :>=, :maximum => :<= }.freeze CHECKS = { is: :==, minimum: :>=, maximum: :<= }.freeze
DEFAULT_TOKENIZER = lambda { |value| value.split(//) } DEFAULT_TOKENIZER = lambda { |value| value.split(//) }
RESERVED_OPTIONS = [:minimum, :maximum, :within, :is, :tokenizer, :too_short, :too_long] RESERVED_OPTIONS = [:minimum, :maximum, :within, :is, :tokenizer, :too_short, :too_long]
......
...@@ -19,7 +19,7 @@ module Gitlab ...@@ -19,7 +19,7 @@ module Gitlab
# if message is not utf-8 encoding, convert it # if message is not utf-8 encoding, convert it
if detect[:encoding] if detect[:encoding]
message.force_encoding(detect[:encoding]) message.force_encoding(detect[:encoding])
message.encode!("utf-8", detect[:encoding], :undef => :replace, :replace => "", :invalid => :replace) message.encode!("utf-8", detect[:encoding], undef: :replace, replace: "", invalid: :replace)
end end
# ensure message encoding is utf8 # ensure message encoding is utf8
......
...@@ -6,7 +6,7 @@ class GraphCommit ...@@ -6,7 +6,7 @@ class GraphCommit
def self.to_graph(project) def self.to_graph(project)
@repo = project.repo @repo = project.repo
commits = Grit::Commit.find_all(@repo, nil, {:max_count => 650}) commits = Grit::Commit.find_all(@repo, nil, {max_count: 650})
ref_cache = {} ref_cache = {}
......
...@@ -11,9 +11,9 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML ...@@ -11,9 +11,9 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML
def block_code(code, language) def block_code(code, language)
if Pygments::Lexer.find(language) if Pygments::Lexer.find(language)
Pygments.highlight(code, :lexer => language, :options => {:encoding => 'utf-8'}) Pygments.highlight(code, lexer: language, options: {encoding: 'utf-8'})
else else
Pygments.highlight(code, :options => {:encoding => 'utf-8'}) Pygments.highlight(code, options: {encoding: 'utf-8'})
end end
end end
......
...@@ -2,8 +2,8 @@ require 'spec_helper' ...@@ -2,8 +2,8 @@ require 'spec_helper'
describe Gitlab::API do describe Gitlab::API do
let(:user) { Factory :user } let(:user) { Factory :user }
let!(:project) { Factory :project, :owner => user } let!(:project) { Factory :project, owner: user }
let!(:issue) { Factory :issue, :author => user, :assignee => user, :project => project } let!(:issue) { Factory :issue, author: user, assignee: user, project: project }
before { project.add_access(user, :read) } before { project.add_access(user, :read) }
describe "GET /issues" do describe "GET /issues" do
...@@ -42,7 +42,7 @@ describe Gitlab::API do ...@@ -42,7 +42,7 @@ describe Gitlab::API do
describe "POST /projects/:id/issues" do describe "POST /projects/:id/issues" do
it "should create a new project issue" do it "should create a new project issue" do
post "#{api_prefix}/projects/#{project.code}/issues?private_token=#{user.private_token}", post "#{api_prefix}/projects/#{project.code}/issues?private_token=#{user.private_token}",
:title => 'new issue', :labels => 'label, label2' title: 'new issue', labels: 'label, label2'
response.status.should == 201 response.status.should == 201
json_response['title'].should == 'new issue' json_response['title'].should == 'new issue'
json_response['description'].should be_nil json_response['description'].should be_nil
...@@ -53,7 +53,7 @@ describe Gitlab::API do ...@@ -53,7 +53,7 @@ describe Gitlab::API do
describe "PUT /projects/:id/issues/:issue_id" do describe "PUT /projects/:id/issues/:issue_id" do
it "should update a project issue" do it "should update a project issue" do
put "#{api_prefix}/projects/#{project.code}/issues/#{issue.id}?private_token=#{user.private_token}", put "#{api_prefix}/projects/#{project.code}/issues/#{issue.id}?private_token=#{user.private_token}",
:title => 'updated title', :labels => 'label2', :closed => 1 title: 'updated title', labels: 'label2', closed: 1
response.status.should == 200 response.status.should == 200
json_response['title'].should == 'updated title' json_response['title'].should == 'updated title'
json_response['labels'].should == ['label2'] json_response['labels'].should == ['label2']
......
...@@ -2,8 +2,8 @@ require 'spec_helper' ...@@ -2,8 +2,8 @@ require 'spec_helper'
describe Gitlab::API do describe Gitlab::API do
let(:user) { Factory :user } let(:user) { Factory :user }
let!(:project) { Factory :project, :owner => user } let!(:project) { Factory :project, owner: user }
let!(:snippet) { Factory :snippet, :author => user, :project => project, :title => 'example' } let!(:snippet) { Factory :snippet, author: user, project: project, title: 'example' }
before { project.add_access(user, :read) } before { project.add_access(user, :read) }
describe "GET /projects" do describe "GET /projects" do
...@@ -83,7 +83,7 @@ describe Gitlab::API do ...@@ -83,7 +83,7 @@ describe Gitlab::API do
describe "POST /projects/:id/snippets" do describe "POST /projects/:id/snippets" do
it "should create a new project snippet" do it "should create a new project snippet" do
post "#{api_prefix}/projects/#{project.code}/snippets?private_token=#{user.private_token}", post "#{api_prefix}/projects/#{project.code}/snippets?private_token=#{user.private_token}",
:title => 'api test', :file_name => 'sample.rb', :code => 'test' title: 'api test', file_name: 'sample.rb', code: 'test'
response.status.should == 201 response.status.should == 201
json_response['title'].should == 'api test' json_response['title'].should == 'api test'
end end
...@@ -92,7 +92,7 @@ describe Gitlab::API do ...@@ -92,7 +92,7 @@ describe Gitlab::API do
describe "PUT /projects/:id/snippets" do describe "PUT /projects/:id/snippets" do
it "should update an existing project snippet" do it "should update an existing project snippet" do
put "#{api_prefix}/projects/#{project.code}/snippets/#{snippet.id}?private_token=#{user.private_token}", put "#{api_prefix}/projects/#{project.code}/snippets/#{snippet.id}?private_token=#{user.private_token}",
:code => 'updated code' code: 'updated code'
response.status.should == 200 response.status.should == 200
json_response['title'].should == 'example' json_response['title'].should == 'example'
snippet.reload.content.should == 'updated code' snippet.reload.content.should == 'updated code'
......
...@@ -5,8 +5,8 @@ describe GitlabMarkdownHelper do ...@@ -5,8 +5,8 @@ describe GitlabMarkdownHelper do
@project = Project.find_by_path("gitlabhq") || Factory(:project) @project = Project.find_by_path("gitlabhq") || Factory(:project)
@commit = @project.repo.commits.first.parents.first @commit = @project.repo.commits.first.parents.first
@commit = CommitDecorator.decorate(Commit.new(@commit)) @commit = CommitDecorator.decorate(Commit.new(@commit))
@other_project = Factory :project, :path => "OtherPath", :code => "OtherCode" @other_project = Factory :project, path: "OtherPath", code: "OtherCode"
@fake_user = Factory :user, :name => "fred" @fake_user = Factory :user, name: "fred"
end end
describe "#gfm" do describe "#gfm" do
...@@ -18,15 +18,15 @@ describe GitlabMarkdownHelper do ...@@ -18,15 +18,15 @@ describe GitlabMarkdownHelper do
describe "referencing a commit" do describe "referencing a commit" do
it "should link using a full id" do it "should link using a full id" do
gfm("Reverts changes from #{@commit.id}").should == "Reverts changes from #{link_to @commit.id, project_commit_path(@project, :id => @commit.id), :title => "Commit: #{@commit.author_name} - #{@commit.title}", :class => "gfm gfm-commit "}" gfm("Reverts changes from #{@commit.id}").should == "Reverts changes from #{link_to @commit.id, project_commit_path(@project, id: @commit.id), title: "Commit: #{@commit.author_name} - #{@commit.title}", class: "gfm gfm-commit "}"
end end
it "should link using a short id" do it "should link using a short id" do
gfm("Backported from #{@commit.id[0, 6]}").should == "Backported from #{link_to @commit.id[0, 6], project_commit_path(@project, :id => @commit.id), :title => "Commit: #{@commit.author_name} - #{@commit.title}", :class => "gfm gfm-commit "}" gfm("Backported from #{@commit.id[0, 6]}").should == "Backported from #{link_to @commit.id[0, 6], project_commit_path(@project, id: @commit.id), title: "Commit: #{@commit.author_name} - #{@commit.title}", class: "gfm gfm-commit "}"
end end
it "should link with adjecent text" do it "should link with adjecent text" do
gfm("Reverted (see #{@commit.id})").should == "Reverted (see #{link_to @commit.id, project_commit_path(@project, :id => @commit.id), :title => "Commit: #{@commit.author_name} - #{@commit.title}", :class => "gfm gfm-commit "})" gfm("Reverted (see #{@commit.id})").should == "Reverted (see #{link_to @commit.id, project_commit_path(@project, id: @commit.id), title: "Commit: #{@commit.author_name} - #{@commit.title}", class: "gfm gfm-commit "})"
end end
it "should not link with an invalid id" do it "should not link with an invalid id" do
...@@ -38,33 +38,33 @@ describe GitlabMarkdownHelper do ...@@ -38,33 +38,33 @@ describe GitlabMarkdownHelper do
it "should link using a simple name" do it "should link using a simple name" do
user = Factory :user, name: "barry" user = Factory :user, name: "barry"
@project.users << user @project.users << user
member = @project.users_projects.where(:user_id => user).first member = @project.users_projects.where(user_id: user).first
gfm("@#{user.name} you are right").should == "#{link_to "@#{user.name}", project_team_member_path(@project, member), :class => "gfm gfm-team_member "} you are right" gfm("@#{user.name} you are right").should == "#{link_to "@#{user.name}", project_team_member_path(@project, member), class: "gfm gfm-team_member "} you are right"
end end
it "should link using a name with dots" do it "should link using a name with dots" do
user = Factory :user, name: "alphA.Beta" user = Factory :user, name: "alphA.Beta"
@project.users << user @project.users << user
member = @project.users_projects.where(:user_id => user).first member = @project.users_projects.where(user_id: user).first
gfm("@#{user.name} you are right").should == "#{link_to "@#{user.name}", project_team_member_path(@project, member), :class => "gfm gfm-team_member "} you are right" gfm("@#{user.name} you are right").should == "#{link_to "@#{user.name}", project_team_member_path(@project, member), class: "gfm gfm-team_member "} you are right"
end end
it "should link using name with underscores" do it "should link using name with underscores" do
user = Factory :user, name: "ping_pong_king" user = Factory :user, name: "ping_pong_king"
@project.users << user @project.users << user
member = @project.users_projects.where(:user_id => user).first member = @project.users_projects.where(user_id: user).first
gfm("@#{user.name} you are right").should == "#{link_to "@#{user.name}", project_team_member_path(@project, member), :class => "gfm gfm-team_member "} you are right" gfm("@#{user.name} you are right").should == "#{link_to "@#{user.name}", project_team_member_path(@project, member), class: "gfm gfm-team_member "} you are right"
end end
it "should link with adjecent text" do it "should link with adjecent text" do
user = Factory.create(:user, :name => "ace") user = Factory.create(:user, name: "ace")
@project.users << user @project.users << user
member = @project.users_projects.where(:user_id => user).first member = @project.users_projects.where(user_id: user).first
gfm("Mail the Admin (@#{user.name})").should == "Mail the Admin (#{link_to "@#{user.name}", project_team_member_path(@project, member), :class => "gfm gfm-team_member "})" gfm("Mail the Admin (@#{user.name})").should == "Mail the Admin (#{link_to "@#{user.name}", project_team_member_path(@project, member), class: "gfm gfm-team_member "})"
end end
it "should add styles" do it "should add styles" do
...@@ -80,16 +80,16 @@ describe GitlabMarkdownHelper do ...@@ -80,16 +80,16 @@ describe GitlabMarkdownHelper do
describe "referencing an issue" do describe "referencing an issue" do
before do before do
@issue = Factory :issue, :assignee => @fake_user, :author => @fake_user, :project => @project @issue = Factory :issue, assignee: @fake_user, author: @fake_user, project: @project
@invalid_issue = Factory :issue, :assignee => @fake_user, :author => @fake_user, :project => @other_project @invalid_issue = Factory :issue, assignee: @fake_user, author: @fake_user, project: @other_project
end end
it "should link using a correct id" do it "should link using a correct id" do
gfm("Fixes ##{@issue.id}").should == "Fixes #{link_to "##{@issue.id}", project_issue_path(@project, @issue), :title => "Issue: #{@issue.title}", :class => "gfm gfm-issue "}" gfm("Fixes ##{@issue.id}").should == "Fixes #{link_to "##{@issue.id}", project_issue_path(@project, @issue), title: "Issue: #{@issue.title}", class: "gfm gfm-issue "}"
end end
it "should link with adjecent text" do it "should link with adjecent text" do
gfm("This has already been discussed (see ##{@issue.id})").should == "This has already been discussed (see #{link_to "##{@issue.id}", project_issue_path(@project, @issue), :title => "Issue: #{@issue.title}", :class => "gfm gfm-issue "})" gfm("This has already been discussed (see ##{@issue.id})").should == "This has already been discussed (see #{link_to "##{@issue.id}", project_issue_path(@project, @issue), title: "Issue: #{@issue.title}", class: "gfm gfm-issue "})"
end end
it "should add styles" do it "should add styles" do
...@@ -103,16 +103,16 @@ describe GitlabMarkdownHelper do ...@@ -103,16 +103,16 @@ describe GitlabMarkdownHelper do
describe "referencing a merge request" do describe "referencing a merge request" do
before do before do
@merge_request = Factory :merge_request, :assignee => @fake_user, :author => @fake_user, :project => @project @merge_request = Factory :merge_request, assignee: @fake_user, author: @fake_user, project: @project
@invalid_merge_request = Factory :merge_request, :assignee => @fake_user, :author => @fake_user, :project => @other_project @invalid_merge_request = Factory :merge_request, assignee: @fake_user, author: @fake_user, project: @other_project
end end
it "should link using a correct id" do it "should link using a correct id" do
gfm("Fixed in !#{@merge_request.id}").should == "Fixed in #{link_to "!#{@merge_request.id}", project_merge_request_path(@project, @merge_request), :title => "Merge Request: #{@merge_request.title}", :class => "gfm gfm-merge_request "}" gfm("Fixed in !#{@merge_request.id}").should == "Fixed in #{link_to "!#{@merge_request.id}", project_merge_request_path(@project, @merge_request), title: "Merge Request: #{@merge_request.title}", class: "gfm gfm-merge_request "}"
end end
it "should link with adjecent text" do it "should link with adjecent text" do
gfm("This has been fixed already (see !#{@merge_request.id})").should == "This has been fixed already (see #{link_to "!#{@merge_request.id}", project_merge_request_path(@project, @merge_request), :title => "Merge Request: #{@merge_request.title}", :class => "gfm gfm-merge_request "})" gfm("This has been fixed already (see !#{@merge_request.id})").should == "This has been fixed already (see #{link_to "!#{@merge_request.id}", project_merge_request_path(@project, @merge_request), title: "Merge Request: #{@merge_request.title}", class: "gfm gfm-merge_request "})"
end end
it "should add styles" do it "should add styles" do
...@@ -127,17 +127,17 @@ describe GitlabMarkdownHelper do ...@@ -127,17 +127,17 @@ describe GitlabMarkdownHelper do
describe "referencing a snippet" do describe "referencing a snippet" do
before do before do
@snippet = Factory.create(:snippet, @snippet = Factory.create(:snippet,
:title => "Render asset to string", title: "Render asset to string",
:author => @fake_user, author: @fake_user,
:project => @project) project: @project)
end end
it "should link using a correct id" do it "should link using a correct id" do
gfm("Check out $#{@snippet.id}").should == "Check out #{link_to "$#{@snippet.id}", project_snippet_path(@project, @snippet), :title => "Snippet: #{@snippet.title}", :class => "gfm gfm-snippet "}" gfm("Check out $#{@snippet.id}").should == "Check out #{link_to "$#{@snippet.id}", project_snippet_path(@project, @snippet), title: "Snippet: #{@snippet.title}", class: "gfm gfm-snippet "}"
end end
it "should link with adjecent text" do it "should link with adjecent text" do
gfm("I have created a snippet for that ($#{@snippet.id})").should == "I have created a snippet for that (#{link_to "$#{@snippet.id}", project_snippet_path(@project, @snippet), :title => "Snippet: #{@snippet.title}", :class => "gfm gfm-snippet "})" gfm("I have created a snippet for that ($#{@snippet.id})").should == "I have created a snippet for that (#{link_to "$#{@snippet.id}", project_snippet_path(@project, @snippet), title: "Snippet: #{@snippet.title}", class: "gfm gfm-snippet "})"
end end
it "should add styles" do it "should add styles" do
...@@ -152,12 +152,12 @@ describe GitlabMarkdownHelper do ...@@ -152,12 +152,12 @@ describe GitlabMarkdownHelper do
it "should link to multiple things" do it "should link to multiple things" do
user = Factory :user, name: "barry" user = Factory :user, name: "barry"
@project.users << user @project.users << user
member = @project.users_projects.where(:user_id => user).first member = @project.users_projects.where(user_id: user).first
gfm("Let @#{user.name} fix the *mess* in #{@commit.id}").should == "Let #{link_to "@#{user.name}", project_team_member_path(@project, member), :class => "gfm gfm-team_member "} fix the *mess* in #{link_to @commit.id, project_commit_path(@project, :id => @commit.id), :title => "Commit: #{@commit.author_name} - #{@commit.title}", :class => "gfm gfm-commit "}" gfm("Let @#{user.name} fix the *mess* in #{@commit.id}").should == "Let #{link_to "@#{user.name}", project_team_member_path(@project, member), class: "gfm gfm-team_member "} fix the *mess* in #{link_to @commit.id, project_commit_path(@project, id: @commit.id), title: "Commit: #{@commit.author_name} - #{@commit.title}", class: "gfm gfm-commit "}"
end end
it "should not trip over other stuff", :focus => true do it "should not trip over other stuff", focus: true do
gfm("_Please_ *stop* 'helping' and all the other b*$#%' you do.").should == "_Please_ *stop* 'helping' and all the other b*$#%' you do." gfm("_Please_ *stop* 'helping' and all the other b*$#%' you do.").should == "_Please_ *stop* 'helping' and all the other b*$#%' you do."
end end
...@@ -166,57 +166,57 @@ describe GitlabMarkdownHelper do ...@@ -166,57 +166,57 @@ describe GitlabMarkdownHelper do
end end
it "should forward HTML options to links" do it "should forward HTML options to links" do
gfm("fixed in #{@commit.id}", :class => "foo").should have_selector("a.foo") gfm("fixed in #{@commit.id}", class: "foo").should have_selector("a.foo")
end end
end end
describe "#link_to_gfm" do describe "#link_to_gfm" do
let(:issue1) { Factory :issue, :assignee => @fake_user, :author => @fake_user, :project => @project } let(:issue1) { Factory :issue, assignee: @fake_user, author: @fake_user, project: @project }
let(:issue2) { Factory :issue, :assignee => @fake_user, :author => @fake_user, :project => @project } let(:issue2) { Factory :issue, assignee: @fake_user, author: @fake_user, project: @project }
it "should handle references nested in links with all the text" do it "should handle references nested in links with all the text" do
link_to_gfm("This should finally fix ##{issue1.id} and ##{issue2.id} for real", project_commit_path(@project, :id => @commit.id)).should == "#{link_to "This should finally fix ", project_commit_path(@project, :id => @commit.id)}#{link_to "##{issue1.id}", project_issue_path(@project, issue1), :title => "Issue: #{issue1.title}", :class => "gfm gfm-issue "}#{link_to " and ", project_commit_path(@project, :id => @commit.id)}#{link_to "##{issue2.id}", project_issue_path(@project, issue2), :title => "Issue: #{issue2.title}", :class => "gfm gfm-issue "}#{link_to " for real", project_commit_path(@project, :id => @commit.id)}" link_to_gfm("This should finally fix ##{issue1.id} and ##{issue2.id} for real", project_commit_path(@project, id: @commit.id)).should == "#{link_to "This should finally fix ", project_commit_path(@project, id: @commit.id)}#{link_to "##{issue1.id}", project_issue_path(@project, issue1), title: "Issue: #{issue1.title}", class: "gfm gfm-issue "}#{link_to " and ", project_commit_path(@project, id: @commit.id)}#{link_to "##{issue2.id}", project_issue_path(@project, issue2), title: "Issue: #{issue2.title}", class: "gfm gfm-issue "}#{link_to " for real", project_commit_path(@project, id: @commit.id)}"
end end
it "should forward HTML options" do it "should forward HTML options" do
link_to_gfm("This should finally fix ##{issue1.id} for real", project_commit_path(@project, :id => @commit.id), :class => "foo").should have_selector(".foo") link_to_gfm("This should finally fix ##{issue1.id} for real", project_commit_path(@project, id: @commit.id), class: "foo").should have_selector(".foo")
end end
end end
describe "#markdown" do describe "#markdown" do
before do before do
@issue = Factory :issue, :assignee => @fake_user, :author => @fake_user, :project => @project @issue = Factory :issue, assignee: @fake_user, author: @fake_user, project: @project
@merge_request = Factory :merge_request, :assignee => @fake_user, :author => @fake_user, :project => @project @merge_request = Factory :merge_request, assignee: @fake_user, author: @fake_user, project: @project
@note = Factory.create(:note, @note = Factory.create(:note,
:note => "Screenshot of the new feature", note: "Screenshot of the new feature",
:project => @project, project: @project,
:noteable_id => @commit.id, noteable_id: @commit.id,
:noteable_type => "Commit", noteable_type: "Commit",
:attachment => "screenshot123.jpg") attachment: "screenshot123.jpg")
@snippet = Factory.create(:snippet, @snippet = Factory.create(:snippet,
:title => "Render asset to string", title: "Render asset to string",
:author => @fake_user, author: @fake_user,
:project => @project) project: @project)
@other_user = Factory :user, name: "bill" @other_user = Factory :user, name: "bill"
@project.users << @other_user @project.users << @other_user
@member = @project.users_projects.where(:user_id => @other_user).first @member = @project.users_projects.where(user_id: @other_user).first
end end
it "should handle references in paragraphs" do it "should handle references in paragraphs" do
markdown("\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. #{@commit.id} Nam pulvinar sapien eget odio adipiscing at faucibus orci vestibulum.\n").should == "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. #{link_to @commit.id, project_commit_path(@project, :id => @commit.id), :title => "Commit: #{@commit.author_name} - #{@commit.title}", :class => "gfm gfm-commit "} Nam pulvinar sapien eget odio adipiscing at faucibus orci vestibulum.</p>\n" markdown("\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. #{@commit.id} Nam pulvinar sapien eget odio adipiscing at faucibus orci vestibulum.\n").should == "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. #{link_to @commit.id, project_commit_path(@project, id: @commit.id), title: "Commit: #{@commit.author_name} - #{@commit.title}", class: "gfm gfm-commit "} Nam pulvinar sapien eget odio adipiscing at faucibus orci vestibulum.</p>\n"
end end
it "should handle references in headers" do it "should handle references in headers" do
markdown("\n# Working around ##{@issue.id} for now\n## Apply !#{@merge_request.id}").should == "<h1 id=\"toc_0\">Working around #{link_to "##{@issue.id}", project_issue_path(@project, @issue), :title => "Issue: #{@issue.title}", :class => "gfm gfm-issue "} for now</h1>\n\n<h2 id=\"toc_1\">Apply #{link_to "!#{@merge_request.id}", project_merge_request_path(@project, @merge_request), :title => "Merge Request: #{@merge_request.title}", :class => "gfm gfm-merge_request "}</h2>\n" markdown("\n# Working around ##{@issue.id} for now\n## Apply !#{@merge_request.id}").should == "<h1 id=\"toc_0\">Working around #{link_to "##{@issue.id}", project_issue_path(@project, @issue), title: "Issue: #{@issue.title}", class: "gfm gfm-issue "} for now</h1>\n\n<h2 id=\"toc_1\">Apply #{link_to "!#{@merge_request.id}", project_merge_request_path(@project, @merge_request), title: "Merge Request: #{@merge_request.title}", class: "gfm gfm-merge_request "}</h2>\n"
end end
it "should handle references in lists" do it "should handle references in lists" do
markdown("\n* dark: ##{@issue.id}\n* light by @#{@other_user.name}\n").should == "<ul>\n<li>dark: #{link_to "##{@issue.id}", project_issue_path(@project, @issue), :title => "Issue: #{@issue.title}", :class => "gfm gfm-issue "}</li>\n<li>light by #{link_to "@#{@other_user.name}", project_team_member_path(@project, @member), :class => "gfm gfm-team_member "}</li>\n</ul>\n" markdown("\n* dark: ##{@issue.id}\n* light by @#{@other_user.name}\n").should == "<ul>\n<li>dark: #{link_to "##{@issue.id}", project_issue_path(@project, @issue), title: "Issue: #{@issue.title}", class: "gfm gfm-issue "}</li>\n<li>light by #{link_to "@#{@other_user.name}", project_team_member_path(@project, @member), class: "gfm gfm-team_member "}</li>\n</ul>\n"
end end
it "should handle references in <em>" do it "should handle references in <em>" do
markdown("Apply _!#{@merge_request.id}_ ASAP").should == "<p>Apply <em>#{link_to "!#{@merge_request.id}", project_merge_request_path(@project, @merge_request), :title => "Merge Request: #{@merge_request.title}", :class => "gfm gfm-merge_request "}</em> ASAP</p>\n" markdown("Apply _!#{@merge_request.id}_ ASAP").should == "<p>Apply <em>#{link_to "!#{@merge_request.id}", project_merge_request_path(@project, @merge_request), title: "Merge Request: #{@merge_request.title}", class: "gfm gfm-merge_request "}</em> ASAP</p>\n"
end end
it "should leave code blocks untouched" do it "should leave code blocks untouched" do
......
...@@ -4,7 +4,7 @@ describe Notify do ...@@ -4,7 +4,7 @@ describe Notify do
include EmailSpec::Helpers include EmailSpec::Helpers
include EmailSpec::Matchers include EmailSpec::Matchers
let(:recipient) { Factory.create(:user, :email => 'recipient@example.com') } let(:recipient) { Factory.create(:user, email: 'recipient@example.com') }
let(:project) { Factory.create(:project) } let(:project) { Factory.create(:project) }
shared_examples 'a multiple recipients email' do shared_examples 'a multiple recipients email' do
...@@ -15,7 +15,7 @@ describe Notify do ...@@ -15,7 +15,7 @@ describe Notify do
describe 'for new users, the email' do describe 'for new users, the email' do
let(:example_site_path) { root_path } let(:example_site_path) { root_path }
let(:new_user) { Factory.create(:user, :email => 'newguy@example.com') } let(:new_user) { Factory.create(:user, email: 'newguy@example.com') }
subject { Notify.new_user_email(new_user.id, new_user.password) } subject { Notify.new_user_email(new_user.id, new_user.password) }
...@@ -42,8 +42,8 @@ describe Notify do ...@@ -42,8 +42,8 @@ describe Notify do
context 'for a project' do context 'for a project' do
describe 'items that are assignable, the email' do describe 'items that are assignable, the email' do
let(:assignee) { Factory.create(:user, :email => 'assignee@example.com') } let(:assignee) { Factory.create(:user, email: 'assignee@example.com') }
let(:previous_assignee) { Factory.create(:user, :name => 'Previous Assignee') } let(:previous_assignee) { Factory.create(:user, name: 'Previous Assignee') }
shared_examples 'an assignee email' do shared_examples 'an assignee email' do
it 'is sent to the assignee' do it 'is sent to the assignee' do
...@@ -52,7 +52,7 @@ describe Notify do ...@@ -52,7 +52,7 @@ describe Notify do
end end
context 'for issues' do context 'for issues' do
let(:issue) { Factory.create(:issue, :assignee => assignee, :project => project ) } let(:issue) { Factory.create(:issue, assignee: assignee, project: project ) }
describe 'that are new' do describe 'that are new' do
subject { Notify.new_issue_email(issue.id) } subject { Notify.new_issue_email(issue.id) }
...@@ -94,7 +94,7 @@ describe Notify do ...@@ -94,7 +94,7 @@ describe Notify do
end end
context 'for merge requests' do context 'for merge requests' do
let(:merge_request) { Factory.create(:merge_request, :assignee => assignee, :project => project) } let(:merge_request) { Factory.create(:merge_request, assignee: assignee, project: project) }
describe 'that are new' do describe 'that are new' do
subject { Notify.new_merge_request_email(merge_request.id) } subject { Notify.new_merge_request_email(merge_request.id) }
...@@ -146,8 +146,8 @@ describe Notify do ...@@ -146,8 +146,8 @@ describe Notify do
end end
context 'items that are noteable, the email for a note' do context 'items that are noteable, the email for a note' do
let(:note_author) { Factory.create(:user, :name => 'author_name') } let(:note_author) { Factory.create(:user, name: 'author_name') }
let(:note) { Factory.create(:note, :project => project, :author => note_author) } let(:note) { Factory.create(:note, project: project, author: note_author) }
before :each do before :each do
Note.stub(:find).with(note.id).and_return(note) Note.stub(:find).with(note.id).and_return(note)
...@@ -168,7 +168,7 @@ describe Notify do ...@@ -168,7 +168,7 @@ describe Notify do
end end
describe 'on a project wall' do describe 'on a project wall' do
let(:note_on_the_wall_path) { wall_project_path(project, :anchor => "note_#{note.id}") } let(:note_on_the_wall_path) { wall_project_path(project, anchor: "note_#{note.id}") }
subject { Notify.note_wall_email(recipient.id, note.id) } subject { Notify.note_wall_email(recipient.id, note.id) }
...@@ -208,8 +208,8 @@ describe Notify do ...@@ -208,8 +208,8 @@ describe Notify do
end end
describe 'on a merge request' do describe 'on a merge request' do
let(:merge_request) { Factory.create(:merge_request, :project => project) } let(:merge_request) { Factory.create(:merge_request, project: project) }
let(:note_on_merge_request_path) { project_merge_request_path(project, merge_request, :anchor => "note_#{note.id}") } let(:note_on_merge_request_path) { project_merge_request_path(project, merge_request, anchor: "note_#{note.id}") }
before(:each) { note.stub(:noteable).and_return(merge_request) } before(:each) { note.stub(:noteable).and_return(merge_request) }
subject { Notify.note_merge_request_email(recipient.id, note.id) } subject { Notify.note_merge_request_email(recipient.id, note.id) }
...@@ -226,8 +226,8 @@ describe Notify do ...@@ -226,8 +226,8 @@ describe Notify do
end end
describe 'on an issue' do describe 'on an issue' do
let(:issue) { Factory.create(:issue, :project => project) } let(:issue) { Factory.create(:issue, project: project) }
let(:note_on_issue_path) { project_issue_path(project, issue, :anchor => "note_#{note.id}") } let(:note_on_issue_path) { project_issue_path(project, issue, anchor: "note_#{note.id}") }
before(:each) { note.stub(:noteable).and_return(issue) } before(:each) { note.stub(:noteable).and_return(issue) }
subject { Notify.note_issue_email(recipient.id, note.id) } subject { Notify.note_issue_email(recipient.id, note.id) }
......
...@@ -11,7 +11,7 @@ describe ActivityObserver do ...@@ -11,7 +11,7 @@ describe ActivityObserver do
describe "Merge Request created" do describe "Merge Request created" do
before do before do
MergeRequest.observers.enable :activity_observer do MergeRequest.observers.enable :activity_observer do
@merge_request = Factory :merge_request, :project => project @merge_request = Factory :merge_request, project: project
@event = Event.last @event = Event.last
end end
end end
...@@ -24,7 +24,7 @@ describe ActivityObserver do ...@@ -24,7 +24,7 @@ describe ActivityObserver do
describe "Issue created" do describe "Issue created" do
before do before do
Issue.observers.enable :activity_observer do Issue.observers.enable :activity_observer do
@issue = Factory :issue, :project => project @issue = Factory :issue, project: project
@event = Event.last @event = Event.last
end end
end end
...@@ -36,8 +36,8 @@ describe ActivityObserver do ...@@ -36,8 +36,8 @@ describe ActivityObserver do
#describe "Issue commented" do #describe "Issue commented" do
#before do #before do
#@issue = Factory :issue, :project => project #@issue = Factory :issue, project: project
#@note = Factory :note, :noteable => @issue, :project => project #@note = Factory :note, noteable: @issue, project: project
#@event = Event.last #@event = Event.last
#end #end
......
...@@ -45,25 +45,25 @@ describe Event do ...@@ -45,25 +45,25 @@ describe Event do
@user = project.owner @user = project.owner
data = { data = {
:before => "0000000000000000000000000000000000000000", before: "0000000000000000000000000000000000000000",
:after => "0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e", after: "0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e",
:ref => "refs/heads/master", ref: "refs/heads/master",
:user_id => @user.id, user_id: @user.id,
:user_name => @user.name, user_name: @user.name,
:repository => { repository: {
:name => project.name, name: project.name,
:url => "localhost/rubinius", url: "localhost/rubinius",
:description => "", description: "",
:homepage => "localhost/rubinius", homepage: "localhost/rubinius",
:private => true private: true
} }
} }
@event = Event.create( @event = Event.create(
:project => project, project: project,
:action => Event::Pushed, action: Event::Pushed,
:data => data, data: data,
:author_id => @user.id author_id: @user.id
) )
end end
......
require 'spec_helper' require 'spec_helper'
describe IssueObserver do describe IssueObserver do
let(:some_user) { double(:user, :id => 1) } let(:some_user) { double(:user, id: 1) }
let(:assignee) { double(:user, :id => 2) } let(:assignee) { double(:user, id: 2) }
let(:issue) { double(:issue, :id => 42, :assignee => assignee) } let(:issue) { double(:issue, id: 42, assignee: assignee) }
before(:each) { subject.stub(:current_user).and_return(some_user) } before(:each) { subject.stub(:current_user).and_return(some_user) }
...@@ -15,13 +15,13 @@ describe IssueObserver do ...@@ -15,13 +15,13 @@ describe IssueObserver do
subject.should_receive(:after_create) subject.should_receive(:after_create)
Issue.observers.enable :issue_observer do Issue.observers.enable :issue_observer do
Factory.create(:issue, :project => Factory.create(:project)) Factory.create(:issue, project: Factory.create(:project))
end end
end end
it 'sends an email to the assignee' do it 'sends an email to the assignee' do
Notify.should_receive(:new_issue_email).with(issue.id). Notify.should_receive(:new_issue_email).with(issue.id).
and_return(double(:deliver => true)) and_return(double(deliver: true))
subject.after_create(issue) subject.after_create(issue)
end end
...@@ -42,7 +42,7 @@ describe IssueObserver do ...@@ -42,7 +42,7 @@ describe IssueObserver do
end end
it 'is called when an issue is changed' do it 'is called when an issue is changed' do
changed = Factory.create(:issue, :project => Factory.create(:project)) changed = Factory.create(:issue, project: Factory.create(:project))
subject.should_receive(:after_update) subject.should_receive(:after_update)
Issue.observers.enable :issue_observer do Issue.observers.enable :issue_observer do
...@@ -101,7 +101,7 @@ describe IssueObserver do ...@@ -101,7 +101,7 @@ describe IssueObserver do
end end
describe '#send_reassigned_email' do describe '#send_reassigned_email' do
let(:previous_assignee) { double(:user, :id => 3) } let(:previous_assignee) { double(:user, id: 3) }
before(:each) do before(:each) do
issue.stub(:assignee_id).and_return(assignee.id) issue.stub(:assignee_id).and_return(assignee.id)
...@@ -110,7 +110,7 @@ describe IssueObserver do ...@@ -110,7 +110,7 @@ describe IssueObserver do
def it_sends_a_reassigned_email_to(recipient) def it_sends_a_reassigned_email_to(recipient)
Notify.should_receive(:reassigned_issue_email).with(recipient, issue.id, previous_assignee.id). Notify.should_receive(:reassigned_issue_email).with(recipient, issue.id, previous_assignee.id).
and_return(double(:deliver => true)) and_return(double(deliver: true))
end end
def it_does_not_send_a_reassigned_email_to(recipient) def it_does_not_send_a_reassigned_email_to(recipient)
......
...@@ -20,9 +20,9 @@ describe Issue do ...@@ -20,9 +20,9 @@ describe Issue do
end end
subject { Factory.create(:issue, subject { Factory.create(:issue,
:author => Factory(:user), author: Factory(:user),
:assignee => Factory(:user), assignee: Factory(:user),
:project => Factory.create(:project)) } project: Factory.create(:project)) }
it { should be_valid } it { should be_valid }
describe '#is_being_reassigned?' do describe '#is_being_reassigned?' do
...@@ -42,10 +42,10 @@ describe Issue do ...@@ -42,10 +42,10 @@ describe Issue do
end end
it 'returns false if the closed attribute has changed and is now false' do it 'returns false if the closed attribute has changed and is now false' do
issue = Factory.create(:issue, issue = Factory.create(:issue,
:closed => true, closed: true,
:author => Factory(:user), author: Factory(:user),
:assignee => Factory(:user), assignee: Factory(:user),
:project => Factory.create(:project)) project: Factory.create(:project))
issue.closed = false issue.closed = false
issue.is_being_closed?.should be_false issue.is_being_closed?.should be_false
end end
...@@ -58,10 +58,10 @@ describe Issue do ...@@ -58,10 +58,10 @@ describe Issue do
describe '#is_being_reopened?' do describe '#is_being_reopened?' do
it 'returns true if the closed attribute has changed and is now false' do it 'returns true if the closed attribute has changed and is now false' do
issue = Factory.create(:issue, issue = Factory.create(:issue,
:closed => true, closed: true,
:author => Factory(:user), author: Factory(:user),
:assignee => Factory(:user), assignee: Factory(:user),
:project => Factory.create(:project)) project: Factory.create(:project))
issue.closed = false issue.closed = false
issue.is_being_reopened?.should be_true issue.is_being_reopened?.should be_true
end end
...@@ -78,9 +78,9 @@ describe Issue do ...@@ -78,9 +78,9 @@ describe Issue do
let(:project) { Factory(:project) } let(:project) { Factory(:project) }
subject { subject {
Factory.create(:issue, Factory.create(:issue,
:author => Factory(:user), author: Factory(:user),
:assignee => Factory(:user), assignee: Factory(:user),
:project => project) project: project)
} }
it "with no notes has a 0/0 score" do it "with no notes has a 0/0 score" do
...@@ -107,8 +107,8 @@ describe Issue do ...@@ -107,8 +107,8 @@ describe Issue do
end end
describe ".search" do describe ".search" do
let!(:issue) { Factory.create(:issue, :title => "Searchable issue", let!(:issue) { Factory.create(:issue, title: "Searchable issue",
:project => Factory.create(:project)) } project: Factory.create(:project)) }
it "matches by title" do it "matches by title" do
Issue.search('able').all.should == [issue] Issue.search('able').all.should == [issue]
......
...@@ -21,17 +21,17 @@ describe MergeRequest do ...@@ -21,17 +21,17 @@ describe MergeRequest do
end end
it { Factory.create(:merge_request, it { Factory.create(:merge_request,
:author => Factory(:user), author: Factory(:user),
:assignee => Factory(:user), assignee: Factory(:user),
:project => Factory.create(:project)).should be_valid } project: Factory.create(:project)).should be_valid }
describe "plus 1" do describe "plus 1" do
let(:project) { Factory(:project) } let(:project) { Factory(:project) }
subject { subject {
Factory.create(:merge_request, Factory.create(:merge_request,
:author => Factory(:user), author: Factory(:user),
:assignee => Factory(:user), assignee: Factory(:user),
:project => project) project: project)
} }
it "with no notes has a 0/0 score" do it "with no notes has a 0/0 score" do
...@@ -58,8 +58,8 @@ describe MergeRequest do ...@@ -58,8 +58,8 @@ describe MergeRequest do
end end
describe ".search" do describe ".search" do
let!(:issue) { Factory.create(:issue, :title => "Searchable issue", let!(:issue) { Factory.create(:issue, title: "Searchable issue",
:project => Factory.create(:project)) } project: Factory.create(:project)) }
it "matches by title" do it "matches by title" do
Issue.search('able').all.should == [issue] Issue.search('able').all.should == [issue]
......
...@@ -26,8 +26,8 @@ describe Milestone do ...@@ -26,8 +26,8 @@ describe Milestone do
end end
let(:project) { Factory :project } let(:project) { Factory :project }
let(:milestone) { Factory :milestone, :project => project } let(:milestone) { Factory :milestone, project: project }
let(:issue) { Factory :issue, :project => project } let(:issue) { Factory :issue, project: project }
it { milestone.should be_valid } it { milestone.should be_valid }
...@@ -39,14 +39,14 @@ describe Milestone do ...@@ -39,14 +39,14 @@ describe Milestone do
it { milestone.percent_complete.should == 0 } it { milestone.percent_complete.should == 0 }
it do it do
issue.update_attributes :closed => true issue.update_attributes closed: true
milestone.percent_complete.should == 100 milestone.percent_complete.should == 100
end end
end end
describe :expires_at do describe :expires_at do
before do before do
milestone.update_attributes :due_date => Date.today + 1.day milestone.update_attributes due_date: Date.today + 1.day
end end
it { milestone.expires_at.should_not be_nil } it { milestone.expires_at.should_not be_nil }
......
...@@ -14,7 +14,7 @@ describe Note do ...@@ -14,7 +14,7 @@ describe Note do
end end
it { Factory.create(:note, it { Factory.create(:note,
:project => project).should be_valid } project: project).should be_valid }
describe "Scopes" do describe "Scopes" do
it "should have a today named scope that returns ..." do it "should have a today named scope that returns ..." do
Note.today.where_values.should == ["created_at >= '#{Date.today}'"] Note.today.where_values.should == ["created_at >= '#{Date.today}'"]
...@@ -44,9 +44,9 @@ describe Note do ...@@ -44,9 +44,9 @@ describe Note do
before do before do
@note = Factory :note, @note = Factory :note,
:project => project, project: project,
:noteable_id => commit.id, noteable_id: commit.id,
:noteable_type => "Commit" noteable_type: "Commit"
end end
it "should save a valid note" do it "should save a valid note" do
...@@ -58,10 +58,10 @@ describe Note do ...@@ -58,10 +58,10 @@ describe Note do
describe "Pre-line commit notes" do describe "Pre-line commit notes" do
before do before do
@note = Factory :note, @note = Factory :note,
:project => project, project: project,
:noteable_id => commit.id, noteable_id: commit.id,
:noteable_type => "Commit", noteable_type: "Commit",
:line_code => "0_16_1" line_code: "0_16_1"
end end
it "should save a valid note" do it "should save a valid note" do
...@@ -72,7 +72,7 @@ describe Note do ...@@ -72,7 +72,7 @@ describe Note do
describe '#create_status_change_note' do describe '#create_status_change_note' do
let(:project) { Factory.create(:project) } let(:project) { Factory.create(:project) }
let(:thing) { Factory.create(:issue, :project => project) } let(:thing) { Factory.create(:issue, project: project) }
let(:author) { Factory(:user) } let(:author) { Factory(:user) }
let(:status) { 'new_status' } let(:status) { 'new_status' }
...@@ -92,7 +92,7 @@ describe Note do ...@@ -92,7 +92,7 @@ describe Note do
describe :authorization do describe :authorization do
before do before do
@p1 = project @p1 = project
@p2 = Factory :project, :code => "alien", :path => "gitlabhq_1" @p2 = Factory :project, code: "alien", path: "gitlabhq_1"
@u1 = Factory :user @u1 = Factory :user
@u2 = Factory :user @u2 = Factory :user
@u3 = Factory :user @u3 = Factory :user
...@@ -102,8 +102,8 @@ describe Note do ...@@ -102,8 +102,8 @@ describe Note do
describe :read do describe :read do
before do before do
@p1.users_projects.create(:user => @u2, :project_access => UsersProject::GUEST) @p1.users_projects.create(user: @u2, project_access: UsersProject::GUEST)
@p2.users_projects.create(:user => @u3, :project_access => UsersProject::GUEST) @p2.users_projects.create(user: @u3, project_access: UsersProject::GUEST)
end end
it { @abilities.allowed?(@u1, :read_note, @p1).should be_false } it { @abilities.allowed?(@u1, :read_note, @p1).should be_false }
...@@ -113,8 +113,8 @@ describe Note do ...@@ -113,8 +113,8 @@ describe Note do
describe :write do describe :write do
before do before do
@p1.users_projects.create(:user => @u2, :project_access => UsersProject::DEVELOPER) @p1.users_projects.create(user: @u2, project_access: UsersProject::DEVELOPER)
@p2.users_projects.create(:user => @u3, :project_access => UsersProject::DEVELOPER) @p2.users_projects.create(user: @u3, project_access: UsersProject::DEVELOPER)
end end
it { @abilities.allowed?(@u1, :write_note, @p1).should be_false } it { @abilities.allowed?(@u1, :write_note, @p1).should be_false }
...@@ -124,9 +124,9 @@ describe Note do ...@@ -124,9 +124,9 @@ describe Note do
describe :admin do describe :admin do
before do before do
@p1.users_projects.create(:user => @u1, :project_access => UsersProject::REPORTER) @p1.users_projects.create(user: @u1, project_access: UsersProject::REPORTER)
@p1.users_projects.create(:user => @u2, :project_access => UsersProject::MASTER) @p1.users_projects.create(user: @u2, project_access: UsersProject::MASTER)
@p2.users_projects.create(:user => @u3, :project_access => UsersProject::MASTER) @p2.users_projects.create(user: @u3, project_access: UsersProject::MASTER)
end end
it { @abilities.allowed?(@u1, :admin_note, @p1).should be_false } it { @abilities.allowed?(@u1, :admin_note, @p1).should be_false }
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
describe Project, "Hooks" do describe Project, "Hooks" do
let(:project) { Factory :project } let(:project) { Factory :project }
before do before do
@key = Factory :key, :user => project.owner @key = Factory :key, user: project.owner
@user = @key.user @user = @key.user
@key_id = @key.identifier @key_id = @key.identifier
end end
......
...@@ -12,7 +12,7 @@ describe Project do ...@@ -12,7 +12,7 @@ describe Project do
describe "read access" do describe "read access" do
before do before do
@p1.users_projects.create(:project => @p1, :user => @u2, :project_access => UsersProject::REPORTER) @p1.users_projects.create(project: @p1, user: @u2, project_access: UsersProject::REPORTER)
end end
it { @abilities.allowed?(@u1, :read_project, @p1).should be_false } it { @abilities.allowed?(@u1, :read_project, @p1).should be_false }
...@@ -21,7 +21,7 @@ describe Project do ...@@ -21,7 +21,7 @@ describe Project do
describe "write access" do describe "write access" do
before do before do
@p1.users_projects.create(:project => @p1, :user => @u2, :project_access => UsersProject::DEVELOPER) @p1.users_projects.create(project: @p1, user: @u2, project_access: UsersProject::DEVELOPER)
end end
it { @abilities.allowed?(@u1, :write_project, @p1).should be_false } it { @abilities.allowed?(@u1, :write_project, @p1).should be_false }
...@@ -30,8 +30,8 @@ describe Project do ...@@ -30,8 +30,8 @@ describe Project do
describe "admin access" do describe "admin access" do
before do before do
@p1.users_projects.create(:project => @p1, :user => @u1, :project_access => UsersProject::DEVELOPER) @p1.users_projects.create(project: @p1, user: @u1, project_access: UsersProject::DEVELOPER)
@p1.users_projects.create(:project => @p1, :user => @u2, :project_access => UsersProject::MASTER) @p1.users_projects.create(project: @p1, user: @u2, project_access: UsersProject::MASTER)
end end
it { @abilities.allowed?(@u1, :admin_project, @p1).should be_false } it { @abilities.allowed?(@u1, :admin_project, @p1).should be_false }
......
...@@ -80,17 +80,17 @@ describe Project do ...@@ -80,17 +80,17 @@ describe Project do
end end
it "should return valid url to repo" do it "should return valid url to repo" do
project = Project.new(:path => "somewhere") project = Project.new(path: "somewhere")
project.url_to_repo.should == Gitlab.config.ssh_path + "somewhere.git" project.url_to_repo.should == Gitlab.config.ssh_path + "somewhere.git"
end end
it "should return path to repo" do it "should return path to repo" do
project = Project.new(:path => "somewhere") project = Project.new(path: "somewhere")
project.path_to_repo.should == File.join(Rails.root, "tmp", "tests", "somewhere") project.path_to_repo.should == File.join(Rails.root, "tmp", "tests", "somewhere")
end end
it "returns the full web URL for this repo" do it "returns the full web URL for this repo" do
project = Project.new(:code => "somewhere") project = Project.new(code: "somewhere")
project.web_url.should == "#{Gitlab.config.url}/somewhere" project.web_url.should == "#{Gitlab.config.url}/somewhere"
end end
...@@ -101,7 +101,7 @@ describe Project do ...@@ -101,7 +101,7 @@ describe Project do
end end
it "should be invalid repo" do it "should be invalid repo" do
project = Project.new(:name => "ok_name", :path => "/INVALID_PATH/", :code => "NEOK") project = Project.new(name: "ok_name", path: "/INVALID_PATH/", code: "NEOK")
project.valid_repo?.should be_false project.valid_repo?.should be_false
end end
end end
...@@ -121,7 +121,7 @@ describe Project do ...@@ -121,7 +121,7 @@ describe Project do
let(:project) { Factory :project } let(:project) { Factory :project }
it 'returns the creation date of the project\'s last event if present' do it 'returns the creation date of the project\'s last event if present' do
last_event = double(:created_at => 'now') last_event = double(created_at: 'now')
project.stub(:events).and_return( [double, double, last_event] ) project.stub(:events).and_return( [double, double, last_event] )
project.last_activity_date.should == last_event.created_at project.last_activity_date.should == last_event.created_at
end end
...@@ -161,7 +161,7 @@ describe Project do ...@@ -161,7 +161,7 @@ describe Project do
end end
it "should return nil" do it "should return nil" do
lambda { Project.new(:path => "invalid").repo }.should raise_error(Grit::NoSuchPathError) lambda { Project.new(path: "invalid").repo }.should raise_error(Grit::NoSuchPathError)
end end
it "should return nil" do it "should return nil" do
...@@ -214,10 +214,10 @@ describe Project do ...@@ -214,10 +214,10 @@ describe Project do
before do before do
@merge_request = Factory :merge_request, @merge_request = Factory :merge_request,
:project => project, project: project,
:merged => false, merged: false,
:closed => false closed: false
@key = Factory :key, :user_id => project.owner.id @key = Factory :key, user_id: project.owner.id
end end
it "should close merge request if last commit from source branch was pushed to target branch" do it "should close merge request if last commit from source branch was pushed to target branch" do
......
...@@ -24,7 +24,7 @@ describe ProtectedBranch do ...@@ -24,7 +24,7 @@ describe ProtectedBranch do
end end
describe 'Callbacks' do describe 'Callbacks' do
subject { ProtectedBranch.new(:project => project, :name => 'branch_name') } subject { ProtectedBranch.new(project: project, name: 'branch_name') }
it 'call update_repository after save' do it 'call update_repository after save' do
subject.should_receive(:update_repository) subject.should_receive(:update_repository)
...@@ -38,7 +38,7 @@ describe ProtectedBranch do ...@@ -38,7 +38,7 @@ describe ProtectedBranch do
end end
describe '#commit' do describe '#commit' do
subject { ProtectedBranch.new(:project => project, :name => 'cant_touch_this') } subject { ProtectedBranch.new(project: project, name: 'cant_touch_this') }
it 'commits itself to its project' do it 'commits itself to its project' do
project.should_receive(:commit).with('cant_touch_this') project.should_receive(:commit).with('cant_touch_this')
......
...@@ -12,7 +12,7 @@ describe SystemHook do ...@@ -12,7 +12,7 @@ describe SystemHook do
it "project_create hook" do it "project_create hook" do
user = Factory :user user = Factory :user
with_resque do with_resque do
project = Factory :project_without_owner, :owner => user project = Factory :project_without_owner, owner: user
end end
WebMock.should have_requested(:post, @system_hook.url).with(body: /project_create/).once WebMock.should have_requested(:post, @system_hook.url).with(body: /project_create/).once
end end
......
...@@ -18,29 +18,29 @@ describe User do ...@@ -18,29 +18,29 @@ describe User do
end end
it "should return valid identifier" do it "should return valid identifier" do
user = User.new(:email => "test@mail.com") user = User.new(email: "test@mail.com")
user.identifier.should == "test_mail_com" user.identifier.should == "test_mail_com"
end end
it "should return identifier without + sign" do it "should return identifier without + sign" do
user = User.new(:email => "test+foo@mail.com") user = User.new(email: "test+foo@mail.com")
user.identifier.should == "test_foo_mail_com" user.identifier.should == "test_foo_mail_com"
end end
it "should execute callback when force_random_password specified" do it "should execute callback when force_random_password specified" do
user = User.new(:email => "test@mail.com", :force_random_password => true) user = User.new(email: "test@mail.com", force_random_password: true)
user.should_receive(:generate_password) user.should_receive(:generate_password)
user.save user.save
end end
it "should not generate password by default" do it "should not generate password by default" do
user = Factory(:user, :password => 'abcdefg', :password_confirmation => 'abcdefg') user = Factory(:user, password: 'abcdefg', password_confirmation: 'abcdefg')
user.password.should == 'abcdefg' user.password.should == 'abcdefg'
end end
it "should generate password when forcing random password" do it "should generate password when forcing random password" do
Devise.stub(:friendly_token).and_return('123456789') Devise.stub(:friendly_token).and_return('123456789')
user = User.create(:email => "test1@mail.com", :force_random_password => true) user = User.create(email: "test1@mail.com", force_random_password: true)
user.password.should == user.password_confirmation user.password.should == user.password_confirmation
user.password.should == '12345678' user.password.should == '12345678'
end end
...@@ -54,8 +54,8 @@ describe User do ...@@ -54,8 +54,8 @@ describe User do
before do before do
@user = Factory :user @user = Factory :user
@note = Factory :note, @note = Factory :note,
:author => @user, author: @user,
:project => Factory(:project) project: Factory(:project)
end end
it "should destroy all notes with user" do it "should destroy all notes with user" do
......
...@@ -3,8 +3,8 @@ require 'spec_helper' ...@@ -3,8 +3,8 @@ require 'spec_helper'
describe "Admin::Hooks" do describe "Admin::Hooks" do
before do before do
@project = Factory :project, @project = Factory :project,
:name => "LeGiT", name: "LeGiT",
:code => "LGT" code: "LGT"
login_as :admin login_as :admin
@system_hook = Factory :system_hook @system_hook = Factory :system_hook
...@@ -30,7 +30,7 @@ describe "Admin::Hooks" do ...@@ -30,7 +30,7 @@ describe "Admin::Hooks" do
before do before do
@url = Faker::Internet.uri("http") @url = Faker::Internet.uri("http")
visit admin_hooks_path visit admin_hooks_path
fill_in "hook_url", :with => @url fill_in "hook_url", with: @url
expect { click_button "Add System Hook" }.to change(SystemHook, :count).by(1) expect { click_button "Add System Hook" }.to change(SystemHook, :count).by(1)
end end
......
...@@ -3,8 +3,8 @@ require 'spec_helper' ...@@ -3,8 +3,8 @@ require 'spec_helper'
describe "Admin::Projects" do describe "Admin::Projects" do
before do before do
@project = Factory :project, @project = Factory :project,
:name => "LeGiT", name: "LeGiT",
:code => "LGT" code: "LGT"
login_as :admin login_as :admin
end end
...@@ -47,8 +47,8 @@ describe "Admin::Projects" do ...@@ -47,8 +47,8 @@ describe "Admin::Projects" do
describe "Update project" do describe "Update project" do
before do before do
fill_in "project_name", :with => "Big Bang" fill_in "project_name", with: "Big Bang"
fill_in "project_code", :with => "BB1" fill_in "project_code", with: "BB1"
click_button "Save Project" click_button "Save Project"
@project.reload @project.reload
end end
...@@ -85,9 +85,9 @@ describe "Admin::Projects" do ...@@ -85,9 +85,9 @@ describe "Admin::Projects" do
describe "POST /admin/projects" do describe "POST /admin/projects" do
before do before do
visit new_admin_project_path visit new_admin_project_path
fill_in 'project_name', :with => 'NewProject' fill_in 'project_name', with: 'NewProject'
fill_in 'project_code', :with => 'NPR' fill_in 'project_code', with: 'NPR'
fill_in 'project_path', :with => 'gitlabhq_1' fill_in 'project_path', with: 'gitlabhq_1'
expect { click_button "Create project" }.to change { Project.count }.by(1) expect { click_button "Create project" }.to change { Project.count }.by(1)
@project = Project.last @project = Project.last
end end
...@@ -109,7 +109,7 @@ describe "Admin::Projects" do ...@@ -109,7 +109,7 @@ describe "Admin::Projects" do
end end
it "should create new user" do it "should create new user" do
select @new_user.name, :from => "user_ids" select @new_user.name, from: "user_ids"
expect { click_button "Add" }.to change { UsersProject.count }.by(1) expect { click_button "Add" }.to change { UsersProject.count }.by(1)
page.should have_content @new_user.name page.should have_content @new_user.name
current_path.should == admin_project_path(@project) current_path.should == admin_project_path(@project)
......
...@@ -22,10 +22,10 @@ describe "Admin::Users" do ...@@ -22,10 +22,10 @@ describe "Admin::Users" do
before do before do
@password = "123ABC" @password = "123ABC"
visit new_admin_user_path visit new_admin_user_path
fill_in "user_name", :with => "Big Bang" fill_in "user_name", with: "Big Bang"
fill_in "user_email", :with => "bigbang@mail.com" fill_in "user_email", with: "bigbang@mail.com"
fill_in "user_password", :with => @password fill_in "user_password", with: @password
fill_in "user_password_confirmation", :with => @password fill_in "user_password_confirmation", with: @password
end end
it "should create new user" do it "should create new user" do
...@@ -40,7 +40,7 @@ describe "Admin::Users" do ...@@ -40,7 +40,7 @@ describe "Admin::Users" do
end end
it "should call send mail" do it "should call send mail" do
Notify.should_receive(:new_user_email).and_return(stub(:deliver => true)) Notify.should_receive(:new_user_email).and_return(stub(deliver: true))
User.observers.enable :user_observer do User.observers.enable :user_observer do
click_button "Save" click_button "Save"
...@@ -88,8 +88,8 @@ describe "Admin::Users" do ...@@ -88,8 +88,8 @@ describe "Admin::Users" do
describe "Update user" do describe "Update user" do
before do before do
fill_in "user_name", :with => "Big Bang" fill_in "user_name", with: "Big Bang"
fill_in "user_email", :with => "bigbang@mail.com" fill_in "user_email", with: "bigbang@mail.com"
check "user_admin" check "user_admin"
click_button "Save" click_button "Save"
end end
...@@ -114,7 +114,7 @@ describe "Admin::Users" do ...@@ -114,7 +114,7 @@ describe "Admin::Users" do
end end
it "should create new user" do it "should create new user" do
select @new_project.name, :from => "project_ids" select @new_project.name, from: "project_ids"
expect { click_button "Add" }.to change { UsersProject.count }.by(1) expect { click_button "Add" }.to change { UsersProject.count }.by(1)
page.should have_content @new_project.name page.should have_content @new_project.name
current_path.should == admin_user_path(@user) current_path.should == admin_user_path(@user)
......
...@@ -7,40 +7,40 @@ describe "User Issues Dashboard" do ...@@ -7,40 +7,40 @@ describe "User Issues Dashboard" do
login_as :user login_as :user
@project1 = Factory :project, @project1 = Factory :project,
:path => "project1", path: "project1",
:code => "TEST1" code: "TEST1"
@project2 = Factory :project, @project2 = Factory :project,
:path => "project2", path: "project2",
:code => "TEST2" code: "TEST2"
@project1.add_access(@user, :read, :write) @project1.add_access(@user, :read, :write)
@project2.add_access(@user, :read, :write) @project2.add_access(@user, :read, :write)
@issue1 = Factory :issue, @issue1 = Factory :issue,
:author => @user, author: @user,
:assignee => @user, assignee: @user,
:project => @project1 project: @project1
@issue2 = Factory :issue, @issue2 = Factory :issue,
:author => @user, author: @user,
:assignee => @user, assignee: @user,
:project => @project2 project: @project2
visit dashboard_issues_path visit dashboard_issues_path
end end
describe "atom feed", :js => false do describe "atom feed", js: false do
it "should render atom feed via private token" do it "should render atom feed via private token" do
logout logout
visit dashboard_issues_path(:atom, :private_token => @user.private_token) visit dashboard_issues_path(:atom, private_token: @user.private_token)
page.response_headers['Content-Type'].should have_content("application/atom+xml") page.response_headers['Content-Type'].should have_content("application/atom+xml")
page.body.should have_selector("title", :text => "#{@user.name} issues") page.body.should have_selector("title", text: "#{@user.name} issues")
page.body.should have_selector("author email", :text => @issue1.author_email) page.body.should have_selector("author email", text: @issue1.author_email)
page.body.should have_selector("entry summary", :text => @issue1.title) page.body.should have_selector("entry summary", text: @issue1.title)
page.body.should have_selector("author email", :text => @issue2.author_email) page.body.should have_selector("author email", text: @issue2.author_email)
page.body.should have_selector("entry summary", :text => @issue2.title) page.body.should have_selector("entry summary", text: @issue2.title)
end end
end end
end end
......
...@@ -5,7 +5,7 @@ describe "User Dashboard" do ...@@ -5,7 +5,7 @@ describe "User Dashboard" do
describe "GET /" do describe "GET /" do
before do before do
@project = Factory :project, :owner => @user @project = Factory :project, owner: @user
@project.add_access(@user, :read) @project.add_access(@user, :read)
visit dashboard_path visit dashboard_path
end end
...@@ -13,14 +13,14 @@ describe "User Dashboard" do ...@@ -13,14 +13,14 @@ describe "User Dashboard" do
it "should render projects atom feed via private token" do it "should render projects atom feed via private token" do
logout logout
visit dashboard_path(:atom, :private_token => @user.private_token) visit dashboard_path(:atom, private_token: @user.private_token)
page.body.should have_selector("feed title") page.body.should have_selector("feed title")
end end
it "should not render projects page via private token" do it "should not render projects page via private token" do
logout logout
visit dashboard_path(:private_token => @user.private_token) visit dashboard_path(private_token: @user.private_token)
current_path.should == new_user_session_path current_path.should == new_user_session_path
end end
end end
......
...@@ -11,9 +11,9 @@ describe "Issues" do ...@@ -11,9 +11,9 @@ describe "Issues" do
describe "GET /issues" do describe "GET /issues" do
before do before do
@issue = Factory :issue, @issue = Factory :issue,
:author => @user, author: @user,
:assignee => @user, assignee: @user,
:project => project project: project
visit project_issues_path(project) visit project_issues_path(project)
end end
...@@ -22,19 +22,19 @@ describe "Issues" do ...@@ -22,19 +22,19 @@ describe "Issues" do
visit project_issues_path(project, :atom) visit project_issues_path(project, :atom)
page.response_headers['Content-Type'].should have_content("application/atom+xml") page.response_headers['Content-Type'].should have_content("application/atom+xml")
page.body.should have_selector("title", :text => "#{project.name} issues") page.body.should have_selector("title", text: "#{project.name} issues")
page.body.should have_selector("author email", :text => @issue.author_email) page.body.should have_selector("author email", text: @issue.author_email)
page.body.should have_selector("entry summary", :text => @issue.title) page.body.should have_selector("entry summary", text: @issue.title)
end end
it "should render atom feed via private token" do it "should render atom feed via private token" do
logout logout
visit project_issues_path(project, :atom, :private_token => @user.private_token) visit project_issues_path(project, :atom, private_token: @user.private_token)
page.response_headers['Content-Type'].should have_content("application/atom+xml") page.response_headers['Content-Type'].should have_content("application/atom+xml")
page.body.should have_selector("title", :text => "#{project.name} issues") page.body.should have_selector("title", text: "#{project.name} issues")
page.body.should have_selector("author email", :text => @issue.author_email) page.body.should have_selector("author email", text: @issue.author_email)
page.body.should have_selector("entry summary", :text => @issue.title) page.body.should have_selector("entry summary", text: @issue.title)
end end
end end
end end
...@@ -2,10 +2,10 @@ require 'spec_helper' ...@@ -2,10 +2,10 @@ require 'spec_helper'
describe "Gitlab Flavored Markdown" do describe "Gitlab Flavored Markdown" do
let(:project) { Factory :project } let(:project) { Factory :project }
let(:issue) { Factory :issue, :project => project } let(:issue) { Factory :issue, project: project }
let(:merge_request) { Factory :merge_request, :project => project } let(:merge_request) { Factory :merge_request, project: project }
let(:fred) do let(:fred) do
u = Factory :user, :name => "fred" u = Factory :user, name: "fred"
project.users << u project.users << u
u u
end end
...@@ -19,7 +19,7 @@ describe "Gitlab Flavored Markdown" do ...@@ -19,7 +19,7 @@ describe "Gitlab Flavored Markdown" do
@test_file = "gfm_test_file" @test_file = "gfm_test_file"
i.add(@test_file, "foo\nbar\n") i.add(@test_file, "foo\nbar\n")
# add commit with gfm # add commit with gfm
i.commit("fix ##{issue.id}\n\nask @#{fred.name} for details", :head => @branch_name) i.commit("fix ##{issue.id}\n\nask @#{fred.name} for details", head: @branch_name)
# add test tag # add test tag
@tag_name = "gfm-test-tag" @tag_name = "gfm-test-tag"
...@@ -27,8 +27,8 @@ describe "Gitlab Flavored Markdown" do ...@@ -27,8 +27,8 @@ describe "Gitlab Flavored Markdown" do
end end
after do after do
# delete test branch and tag # delete test branch and tag
project.repo.git.native(:branch, {:D => true}, @branch_name) project.repo.git.native(:branch, {D: true}, @branch_name)
project.repo.git.native(:tag, {:d => true}, @tag_name) project.repo.git.native(:tag, {d: true}, @tag_name)
project.repo.gc_auto project.repo.gc_auto
end end
...@@ -42,25 +42,25 @@ describe "Gitlab Flavored Markdown" do ...@@ -42,25 +42,25 @@ describe "Gitlab Flavored Markdown" do
describe "for commits" do describe "for commits" do
it "should render title in commits#index" do it "should render title in commits#index" do
visit project_commits_path(project, :ref => @branch_name) visit project_commits_path(project, ref: @branch_name)
page.should have_link("##{issue.id}") page.should have_link("##{issue.id}")
end end
it "should render title in commits#show" do it "should render title in commits#show" do
visit project_commit_path(project, :id => commit.id) visit project_commit_path(project, id: commit.id)
page.should have_link("##{issue.id}") page.should have_link("##{issue.id}")
end end
it "should render description in commits#show" do it "should render description in commits#show" do
visit project_commit_path(project, :id => commit.id) visit project_commit_path(project, id: commit.id)
page.should have_link("@#{fred.name}") page.should have_link("@#{fred.name}")
end end
it "should render title in refs#tree", :js => true do it "should render title in refs#tree", js: true do
visit tree_project_ref_path(project, :id => @branch_name) visit tree_project_ref_path(project, id: @branch_name)
within(".tree_commit") do within(".tree_commit") do
page.should have_link("##{issue.id}") page.should have_link("##{issue.id}")
...@@ -68,7 +68,7 @@ describe "Gitlab Flavored Markdown" do ...@@ -68,7 +68,7 @@ describe "Gitlab Flavored Markdown" do
end end
it "should render title in refs#blame" do it "should render title in refs#blame" do
visit blame_file_project_ref_path(project, :id => @branch_name, :path => @test_file) visit blame_file_project_ref_path(project, id: @branch_name, path: @test_file)
within(".blame_commit") do within(".blame_commit") do
page.should have_link("##{issue.id}") page.should have_link("##{issue.id}")
...@@ -92,15 +92,15 @@ describe "Gitlab Flavored Markdown" do ...@@ -92,15 +92,15 @@ describe "Gitlab Flavored Markdown" do
describe "for issues" do describe "for issues" do
before do before do
@other_issue = Factory :issue, @other_issue = Factory :issue,
:author => @user, author: @user,
:assignee => @user, assignee: @user,
:project => project project: project
@issue = Factory :issue, @issue = Factory :issue,
:author => @user, author: @user,
:assignee => @user, assignee: @user,
:project => project, project: project,
:title => "fix ##{@other_issue.id}", title: "fix ##{@other_issue.id}",
:description => "ask @#{fred.name} for details" description: "ask @#{fred.name} for details"
end end
it "should render subject in issues#index" do it "should render subject in issues#index" do
...@@ -126,8 +126,8 @@ describe "Gitlab Flavored Markdown" do ...@@ -126,8 +126,8 @@ describe "Gitlab Flavored Markdown" do
describe "for merge requests" do describe "for merge requests" do
before do before do
@merge_request = Factory :merge_request, @merge_request = Factory :merge_request,
:project => project, project: project,
:title => "fix ##{issue.id}" title: "fix ##{issue.id}"
end end
it "should render title in merge_requests#index" do it "should render title in merge_requests#index" do
...@@ -147,9 +147,9 @@ describe "Gitlab Flavored Markdown" do ...@@ -147,9 +147,9 @@ describe "Gitlab Flavored Markdown" do
describe "for milestones" do describe "for milestones" do
before do before do
@milestone = Factory :milestone, @milestone = Factory :milestone,
:project => project, project: project,
:title => "fix ##{issue.id}", title: "fix ##{issue.id}",
:description => "ask @#{fred.name} for details" description: "ask @#{fred.name} for details"
end end
it "should render title in milestones#index" do it "should render title in milestones#index" do
...@@ -173,45 +173,45 @@ describe "Gitlab Flavored Markdown" do ...@@ -173,45 +173,45 @@ describe "Gitlab Flavored Markdown" do
describe "for notes" do describe "for notes" do
it "should render in commits#show", :js => true do it "should render in commits#show", js: true do
visit project_commit_path(project, :id => commit.id) visit project_commit_path(project, id: commit.id)
fill_in "note_note", :with => "see ##{issue.id}" fill_in "note_note", with: "see ##{issue.id}"
click_button "Add Comment" click_button "Add Comment"
page.should have_link("##{issue.id}") page.should have_link("##{issue.id}")
end end
it "should render in issue#show", :js => true do it "should render in issue#show", js: true do
visit project_issue_path(project, issue) visit project_issue_path(project, issue)
fill_in "note_note", :with => "see ##{issue.id}" fill_in "note_note", with: "see ##{issue.id}"
click_button "Add Comment" click_button "Add Comment"
page.should have_link("##{issue.id}") page.should have_link("##{issue.id}")
end end
it "should render in merge_request#show", :js => true do it "should render in merge_request#show", js: true do
visit project_merge_request_path(project, merge_request) visit project_merge_request_path(project, merge_request)
fill_in "note_note", :with => "see ##{issue.id}" fill_in "note_note", with: "see ##{issue.id}"
click_button "Add Comment" click_button "Add Comment"
page.should have_link("##{issue.id}") page.should have_link("##{issue.id}")
end end
it "should render in projects#wall", :js => true do it "should render in projects#wall", js: true do
visit wall_project_path(project) visit wall_project_path(project)
fill_in "note_note", :with => "see ##{issue.id}" fill_in "note_note", with: "see ##{issue.id}"
click_button "Add Comment" click_button "Add Comment"
page.should have_link("##{issue.id}") page.should have_link("##{issue.id}")
end end
it "should render in wikis#index", :js => true do it "should render in wikis#index", js: true do
visit project_wiki_path(project, :index) visit project_wiki_path(project, :index)
fill_in "Title", :with => 'Test title' fill_in "Title", with: 'Test title'
fill_in "Content", :with => '[link test](test)' fill_in "Content", with: '[link test](test)'
click_on "Save" click_on "Save"
fill_in "note_note", :with => "see ##{issue.id}" fill_in "note_note", with: "see ##{issue.id}"
click_button "Add Comment" click_button "Add Comment"
page.should have_link("##{issue.id}") page.should have_link("##{issue.id}")
...@@ -222,8 +222,8 @@ describe "Gitlab Flavored Markdown" do ...@@ -222,8 +222,8 @@ describe "Gitlab Flavored Markdown" do
describe "for wikis" do describe "for wikis" do
before do before do
visit project_wiki_path(project, :index) visit project_wiki_path(project, :index)
fill_in "Title", :with => "Circumvent ##{issue.id}" fill_in "Title", with: "Circumvent ##{issue.id}"
fill_in "Content", :with => "# Other pages\n\n* [Foo](foo)\n* [Bar](bar)\n\nAlso look at ##{issue.id} :-)" fill_in "Content", with: "# Other pages\n\n* [Foo](foo)\n* [Bar](bar)\n\nAlso look at ##{issue.id} :-)"
click_on "Save" click_on "Save"
end end
......
...@@ -9,7 +9,7 @@ describe "Hooks" do ...@@ -9,7 +9,7 @@ describe "Hooks" do
describe "GET index" do describe "GET index" do
it "should be available" do it "should be available" do
@hook = Factory :project_hook, :project => @project @hook = Factory :project_hook, project: @project
visit project_hooks_path(@project) visit project_hooks_path(@project)
page.should have_content "Hooks" page.should have_content "Hooks"
page.should have_content @hook.url page.should have_content @hook.url
...@@ -20,7 +20,7 @@ describe "Hooks" do ...@@ -20,7 +20,7 @@ describe "Hooks" do
before do before do
@url = Faker::Internet.uri("http") @url = Faker::Internet.uri("http")
visit project_hooks_path(@project) visit project_hooks_path(@project)
fill_in "hook_url", :with => @url fill_in "hook_url", with: @url
expect { click_button "Add Web Hook" }.to change(ProjectHook, :count).by(1) expect { click_button "Add Web Hook" }.to change(ProjectHook, :count).by(1)
end end
...@@ -32,7 +32,7 @@ describe "Hooks" do ...@@ -32,7 +32,7 @@ describe "Hooks" do
describe "Test" do describe "Test" do
before do before do
@hook = Factory :project_hook, :project => @project @hook = Factory :project_hook, project: @project
stub_request(:post, @hook.url) stub_request(:post, @hook.url)
visit project_hooks_path(@project) visit project_hooks_path(@project)
click_link "Test Hook" click_link "Test Hook"
......
...@@ -11,12 +11,12 @@ describe "Issues" do ...@@ -11,12 +11,12 @@ describe "Issues" do
project.add_access(@user2, :read, :write) project.add_access(@user2, :read, :write)
end end
describe "Edit issue", :js => true do describe "Edit issue", js: true do
before do before do
@issue = Factory :issue, @issue = Factory :issue,
:author => @user, author: @user,
:assignee => @user, assignee: @user,
:project => project project: project
visit project_issues_path(project) visit project_issues_path(project)
click_link "Edit" click_link "Edit"
end end
...@@ -27,8 +27,8 @@ describe "Issues" do ...@@ -27,8 +27,8 @@ describe "Issues" do
describe "fill in" do describe "fill in" do
before do before do
fill_in "issue_title", :with => "bug 345" fill_in "issue_title", with: "bug 345"
fill_in "issue_description", :with => "bug description" fill_in "issue_description", with: "bug description"
end end
it { expect { click_button "Save changes" }.to_not change {Issue.count} } it { expect { click_button "Save changes" }.to_not change {Issue.count} }
...@@ -43,14 +43,14 @@ describe "Issues" do ...@@ -43,14 +43,14 @@ describe "Issues" do
end end
end end
describe "Search issue", :js => true do describe "Search issue", js: true do
before do before do
['foobar', 'foobar2', 'gitlab'].each do |title| ['foobar', 'foobar2', 'gitlab'].each do |title|
@issue = Factory :issue, @issue = Factory :issue,
:author => @user, author: @user,
:assignee => @user, assignee: @user,
:project => project, project: project,
:title => title title: title
@issue.save @issue.save
end end
end end
...@@ -62,7 +62,7 @@ describe "Issues" do ...@@ -62,7 +62,7 @@ describe "Issues" do
visit project_issues_path(project) visit project_issues_path(project)
click_link 'Closed' click_link 'Closed'
fill_in 'issue_search', :with => 'foobar' fill_in 'issue_search', with: 'foobar'
page.should have_content 'foobar' page.should have_content 'foobar'
page.should_not have_content 'foobar2' page.should_not have_content 'foobar2'
...@@ -71,7 +71,7 @@ describe "Issues" do ...@@ -71,7 +71,7 @@ describe "Issues" do
it "should search for term and return the correct results" do it "should search for term and return the correct results" do
visit project_issues_path(project) visit project_issues_path(project)
fill_in 'issue_search', :with => 'foobar' fill_in 'issue_search', with: 'foobar'
page.should have_content 'foobar' page.should have_content 'foobar'
page.should have_content 'foobar2' page.should have_content 'foobar2'
...@@ -80,8 +80,8 @@ describe "Issues" do ...@@ -80,8 +80,8 @@ describe "Issues" do
it "should return all results if term has been cleared" do it "should return all results if term has been cleared" do
visit project_issues_path(project) visit project_issues_path(project)
fill_in "issue_search", :with => "foobar" fill_in "issue_search", with: "foobar"
# Because fill_in, :with => "" triggers nothing we need to trigger a keyup event # Because fill_in, with: "" triggers nothing we need to trigger a keyup event
page.execute_script("$('.issue_search').val('').keyup();"); page.execute_script("$('.issue_search').val('').keyup();");
page.should have_content 'foobar' page.should have_content 'foobar'
......
...@@ -10,7 +10,7 @@ describe "Projects", "DeployKeys" do ...@@ -10,7 +10,7 @@ describe "Projects", "DeployKeys" do
describe "GET /keys" do describe "GET /keys" do
before do before do
@key = Factory :key, :project => project @key = Factory :key, project: project
visit project_deploy_keys_path(project) visit project_deploy_keys_path(project)
end end
...@@ -41,8 +41,8 @@ describe "Projects", "DeployKeys" do ...@@ -41,8 +41,8 @@ describe "Projects", "DeployKeys" do
describe "fill in" do describe "fill in" do
before do before do
fill_in "key_title", :with => "laptop" fill_in "key_title", with: "laptop"
fill_in "key_key", :with => "publickey234=" fill_in "key_key", with: "publickey234="
end end
it { expect { click_button "Save" }.to change {Key.count}.by(1) } it { expect { click_button "Save" }.to change {Key.count}.by(1) }
...@@ -57,7 +57,7 @@ describe "Projects", "DeployKeys" do ...@@ -57,7 +57,7 @@ describe "Projects", "DeployKeys" do
describe "Show page" do describe "Show page" do
before do before do
@key = Factory :key, :project => project @key = Factory :key, project: project
visit project_deploy_key_path(project, @key) visit project_deploy_key_path(project, @key)
end end
......
...@@ -5,7 +5,7 @@ describe "Projects" do ...@@ -5,7 +5,7 @@ describe "Projects" do
describe "GET /projects/show" do describe "GET /projects/show" do
before do before do
@project = Factory :project, :owner => @user @project = Factory :project, owner: @user
@project.add_access(@user, :read) @project.add_access(@user, :read)
visit project_path(@project) visit project_path(@project)
...@@ -37,13 +37,13 @@ describe "Projects" do ...@@ -37,13 +37,13 @@ describe "Projects" do
describe "PUT /projects/:id" do describe "PUT /projects/:id" do
before do before do
@project = Factory :project, :owner => @user @project = Factory :project, owner: @user
@project.add_access(@user, :admin, :read) @project.add_access(@user, :admin, :read)
visit edit_project_path(@project) visit edit_project_path(@project)
fill_in 'project_name', :with => 'Awesome' fill_in 'project_name', with: 'Awesome'
fill_in 'project_code', :with => 'gitlabhq' fill_in 'project_code', with: 'gitlabhq'
click_button "Save" click_button "Save"
@project = @project.reload @project = @project.reload
end end
......
...@@ -6,7 +6,7 @@ describe "Search" do ...@@ -6,7 +6,7 @@ describe "Search" do
@project = Factory :project @project = Factory :project
@project.add_access(@user, :read) @project.add_access(@user, :read)
visit search_path visit search_path
fill_in "search", :with => @project.name[0..3] fill_in "search", with: @project.name[0..3]
click_button "Search" click_button "Search"
end end
......
...@@ -20,9 +20,9 @@ describe "Application access" do ...@@ -20,9 +20,9 @@ describe "Application access" do
@u2 = Factory :user @u2 = Factory :user
@u3 = Factory :user @u3 = Factory :user
# full access # full access
@project.users_projects.create(:user => @u1, :project_access => UsersProject::MASTER) @project.users_projects.create(user: @u1, project_access: UsersProject::MASTER)
# readonly # readonly
@project.users_projects.create(:user => @u3, :project_access => UsersProject::REPORTER) @project.users_projects.create(user: @u3, project_access: UsersProject::REPORTER)
end end
describe "GET /project_code" do describe "GET /project_code" do
...@@ -83,7 +83,7 @@ describe "Application access" do ...@@ -83,7 +83,7 @@ describe "Application access" do
before do before do
@commit = @project.commit @commit = @project.commit
@path = @commit.tree.contents.select { |i| i.is_a?(Grit::Blob)}.first.name @path = @commit.tree.contents.select { |i| i.is_a?(Grit::Blob)}.first.name
@blob_path = blob_project_ref_path(@project, @commit.id, :path => @path) @blob_path = blob_project_ref_path(@project, @commit.id, path: @path)
end end
it { @blob_path.should be_allowed_for @u1 } it { @blob_path.should be_allowed_for @u1 }
......
...@@ -11,8 +11,8 @@ describe "Snippets" do ...@@ -11,8 +11,8 @@ describe "Snippets" do
describe "GET /snippets" do describe "GET /snippets" do
before do before do
@snippet = Factory :snippet, @snippet = Factory :snippet,
:author => @user, author: @user,
:project => project project: project
visit project_snippets_path(project) visit project_snippets_path(project)
end end
...@@ -50,9 +50,9 @@ describe "Snippets" do ...@@ -50,9 +50,9 @@ describe "Snippets" do
describe "fill in" do describe "fill in" do
before do before do
fill_in "snippet_title", :with => "login function" fill_in "snippet_title", with: "login function"
fill_in "snippet_file_name", :with => "test.rb" fill_in "snippet_file_name", with: "test.rb"
fill_in "snippet_content", :with => "def login; end" fill_in "snippet_content", with: "def login; end"
end end
it { expect { click_button "Save" }.to change {Snippet.count}.by(1) } it { expect { click_button "Save" }.to change {Snippet.count}.by(1) }
...@@ -69,8 +69,8 @@ describe "Snippets" do ...@@ -69,8 +69,8 @@ describe "Snippets" do
describe "Edit snippet" do describe "Edit snippet" do
before do before do
@snippet = Factory :snippet, @snippet = Factory :snippet,
:author => @user, author: @user,
:project => project project: project
visit project_snippet_path(project, @snippet) visit project_snippet_path(project, @snippet)
click_link "Edit" click_link "Edit"
end end
...@@ -81,9 +81,9 @@ describe "Snippets" do ...@@ -81,9 +81,9 @@ describe "Snippets" do
describe "fill in" do describe "fill in" do
before do before do
fill_in "snippet_title", :with => "login function" fill_in "snippet_title", with: "login function"
fill_in "snippet_file_name", :with => "test.rb" fill_in "snippet_file_name", with: "test.rb"
fill_in "snippet_content", :with => "def login; end" fill_in "snippet_content", with: "def login; end"
end end
it { expect { click_button "Save" }.to_not change {Snippet.count} } it { expect { click_button "Save" }.to_not change {Snippet.count} }
......
...@@ -37,7 +37,7 @@ RSpec.configure do |config| ...@@ -37,7 +37,7 @@ RSpec.configure do |config|
# instead of true. # instead of true.
config.use_transactional_fixtures = false config.use_transactional_fixtures = false
config.before :each, :type => :integration do config.before :each, type: :integration do
DeviseSessionMock.disable DeviseSessionMock.disable
end end
...@@ -59,7 +59,7 @@ RSpec.configure do |config| ...@@ -59,7 +59,7 @@ RSpec.configure do |config|
DatabaseCleaner.clean DatabaseCleaner.clean
end end
config.include RSpec::Rails::RequestExampleGroup, :type => :request, :example_group => { config.include RSpec::Rails::RequestExampleGroup, type: :request, example_group: {
:file_path => /spec\/api/ file_path: /spec\/api/
} }
end end
module LoginMacros module LoginMacros
def login_as role def login_as role
@user = User.create(:email => "user#{User.count}@mail.com", @user = User.create(email: "user#{User.count}@mail.com",
:name => "John Smith", name: "John Smith",
:password => "123456", password: "123456",
:password_confirmation => "123456", password_confirmation: "123456",
:skype => 'user_skype') skype: 'user_skype')
if role == :admin if role == :admin
@user.admin = true @user.admin = true
...@@ -12,15 +12,15 @@ module LoginMacros ...@@ -12,15 +12,15 @@ module LoginMacros
end end
visit new_user_session_path visit new_user_session_path
fill_in "user_email", :with => @user.email fill_in "user_email", with: @user.email
fill_in "user_password", :with => "123456" fill_in "user_password", with: "123456"
click_button "Sign in" click_button "Sign in"
end end
def login_with(user) def login_with(user)
visit new_user_session_path visit new_user_session_path
fill_in "user_email", :with => user.email fill_in "user_email", with: user.email
fill_in "user_password", :with => "123456" fill_in "user_password", with: "123456"
click_button "Sign in" click_button "Sign in"
end end
......
...@@ -9,7 +9,7 @@ module ValidCommit ...@@ -9,7 +9,7 @@ module ValidCommit
C_FILE_PATH = "app/models" C_FILE_PATH = "app/models"
C_FILES = [".gitkeep", "ability.rb", "commit.rb", "issue.rb", "key.rb", "mailer_observer.rb", "merge_request.rb", "note.rb", "project.rb", "protected_branch.rb", "repository.rb", "snippet.rb", "tree.rb", "user.rb", "users_project.rb", "web_hook.rb", "wiki.rb"] C_FILES = [".gitkeep", "ability.rb", "commit.rb", "issue.rb", "key.rb", "mailer_observer.rb", "merge_request.rb", "note.rb", "project.rb", "protected_branch.rb", "repository.rb", "snippet.rb", "tree.rb", "user.rb", "users_project.rb", "web_hook.rb", "wiki.rb"]
BLOB_FILE = %{%h3= @key.title\n%hr\n%pre= @key.key\n.actions\n = link_to 'Remove', @key, :confirm => 'Are you sure?', :method => :delete, :class => \"btn danger delete-key\"\n\n\n} BLOB_FILE = %{%h3= @key.title\n%hr\n%pre= @key.key\n.actions\n = link_to 'Remove', @key, confirm: 'Are you sure?', method: :delete, class: \"btn danger delete-key\"\n\n\n}
BLOB_FILE_PATH = "app/views/keys/show.html.haml" BLOB_FILE_PATH = "app/views/keys/show.html.haml"
end end
...@@ -10,7 +10,7 @@ describe PostReceive do ...@@ -10,7 +10,7 @@ describe PostReceive do
context "web hook" do context "web hook" do
let(:project) { Factory.create(:project) } let(:project) { Factory.create(:project) }
let(:key) { Factory.create(:key, :user => project.owner) } let(:key) { Factory.create(:key, user: project.owner) }
let(:key_id) { key.identifier } let(:key_id) { key.identifier }
it "fetches the correct project" do it "fetches the correct project" do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment