Commit 2ed7cbfba4ff3c6a4cf3e72515a0375544998de0
1 parent
95791316
Exists in
master
and in
4 other branches
Move projects controllers/views in Projects module
Showing
330 changed files
with
4167 additions
and
4170 deletions
Show diff stats
app/assets/javascripts/dispatcher.js.coffee
| ... | ... | @@ -18,19 +18,19 @@ class Dispatcher |
| 18 | 18 | path = page.split(':') |
| 19 | 19 | |
| 20 | 20 | switch page |
| 21 | - when 'issues:index' | |
| 21 | + when 'projects:issues:index' | |
| 22 | 22 | Issues.init() |
| 23 | 23 | when 'dashboard:show' |
| 24 | 24 | new Dashboard() |
| 25 | - when 'commit:show' | |
| 25 | + when 'projects:commit:show' | |
| 26 | 26 | new Commit() |
| 27 | - when 'groups:show', 'teams:show', 'projects:show' | |
| 27 | + when 'groups:show', 'projects:show' | |
| 28 | 28 | Pager.init(20, true) |
| 29 | 29 | when 'projects:new', 'projects:edit' |
| 30 | 30 | new Project() |
| 31 | - when 'walls:show' | |
| 31 | + when 'projects:walls:show' | |
| 32 | 32 | new Wall(project_id) |
| 33 | - when 'teams:members:index' | |
| 33 | + when 'projects:teams:members:index' | |
| 34 | 34 | new TeamMembers() |
| 35 | 35 | when 'groups:people' |
| 36 | 36 | new GroupMembers() | ... | ... |
app/controllers/blame_controller.rb
| ... | ... | @@ -1,14 +0,0 @@ |
| 1 | -# Controller for viewing a file's blame | |
| 2 | -class BlameController < ProjectResourceController | |
| 3 | - include ExtractsPath | |
| 4 | - | |
| 5 | - # Authorize | |
| 6 | - before_filter :authorize_read_project! | |
| 7 | - before_filter :authorize_code_access! | |
| 8 | - before_filter :require_non_empty_project | |
| 9 | - | |
| 10 | - def show | |
| 11 | - @blob = Gitlab::Git::Blob.new(@repository, @commit.id, @ref, @path) | |
| 12 | - @blame = Gitlab::Git::Blame.new(project.repository, @commit.id, @path) | |
| 13 | - end | |
| 14 | -end |
app/controllers/blob_controller.rb
| ... | ... | @@ -1,13 +0,0 @@ |
| 1 | -# Controller for viewing a file's blame | |
| 2 | -class BlobController < ProjectResourceController | |
| 3 | - include ExtractsPath | |
| 4 | - | |
| 5 | - # Authorize | |
| 6 | - before_filter :authorize_read_project! | |
| 7 | - before_filter :authorize_code_access! | |
| 8 | - before_filter :require_non_empty_project | |
| 9 | - | |
| 10 | - def show | |
| 11 | - @blob = Gitlab::Git::Blob.new(@repository, @commit.id, @ref, @path) | |
| 12 | - end | |
| 13 | -end |
app/controllers/commit_controller.rb
| ... | ... | @@ -1,43 +0,0 @@ |
| 1 | -# Controller for a specific Commit | |
| 2 | -# | |
| 3 | -# Not to be confused with CommitsController, plural. | |
| 4 | -class CommitController < ProjectResourceController | |
| 5 | - # Authorize | |
| 6 | - before_filter :authorize_read_project! | |
| 7 | - before_filter :authorize_code_access! | |
| 8 | - before_filter :require_non_empty_project | |
| 9 | - | |
| 10 | - def show | |
| 11 | - result = CommitLoadContext.new(project, current_user, params).execute | |
| 12 | - | |
| 13 | - @commit = result[:commit] | |
| 14 | - | |
| 15 | - if @commit.nil? | |
| 16 | - git_not_found! | |
| 17 | - return | |
| 18 | - end | |
| 19 | - | |
| 20 | - @suppress_diff = result[:suppress_diff] | |
| 21 | - | |
| 22 | - @note = result[:note] | |
| 23 | - @line_notes = result[:line_notes] | |
| 24 | - @notes_count = result[:notes_count] | |
| 25 | - @target_type = :commit | |
| 26 | - @target_id = @commit.id | |
| 27 | - | |
| 28 | - @comments_allowed = @reply_allowed = true | |
| 29 | - @comments_target = { noteable_type: 'Commit', | |
| 30 | - commit_id: @commit.id } | |
| 31 | - | |
| 32 | - respond_to do |format| | |
| 33 | - format.html do | |
| 34 | - if result[:status] == :huge_commit | |
| 35 | - render "huge_commit" and return | |
| 36 | - end | |
| 37 | - end | |
| 38 | - | |
| 39 | - format.diff { render text: @commit.to_diff } | |
| 40 | - format.patch { render text: @commit.to_patch } | |
| 41 | - end | |
| 42 | - end | |
| 43 | -end |
app/controllers/commits_controller.rb
| ... | ... | @@ -1,23 +0,0 @@ |
| 1 | -require "base64" | |
| 2 | - | |
| 3 | -class CommitsController < ProjectResourceController | |
| 4 | - include ExtractsPath | |
| 5 | - | |
| 6 | - # Authorize | |
| 7 | - before_filter :authorize_read_project! | |
| 8 | - before_filter :authorize_code_access! | |
| 9 | - before_filter :require_non_empty_project | |
| 10 | - | |
| 11 | - def show | |
| 12 | - @repo = @project.repository | |
| 13 | - @limit, @offset = (params[:limit] || 40), (params[:offset] || 0) | |
| 14 | - | |
| 15 | - @commits = @repo.commits(@ref, @path, @limit, @offset) | |
| 16 | - | |
| 17 | - respond_to do |format| | |
| 18 | - format.html # index.html.erb | |
| 19 | - format.js | |
| 20 | - format.atom { render layout: false } | |
| 21 | - end | |
| 22 | - end | |
| 23 | -end |
app/controllers/compare_controller.rb
| ... | ... | @@ -1,23 +0,0 @@ |
| 1 | -class CompareController < ProjectResourceController | |
| 2 | - # Authorize | |
| 3 | - before_filter :authorize_read_project! | |
| 4 | - before_filter :authorize_code_access! | |
| 5 | - before_filter :require_non_empty_project | |
| 6 | - | |
| 7 | - def index | |
| 8 | - end | |
| 9 | - | |
| 10 | - def show | |
| 11 | - compare = Gitlab::Git::Compare.new(project.repository, params[:from], params[:to]) | |
| 12 | - | |
| 13 | - @commits = compare.commits | |
| 14 | - @commit = compare.commit | |
| 15 | - @diffs = compare.diffs | |
| 16 | - @refs_are_same = compare.same | |
| 17 | - @line_notes = [] | |
| 18 | - end | |
| 19 | - | |
| 20 | - def create | |
| 21 | - redirect_to project_compare_path(@project, params[:from], params[:to]) | |
| 22 | - end | |
| 23 | -end |
app/controllers/deploy_keys_controller.rb
| ... | ... | @@ -1,61 +0,0 @@ |
| 1 | -class DeployKeysController < ProjectResourceController | |
| 2 | - respond_to :html | |
| 3 | - | |
| 4 | - # Authorize | |
| 5 | - before_filter :authorize_admin_project! | |
| 6 | - | |
| 7 | - layout "project_settings" | |
| 8 | - | |
| 9 | - def index | |
| 10 | - @enabled_keys = @project.deploy_keys.all | |
| 11 | - @available_keys = available_keys - @enabled_keys | |
| 12 | - end | |
| 13 | - | |
| 14 | - def show | |
| 15 | - @key = @project.deploy_keys.find(params[:id]) | |
| 16 | - end | |
| 17 | - | |
| 18 | - def new | |
| 19 | - @key = @project.deploy_keys.new | |
| 20 | - | |
| 21 | - respond_with(@key) | |
| 22 | - end | |
| 23 | - | |
| 24 | - def create | |
| 25 | - @key = DeployKey.new(params[:deploy_key]) | |
| 26 | - | |
| 27 | - if @key.valid? && @project.deploy_keys << @key | |
| 28 | - redirect_to project_deploy_keys_path(@project) | |
| 29 | - else | |
| 30 | - render "new" | |
| 31 | - end | |
| 32 | - end | |
| 33 | - | |
| 34 | - def destroy | |
| 35 | - @key = @project.deploy_keys.find(params[:id]) | |
| 36 | - @key.destroy | |
| 37 | - | |
| 38 | - respond_to do |format| | |
| 39 | - format.html { redirect_to project_deploy_keys_url } | |
| 40 | - format.js { render nothing: true } | |
| 41 | - end | |
| 42 | - end | |
| 43 | - | |
| 44 | - def enable | |
| 45 | - project.deploy_keys << available_keys.find(params[:id]) | |
| 46 | - | |
| 47 | - redirect_to project_deploy_keys_path(@project) | |
| 48 | - end | |
| 49 | - | |
| 50 | - def disable | |
| 51 | - @project.deploy_keys_projects.where(deploy_key_id: params[:id]).last.destroy | |
| 52 | - | |
| 53 | - redirect_to project_deploy_keys_path(@project) | |
| 54 | - end | |
| 55 | - | |
| 56 | - protected | |
| 57 | - | |
| 58 | - def available_keys | |
| 59 | - @available_keys ||= current_user.accessible_deploy_keys | |
| 60 | - end | |
| 61 | -end |
app/controllers/edit_tree_controller.rb
| ... | ... | @@ -1,49 +0,0 @@ |
| 1 | -# Controller for edit a repository's file | |
| 2 | -class EditTreeController < ProjectResourceController | |
| 3 | - include ExtractsPath | |
| 4 | - | |
| 5 | - # Authorize | |
| 6 | - before_filter :authorize_read_project! | |
| 7 | - before_filter :authorize_code_access! | |
| 8 | - before_filter :require_non_empty_project | |
| 9 | - | |
| 10 | - before_filter :edit_requirements, only: [:show, :update] | |
| 11 | - | |
| 12 | - def show | |
| 13 | - @last_commit = @project.repository.last_commit_for(@ref, @path).sha | |
| 14 | - end | |
| 15 | - | |
| 16 | - def update | |
| 17 | - edit_file_action = Gitlab::Satellite::EditFileAction.new(current_user, @project, @ref, @path) | |
| 18 | - updated_successfully = edit_file_action.commit!( | |
| 19 | - params[:content], | |
| 20 | - params[:commit_message], | |
| 21 | - params[:last_commit] | |
| 22 | - ) | |
| 23 | - | |
| 24 | - if updated_successfully | |
| 25 | - redirect_to project_blob_path(@project, @id), notice: "Your changes have been successfully commited" | |
| 26 | - else | |
| 27 | - flash[:notice] = "Your changes could not be commited, because the file has been changed" | |
| 28 | - render :show | |
| 29 | - end | |
| 30 | - end | |
| 31 | - | |
| 32 | - private | |
| 33 | - | |
| 34 | - def edit_requirements | |
| 35 | - @blob = Gitlab::Git::Blob.new(@repository, @commit.id, @ref, @path) | |
| 36 | - | |
| 37 | - unless @blob.exists? && @blob.text? | |
| 38 | - redirect_to project_blob_path(@project, @id), notice: "You can only edit text files" | |
| 39 | - end | |
| 40 | - | |
| 41 | - allowed = if project.protected_branch? @ref | |
| 42 | - can?(current_user, :push_code_to_protected_branches, project) | |
| 43 | - else | |
| 44 | - can?(current_user, :push_code, project) | |
| 45 | - end | |
| 46 | - | |
| 47 | - return access_denied! unless allowed | |
| 48 | - end | |
| 49 | -end |
app/controllers/graphs_controller.rb
| ... | ... | @@ -1,17 +0,0 @@ |
| 1 | -class GraphsController < ProjectResourceController | |
| 2 | - # Authorize | |
| 3 | - before_filter :authorize_read_project! | |
| 4 | - before_filter :authorize_code_access! | |
| 5 | - before_filter :require_non_empty_project | |
| 6 | - | |
| 7 | - def show | |
| 8 | - respond_to do |format| | |
| 9 | - format.html | |
| 10 | - format.js do | |
| 11 | - @repo = @project.repository | |
| 12 | - @stats = Gitlab::Git::GitStats.new(@repo.raw, @repo.root_ref) | |
| 13 | - @log = @stats.parsed_log.to_json rescue [] | |
| 14 | - end | |
| 15 | - end | |
| 16 | - end | |
| 17 | -end |
app/controllers/hooks_controller.rb
| ... | ... | @@ -1,39 +0,0 @@ |
| 1 | -class HooksController < ProjectResourceController | |
| 2 | - # Authorize | |
| 3 | - before_filter :authorize_read_project! | |
| 4 | - before_filter :authorize_admin_project!, only: [:new, :create, :destroy] | |
| 5 | - | |
| 6 | - respond_to :html | |
| 7 | - | |
| 8 | - layout "project_settings" | |
| 9 | - | |
| 10 | - def index | |
| 11 | - @hooks = @project.hooks.all | |
| 12 | - @hook = ProjectHook.new | |
| 13 | - end | |
| 14 | - | |
| 15 | - def create | |
| 16 | - @hook = @project.hooks.new(params[:hook]) | |
| 17 | - @hook.save | |
| 18 | - | |
| 19 | - if @hook.valid? | |
| 20 | - redirect_to project_hooks_path(@project) | |
| 21 | - else | |
| 22 | - @hooks = @project.hooks.all | |
| 23 | - render :index | |
| 24 | - end | |
| 25 | - end | |
| 26 | - | |
| 27 | - def test | |
| 28 | - TestHookContext.new(project, current_user, params).execute | |
| 29 | - | |
| 30 | - redirect_to :back | |
| 31 | - end | |
| 32 | - | |
| 33 | - def destroy | |
| 34 | - @hook = @project.hooks.find(params[:id]) | |
| 35 | - @hook.destroy | |
| 36 | - | |
| 37 | - redirect_to project_hooks_path(@project) | |
| 38 | - end | |
| 39 | -end |
app/controllers/issues_controller.rb
| ... | ... | @@ -1,114 +0,0 @@ |
| 1 | -class IssuesController < ProjectResourceController | |
| 2 | - before_filter :module_enabled | |
| 3 | - before_filter :issue, only: [:edit, :update, :show] | |
| 4 | - | |
| 5 | - # Allow read any issue | |
| 6 | - before_filter :authorize_read_issue! | |
| 7 | - | |
| 8 | - # Allow write(create) issue | |
| 9 | - before_filter :authorize_write_issue!, only: [:new, :create] | |
| 10 | - | |
| 11 | - # Allow modify issue | |
| 12 | - before_filter :authorize_modify_issue!, only: [:edit, :update] | |
| 13 | - | |
| 14 | - respond_to :js, :html | |
| 15 | - | |
| 16 | - def index | |
| 17 | - terms = params['issue_search'] | |
| 18 | - | |
| 19 | - @issues = issues_filtered | |
| 20 | - @issues = @issues.where("title LIKE ?", "%#{terms}%") if terms.present? | |
| 21 | - @issues = @issues.page(params[:page]).per(20) | |
| 22 | - | |
| 23 | - | |
| 24 | - assignee_id, milestone_id = params[:assignee_id], params[:milestone_id] | |
| 25 | - | |
| 26 | - @assignee = @project.team.find(assignee_id) if assignee_id.present? && !assignee_id.to_i.zero? | |
| 27 | - @milestone = @project.milestones.find(milestone_id) if milestone_id.present? && !milestone_id.to_i.zero? | |
| 28 | - | |
| 29 | - respond_to do |format| | |
| 30 | - format.html # index.html.erb | |
| 31 | - format.js | |
| 32 | - format.atom { render layout: false } | |
| 33 | - end | |
| 34 | - end | |
| 35 | - | |
| 36 | - def new | |
| 37 | - @issue = @project.issues.new(params[:issue]) | |
| 38 | - respond_with(@issue) | |
| 39 | - end | |
| 40 | - | |
| 41 | - def edit | |
| 42 | - respond_with(@issue) | |
| 43 | - end | |
| 44 | - | |
| 45 | - def show | |
| 46 | - @note = @project.notes.new(noteable: @issue) | |
| 47 | - @target_type = :issue | |
| 48 | - @target_id = @issue.id | |
| 49 | - | |
| 50 | - respond_to do |format| | |
| 51 | - format.html | |
| 52 | - format.js | |
| 53 | - end | |
| 54 | - end | |
| 55 | - | |
| 56 | - def create | |
| 57 | - @issue = @project.issues.new(params[:issue]) | |
| 58 | - @issue.author = current_user | |
| 59 | - @issue.save | |
| 60 | - | |
| 61 | - respond_to do |format| | |
| 62 | - format.html do | |
| 63 | - if @issue.valid? | |
| 64 | - redirect_to project_issue_path(@project, @issue) | |
| 65 | - else | |
| 66 | - render :new | |
| 67 | - end | |
| 68 | - end | |
| 69 | - format.js | |
| 70 | - end | |
| 71 | - end | |
| 72 | - | |
| 73 | - def update | |
| 74 | - @issue.update_attributes(params[:issue].merge(author_id_of_changes: current_user.id)) | |
| 75 | - | |
| 76 | - respond_to do |format| | |
| 77 | - format.js | |
| 78 | - format.html do | |
| 79 | - if @issue.valid? | |
| 80 | - redirect_to [@project, @issue] | |
| 81 | - else | |
| 82 | - render :edit | |
| 83 | - end | |
| 84 | - end | |
| 85 | - end | |
| 86 | - end | |
| 87 | - | |
| 88 | - def bulk_update | |
| 89 | - result = Issues::BulkUpdateContext.new(project, current_user, params).execute | |
| 90 | - redirect_to :back, notice: "#{result[:count]} issues updated" | |
| 91 | - end | |
| 92 | - | |
| 93 | - protected | |
| 94 | - | |
| 95 | - def issue | |
| 96 | - @issue ||= @project.issues.find(params[:id]) | |
| 97 | - end | |
| 98 | - | |
| 99 | - def authorize_modify_issue! | |
| 100 | - return render_404 unless can?(current_user, :modify_issue, @issue) | |
| 101 | - end | |
| 102 | - | |
| 103 | - def authorize_admin_issue! | |
| 104 | - return render_404 unless can?(current_user, :admin_issue, @issue) | |
| 105 | - end | |
| 106 | - | |
| 107 | - def module_enabled | |
| 108 | - return render_404 unless @project.issues_enabled | |
| 109 | - end | |
| 110 | - | |
| 111 | - def issues_filtered | |
| 112 | - @issues = Issues::ListContext.new(project, current_user, params).execute | |
| 113 | - end | |
| 114 | -end |
app/controllers/labels_controller.rb
| ... | ... | @@ -1,24 +0,0 @@ |
| 1 | -class LabelsController < ProjectResourceController | |
| 2 | - before_filter :module_enabled | |
| 3 | - | |
| 4 | - # Allow read any issue | |
| 5 | - before_filter :authorize_read_issue! | |
| 6 | - | |
| 7 | - respond_to :js, :html | |
| 8 | - | |
| 9 | - def index | |
| 10 | - @labels = @project.issues_labels | |
| 11 | - end | |
| 12 | - | |
| 13 | - def generate | |
| 14 | - Gitlab::IssuesLabels.generate(@project) | |
| 15 | - | |
| 16 | - redirect_to project_labels_path(@project) | |
| 17 | - end | |
| 18 | - | |
| 19 | - protected | |
| 20 | - | |
| 21 | - def module_enabled | |
| 22 | - return render_404 unless @project.issues_enabled | |
| 23 | - end | |
| 24 | -end |
app/controllers/merge_requests_controller.rb
| ... | ... | @@ -1,163 +0,0 @@ |
| 1 | -require 'gitlab/satellite/satellite' | |
| 2 | - | |
| 3 | -class MergeRequestsController < ProjectResourceController | |
| 4 | - before_filter :module_enabled | |
| 5 | - before_filter :merge_request, only: [:edit, :update, :show, :commits, :diffs, :automerge, :automerge_check, :ci_status] | |
| 6 | - before_filter :validates_merge_request, only: [:show, :diffs] | |
| 7 | - before_filter :define_show_vars, only: [:show, :diffs] | |
| 8 | - | |
| 9 | - # Allow read any merge_request | |
| 10 | - before_filter :authorize_read_merge_request! | |
| 11 | - | |
| 12 | - # Allow write(create) merge_request | |
| 13 | - before_filter :authorize_write_merge_request!, only: [:new, :create] | |
| 14 | - | |
| 15 | - # Allow modify merge_request | |
| 16 | - before_filter :authorize_modify_merge_request!, only: [:close, :edit, :update, :sort] | |
| 17 | - | |
| 18 | - def index | |
| 19 | - @merge_requests = MergeRequestsLoadContext.new(project, current_user, params).execute | |
| 20 | - end | |
| 21 | - | |
| 22 | - def show | |
| 23 | - respond_to do |format| | |
| 24 | - format.html | |
| 25 | - format.js | |
| 26 | - | |
| 27 | - format.diff { render text: @merge_request.to_diff } | |
| 28 | - format.patch { render text: @merge_request.to_patch } | |
| 29 | - end | |
| 30 | - end | |
| 31 | - | |
| 32 | - def diffs | |
| 33 | - @diffs = @merge_request.diffs | |
| 34 | - @commit = @merge_request.last_commit | |
| 35 | - | |
| 36 | - @comments_allowed = @reply_allowed = true | |
| 37 | - @comments_target = { noteable_type: 'MergeRequest', | |
| 38 | - noteable_id: @merge_request.id } | |
| 39 | - @line_notes = @merge_request.notes.where("line_code is not null") | |
| 40 | - end | |
| 41 | - | |
| 42 | - def new | |
| 43 | - @merge_request = @project.merge_requests.new(params[:merge_request]) | |
| 44 | - end | |
| 45 | - | |
| 46 | - def edit | |
| 47 | - end | |
| 48 | - | |
| 49 | - def create | |
| 50 | - @merge_request = @project.merge_requests.new(params[:merge_request]) | |
| 51 | - @merge_request.author = current_user | |
| 52 | - | |
| 53 | - if @merge_request.save | |
| 54 | - @merge_request.reload_code | |
| 55 | - redirect_to [@project, @merge_request], notice: 'Merge request was successfully created.' | |
| 56 | - else | |
| 57 | - render "new" | |
| 58 | - end | |
| 59 | - end | |
| 60 | - | |
| 61 | - def update | |
| 62 | - if @merge_request.update_attributes(params[:merge_request].merge(author_id_of_changes: current_user.id)) | |
| 63 | - @merge_request.reload_code | |
| 64 | - @merge_request.mark_as_unchecked | |
| 65 | - redirect_to [@project, @merge_request], notice: 'Merge request was successfully updated.' | |
| 66 | - else | |
| 67 | - render "edit" | |
| 68 | - end | |
| 69 | - end | |
| 70 | - | |
| 71 | - def automerge_check | |
| 72 | - if @merge_request.unchecked? | |
| 73 | - @merge_request.check_if_can_be_merged | |
| 74 | - end | |
| 75 | - render json: {merge_status: @merge_request.merge_status_name} | |
| 76 | - rescue Gitlab::SatelliteNotExistError | |
| 77 | - render json: {merge_status: :no_satellite} | |
| 78 | - end | |
| 79 | - | |
| 80 | - def automerge | |
| 81 | - return access_denied! unless allowed_to_merge? | |
| 82 | - | |
| 83 | - if @merge_request.opened? && @merge_request.can_be_merged? | |
| 84 | - @merge_request.should_remove_source_branch = params[:should_remove_source_branch] | |
| 85 | - @merge_request.automerge!(current_user) | |
| 86 | - @status = true | |
| 87 | - else | |
| 88 | - @status = false | |
| 89 | - end | |
| 90 | - end | |
| 91 | - | |
| 92 | - def branch_from | |
| 93 | - @commit = @repository.commit(params[:ref]) | |
| 94 | - end | |
| 95 | - | |
| 96 | - def branch_to | |
| 97 | - @commit = @repository.commit(params[:ref]) | |
| 98 | - end | |
| 99 | - | |
| 100 | - def ci_status | |
| 101 | - status = project.gitlab_ci_service.commit_status(merge_request.last_commit.sha) | |
| 102 | - response = { status: status } | |
| 103 | - | |
| 104 | - render json: response | |
| 105 | - end | |
| 106 | - | |
| 107 | - protected | |
| 108 | - | |
| 109 | - def merge_request | |
| 110 | - @merge_request ||= @project.merge_requests.find(params[:id]) | |
| 111 | - end | |
| 112 | - | |
| 113 | - def authorize_modify_merge_request! | |
| 114 | - return render_404 unless can?(current_user, :modify_merge_request, @merge_request) | |
| 115 | - end | |
| 116 | - | |
| 117 | - def authorize_admin_merge_request! | |
| 118 | - return render_404 unless can?(current_user, :admin_merge_request, @merge_request) | |
| 119 | - end | |
| 120 | - | |
| 121 | - def module_enabled | |
| 122 | - return render_404 unless @project.merge_requests_enabled | |
| 123 | - end | |
| 124 | - | |
| 125 | - def validates_merge_request | |
| 126 | - # Show git not found page if target branch doesn't exist | |
| 127 | - return invalid_mr unless @project.repository.branch_names.include?(@merge_request.target_branch) | |
| 128 | - | |
| 129 | - # Show git not found page if source branch doesn't exist | |
| 130 | - # and there is no saved commits between source & target branch | |
| 131 | - return invalid_mr if !@project.repository.branch_names.include?(@merge_request.source_branch) && @merge_request.commits.blank? | |
| 132 | - end | |
| 133 | - | |
| 134 | - def define_show_vars | |
| 135 | - # Build a note object for comment form | |
| 136 | - @note = @project.notes.new(noteable: @merge_request) | |
| 137 | - | |
| 138 | - # Get commits from repository | |
| 139 | - # or from cache if already merged | |
| 140 | - @commits = @merge_request.commits | |
| 141 | - | |
| 142 | - @allowed_to_merge = allowed_to_merge? | |
| 143 | - @show_merge_controls = @merge_request.opened? && @commits.any? && @allowed_to_merge | |
| 144 | - | |
| 145 | - @target_type = :merge_request | |
| 146 | - @target_id = @merge_request.id | |
| 147 | - end | |
| 148 | - | |
| 149 | - def allowed_to_merge? | |
| 150 | - action = if project.protected_branch?(@merge_request.target_branch) | |
| 151 | - :push_code_to_protected_branches | |
| 152 | - else | |
| 153 | - :push_code | |
| 154 | - end | |
| 155 | - | |
| 156 | - can?(current_user, action, @project) | |
| 157 | - end | |
| 158 | - | |
| 159 | - def invalid_mr | |
| 160 | - # Render special view for MR with removed source or target branch | |
| 161 | - render 'invalid' | |
| 162 | - end | |
| 163 | -end |
app/controllers/milestones_controller.rb
| ... | ... | @@ -1,94 +0,0 @@ |
| 1 | -class MilestonesController < ProjectResourceController | |
| 2 | - before_filter :module_enabled | |
| 3 | - before_filter :milestone, only: [:edit, :update, :destroy, :show] | |
| 4 | - | |
| 5 | - # Allow read any milestone | |
| 6 | - before_filter :authorize_read_milestone! | |
| 7 | - | |
| 8 | - # Allow admin milestone | |
| 9 | - before_filter :authorize_admin_milestone!, except: [:index, :show] | |
| 10 | - | |
| 11 | - respond_to :html | |
| 12 | - | |
| 13 | - def index | |
| 14 | - @milestones = case params[:f] | |
| 15 | - when 'all'; @project.milestones.order("state, due_date DESC") | |
| 16 | - when 'closed'; @project.milestones.closed.order("due_date DESC") | |
| 17 | - else @project.milestones.active.order("due_date DESC") | |
| 18 | - end | |
| 19 | - | |
| 20 | - @milestones = @milestones.includes(:project) | |
| 21 | - @milestones = @milestones.page(params[:page]).per(20) | |
| 22 | - end | |
| 23 | - | |
| 24 | - def new | |
| 25 | - @milestone = @project.milestones.new | |
| 26 | - respond_with(@milestone) | |
| 27 | - end | |
| 28 | - | |
| 29 | - def edit | |
| 30 | - respond_with(@milestone) | |
| 31 | - end | |
| 32 | - | |
| 33 | - def show | |
| 34 | - @issues = @milestone.issues | |
| 35 | - @users = @milestone.participants.uniq | |
| 36 | - @merge_requests = @milestone.merge_requests | |
| 37 | - | |
| 38 | - respond_to do |format| | |
| 39 | - format.html | |
| 40 | - format.js | |
| 41 | - end | |
| 42 | - end | |
| 43 | - | |
| 44 | - def create | |
| 45 | - @milestone = @project.milestones.new(params[:milestone]) | |
| 46 | - @milestone.author_id_of_changes = current_user.id | |
| 47 | - | |
| 48 | - if @milestone.save | |
| 49 | - redirect_to project_milestone_path(@project, @milestone) | |
| 50 | - else | |
| 51 | - render "new" | |
| 52 | - end | |
| 53 | - end | |
| 54 | - | |
| 55 | - def update | |
| 56 | - @milestone.update_attributes(params[:milestone].merge(author_id_of_changes: current_user.id)) | |
| 57 | - | |
| 58 | - respond_to do |format| | |
| 59 | - format.js | |
| 60 | - format.html do | |
| 61 | - if @milestone.valid? | |
| 62 | - redirect_to [@project, @milestone] | |
| 63 | - else | |
| 64 | - render :edit | |
| 65 | - end | |
| 66 | - end | |
| 67 | - end | |
| 68 | - end | |
| 69 | - | |
| 70 | - def destroy | |
| 71 | - return access_denied! unless can?(current_user, :admin_milestone, @milestone) | |
| 72 | - | |
| 73 | - @milestone.destroy | |
| 74 | - | |
| 75 | - respond_to do |format| | |
| 76 | - format.html { redirect_to project_milestones_path } | |
| 77 | - format.js { render nothing: true } | |
| 78 | - end | |
| 79 | - end | |
| 80 | - | |
| 81 | - protected | |
| 82 | - | |
| 83 | - def milestone | |
| 84 | - @milestone ||= @project.milestones.find(params[:id]) | |
| 85 | - end | |
| 86 | - | |
| 87 | - def authorize_admin_milestone! | |
| 88 | - return render_404 unless can?(current_user, :admin_milestone, @project) | |
| 89 | - end | |
| 90 | - | |
| 91 | - def module_enabled | |
| 92 | - return render_404 unless @project.issues_enabled | |
| 93 | - end | |
| 94 | -end |
app/controllers/network_controller.rb
| ... | ... | @@ -1,23 +0,0 @@ |
| 1 | -class NetworkController < ProjectResourceController | |
| 2 | - include ExtractsPath | |
| 3 | - include ApplicationHelper | |
| 4 | - | |
| 5 | - # Authorize | |
| 6 | - before_filter :authorize_read_project! | |
| 7 | - before_filter :authorize_code_access! | |
| 8 | - before_filter :require_non_empty_project | |
| 9 | - | |
| 10 | - def show | |
| 11 | - if @options[:q] | |
| 12 | - @commit = @project.repository.commit(@options[:q]) || @commit | |
| 13 | - end | |
| 14 | - | |
| 15 | - respond_to do |format| | |
| 16 | - format.html | |
| 17 | - | |
| 18 | - format.json do | |
| 19 | - @graph = Network::Graph.new(project, @ref, @commit, @options[:filter_ref]) | |
| 20 | - end | |
| 21 | - end | |
| 22 | - end | |
| 23 | -end |
app/controllers/notes_controller.rb
| ... | ... | @@ -1,76 +0,0 @@ |
| 1 | -class NotesController < ProjectResourceController | |
| 2 | - # Authorize | |
| 3 | - before_filter :authorize_read_note! | |
| 4 | - before_filter :authorize_write_note!, only: [:create] | |
| 5 | - | |
| 6 | - respond_to :js | |
| 7 | - | |
| 8 | - def index | |
| 9 | - @notes = Notes::LoadContext.new(project, current_user, params).execute | |
| 10 | - @target_type = params[:target_type].camelize | |
| 11 | - @target_id = params[:target_id] | |
| 12 | - | |
| 13 | - if params[:target_type] == "merge_request" | |
| 14 | - @discussions = discussions_from_notes | |
| 15 | - end | |
| 16 | - | |
| 17 | - respond_with(@notes) | |
| 18 | - end | |
| 19 | - | |
| 20 | - def create | |
| 21 | - @note = Notes::CreateContext.new(project, current_user, params).execute | |
| 22 | - @target_type = params[:target_type].camelize | |
| 23 | - @target_id = params[:target_id] | |
| 24 | - | |
| 25 | - respond_to do |format| | |
| 26 | - format.html {redirect_to :back} | |
| 27 | - format.js | |
| 28 | - end | |
| 29 | - end | |
| 30 | - | |
| 31 | - def destroy | |
| 32 | - @note = @project.notes.find(params[:id]) | |
| 33 | - return access_denied! unless can?(current_user, :admin_note, @note) | |
| 34 | - @note.destroy | |
| 35 | - | |
| 36 | - respond_to do |format| | |
| 37 | - format.js { render nothing: true } | |
| 38 | - end | |
| 39 | - end | |
| 40 | - | |
| 41 | - def preview | |
| 42 | - render text: view_context.markdown(params[:note]) | |
| 43 | - end | |
| 44 | - | |
| 45 | - protected | |
| 46 | - | |
| 47 | - def discussion_notes_for(note) | |
| 48 | - @notes.select do |other_note| | |
| 49 | - note.discussion_id == other_note.discussion_id | |
| 50 | - end | |
| 51 | - end | |
| 52 | - | |
| 53 | - def discussions_from_notes | |
| 54 | - discussion_ids = [] | |
| 55 | - discussions = [] | |
| 56 | - | |
| 57 | - @notes.each do |note| | |
| 58 | - next if discussion_ids.include?(note.discussion_id) | |
| 59 | - | |
| 60 | - # don't group notes for the main target | |
| 61 | - if note_for_main_target?(note) | |
| 62 | - discussions << [note] | |
| 63 | - else | |
| 64 | - discussions << discussion_notes_for(note) | |
| 65 | - discussion_ids << note.discussion_id | |
| 66 | - end | |
| 67 | - end | |
| 68 | - | |
| 69 | - discussions | |
| 70 | - end | |
| 71 | - | |
| 72 | - # Helps to distinguish e.g. commit notes in mr notes list | |
| 73 | - def note_for_main_target?(note) | |
| 74 | - (@target_type.camelize == note.noteable_type && !note.for_diff_line?) | |
| 75 | - end | |
| 76 | -end |
app/controllers/project_resource_controller.rb
app/controllers/projects/application_controller.rb
| ... | ... | @@ -0,0 +1,14 @@ |
| 1 | +# Controller for viewing a file's blame | |
| 2 | +class Projects::BlameController < Projects::ApplicationController | |
| 3 | + include ExtractsPath | |
| 4 | + | |
| 5 | + # Authorize | |
| 6 | + before_filter :authorize_read_project! | |
| 7 | + before_filter :authorize_code_access! | |
| 8 | + before_filter :require_non_empty_project | |
| 9 | + | |
| 10 | + def show | |
| 11 | + @blob = Gitlab::Git::Blob.new(@repository, @commit.id, @ref, @path) | |
| 12 | + @blame = Gitlab::Git::Blame.new(project.repository, @commit.id, @path) | |
| 13 | + end | |
| 14 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,13 @@ |
| 1 | +# Controller for viewing a file's blame | |
| 2 | +class Projects::BlobController < Projects::ApplicationController | |
| 3 | + include ExtractsPath | |
| 4 | + | |
| 5 | + # Authorize | |
| 6 | + before_filter :authorize_read_project! | |
| 7 | + before_filter :authorize_code_access! | |
| 8 | + before_filter :require_non_empty_project | |
| 9 | + | |
| 10 | + def show | |
| 11 | + @blob = Gitlab::Git::Blob.new(@repository, @commit.id, @ref, @path) | |
| 12 | + end | |
| 13 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,43 @@ |
| 1 | +# Controller for a specific Commit | |
| 2 | +# | |
| 3 | +# Not to be confused with CommitsController, plural. | |
| 4 | +class Projects::CommitController < Projects::ApplicationController | |
| 5 | + # Authorize | |
| 6 | + before_filter :authorize_read_project! | |
| 7 | + before_filter :authorize_code_access! | |
| 8 | + before_filter :require_non_empty_project | |
| 9 | + | |
| 10 | + def show | |
| 11 | + result = CommitLoadContext.new(project, current_user, params).execute | |
| 12 | + | |
| 13 | + @commit = result[:commit] | |
| 14 | + | |
| 15 | + if @commit.nil? | |
| 16 | + git_not_found! | |
| 17 | + return | |
| 18 | + end | |
| 19 | + | |
| 20 | + @suppress_diff = result[:suppress_diff] | |
| 21 | + | |
| 22 | + @note = result[:note] | |
| 23 | + @line_notes = result[:line_notes] | |
| 24 | + @notes_count = result[:notes_count] | |
| 25 | + @target_type = :commit | |
| 26 | + @target_id = @commit.id | |
| 27 | + | |
| 28 | + @comments_allowed = @reply_allowed = true | |
| 29 | + @comments_target = { noteable_type: 'Commit', | |
| 30 | + commit_id: @commit.id } | |
| 31 | + | |
| 32 | + respond_to do |format| | |
| 33 | + format.html do | |
| 34 | + if result[:status] == :huge_commit | |
| 35 | + render "huge_commit" and return | |
| 36 | + end | |
| 37 | + end | |
| 38 | + | |
| 39 | + format.diff { render text: @commit.to_diff } | |
| 40 | + format.patch { render text: @commit.to_patch } | |
| 41 | + end | |
| 42 | + end | |
| 43 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,23 @@ |
| 1 | +require "base64" | |
| 2 | + | |
| 3 | +class Projects::CommitsController < Projects::ApplicationController | |
| 4 | + include ExtractsPath | |
| 5 | + | |
| 6 | + # Authorize | |
| 7 | + before_filter :authorize_read_project! | |
| 8 | + before_filter :authorize_code_access! | |
| 9 | + before_filter :require_non_empty_project | |
| 10 | + | |
| 11 | + def show | |
| 12 | + @repo = @project.repository | |
| 13 | + @limit, @offset = (params[:limit] || 40), (params[:offset] || 0) | |
| 14 | + | |
| 15 | + @commits = @repo.commits(@ref, @path, @limit, @offset) | |
| 16 | + | |
| 17 | + respond_to do |format| | |
| 18 | + format.html # index.html.erb | |
| 19 | + format.js | |
| 20 | + format.atom { render layout: false } | |
| 21 | + end | |
| 22 | + end | |
| 23 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,23 @@ |
| 1 | +class Projects::CompareController < Projects::ApplicationController | |
| 2 | + # Authorize | |
| 3 | + before_filter :authorize_read_project! | |
| 4 | + before_filter :authorize_code_access! | |
| 5 | + before_filter :require_non_empty_project | |
| 6 | + | |
| 7 | + def index | |
| 8 | + end | |
| 9 | + | |
| 10 | + def show | |
| 11 | + compare = Gitlab::Git::Compare.new(project.repository, params[:from], params[:to]) | |
| 12 | + | |
| 13 | + @commits = compare.commits | |
| 14 | + @commit = compare.commit | |
| 15 | + @diffs = compare.diffs | |
| 16 | + @refs_are_same = compare.same | |
| 17 | + @line_notes = [] | |
| 18 | + end | |
| 19 | + | |
| 20 | + def create | |
| 21 | + redirect_to project_compare_path(@project, params[:from], params[:to]) | |
| 22 | + end | |
| 23 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,61 @@ |
| 1 | +class Projects::DeployKeysController < Projects::ApplicationController | |
| 2 | + respond_to :html | |
| 3 | + | |
| 4 | + # Authorize | |
| 5 | + before_filter :authorize_admin_project! | |
| 6 | + | |
| 7 | + layout "project_settings" | |
| 8 | + | |
| 9 | + def index | |
| 10 | + @enabled_keys = @project.deploy_keys.all | |
| 11 | + @available_keys = available_keys - @enabled_keys | |
| 12 | + end | |
| 13 | + | |
| 14 | + def show | |
| 15 | + @key = @project.deploy_keys.find(params[:id]) | |
| 16 | + end | |
| 17 | + | |
| 18 | + def new | |
| 19 | + @key = @project.deploy_keys.new | |
| 20 | + | |
| 21 | + respond_with(@key) | |
| 22 | + end | |
| 23 | + | |
| 24 | + def create | |
| 25 | + @key = DeployKey.new(params[:deploy_key]) | |
| 26 | + | |
| 27 | + if @key.valid? && @project.deploy_keys << @key | |
| 28 | + redirect_to project_deploy_keys_path(@project) | |
| 29 | + else | |
| 30 | + render "new" | |
| 31 | + end | |
| 32 | + end | |
| 33 | + | |
| 34 | + def destroy | |
| 35 | + @key = @project.deploy_keys.find(params[:id]) | |
| 36 | + @key.destroy | |
| 37 | + | |
| 38 | + respond_to do |format| | |
| 39 | + format.html { redirect_to project_deploy_keys_url } | |
| 40 | + format.js { render nothing: true } | |
| 41 | + end | |
| 42 | + end | |
| 43 | + | |
| 44 | + def enable | |
| 45 | + project.deploy_keys << available_keys.find(params[:id]) | |
| 46 | + | |
| 47 | + redirect_to project_deploy_keys_path(@project) | |
| 48 | + end | |
| 49 | + | |
| 50 | + def disable | |
| 51 | + @project.deploy_keys_projects.where(deploy_key_id: params[:id]).last.destroy | |
| 52 | + | |
| 53 | + redirect_to project_deploy_keys_path(@project) | |
| 54 | + end | |
| 55 | + | |
| 56 | + protected | |
| 57 | + | |
| 58 | + def available_keys | |
| 59 | + @available_keys ||= current_user.accessible_deploy_keys | |
| 60 | + end | |
| 61 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,49 @@ |
| 1 | +# Controller for edit a repository's file | |
| 2 | +class Projects::EditTreeController < Projects::ApplicationController | |
| 3 | + include ExtractsPath | |
| 4 | + | |
| 5 | + # Authorize | |
| 6 | + before_filter :authorize_read_project! | |
| 7 | + before_filter :authorize_code_access! | |
| 8 | + before_filter :require_non_empty_project | |
| 9 | + | |
| 10 | + before_filter :edit_requirements, only: [:show, :update] | |
| 11 | + | |
| 12 | + def show | |
| 13 | + @last_commit = @project.repository.last_commit_for(@ref, @path).sha | |
| 14 | + end | |
| 15 | + | |
| 16 | + def update | |
| 17 | + edit_file_action = Gitlab::Satellite::EditFileAction.new(current_user, @project, @ref, @path) | |
| 18 | + updated_successfully = edit_file_action.commit!( | |
| 19 | + params[:content], | |
| 20 | + params[:commit_message], | |
| 21 | + params[:last_commit] | |
| 22 | + ) | |
| 23 | + | |
| 24 | + if updated_successfully | |
| 25 | + redirect_to project_blob_path(@project, @id), notice: "Your changes have been successfully commited" | |
| 26 | + else | |
| 27 | + flash[:notice] = "Your changes could not be commited, because the file has been changed" | |
| 28 | + render :show | |
| 29 | + end | |
| 30 | + end | |
| 31 | + | |
| 32 | + private | |
| 33 | + | |
| 34 | + def edit_requirements | |
| 35 | + @blob = Gitlab::Git::Blob.new(@repository, @commit.id, @ref, @path) | |
| 36 | + | |
| 37 | + unless @blob.exists? && @blob.text? | |
| 38 | + redirect_to project_blob_path(@project, @id), notice: "You can only edit text files" | |
| 39 | + end | |
| 40 | + | |
| 41 | + allowed = if project.protected_branch? @ref | |
| 42 | + can?(current_user, :push_code_to_protected_branches, project) | |
| 43 | + else | |
| 44 | + can?(current_user, :push_code, project) | |
| 45 | + end | |
| 46 | + | |
| 47 | + return access_denied! unless allowed | |
| 48 | + end | |
| 49 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,17 @@ |
| 1 | +class Projects::GraphsController < Projects::ApplicationController | |
| 2 | + # Authorize | |
| 3 | + before_filter :authorize_read_project! | |
| 4 | + before_filter :authorize_code_access! | |
| 5 | + before_filter :require_non_empty_project | |
| 6 | + | |
| 7 | + def show | |
| 8 | + respond_to do |format| | |
| 9 | + format.html | |
| 10 | + format.js do | |
| 11 | + @repo = @project.repository | |
| 12 | + @stats = Gitlab::Git::GitStats.new(@repo.raw, @repo.root_ref) | |
| 13 | + @log = @stats.parsed_log.to_json rescue [] | |
| 14 | + end | |
| 15 | + end | |
| 16 | + end | |
| 17 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,39 @@ |
| 1 | +class Projects::HooksController < Projects::ApplicationController | |
| 2 | + # Authorize | |
| 3 | + before_filter :authorize_read_project! | |
| 4 | + before_filter :authorize_admin_project!, only: [:new, :create, :destroy] | |
| 5 | + | |
| 6 | + respond_to :html | |
| 7 | + | |
| 8 | + layout "project_settings" | |
| 9 | + | |
| 10 | + def index | |
| 11 | + @hooks = @project.hooks.all | |
| 12 | + @hook = ProjectHook.new | |
| 13 | + end | |
| 14 | + | |
| 15 | + def create | |
| 16 | + @hook = @project.hooks.new(params[:hook]) | |
| 17 | + @hook.save | |
| 18 | + | |
| 19 | + if @hook.valid? | |
| 20 | + redirect_to project_hooks_path(@project) | |
| 21 | + else | |
| 22 | + @hooks = @project.hooks.all | |
| 23 | + render :index | |
| 24 | + end | |
| 25 | + end | |
| 26 | + | |
| 27 | + def test | |
| 28 | + TestHookContext.new(project, current_user, params).execute | |
| 29 | + | |
| 30 | + redirect_to :back | |
| 31 | + end | |
| 32 | + | |
| 33 | + def destroy | |
| 34 | + @hook = @project.hooks.find(params[:id]) | |
| 35 | + @hook.destroy | |
| 36 | + | |
| 37 | + redirect_to project_hooks_path(@project) | |
| 38 | + end | |
| 39 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,114 @@ |
| 1 | +class Projects::IssuesController < Projects::ApplicationController | |
| 2 | + before_filter :module_enabled | |
| 3 | + before_filter :issue, only: [:edit, :update, :show] | |
| 4 | + | |
| 5 | + # Allow read any issue | |
| 6 | + before_filter :authorize_read_issue! | |
| 7 | + | |
| 8 | + # Allow write(create) issue | |
| 9 | + before_filter :authorize_write_issue!, only: [:new, :create] | |
| 10 | + | |
| 11 | + # Allow modify issue | |
| 12 | + before_filter :authorize_modify_issue!, only: [:edit, :update] | |
| 13 | + | |
| 14 | + respond_to :js, :html | |
| 15 | + | |
| 16 | + def index | |
| 17 | + terms = params['issue_search'] | |
| 18 | + | |
| 19 | + @issues = issues_filtered | |
| 20 | + @issues = @issues.where("title LIKE ?", "%#{terms}%") if terms.present? | |
| 21 | + @issues = @issues.page(params[:page]).per(20) | |
| 22 | + | |
| 23 | + | |
| 24 | + assignee_id, milestone_id = params[:assignee_id], params[:milestone_id] | |
| 25 | + | |
| 26 | + @assignee = @project.team.find(assignee_id) if assignee_id.present? && !assignee_id.to_i.zero? | |
| 27 | + @milestone = @project.milestones.find(milestone_id) if milestone_id.present? && !milestone_id.to_i.zero? | |
| 28 | + | |
| 29 | + respond_to do |format| | |
| 30 | + format.html # index.html.erb | |
| 31 | + format.js | |
| 32 | + format.atom { render layout: false } | |
| 33 | + end | |
| 34 | + end | |
| 35 | + | |
| 36 | + def new | |
| 37 | + @issue = @project.issues.new(params[:issue]) | |
| 38 | + respond_with(@issue) | |
| 39 | + end | |
| 40 | + | |
| 41 | + def edit | |
| 42 | + respond_with(@issue) | |
| 43 | + end | |
| 44 | + | |
| 45 | + def show | |
| 46 | + @note = @project.notes.new(noteable: @issue) | |
| 47 | + @target_type = :issue | |
| 48 | + @target_id = @issue.id | |
| 49 | + | |
| 50 | + respond_to do |format| | |
| 51 | + format.html | |
| 52 | + format.js | |
| 53 | + end | |
| 54 | + end | |
| 55 | + | |
| 56 | + def create | |
| 57 | + @issue = @project.issues.new(params[:issue]) | |
| 58 | + @issue.author = current_user | |
| 59 | + @issue.save | |
| 60 | + | |
| 61 | + respond_to do |format| | |
| 62 | + format.html do | |
| 63 | + if @issue.valid? | |
| 64 | + redirect_to project_issue_path(@project, @issue) | |
| 65 | + else | |
| 66 | + render :new | |
| 67 | + end | |
| 68 | + end | |
| 69 | + format.js | |
| 70 | + end | |
| 71 | + end | |
| 72 | + | |
| 73 | + def update | |
| 74 | + @issue.update_attributes(params[:issue].merge(author_id_of_changes: current_user.id)) | |
| 75 | + | |
| 76 | + respond_to do |format| | |
| 77 | + format.js | |
| 78 | + format.html do | |
| 79 | + if @issue.valid? | |
| 80 | + redirect_to [@project, @issue] | |
| 81 | + else | |
| 82 | + render :edit | |
| 83 | + end | |
| 84 | + end | |
| 85 | + end | |
| 86 | + end | |
| 87 | + | |
| 88 | + def bulk_update | |
| 89 | + result = Issues::BulkUpdateContext.new(project, current_user, params).execute | |
| 90 | + redirect_to :back, notice: "#{result[:count]} issues updated" | |
| 91 | + end | |
| 92 | + | |
| 93 | + protected | |
| 94 | + | |
| 95 | + def issue | |
| 96 | + @issue ||= @project.issues.find(params[:id]) | |
| 97 | + end | |
| 98 | + | |
| 99 | + def authorize_modify_issue! | |
| 100 | + return render_404 unless can?(current_user, :modify_issue, @issue) | |
| 101 | + end | |
| 102 | + | |
| 103 | + def authorize_admin_issue! | |
| 104 | + return render_404 unless can?(current_user, :admin_issue, @issue) | |
| 105 | + end | |
| 106 | + | |
| 107 | + def module_enabled | |
| 108 | + return render_404 unless @project.issues_enabled | |
| 109 | + end | |
| 110 | + | |
| 111 | + def issues_filtered | |
| 112 | + @issues = Issues::ListContext.new(project, current_user, params).execute | |
| 113 | + end | |
| 114 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,24 @@ |
| 1 | +class Projects::LabelsController < Projects::ApplicationController | |
| 2 | + before_filter :module_enabled | |
| 3 | + | |
| 4 | + # Allow read any issue | |
| 5 | + before_filter :authorize_read_issue! | |
| 6 | + | |
| 7 | + respond_to :js, :html | |
| 8 | + | |
| 9 | + def index | |
| 10 | + @labels = @project.issues_labels | |
| 11 | + end | |
| 12 | + | |
| 13 | + def generate | |
| 14 | + Gitlab::IssuesLabels.generate(@project) | |
| 15 | + | |
| 16 | + redirect_to project_labels_path(@project) | |
| 17 | + end | |
| 18 | + | |
| 19 | + protected | |
| 20 | + | |
| 21 | + def module_enabled | |
| 22 | + return render_404 unless @project.issues_enabled | |
| 23 | + end | |
| 24 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,163 @@ |
| 1 | +require 'gitlab/satellite/satellite' | |
| 2 | + | |
| 3 | +class Projects::MergeRequestsController < Projects::ApplicationController | |
| 4 | + before_filter :module_enabled | |
| 5 | + before_filter :merge_request, only: [:edit, :update, :show, :commits, :diffs, :automerge, :automerge_check, :ci_status] | |
| 6 | + before_filter :validates_merge_request, only: [:show, :diffs] | |
| 7 | + before_filter :define_show_vars, only: [:show, :diffs] | |
| 8 | + | |
| 9 | + # Allow read any merge_request | |
| 10 | + before_filter :authorize_read_merge_request! | |
| 11 | + | |
| 12 | + # Allow write(create) merge_request | |
| 13 | + before_filter :authorize_write_merge_request!, only: [:new, :create] | |
| 14 | + | |
| 15 | + # Allow modify merge_request | |
| 16 | + before_filter :authorize_modify_merge_request!, only: [:close, :edit, :update, :sort] | |
| 17 | + | |
| 18 | + def index | |
| 19 | + @merge_requests = MergeRequestsLoadContext.new(project, current_user, params).execute | |
| 20 | + end | |
| 21 | + | |
| 22 | + def show | |
| 23 | + respond_to do |format| | |
| 24 | + format.html | |
| 25 | + format.js | |
| 26 | + | |
| 27 | + format.diff { render text: @merge_request.to_diff } | |
| 28 | + format.patch { render text: @merge_request.to_patch } | |
| 29 | + end | |
| 30 | + end | |
| 31 | + | |
| 32 | + def diffs | |
| 33 | + @diffs = @merge_request.diffs | |
| 34 | + @commit = @merge_request.last_commit | |
| 35 | + | |
| 36 | + @comments_allowed = @reply_allowed = true | |
| 37 | + @comments_target = { noteable_type: 'MergeRequest', | |
| 38 | + noteable_id: @merge_request.id } | |
| 39 | + @line_notes = @merge_request.notes.where("line_code is not null") | |
| 40 | + end | |
| 41 | + | |
| 42 | + def new | |
| 43 | + @merge_request = @project.merge_requests.new(params[:merge_request]) | |
| 44 | + end | |
| 45 | + | |
| 46 | + def edit | |
| 47 | + end | |
| 48 | + | |
| 49 | + def create | |
| 50 | + @merge_request = @project.merge_requests.new(params[:merge_request]) | |
| 51 | + @merge_request.author = current_user | |
| 52 | + | |
| 53 | + if @merge_request.save | |
| 54 | + @merge_request.reload_code | |
| 55 | + redirect_to [@project, @merge_request], notice: 'Merge request was successfully created.' | |
| 56 | + else | |
| 57 | + render "new" | |
| 58 | + end | |
| 59 | + end | |
| 60 | + | |
| 61 | + def update | |
| 62 | + if @merge_request.update_attributes(params[:merge_request].merge(author_id_of_changes: current_user.id)) | |
| 63 | + @merge_request.reload_code | |
| 64 | + @merge_request.mark_as_unchecked | |
| 65 | + redirect_to [@project, @merge_request], notice: 'Merge request was successfully updated.' | |
| 66 | + else | |
| 67 | + render "edit" | |
| 68 | + end | |
| 69 | + end | |
| 70 | + | |
| 71 | + def automerge_check | |
| 72 | + if @merge_request.unchecked? | |
| 73 | + @merge_request.check_if_can_be_merged | |
| 74 | + end | |
| 75 | + render json: {merge_status: @merge_request.merge_status_name} | |
| 76 | + rescue Gitlab::SatelliteNotExistError | |
| 77 | + render json: {merge_status: :no_satellite} | |
| 78 | + end | |
| 79 | + | |
| 80 | + def automerge | |
| 81 | + return access_denied! unless allowed_to_merge? | |
| 82 | + | |
| 83 | + if @merge_request.opened? && @merge_request.can_be_merged? | |
| 84 | + @merge_request.should_remove_source_branch = params[:should_remove_source_branch] | |
| 85 | + @merge_request.automerge!(current_user) | |
| 86 | + @status = true | |
| 87 | + else | |
| 88 | + @status = false | |
| 89 | + end | |
| 90 | + end | |
| 91 | + | |
| 92 | + def branch_from | |
| 93 | + @commit = @repository.commit(params[:ref]) | |
| 94 | + end | |
| 95 | + | |
| 96 | + def branch_to | |
| 97 | + @commit = @repository.commit(params[:ref]) | |
| 98 | + end | |
| 99 | + | |
| 100 | + def ci_status | |
| 101 | + status = project.gitlab_ci_service.commit_status(merge_request.last_commit.sha) | |
| 102 | + response = { status: status } | |
| 103 | + | |
| 104 | + render json: response | |
| 105 | + end | |
| 106 | + | |
| 107 | + protected | |
| 108 | + | |
| 109 | + def merge_request | |
| 110 | + @merge_request ||= @project.merge_requests.find(params[:id]) | |
| 111 | + end | |
| 112 | + | |
| 113 | + def authorize_modify_merge_request! | |
| 114 | + return render_404 unless can?(current_user, :modify_merge_request, @merge_request) | |
| 115 | + end | |
| 116 | + | |
| 117 | + def authorize_admin_merge_request! | |
| 118 | + return render_404 unless can?(current_user, :admin_merge_request, @merge_request) | |
| 119 | + end | |
| 120 | + | |
| 121 | + def module_enabled | |
| 122 | + return render_404 unless @project.merge_requests_enabled | |
| 123 | + end | |
| 124 | + | |
| 125 | + def validates_merge_request | |
| 126 | + # Show git not found page if target branch doesn't exist | |
| 127 | + return invalid_mr unless @project.repository.branch_names.include?(@merge_request.target_branch) | |
| 128 | + | |
| 129 | + # Show git not found page if source branch doesn't exist | |
| 130 | + # and there is no saved commits between source & target branch | |
| 131 | + return invalid_mr if !@project.repository.branch_names.include?(@merge_request.source_branch) && @merge_request.commits.blank? | |
| 132 | + end | |
| 133 | + | |
| 134 | + def define_show_vars | |
| 135 | + # Build a note object for comment form | |
| 136 | + @note = @project.notes.new(noteable: @merge_request) | |
| 137 | + | |
| 138 | + # Get commits from repository | |
| 139 | + # or from cache if already merged | |
| 140 | + @commits = @merge_request.commits | |
| 141 | + | |
| 142 | + @allowed_to_merge = allowed_to_merge? | |
| 143 | + @show_merge_controls = @merge_request.opened? && @commits.any? && @allowed_to_merge | |
| 144 | + | |
| 145 | + @target_type = :merge_request | |
| 146 | + @target_id = @merge_request.id | |
| 147 | + end | |
| 148 | + | |
| 149 | + def allowed_to_merge? | |
| 150 | + action = if project.protected_branch?(@merge_request.target_branch) | |
| 151 | + :push_code_to_protected_branches | |
| 152 | + else | |
| 153 | + :push_code | |
| 154 | + end | |
| 155 | + | |
| 156 | + can?(current_user, action, @project) | |
| 157 | + end | |
| 158 | + | |
| 159 | + def invalid_mr | |
| 160 | + # Render special view for MR with removed source or target branch | |
| 161 | + render 'invalid' | |
| 162 | + end | |
| 163 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,94 @@ |
| 1 | +class Projects::MilestonesController < Projects::ApplicationController | |
| 2 | + before_filter :module_enabled | |
| 3 | + before_filter :milestone, only: [:edit, :update, :destroy, :show] | |
| 4 | + | |
| 5 | + # Allow read any milestone | |
| 6 | + before_filter :authorize_read_milestone! | |
| 7 | + | |
| 8 | + # Allow admin milestone | |
| 9 | + before_filter :authorize_admin_milestone!, except: [:index, :show] | |
| 10 | + | |
| 11 | + respond_to :html | |
| 12 | + | |
| 13 | + def index | |
| 14 | + @milestones = case params[:f] | |
| 15 | + when 'all'; @project.milestones.order("state, due_date DESC") | |
| 16 | + when 'closed'; @project.milestones.closed.order("due_date DESC") | |
| 17 | + else @project.milestones.active.order("due_date DESC") | |
| 18 | + end | |
| 19 | + | |
| 20 | + @milestones = @milestones.includes(:project) | |
| 21 | + @milestones = @milestones.page(params[:page]).per(20) | |
| 22 | + end | |
| 23 | + | |
| 24 | + def new | |
| 25 | + @milestone = @project.milestones.new | |
| 26 | + respond_with(@milestone) | |
| 27 | + end | |
| 28 | + | |
| 29 | + def edit | |
| 30 | + respond_with(@milestone) | |
| 31 | + end | |
| 32 | + | |
| 33 | + def show | |
| 34 | + @issues = @milestone.issues | |
| 35 | + @users = @milestone.participants.uniq | |
| 36 | + @merge_requests = @milestone.merge_requests | |
| 37 | + | |
| 38 | + respond_to do |format| | |
| 39 | + format.html | |
| 40 | + format.js | |
| 41 | + end | |
| 42 | + end | |
| 43 | + | |
| 44 | + def create | |
| 45 | + @milestone = @project.milestones.new(params[:milestone]) | |
| 46 | + @milestone.author_id_of_changes = current_user.id | |
| 47 | + | |
| 48 | + if @milestone.save | |
| 49 | + redirect_to project_milestone_path(@project, @milestone) | |
| 50 | + else | |
| 51 | + render "new" | |
| 52 | + end | |
| 53 | + end | |
| 54 | + | |
| 55 | + def update | |
| 56 | + @milestone.update_attributes(params[:milestone].merge(author_id_of_changes: current_user.id)) | |
| 57 | + | |
| 58 | + respond_to do |format| | |
| 59 | + format.js | |
| 60 | + format.html do | |
| 61 | + if @milestone.valid? | |
| 62 | + redirect_to [@project, @milestone] | |
| 63 | + else | |
| 64 | + render :edit | |
| 65 | + end | |
| 66 | + end | |
| 67 | + end | |
| 68 | + end | |
| 69 | + | |
| 70 | + def destroy | |
| 71 | + return access_denied! unless can?(current_user, :admin_milestone, @milestone) | |
| 72 | + | |
| 73 | + @milestone.destroy | |
| 74 | + | |
| 75 | + respond_to do |format| | |
| 76 | + format.html { redirect_to project_milestones_path } | |
| 77 | + format.js { render nothing: true } | |
| 78 | + end | |
| 79 | + end | |
| 80 | + | |
| 81 | + protected | |
| 82 | + | |
| 83 | + def milestone | |
| 84 | + @milestone ||= @project.milestones.find(params[:id]) | |
| 85 | + end | |
| 86 | + | |
| 87 | + def authorize_admin_milestone! | |
| 88 | + return render_404 unless can?(current_user, :admin_milestone, @project) | |
| 89 | + end | |
| 90 | + | |
| 91 | + def module_enabled | |
| 92 | + return render_404 unless @project.issues_enabled | |
| 93 | + end | |
| 94 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,23 @@ |
| 1 | +class Projects::NetworkController < Projects::ApplicationController | |
| 2 | + include ExtractsPath | |
| 3 | + include ApplicationHelper | |
| 4 | + | |
| 5 | + # Authorize | |
| 6 | + before_filter :authorize_read_project! | |
| 7 | + before_filter :authorize_code_access! | |
| 8 | + before_filter :require_non_empty_project | |
| 9 | + | |
| 10 | + def show | |
| 11 | + if @options[:q] | |
| 12 | + @commit = @project.repository.commit(@options[:q]) || @commit | |
| 13 | + end | |
| 14 | + | |
| 15 | + respond_to do |format| | |
| 16 | + format.html | |
| 17 | + | |
| 18 | + format.json do | |
| 19 | + @graph = Network::Graph.new(project, @ref, @commit, @options[:filter_ref]) | |
| 20 | + end | |
| 21 | + end | |
| 22 | + end | |
| 23 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,76 @@ |
| 1 | +class Projects::NotesController < Projects::ApplicationController | |
| 2 | + # Authorize | |
| 3 | + before_filter :authorize_read_note! | |
| 4 | + before_filter :authorize_write_note!, only: [:create] | |
| 5 | + | |
| 6 | + respond_to :js | |
| 7 | + | |
| 8 | + def index | |
| 9 | + @notes = Notes::LoadContext.new(project, current_user, params).execute | |
| 10 | + @target_type = params[:target_type].camelize | |
| 11 | + @target_id = params[:target_id] | |
| 12 | + | |
| 13 | + if params[:target_type] == "merge_request" | |
| 14 | + @discussions = discussions_from_notes | |
| 15 | + end | |
| 16 | + | |
| 17 | + respond_with(@notes) | |
| 18 | + end | |
| 19 | + | |
| 20 | + def create | |
| 21 | + @note = Notes::CreateContext.new(project, current_user, params).execute | |
| 22 | + @target_type = params[:target_type].camelize | |
| 23 | + @target_id = params[:target_id] | |
| 24 | + | |
| 25 | + respond_to do |format| | |
| 26 | + format.html {redirect_to :back} | |
| 27 | + format.js | |
| 28 | + end | |
| 29 | + end | |
| 30 | + | |
| 31 | + def destroy | |
| 32 | + @note = @project.notes.find(params[:id]) | |
| 33 | + return access_denied! unless can?(current_user, :admin_note, @note) | |
| 34 | + @note.destroy | |
| 35 | + | |
| 36 | + respond_to do |format| | |
| 37 | + format.js { render nothing: true } | |
| 38 | + end | |
| 39 | + end | |
| 40 | + | |
| 41 | + def preview | |
| 42 | + render text: view_context.markdown(params[:note]) | |
| 43 | + end | |
| 44 | + | |
| 45 | + protected | |
| 46 | + | |
| 47 | + def discussion_notes_for(note) | |
| 48 | + @notes.select do |other_note| | |
| 49 | + note.discussion_id == other_note.discussion_id | |
| 50 | + end | |
| 51 | + end | |
| 52 | + | |
| 53 | + def discussions_from_notes | |
| 54 | + discussion_ids = [] | |
| 55 | + discussions = [] | |
| 56 | + | |
| 57 | + @notes.each do |note| | |
| 58 | + next if discussion_ids.include?(note.discussion_id) | |
| 59 | + | |
| 60 | + # don't group notes for the main target | |
| 61 | + if note_for_main_target?(note) | |
| 62 | + discussions << [note] | |
| 63 | + else | |
| 64 | + discussions << discussion_notes_for(note) | |
| 65 | + discussion_ids << note.discussion_id | |
| 66 | + end | |
| 67 | + end | |
| 68 | + | |
| 69 | + discussions | |
| 70 | + end | |
| 71 | + | |
| 72 | + # Helps to distinguish e.g. commit notes in mr notes list | |
| 73 | + def note_for_main_target?(note) | |
| 74 | + (@target_type.camelize == note.noteable_type && !note.for_diff_line?) | |
| 75 | + end | |
| 76 | +end | ... | ... |
app/controllers/projects/protected_branches_controller.rb
0 → 100644
| ... | ... | @@ -0,0 +1,26 @@ |
| 1 | +class Projects::ProtectedBranchesController < Projects::ApplicationController | |
| 2 | + # Authorize | |
| 3 | + before_filter :authorize_read_project! | |
| 4 | + before_filter :require_non_empty_project | |
| 5 | + | |
| 6 | + before_filter :authorize_admin_project!, only: [:destroy, :create] | |
| 7 | + | |
| 8 | + def index | |
| 9 | + @branches = @project.protected_branches.all | |
| 10 | + @protected_branch = @project.protected_branches.new | |
| 11 | + end | |
| 12 | + | |
| 13 | + def create | |
| 14 | + @project.protected_branches.create(params[:protected_branch]) | |
| 15 | + redirect_to project_protected_branches_path(@project) | |
| 16 | + end | |
| 17 | + | |
| 18 | + def destroy | |
| 19 | + @project.protected_branches.find(params[:id]).destroy | |
| 20 | + | |
| 21 | + respond_to do |format| | |
| 22 | + format.html { redirect_to project_protected_branches_path } | |
| 23 | + format.js { render nothing: true } | |
| 24 | + end | |
| 25 | + end | |
| 26 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,25 @@ |
| 1 | +# Controller for viewing a file's raw | |
| 2 | +class Projects::RawController < Projects::ApplicationController | |
| 3 | + include ExtractsPath | |
| 4 | + | |
| 5 | + # Authorize | |
| 6 | + before_filter :authorize_read_project! | |
| 7 | + before_filter :authorize_code_access! | |
| 8 | + before_filter :require_non_empty_project | |
| 9 | + | |
| 10 | + def show | |
| 11 | + @blob = Gitlab::Git::Blob.new(@repository, @commit.id, @ref, @path) | |
| 12 | + | |
| 13 | + if @blob.exists? | |
| 14 | + send_data( | |
| 15 | + @blob.data, | |
| 16 | + type: @blob.mime_type, | |
| 17 | + disposition: 'inline', | |
| 18 | + filename: @blob.name | |
| 19 | + ) | |
| 20 | + else | |
| 21 | + not_found! | |
| 22 | + end | |
| 23 | + end | |
| 24 | +end | |
| 25 | + | ... | ... |
| ... | ... | @@ -0,0 +1,43 @@ |
| 1 | +class Projects::RefsController < Projects::ApplicationController | |
| 2 | + include ExtractsPath | |
| 3 | + | |
| 4 | + # Authorize | |
| 5 | + before_filter :authorize_read_project! | |
| 6 | + before_filter :authorize_code_access! | |
| 7 | + before_filter :require_non_empty_project | |
| 8 | + | |
| 9 | + def switch | |
| 10 | + respond_to do |format| | |
| 11 | + format.html do | |
| 12 | + new_path = if params[:destination] == "tree" | |
| 13 | + project_tree_path(@project, (@id)) | |
| 14 | + elsif params[:destination] == "blob" | |
| 15 | + project_blob_path(@project, (@id)) | |
| 16 | + elsif params[:destination] == "graph" | |
| 17 | + project_network_path(@project, @id, @options) | |
| 18 | + else | |
| 19 | + project_commits_path(@project, @id) | |
| 20 | + end | |
| 21 | + | |
| 22 | + redirect_to new_path | |
| 23 | + end | |
| 24 | + format.js do | |
| 25 | + @ref = params[:ref] | |
| 26 | + define_tree_vars | |
| 27 | + render "tree" | |
| 28 | + end | |
| 29 | + end | |
| 30 | + end | |
| 31 | + | |
| 32 | + def logs_tree | |
| 33 | + contents = @tree.entries | |
| 34 | + @logs = contents.map do |content| | |
| 35 | + file = params[:path] ? File.join(params[:path], content.name) : content.name | |
| 36 | + last_commit = @repo.commits(@commit.id, file, 1).last | |
| 37 | + { | |
| 38 | + file_name: content.name, | |
| 39 | + commit: last_commit | |
| 40 | + } | |
| 41 | + end | |
| 42 | + end | |
| 43 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,41 @@ |
| 1 | +class Projects::RepositoriesController < Projects::ApplicationController | |
| 2 | + # Authorize | |
| 3 | + before_filter :authorize_read_project! | |
| 4 | + before_filter :authorize_code_access! | |
| 5 | + before_filter :require_non_empty_project | |
| 6 | + | |
| 7 | + def show | |
| 8 | + @activities = @repository.commits_with_refs(20) | |
| 9 | + end | |
| 10 | + | |
| 11 | + def branches | |
| 12 | + @branches = @repository.branches | |
| 13 | + end | |
| 14 | + | |
| 15 | + def tags | |
| 16 | + @tags = @repository.tags | |
| 17 | + end | |
| 18 | + | |
| 19 | + def stats | |
| 20 | + @stats = Gitlab::Git::Stats.new(@repository.raw, @repository.root_ref) | |
| 21 | + @graph = @stats.graph | |
| 22 | + end | |
| 23 | + | |
| 24 | + def archive | |
| 25 | + unless can?(current_user, :download_code, @project) | |
| 26 | + render_404 and return | |
| 27 | + end | |
| 28 | + | |
| 29 | + | |
| 30 | + storage_path = Rails.root.join("tmp", "repositories") | |
| 31 | + | |
| 32 | + file_path = @repository.archive_repo(params[:ref], storage_path) | |
| 33 | + | |
| 34 | + if file_path | |
| 35 | + # Send file to user | |
| 36 | + send_file file_path | |
| 37 | + else | |
| 38 | + render_404 | |
| 39 | + end | |
| 40 | + end | |
| 41 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,39 @@ |
| 1 | +class Projects::ServicesController < Projects::ApplicationController | |
| 2 | + # Authorize | |
| 3 | + before_filter :authorize_admin_project! | |
| 4 | + before_filter :service, only: [:edit, :update, :test] | |
| 5 | + | |
| 6 | + respond_to :html | |
| 7 | + | |
| 8 | + layout "project_settings" | |
| 9 | + | |
| 10 | + def index | |
| 11 | + @project.build_missing_services | |
| 12 | + @services = @project.services.reload | |
| 13 | + end | |
| 14 | + | |
| 15 | + def edit | |
| 16 | + end | |
| 17 | + | |
| 18 | + def update | |
| 19 | + if @service.update_attributes(params[:service]) | |
| 20 | + redirect_to edit_project_service_path(@project, @service.to_param) | |
| 21 | + else | |
| 22 | + render 'edit' | |
| 23 | + end | |
| 24 | + end | |
| 25 | + | |
| 26 | + def test | |
| 27 | + data = GitPushService.new.sample_data(project, current_user) | |
| 28 | + | |
| 29 | + @service.execute(data) | |
| 30 | + | |
| 31 | + redirect_to :back | |
| 32 | + end | |
| 33 | + | |
| 34 | + private | |
| 35 | + | |
| 36 | + def service | |
| 37 | + @service ||= @project.services.find { |service| service.to_param == params[:id] } | |
| 38 | + end | |
| 39 | +end | ... | ... |
app/controllers/projects/snippets_controller.rb
| ... | ... | @@ -14,7 +14,7 @@ class Projects::SnippetsController < Projects::ApplicationController |
| 14 | 14 | # Allow destroy snippet |
| 15 | 15 | before_filter :authorize_admin_project_snippet!, only: [:destroy] |
| 16 | 16 | |
| 17 | - layout 'project_resource' | |
| 17 | + layout 'projects' | |
| 18 | 18 | |
| 19 | 19 | respond_to :html |
| 20 | 20 | ... | ... |
| ... | ... | @@ -0,0 +1,62 @@ |
| 1 | +class Projects::TeamMembersController < Projects::ApplicationController | |
| 2 | + # Authorize | |
| 3 | + before_filter :authorize_read_project! | |
| 4 | + before_filter :authorize_admin_project!, except: [:index, :show] | |
| 5 | + | |
| 6 | + layout "project_settings" | |
| 7 | + | |
| 8 | + def index | |
| 9 | + @group = @project.group | |
| 10 | + @users_projects = @project.users_projects.order('project_access DESC') | |
| 11 | + end | |
| 12 | + | |
| 13 | + def new | |
| 14 | + @user_project_relation = project.users_projects.new | |
| 15 | + end | |
| 16 | + | |
| 17 | + def create | |
| 18 | + users = User.where(id: params[:user_ids].split(',')) | |
| 19 | + | |
| 20 | + @project.team << [users, params[:project_access]] | |
| 21 | + | |
| 22 | + if params[:redirect_to] | |
| 23 | + redirect_to params[:redirect_to] | |
| 24 | + else | |
| 25 | + redirect_to project_team_index_path(@project) | |
| 26 | + end | |
| 27 | + end | |
| 28 | + | |
| 29 | + def update | |
| 30 | + @user_project_relation = project.users_projects.find_by_user_id(member) | |
| 31 | + @user_project_relation.update_attributes(params[:team_member]) | |
| 32 | + | |
| 33 | + unless @user_project_relation.valid? | |
| 34 | + flash[:alert] = "User should have at least one role" | |
| 35 | + end | |
| 36 | + redirect_to project_team_index_path(@project) | |
| 37 | + end | |
| 38 | + | |
| 39 | + def destroy | |
| 40 | + @user_project_relation = project.users_projects.find_by_user_id(member) | |
| 41 | + @user_project_relation.destroy | |
| 42 | + | |
| 43 | + respond_to do |format| | |
| 44 | + format.html { redirect_to project_team_index_path(@project) } | |
| 45 | + format.js { render nothing: true } | |
| 46 | + end | |
| 47 | + end | |
| 48 | + | |
| 49 | + def apply_import | |
| 50 | + giver = Project.find(params[:source_project_id]) | |
| 51 | + status = @project.team.import(giver) | |
| 52 | + notice = status ? "Succesfully imported" : "Import failed" | |
| 53 | + | |
| 54 | + redirect_to project_team_index_path(project), notice: notice | |
| 55 | + end | |
| 56 | + | |
| 57 | + protected | |
| 58 | + | |
| 59 | + def member | |
| 60 | + @member ||= User.find_by_username(params[:id]) | |
| 61 | + end | |
| 62 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,17 @@ |
| 1 | +# Controller for viewing a repository's file structure | |
| 2 | +class Projects::TreeController < Projects::ApplicationController | |
| 3 | + include ExtractsPath | |
| 4 | + | |
| 5 | + # Authorize | |
| 6 | + before_filter :authorize_read_project! | |
| 7 | + before_filter :authorize_code_access! | |
| 8 | + before_filter :require_non_empty_project | |
| 9 | + | |
| 10 | + def show | |
| 11 | + respond_to do |format| | |
| 12 | + format.html | |
| 13 | + # Disable cache so browser history works | |
| 14 | + format.js { no_cache_headers } | |
| 15 | + end | |
| 16 | + end | |
| 17 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,20 @@ |
| 1 | +class Projects::WallsController < Projects::ApplicationController | |
| 2 | + before_filter :module_enabled | |
| 3 | + | |
| 4 | + respond_to :js, :html | |
| 5 | + | |
| 6 | + def show | |
| 7 | + @note = @project.notes.new | |
| 8 | + | |
| 9 | + respond_to do |format| | |
| 10 | + format.html | |
| 11 | + end | |
| 12 | + end | |
| 13 | + | |
| 14 | + protected | |
| 15 | + | |
| 16 | + def module_enabled | |
| 17 | + return render_404 unless @project.wall_enabled | |
| 18 | + end | |
| 19 | +end | |
| 20 | + | ... | ... |
| ... | ... | @@ -0,0 +1,95 @@ |
| 1 | +class Projects::WikisController < Projects::ApplicationController | |
| 2 | + before_filter :authorize_read_wiki! | |
| 3 | + before_filter :authorize_write_wiki!, only: [:edit, :create, :history] | |
| 4 | + before_filter :authorize_admin_wiki!, only: :destroy | |
| 5 | + before_filter :load_gollum_wiki | |
| 6 | + | |
| 7 | + def pages | |
| 8 | + @wiki_pages = @gollum_wiki.pages | |
| 9 | + end | |
| 10 | + | |
| 11 | + def show | |
| 12 | + @wiki = @gollum_wiki.find_page(params[:id], params[:version_id]) | |
| 13 | + | |
| 14 | + if @wiki | |
| 15 | + render 'show' | |
| 16 | + else | |
| 17 | + return render('empty') unless can?(current_user, :write_wiki, @project) | |
| 18 | + @wiki = WikiPage.new(@gollum_wiki) | |
| 19 | + @wiki.title = params[:id] | |
| 20 | + | |
| 21 | + render 'edit' | |
| 22 | + end | |
| 23 | + end | |
| 24 | + | |
| 25 | + def edit | |
| 26 | + @wiki = @gollum_wiki.find_page(params[:id]) | |
| 27 | + end | |
| 28 | + | |
| 29 | + def update | |
| 30 | + @wiki = @gollum_wiki.find_page(params[:id]) | |
| 31 | + | |
| 32 | + return render('empty') unless can?(current_user, :write_wiki, @project) | |
| 33 | + | |
| 34 | + if @wiki.update(content, format, message) | |
| 35 | + redirect_to [@project, @wiki], notice: 'Wiki was successfully updated.' | |
| 36 | + else | |
| 37 | + render 'edit' | |
| 38 | + end | |
| 39 | + end | |
| 40 | + | |
| 41 | + def create | |
| 42 | + @wiki = WikiPage.new(@gollum_wiki) | |
| 43 | + | |
| 44 | + if @wiki.create(wiki_params) | |
| 45 | + redirect_to project_wiki_path(@project, @wiki), notice: 'Wiki was successfully updated.' | |
| 46 | + else | |
| 47 | + render action: "edit" | |
| 48 | + end | |
| 49 | + end | |
| 50 | + | |
| 51 | + def history | |
| 52 | + @wiki = @gollum_wiki.find_page(params[:id]) | |
| 53 | + | |
| 54 | + redirect_to(project_wiki_path(@project, :home), notice: "Page not found") unless @wiki | |
| 55 | + end | |
| 56 | + | |
| 57 | + def destroy | |
| 58 | + @wiki = @gollum_wiki.find_page(params[:id]) | |
| 59 | + @wiki.delete if @wiki | |
| 60 | + redirect_to project_wiki_path(@project, :home), notice: "Page was successfully deleted" | |
| 61 | + end | |
| 62 | + | |
| 63 | + def git_access | |
| 64 | + end | |
| 65 | + | |
| 66 | + private | |
| 67 | + | |
| 68 | + def load_gollum_wiki | |
| 69 | + @gollum_wiki = GollumWiki.new(@project, current_user) | |
| 70 | + | |
| 71 | + # Call #wiki to make sure the Wiki Repo is initialized | |
| 72 | + @gollum_wiki.wiki | |
| 73 | + rescue GollumWiki::CouldNotCreateWikiError => ex | |
| 74 | + flash[:notice] = "Could not create Wiki Repository at this time. Please try again later." | |
| 75 | + redirect_to @project | |
| 76 | + return false | |
| 77 | + end | |
| 78 | + | |
| 79 | + def wiki_params | |
| 80 | + params[:wiki].slice(:title, :content, :format, :message) | |
| 81 | + end | |
| 82 | + | |
| 83 | + def content | |
| 84 | + params[:wiki][:content] | |
| 85 | + end | |
| 86 | + | |
| 87 | + def format | |
| 88 | + params[:wiki][:format] | |
| 89 | + end | |
| 90 | + | |
| 91 | + def message | |
| 92 | + params[:wiki][:message] | |
| 93 | + end | |
| 94 | + | |
| 95 | +end | ... | ... |
app/controllers/projects_controller.rb
app/controllers/protected_branches_controller.rb
| ... | ... | @@ -1,26 +0,0 @@ |
| 1 | -class ProtectedBranchesController < ProjectResourceController | |
| 2 | - # Authorize | |
| 3 | - before_filter :authorize_read_project! | |
| 4 | - before_filter :require_non_empty_project | |
| 5 | - | |
| 6 | - before_filter :authorize_admin_project!, only: [:destroy, :create] | |
| 7 | - | |
| 8 | - def index | |
| 9 | - @branches = @project.protected_branches.all | |
| 10 | - @protected_branch = @project.protected_branches.new | |
| 11 | - end | |
| 12 | - | |
| 13 | - def create | |
| 14 | - @project.protected_branches.create(params[:protected_branch]) | |
| 15 | - redirect_to project_protected_branches_path(@project) | |
| 16 | - end | |
| 17 | - | |
| 18 | - def destroy | |
| 19 | - @project.protected_branches.find(params[:id]).destroy | |
| 20 | - | |
| 21 | - respond_to do |format| | |
| 22 | - format.html { redirect_to project_protected_branches_path } | |
| 23 | - format.js { render nothing: true } | |
| 24 | - end | |
| 25 | - end | |
| 26 | -end |
app/controllers/raw_controller.rb
| ... | ... | @@ -1,25 +0,0 @@ |
| 1 | -# Controller for viewing a file's raw | |
| 2 | -class RawController < ProjectResourceController | |
| 3 | - include ExtractsPath | |
| 4 | - | |
| 5 | - # Authorize | |
| 6 | - before_filter :authorize_read_project! | |
| 7 | - before_filter :authorize_code_access! | |
| 8 | - before_filter :require_non_empty_project | |
| 9 | - | |
| 10 | - def show | |
| 11 | - @blob = Gitlab::Git::Blob.new(@repository, @commit.id, @ref, @path) | |
| 12 | - | |
| 13 | - if @blob.exists? | |
| 14 | - send_data( | |
| 15 | - @blob.data, | |
| 16 | - type: @blob.mime_type, | |
| 17 | - disposition: 'inline', | |
| 18 | - filename: @blob.name | |
| 19 | - ) | |
| 20 | - else | |
| 21 | - not_found! | |
| 22 | - end | |
| 23 | - end | |
| 24 | -end | |
| 25 | - |
app/controllers/refs_controller.rb
| ... | ... | @@ -1,43 +0,0 @@ |
| 1 | -class RefsController < ProjectResourceController | |
| 2 | - include ExtractsPath | |
| 3 | - | |
| 4 | - # Authorize | |
| 5 | - before_filter :authorize_read_project! | |
| 6 | - before_filter :authorize_code_access! | |
| 7 | - before_filter :require_non_empty_project | |
| 8 | - | |
| 9 | - def switch | |
| 10 | - respond_to do |format| | |
| 11 | - format.html do | |
| 12 | - new_path = if params[:destination] == "tree" | |
| 13 | - project_tree_path(@project, (@id)) | |
| 14 | - elsif params[:destination] == "blob" | |
| 15 | - project_blob_path(@project, (@id)) | |
| 16 | - elsif params[:destination] == "graph" | |
| 17 | - project_network_path(@project, @id, @options) | |
| 18 | - else | |
| 19 | - project_commits_path(@project, @id) | |
| 20 | - end | |
| 21 | - | |
| 22 | - redirect_to new_path | |
| 23 | - end | |
| 24 | - format.js do | |
| 25 | - @ref = params[:ref] | |
| 26 | - define_tree_vars | |
| 27 | - render "tree" | |
| 28 | - end | |
| 29 | - end | |
| 30 | - end | |
| 31 | - | |
| 32 | - def logs_tree | |
| 33 | - contents = @tree.entries | |
| 34 | - @logs = contents.map do |content| | |
| 35 | - file = params[:path] ? File.join(params[:path], content.name) : content.name | |
| 36 | - last_commit = @repo.commits(@commit.id, file, 1).last | |
| 37 | - { | |
| 38 | - file_name: content.name, | |
| 39 | - commit: last_commit | |
| 40 | - } | |
| 41 | - end | |
| 42 | - end | |
| 43 | -end |
app/controllers/repositories_controller.rb
| ... | ... | @@ -1,41 +0,0 @@ |
| 1 | -class RepositoriesController < ProjectResourceController | |
| 2 | - # Authorize | |
| 3 | - before_filter :authorize_read_project! | |
| 4 | - before_filter :authorize_code_access! | |
| 5 | - before_filter :require_non_empty_project | |
| 6 | - | |
| 7 | - def show | |
| 8 | - @activities = @repository.commits_with_refs(20) | |
| 9 | - end | |
| 10 | - | |
| 11 | - def branches | |
| 12 | - @branches = @repository.branches | |
| 13 | - end | |
| 14 | - | |
| 15 | - def tags | |
| 16 | - @tags = @repository.tags | |
| 17 | - end | |
| 18 | - | |
| 19 | - def stats | |
| 20 | - @stats = Gitlab::Git::Stats.new(@repository.raw, @repository.root_ref) | |
| 21 | - @graph = @stats.graph | |
| 22 | - end | |
| 23 | - | |
| 24 | - def archive | |
| 25 | - unless can?(current_user, :download_code, @project) | |
| 26 | - render_404 and return | |
| 27 | - end | |
| 28 | - | |
| 29 | - | |
| 30 | - storage_path = Rails.root.join("tmp", "repositories") | |
| 31 | - | |
| 32 | - file_path = @repository.archive_repo(params[:ref], storage_path) | |
| 33 | - | |
| 34 | - if file_path | |
| 35 | - # Send file to user | |
| 36 | - send_file file_path | |
| 37 | - else | |
| 38 | - render_404 | |
| 39 | - end | |
| 40 | - end | |
| 41 | -end |
app/controllers/services_controller.rb
| ... | ... | @@ -1,39 +0,0 @@ |
| 1 | -class ServicesController < ProjectResourceController | |
| 2 | - # Authorize | |
| 3 | - before_filter :authorize_admin_project! | |
| 4 | - before_filter :service, only: [:edit, :update, :test] | |
| 5 | - | |
| 6 | - respond_to :html | |
| 7 | - | |
| 8 | - layout "project_settings" | |
| 9 | - | |
| 10 | - def index | |
| 11 | - @project.build_missing_services | |
| 12 | - @services = @project.services.reload | |
| 13 | - end | |
| 14 | - | |
| 15 | - def edit | |
| 16 | - end | |
| 17 | - | |
| 18 | - def update | |
| 19 | - if @service.update_attributes(params[:service]) | |
| 20 | - redirect_to edit_project_service_path(@project, @service.to_param) | |
| 21 | - else | |
| 22 | - render 'edit' | |
| 23 | - end | |
| 24 | - end | |
| 25 | - | |
| 26 | - def test | |
| 27 | - data = GitPushService.new.sample_data(project, current_user) | |
| 28 | - | |
| 29 | - @service.execute(data) | |
| 30 | - | |
| 31 | - redirect_to :back | |
| 32 | - end | |
| 33 | - | |
| 34 | - private | |
| 35 | - | |
| 36 | - def service | |
| 37 | - @service ||= @project.services.find { |service| service.to_param == params[:id] } | |
| 38 | - end | |
| 39 | -end |
app/controllers/team_members_controller.rb
| ... | ... | @@ -1,62 +0,0 @@ |
| 1 | -class TeamMembersController < ProjectResourceController | |
| 2 | - # Authorize | |
| 3 | - before_filter :authorize_read_project! | |
| 4 | - before_filter :authorize_admin_project!, except: [:index, :show] | |
| 5 | - | |
| 6 | - layout "project_settings" | |
| 7 | - | |
| 8 | - def index | |
| 9 | - @group = @project.group | |
| 10 | - @users_projects = @project.users_projects.order('project_access DESC') | |
| 11 | - end | |
| 12 | - | |
| 13 | - def new | |
| 14 | - @user_project_relation = project.users_projects.new | |
| 15 | - end | |
| 16 | - | |
| 17 | - def create | |
| 18 | - users = User.where(id: params[:user_ids].split(',')) | |
| 19 | - | |
| 20 | - @project.team << [users, params[:project_access]] | |
| 21 | - | |
| 22 | - if params[:redirect_to] | |
| 23 | - redirect_to params[:redirect_to] | |
| 24 | - else | |
| 25 | - redirect_to project_team_index_path(@project) | |
| 26 | - end | |
| 27 | - end | |
| 28 | - | |
| 29 | - def update | |
| 30 | - @user_project_relation = project.users_projects.find_by_user_id(member) | |
| 31 | - @user_project_relation.update_attributes(params[:team_member]) | |
| 32 | - | |
| 33 | - unless @user_project_relation.valid? | |
| 34 | - flash[:alert] = "User should have at least one role" | |
| 35 | - end | |
| 36 | - redirect_to project_team_index_path(@project) | |
| 37 | - end | |
| 38 | - | |
| 39 | - def destroy | |
| 40 | - @user_project_relation = project.users_projects.find_by_user_id(member) | |
| 41 | - @user_project_relation.destroy | |
| 42 | - | |
| 43 | - respond_to do |format| | |
| 44 | - format.html { redirect_to project_team_index_path(@project) } | |
| 45 | - format.js { render nothing: true } | |
| 46 | - end | |
| 47 | - end | |
| 48 | - | |
| 49 | - def apply_import | |
| 50 | - giver = Project.find(params[:source_project_id]) | |
| 51 | - status = @project.team.import(giver) | |
| 52 | - notice = status ? "Succesfully imported" : "Import failed" | |
| 53 | - | |
| 54 | - redirect_to project_team_index_path(project), notice: notice | |
| 55 | - end | |
| 56 | - | |
| 57 | - protected | |
| 58 | - | |
| 59 | - def member | |
| 60 | - @member ||= User.find_by_username(params[:id]) | |
| 61 | - end | |
| 62 | -end |
app/controllers/tree_controller.rb
| ... | ... | @@ -1,17 +0,0 @@ |
| 1 | -# Controller for viewing a repository's file structure | |
| 2 | -class TreeController < ProjectResourceController | |
| 3 | - include ExtractsPath | |
| 4 | - | |
| 5 | - # Authorize | |
| 6 | - before_filter :authorize_read_project! | |
| 7 | - before_filter :authorize_code_access! | |
| 8 | - before_filter :require_non_empty_project | |
| 9 | - | |
| 10 | - def show | |
| 11 | - respond_to do |format| | |
| 12 | - format.html | |
| 13 | - # Disable cache so browser history works | |
| 14 | - format.js { no_cache_headers } | |
| 15 | - end | |
| 16 | - end | |
| 17 | -end |
app/controllers/walls_controller.rb
| ... | ... | @@ -1,20 +0,0 @@ |
| 1 | -class WallsController < ProjectResourceController | |
| 2 | - before_filter :module_enabled | |
| 3 | - | |
| 4 | - respond_to :js, :html | |
| 5 | - | |
| 6 | - def show | |
| 7 | - @note = @project.notes.new | |
| 8 | - | |
| 9 | - respond_to do |format| | |
| 10 | - format.html | |
| 11 | - end | |
| 12 | - end | |
| 13 | - | |
| 14 | - protected | |
| 15 | - | |
| 16 | - def module_enabled | |
| 17 | - return render_404 unless @project.wall_enabled | |
| 18 | - end | |
| 19 | -end | |
| 20 | - |
app/controllers/wikis_controller.rb
| ... | ... | @@ -1,95 +0,0 @@ |
| 1 | -class WikisController < ProjectResourceController | |
| 2 | - before_filter :authorize_read_wiki! | |
| 3 | - before_filter :authorize_write_wiki!, only: [:edit, :create, :history] | |
| 4 | - before_filter :authorize_admin_wiki!, only: :destroy | |
| 5 | - before_filter :load_gollum_wiki | |
| 6 | - | |
| 7 | - def pages | |
| 8 | - @wiki_pages = @gollum_wiki.pages | |
| 9 | - end | |
| 10 | - | |
| 11 | - def show | |
| 12 | - @wiki = @gollum_wiki.find_page(params[:id], params[:version_id]) | |
| 13 | - | |
| 14 | - if @wiki | |
| 15 | - render 'show' | |
| 16 | - else | |
| 17 | - return render('empty') unless can?(current_user, :write_wiki, @project) | |
| 18 | - @wiki = WikiPage.new(@gollum_wiki) | |
| 19 | - @wiki.title = params[:id] | |
| 20 | - | |
| 21 | - render 'edit' | |
| 22 | - end | |
| 23 | - end | |
| 24 | - | |
| 25 | - def edit | |
| 26 | - @wiki = @gollum_wiki.find_page(params[:id]) | |
| 27 | - end | |
| 28 | - | |
| 29 | - def update | |
| 30 | - @wiki = @gollum_wiki.find_page(params[:id]) | |
| 31 | - | |
| 32 | - return render('empty') unless can?(current_user, :write_wiki, @project) | |
| 33 | - | |
| 34 | - if @wiki.update(content, format, message) | |
| 35 | - redirect_to [@project, @wiki], notice: 'Wiki was successfully updated.' | |
| 36 | - else | |
| 37 | - render 'edit' | |
| 38 | - end | |
| 39 | - end | |
| 40 | - | |
| 41 | - def create | |
| 42 | - @wiki = WikiPage.new(@gollum_wiki) | |
| 43 | - | |
| 44 | - if @wiki.create(wiki_params) | |
| 45 | - redirect_to project_wiki_path(@project, @wiki), notice: 'Wiki was successfully updated.' | |
| 46 | - else | |
| 47 | - render action: "edit" | |
| 48 | - end | |
| 49 | - end | |
| 50 | - | |
| 51 | - def history | |
| 52 | - @wiki = @gollum_wiki.find_page(params[:id]) | |
| 53 | - | |
| 54 | - redirect_to(project_wiki_path(@project, :home), notice: "Page not found") unless @wiki | |
| 55 | - end | |
| 56 | - | |
| 57 | - def destroy | |
| 58 | - @wiki = @gollum_wiki.find_page(params[:id]) | |
| 59 | - @wiki.delete if @wiki | |
| 60 | - redirect_to project_wiki_path(@project, :home), notice: "Page was successfully deleted" | |
| 61 | - end | |
| 62 | - | |
| 63 | - def git_access | |
| 64 | - end | |
| 65 | - | |
| 66 | - private | |
| 67 | - | |
| 68 | - def load_gollum_wiki | |
| 69 | - @gollum_wiki = GollumWiki.new(@project, current_user) | |
| 70 | - | |
| 71 | - # Call #wiki to make sure the Wiki Repo is initialized | |
| 72 | - @gollum_wiki.wiki | |
| 73 | - rescue GollumWiki::CouldNotCreateWikiError => ex | |
| 74 | - flash[:notice] = "Could not create Wiki Repository at this time. Please try again later." | |
| 75 | - redirect_to @project | |
| 76 | - return false | |
| 77 | - end | |
| 78 | - | |
| 79 | - def wiki_params | |
| 80 | - params[:wiki].slice(:title, :content, :format, :message) | |
| 81 | - end | |
| 82 | - | |
| 83 | - def content | |
| 84 | - params[:wiki][:content] | |
| 85 | - end | |
| 86 | - | |
| 87 | - def format | |
| 88 | - params[:wiki][:format] | |
| 89 | - end | |
| 90 | - | |
| 91 | - def message | |
| 92 | - params[:wiki][:message] | |
| 93 | - end | |
| 94 | - | |
| 95 | -end |
app/helpers/commits_helper.rb
| ... | ... | @@ -109,7 +109,7 @@ module CommitsHelper |
| 109 | 109 | end |
| 110 | 110 | |
| 111 | 111 | def commit_to_html commit |
| 112 | - escape_javascript(render 'commits/commit', commit: commit) | |
| 112 | + escape_javascript(render 'projects/commits/commit', commit: commit) | |
| 113 | 113 | end |
| 114 | 114 | |
| 115 | 115 | def diff_line_content(line) | ... | ... |
app/helpers/tree_helper.rb
| ... | ... | @@ -10,13 +10,13 @@ module TreeHelper |
| 10 | 10 | tree = "" |
| 11 | 11 | |
| 12 | 12 | # Render folders if we have any |
| 13 | - tree += render partial: 'tree/tree_item', collection: folders, locals: {type: 'folder'} if folders.present? | |
| 13 | + tree += render partial: 'projects/tree/tree_item', collection: folders, locals: {type: 'folder'} if folders.present? | |
| 14 | 14 | |
| 15 | 15 | # Render files if we have any |
| 16 | - tree += render partial: 'tree/blob_item', collection: files, locals: {type: 'file'} if files.present? | |
| 16 | + tree += render partial: 'projects/tree/blob_item', collection: files, locals: {type: 'file'} if files.present? | |
| 17 | 17 | |
| 18 | 18 | # Render submodules if we have any |
| 19 | - tree += render partial: 'tree/submodule_item', collection: submodules if submodules.present? | |
| 19 | + tree += render partial: 'projects/tree/submodule_item', collection: submodules if submodules.present? | |
| 20 | 20 | |
| 21 | 21 | tree.html_safe |
| 22 | 22 | end | ... | ... |
app/views/blame/_head.html.haml
app/views/blame/show.html.haml
| ... | ... | @@ -1,49 +0,0 @@ |
| 1 | -= render "head" | |
| 2 | - | |
| 3 | -#tree-holder.tree-holder | |
| 4 | - %ul.breadcrumb | |
| 5 | - %li | |
| 6 | - %i.icon-angle-right | |
| 7 | - = link_to project_tree_path(@project, @ref) do | |
| 8 | - = @project.name | |
| 9 | - - tree_breadcrumbs(@tree, 6) do |link| | |
| 10 | - \/ | |
| 11 | - %li= link | |
| 12 | - .clear | |
| 13 | - | |
| 14 | - .file_holder | |
| 15 | - .file_title | |
| 16 | - %i.icon-file | |
| 17 | - %span.file_name | |
| 18 | - = @blob.name | |
| 19 | - %small= number_to_human_size @blob.size | |
| 20 | - %span.options= render "blob/actions" | |
| 21 | - .file_content.blame | |
| 22 | - %table | |
| 23 | - - current_line = 1 | |
| 24 | - - @blame.each do |commit, lines| | |
| 25 | - - commit = Commit.new(commit) | |
| 26 | - %tr | |
| 27 | - %td.blame-commit | |
| 28 | - %span.commit | |
| 29 | - = link_to commit.short_id(8), project_commit_path(@project, commit), class: "commit_short_id" | |
| 30 | - | |
| 31 | - = commit_author_link(commit, avatar: true, size: 16) | |
| 32 | - | |
| 33 | - = link_to_gfm truncate(commit.title, length: 20), project_commit_path(@project, commit.id), class: "row_title" | |
| 34 | - %td.lines.blame-numbers | |
| 35 | - %pre | |
| 36 | - - if lines.empty? | |
| 37 | - = current_line | |
| 38 | - - current_line += 1 | |
| 39 | - - else | |
| 40 | - - lines.each do |line| | |
| 41 | - = current_line | |
| 42 | - \ | |
| 43 | - - current_line += 1 | |
| 44 | - %td.lines | |
| 45 | - %pre | |
| 46 | - :erb | |
| 47 | - <% lines.each do |line| %> | |
| 48 | - <%= line %> | |
| 49 | - <% end %> |
app/views/blob/_actions.html.haml
| ... | ... | @@ -1,12 +0,0 @@ |
| 1 | -.btn-group.tree-btn-group | |
| 2 | - -# only show edit link for text files | |
| 3 | - - if @blob.text? | |
| 4 | - = link_to "edit", project_edit_tree_path(@project, @id), class: "btn btn-tiny", disabled: !allowed_tree_edit? | |
| 5 | - = link_to "raw", project_raw_path(@project, @id), class: "btn btn-tiny", target: "_blank" | |
| 6 | - -# only show normal/blame view links for text files | |
| 7 | - - if @blob.text? | |
| 8 | - - if current_page? project_blame_path(@project, @id) | |
| 9 | - = link_to "normal view", project_blob_path(@project, @id), class: "btn btn-tiny" | |
| 10 | - - else | |
| 11 | - = link_to "blame", project_blame_path(@project, @id), class: "btn btn-tiny" unless @blob.empty? | |
| 12 | - = link_to "history", project_commits_path(@project, @id), class: "btn btn-tiny" |
app/views/blob/_blob.html.haml
| ... | ... | @@ -1,32 +0,0 @@ |
| 1 | -%ul.breadcrumb | |
| 2 | - %li | |
| 3 | - %i.icon-angle-right | |
| 4 | - = link_to project_tree_path(@project, @ref) do | |
| 5 | - = @project.path | |
| 6 | - - tree_breadcrumbs(@tree, 6) do |title, path| | |
| 7 | - \/ | |
| 8 | - %li | |
| 9 | - - if path | |
| 10 | - - if path.end_with?(@path) | |
| 11 | - = link_to project_blob_path(@project, path) do | |
| 12 | - %span.cblue | |
| 13 | - = truncate(title, length: 40) | |
| 14 | - - else | |
| 15 | - = link_to truncate(title, length: 40), project_tree_path(@project, path) | |
| 16 | - - else | |
| 17 | - = link_to title, '#' | |
| 18 | - | |
| 19 | -%div#tree-content-holder.tree-content-holder | |
| 20 | - .file_holder | |
| 21 | - .file_title | |
| 22 | - %i.icon-file | |
| 23 | - %span.file_name | |
| 24 | - = blob.name | |
| 25 | - %small= number_to_human_size blob.size | |
| 26 | - %span.options= render "actions" | |
| 27 | - - if blob.text? | |
| 28 | - = render "text", blob: blob | |
| 29 | - - elsif blob.image? | |
| 30 | - = render "image", blob: blob | |
| 31 | - - else | |
| 32 | - = render "download", blob: blob |
app/views/blob/_download.html.haml
app/views/blob/_image.html.haml
app/views/blob/_text.html.haml
| ... | ... | @@ -1,14 +0,0 @@ |
| 1 | -- if gitlab_markdown?(blob.name) | |
| 2 | - .file_content.wiki | |
| 3 | - = preserve do | |
| 4 | - = markdown(blob.data) | |
| 5 | -- elsif markup?(blob.name) | |
| 6 | - .file_content.wiki | |
| 7 | - = raw GitHub::Markup.render(blob.name, blob.data) | |
| 8 | -- else | |
| 9 | - .file_content.code | |
| 10 | - - unless blob.empty? | |
| 11 | - %div{class: user_color_scheme_class} | |
| 12 | - = raw blob.colorize(formatter: :gitlab) | |
| 13 | - - else | |
| 14 | - %p.nothing_here_message Empty file |
app/views/blob/show.html.haml
app/views/commit/_commit_box.html.haml
| ... | ... | @@ -1,50 +0,0 @@ |
| 1 | -.ui-box.ui-box-show | |
| 2 | - .ui-box-head | |
| 3 | - .pull-right | |
| 4 | - - if @notes_count > 0 | |
| 5 | - %span.btn.disabled.grouped | |
| 6 | - %i.icon-comment | |
| 7 | - = @notes_count | |
| 8 | - .left.btn-group | |
| 9 | - %a.btn.grouped.dropdown-toggle{ data: {toggle: :dropdown} } | |
| 10 | - %i.icon-download-alt | |
| 11 | - Download as | |
| 12 | - %span.caret | |
| 13 | - %ul.dropdown-menu | |
| 14 | - %li= link_to "Email Patches", project_commit_path(@project, @commit, format: :patch) | |
| 15 | - %li= link_to "Plain Diff", project_commit_path(@project, @commit, format: :diff) | |
| 16 | - = link_to project_tree_path(@project, @commit), class: "btn btn-primary grouped" do | |
| 17 | - %span Browse Code » | |
| 18 | - %h3.commit-title.page_title | |
| 19 | - = gfm escape_once(@commit.title) | |
| 20 | - - if @commit.description.present? | |
| 21 | - %pre.commit-description | |
| 22 | - = gfm escape_once(@commit.description) | |
| 23 | - .ui-box-body | |
| 24 | - .row | |
| 25 | - .span5 | |
| 26 | - .author | |
| 27 | - = commit_author_link(@commit, avatar: true, size: 32) | |
| 28 | - authored | |
| 29 | - %time{title: @commit.authored_date.stamp("Aug 21, 2011 9:23pm")} | |
| 30 | - #{time_ago_in_words(@commit.authored_date)} ago | |
| 31 | - - if @commit.different_committer? | |
| 32 | - .committer | |
| 33 | - → | |
| 34 | - = commit_committer_link(@commit) | |
| 35 | - committed | |
| 36 | - %time{title: @commit.committed_date.stamp("Aug 21, 2011 9:23pm")} | |
| 37 | - #{time_ago_in_words(@commit.committed_date)} ago | |
| 38 | - .span6.pull-right | |
| 39 | - .pull-right | |
| 40 | - .sha-block | |
| 41 | - %span.cgray commit | |
| 42 | - %span.label_commit= @commit.id | |
| 43 | - .clearfix | |
| 44 | - .pull-right | |
| 45 | - .sha-block | |
| 46 | - %span.cgray= pluralize(@commit.parents.count, "parent") | |
| 47 | - - @commit.parents.each do |parent| | |
| 48 | - = link_to parent.id[0...10], project_commit_path(@project, parent) | |
| 49 | - | |
| 50 | - |
app/views/commit/huge_commit.html.haml
app/views/commit/show.html.haml
| ... | ... | @@ -1,11 +0,0 @@ |
| 1 | -= render "commit_box" | |
| 2 | - | |
| 3 | -- unless @commit.has_zero_stats? | |
| 4 | - %p.pull-right.cgray | |
| 5 | - This commit has | |
| 6 | - %span.cgreen #{@commit.stats.additions} additions | |
| 7 | - and | |
| 8 | - %span.cred #{@commit.stats.deletions} deletions | |
| 9 | - | |
| 10 | -= render "commits/diffs", diffs: @commit.diffs | |
| 11 | -= render "notes/notes_with_form" |
app/views/commits/_commit.html.haml
| ... | ... | @@ -1,21 +0,0 @@ |
| 1 | -%li.commit | |
| 2 | - .browse_code_link_holder | |
| 3 | - %p | |
| 4 | - %strong= link_to "Browse Code »", project_tree_path(@project, commit), class: "right" | |
| 5 | - %p | |
| 6 | - = link_to commit.short_id(8), project_commit_path(@project, commit), class: "commit_short_id" | |
| 7 | - = commit_author_link(commit, avatar: true, size: 24) | |
| 8 | - | |
| 9 | - = link_to_gfm truncate(commit.title, length: 70), project_commit_path(@project, commit.id), class: "row_title" | |
| 10 | - | |
| 11 | - %time.committed_ago{ datetime: commit.committed_date, title: commit.committed_date.stamp("Aug 21, 2011 9:23pm") } | |
| 12 | - = time_ago_in_words(commit.committed_date) | |
| 13 | - ago | |
| 14 | - | |
| 15 | - | |
| 16 | - %span.notes_count | |
| 17 | - - notes = @project.notes.for_commit_id(commit.id) | |
| 18 | - - if notes.any? | |
| 19 | - %span.badge.badge-info | |
| 20 | - %i.icon-comment | |
| 21 | - = notes.count |
app/views/commits/_commits.html.haml
| ... | ... | @@ -1,9 +0,0 @@ |
| 1 | -- @commits.group_by { |c| c.committed_date.to_date }.sort.reverse.each do |day, commits| | |
| 2 | - %div.ui-box | |
| 3 | - %h5.title | |
| 4 | - %i.icon-calendar | |
| 5 | - %span= day.stamp("28 Aug, 2010") | |
| 6 | - | |
| 7 | - .pull-right | |
| 8 | - %small= pluralize(commits.count, 'commit') | |
| 9 | - %ul.well-list= render commits |
app/views/commits/_diff_head.html.haml
| ... | ... | @@ -1,26 +0,0 @@ |
| 1 | -%ul.bordered-list | |
| 2 | - - diffs.each_with_index do |diff, i| | |
| 3 | - %li | |
| 4 | - - if diff.deleted_file | |
| 5 | - %span.deleted-file | |
| 6 | - %a{href: "#diff-#{i}"} | |
| 7 | - %i.icon-minus | |
| 8 | - = diff.old_path | |
| 9 | - - elsif diff.renamed_file | |
| 10 | - %span.renamed-file | |
| 11 | - %a{href: "#diff-#{i}"} | |
| 12 | - %i.icon-minus | |
| 13 | - = diff.old_path | |
| 14 | - = "->" | |
| 15 | - = diff.new_path | |
| 16 | - - elsif diff.new_file | |
| 17 | - %span.new-file | |
| 18 | - %a{href: "#diff-#{i}"} | |
| 19 | - %i.icon-plus | |
| 20 | - = diff.new_path | |
| 21 | - - else | |
| 22 | - %span.edit-file | |
| 23 | - %a{href: "#diff-#{i}"} | |
| 24 | - %i.icon-adjust | |
| 25 | - = diff.new_path | |
| 26 | - |
app/views/commits/_diffs.html.haml
| ... | ... | @@ -1,49 +0,0 @@ |
| 1 | -- if @suppress_diff | |
| 2 | - .alert.alert-block | |
| 3 | - %p | |
| 4 | - %strong Warning! Large commit with more than #{Commit::DIFF_SAFE_SIZE} files changed. | |
| 5 | - %p To prevent performance issue we rejected diff information. | |
| 6 | - %p | |
| 7 | - But if you still want to see diff | |
| 8 | - = link_to "click this link", project_commit_path(@project, @commit, force_show_diff: true), class: "underlined_link" | |
| 9 | - | |
| 10 | -%p.cgray | |
| 11 | - Showing #{pluralize(diffs.count, "changed file")} | |
| 12 | -.file-stats | |
| 13 | - = render "commits/diff_head", diffs: diffs | |
| 14 | - | |
| 15 | -.files | |
| 16 | - - unless @suppress_diff | |
| 17 | - - diffs.each_with_index do |diff, i| | |
| 18 | - - next if diff.diff.empty? | |
| 19 | - - file = Gitlab::Git::Blob.new(@repository, @commit.id, @ref, diff.new_path) | |
| 20 | - - file = Gitlab::Git::Blob.new(@repository, @commit.parent_id, @ref, diff.old_path) unless file.exists? | |
| 21 | - - next unless file.exists? | |
| 22 | - .file{id: "diff-#{i}"} | |
| 23 | - .header | |
| 24 | - - if diff.deleted_file | |
| 25 | - %span= diff.old_path | |
| 26 | - | |
| 27 | - - if @commit.parent_ids.present? | |
| 28 | - = link_to project_blob_path(@project, tree_join(@commit.parent_id, diff.new_path)), {:class => 'btn btn-tiny pull-right view-file'} do | |
| 29 | - View file @ | |
| 30 | - %span.commit-short-id= @commit.short_id(6) | |
| 31 | - - else | |
| 32 | - %span= diff.new_path | |
| 33 | - - if diff.a_mode && diff.b_mode && diff.a_mode != diff.b_mode | |
| 34 | - %span.file-mode= "#{diff.a_mode} → #{diff.b_mode}" | |
| 35 | - | |
| 36 | - = link_to project_blob_path(@project, tree_join(@commit.id, diff.new_path)), {:class => 'btn btn-tiny pull-right view-file'} do | |
| 37 | - View file @ | |
| 38 | - %span.commit-short-id= @commit.short_id(6) | |
| 39 | - | |
| 40 | - .content | |
| 41 | - -# Skipp all non non-supported blobs | |
| 42 | - - next unless file.respond_to?('text?') | |
| 43 | - - if file.text? | |
| 44 | - = render "commits/text_file", diff: diff, index: i | |
| 45 | - - elsif file.image? | |
| 46 | - - old_file = Gitlab::Git::Blob.new(@repository, @commit.parent_id, @ref, diff.old_path) if @commit.parent_id | |
| 47 | - = render "commits/image", diff: diff, old_file: old_file, file: file, index: i | |
| 48 | - - else | |
| 49 | - %p.nothing_here_message No preview for this file type |
app/views/commits/_head.html.haml
| ... | ... | @@ -1,27 +0,0 @@ |
| 1 | -%ul.nav.nav-tabs | |
| 2 | - %li= render partial: 'shared/ref_switcher', locals: {destination: 'commits'} | |
| 3 | - | |
| 4 | - = nav_link(controller: [:commit, :commits]) do | |
| 5 | - = link_to 'Commits', project_commits_path(@project, @repository.root_ref) | |
| 6 | - = nav_link(controller: :compare) do | |
| 7 | - = link_to 'Compare', project_compare_index_path(@project) | |
| 8 | - | |
| 9 | - = nav_link(html_options: {class: branches_tab_class}) do | |
| 10 | - = link_to project_repository_path(@project) do | |
| 11 | - Branches | |
| 12 | - %span.badge= @repository.branches.length | |
| 13 | - | |
| 14 | - = nav_link(controller: :repositories, action: :tags) do | |
| 15 | - = link_to tags_project_repository_path(@project) do | |
| 16 | - Tags | |
| 17 | - %span.badge= @repository.tags.length | |
| 18 | - | |
| 19 | - = nav_link(controller: :repositories, action: :stats) do | |
| 20 | - = link_to stats_project_repository_path(@project) do | |
| 21 | - Stats | |
| 22 | - | |
| 23 | - | |
| 24 | - - if current_controller?(:commits) && current_user.private_token | |
| 25 | - %li.pull-right | |
| 26 | - = link_to project_commits_path(@project, @ref, {format: :atom, private_token: current_user.private_token}), title: "Feed" do | |
| 27 | - %i.icon-rss |
app/views/commits/_image.html.haml
| ... | ... | @@ -1,63 +0,0 @@ |
| 1 | -- if diff.renamed_file || diff.new_file || diff.deleted_file | |
| 2 | - .image | |
| 3 | - %span.wrap | |
| 4 | - .frame{class: image_diff_class(diff)} | |
| 5 | - %img{src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} | |
| 6 | - %p.image-info= "#{number_to_human_size file.size}" | |
| 7 | -- else | |
| 8 | - .image | |
| 9 | - %div.two-up.view | |
| 10 | - %span.wrap | |
| 11 | - .frame.deleted | |
| 12 | - %a{href: project_tree_path(@project, tree_join(@commit.id, diff.old_path))} | |
| 13 | - %img{src: "data:#{old_file.mime_type};base64,#{Base64.encode64(old_file.data)}"} | |
| 14 | - %p.image-info.hide | |
| 15 | - %span.meta-filesize= "#{number_to_human_size old_file.size}" | |
| 16 | - | | |
| 17 | - %b W: | |
| 18 | - %span.meta-width | |
| 19 | - | | |
| 20 | - %b H: | |
| 21 | - %span.meta-height | |
| 22 | - %span.wrap | |
| 23 | - .frame.added | |
| 24 | - %a{href: project_tree_path(@project, tree_join(@commit.id, diff.new_path))} | |
| 25 | - %img{src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} | |
| 26 | - %p.image-info.hide | |
| 27 | - %span.meta-filesize= "#{number_to_human_size file.size}" | |
| 28 | - | | |
| 29 | - %b W: | |
| 30 | - %span.meta-width | |
| 31 | - | | |
| 32 | - %b H: | |
| 33 | - %span.meta-height | |
| 34 | - | |
| 35 | - %div.swipe.view.hide | |
| 36 | - .swipe-frame | |
| 37 | - .frame.deleted | |
| 38 | - %img{src: "data:#{old_file.mime_type};base64,#{Base64.encode64(old_file.data)}"} | |
| 39 | - .swipe-wrap | |
| 40 | - .frame.added | |
| 41 | - %img{src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} | |
| 42 | - %span.swipe-bar | |
| 43 | - %span.top-handle | |
| 44 | - %span.bottom-handle | |
| 45 | - | |
| 46 | - %div.onion-skin.view.hide | |
| 47 | - .onion-skin-frame | |
| 48 | - .frame.deleted | |
| 49 | - %img{src: "data:#{old_file.mime_type};base64,#{Base64.encode64(old_file.data)}"} | |
| 50 | - .frame.added | |
| 51 | - %img{src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} | |
| 52 | - .controls | |
| 53 | - .transparent | |
| 54 | - .drag-track | |
| 55 | - .dragger{:style => "left: 0px;"} | |
| 56 | - .opaque | |
| 57 | - | |
| 58 | - | |
| 59 | - .view-modes.hide | |
| 60 | - %ul.view-modes-menu | |
| 61 | - %li.two-up{data: {mode: 'two-up'}} 2-up | |
| 62 | - %li.swipe{data: {mode: 'swipe'}} Swipe | |
| 63 | - %li.onion-skin{data: {mode: 'onion-skin'}} Onion skin | |
| 64 | 0 | \ No newline at end of file |
app/views/commits/_text_file.html.haml
| ... | ... | @@ -1,23 +0,0 @@ |
| 1 | -- too_big = diff.diff.lines.count > 1000 | |
| 2 | -- if too_big | |
| 3 | - %a.supp_diff_link Diff suppressed. Click to show | |
| 4 | - | |
| 5 | -%table.text-file{class: "#{'hide' if too_big}"} | |
| 6 | - - each_diff_line(diff, index) do |line, type, line_code, line_new, line_old| | |
| 7 | - %tr.line_holder{ id: line_code, class: "#{type}" } | |
| 8 | - - if type == "match" | |
| 9 | - %td.old_line= "..." | |
| 10 | - %td.new_line= "..." | |
| 11 | - %td.line_content.matched= line | |
| 12 | - - else | |
| 13 | - %td.old_line | |
| 14 | - = link_to raw(type == "new" ? " " : line_old), "##{line_code}", id: line_code | |
| 15 | - - if @comments_allowed | |
| 16 | - = render "notes/diff_note_link", line_code: line_code | |
| 17 | - %td.new_line= link_to raw(type == "old" ? " " : line_new) , "##{line_code}", id: line_code | |
| 18 | - %td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw diff_line_content(line) | |
| 19 | - | |
| 20 | - - if @reply_allowed | |
| 21 | - - comments = @line_notes.select { |n| n.line_code == line_code }.sort_by(&:created_at) | |
| 22 | - - unless comments.empty? | |
| 23 | - = render "notes/diff_notes_with_reply", notes: comments |
app/views/commits/show.atom.builder
| ... | ... | @@ -1,23 +0,0 @@ |
| 1 | -xml.instruct! | |
| 2 | -xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do | |
| 3 | - xml.title "Recent commits to #{@project.name}:#{@ref}" | |
| 4 | - xml.link :href => project_commits_url(@project, @ref, format: :atom), :rel => "self", :type => "application/atom+xml" | |
| 5 | - xml.link :href => project_commits_url(@project, @ref), :rel => "alternate", :type => "text/html" | |
| 6 | - xml.id project_commits_url(@project) | |
| 7 | - xml.updated @commits.first.committed_date.strftime("%Y-%m-%dT%H:%M:%SZ") if @commits.any? | |
| 8 | - | |
| 9 | - @commits.each do |commit| | |
| 10 | - xml.entry do | |
| 11 | - xml.id project_commit_url(@project, :id => commit.id) | |
| 12 | - xml.link :href => project_commit_url(@project, :id => commit.id) | |
| 13 | - xml.title truncate(commit.title, :length => 80) | |
| 14 | - xml.updated commit.committed_date.strftime("%Y-%m-%dT%H:%M:%SZ") | |
| 15 | - xml.media :thumbnail, :width => "40", :height => "40", :url => gravatar_icon(commit.author_email) | |
| 16 | - xml.author do |author| | |
| 17 | - xml.name commit.author_name | |
| 18 | - xml.email commit.author_email | |
| 19 | - end | |
| 20 | - xml.summary gfm(commit.description) | |
| 21 | - end | |
| 22 | - end | |
| 23 | -end |
app/views/commits/show.html.haml
| ... | ... | @@ -1,15 +0,0 @@ |
| 1 | -= render "head" | |
| 2 | - | |
| 3 | -- if @path.present? | |
| 4 | - %ul.breadcrumb | |
| 5 | - = commits_breadcrumbs | |
| 6 | - | |
| 7 | -%div{id: dom_id(@project)} | |
| 8 | - #commits-list= render "commits" | |
| 9 | -.clear | |
| 10 | -.loading{ style: "display:none;"} | |
| 11 | - | |
| 12 | -- if @commits.count == @limit | |
| 13 | - :javascript | |
| 14 | - CommitsList.init("#{@ref}", #{@limit}); | |
| 15 | - |
app/views/commits/show.js.haml
app/views/compare/_form.html.haml
| ... | ... | @@ -1,37 +0,0 @@ |
| 1 | -%div | |
| 2 | - - unless params[:to] | |
| 3 | - %p.slead | |
| 4 | - Fill input field with commit id like | |
| 5 | - %code.label-branch 4eedf23 | |
| 6 | - or branch/tag name like | |
| 7 | - %code.label-branch master | |
| 8 | - and press compare button for commits list, code diff. | |
| 9 | - | |
| 10 | - %br | |
| 11 | - | |
| 12 | - = form_tag project_compare_index_path(@project), method: :post do | |
| 13 | - .clearfix | |
| 14 | - .pull-left | |
| 15 | - - if params[:to] && params[:from] | |
| 16 | - = link_to 'switch', {from: params[:to], to: params[:from]}, {class: 'commits-compare-switch has_tooltip', title: 'Switch base of comparison'} | |
| 17 | - = text_field_tag :from, params[:from], placeholder: "master", class: "xlarge" | |
| 18 | - = "..." | |
| 19 | - = text_field_tag :to, params[:to], placeholder: "aa8b4ef", class: "xlarge" | |
| 20 | - .pull-left | |
| 21 | - | |
| 22 | - = submit_tag "Compare", class: "btn btn-primary wide commits-compare-btn" | |
| 23 | - - if @refs_are_same | |
| 24 | - .alert | |
| 25 | - %span Refs are the same | |
| 26 | - | |
| 27 | - | |
| 28 | - | |
| 29 | -:javascript | |
| 30 | - var availableTags = #{@project.repository.ref_names.to_json}; | |
| 31 | - | |
| 32 | - $("#from, #to").autocomplete({ | |
| 33 | - source: availableTags, | |
| 34 | - minLength: 1 | |
| 35 | - }); | |
| 36 | - | |
| 37 | - disableButtonIfEmptyField('#to', '.commits-compare-btn'); |
app/views/compare/index.html.haml
app/views/compare/show.html.haml
| ... | ... | @@ -1,23 +0,0 @@ |
| 1 | -= render "commits/head" | |
| 2 | - | |
| 3 | -%h3.page_title | |
| 4 | - Compare View | |
| 5 | -%hr | |
| 6 | - | |
| 7 | -= render "form" | |
| 8 | - | |
| 9 | -- if @commits.size > 100 | |
| 10 | - .alert.alert-block | |
| 11 | - %p | |
| 12 | - %strong Warning! This comparison include 100+ commits. | |
| 13 | - %p To prevent performance issue we dont show diff information. | |
| 14 | - | |
| 15 | -- if @commits.present? | |
| 16 | - %div.ui-box | |
| 17 | - %h5.title | |
| 18 | - Commits (#{@commits.count}) | |
| 19 | - %ul.well-list= render Commit.decorate(@commits) | |
| 20 | - | |
| 21 | - - unless @diffs.empty? | |
| 22 | - %h4 Diff | |
| 23 | - = render "commits/diffs", diffs: @diffs |
app/views/dashboard/issues.html.haml
app/views/deploy_keys/_deploy_key.html.haml
| ... | ... | @@ -1,25 +0,0 @@ |
| 1 | -%li | |
| 2 | - .pull-right | |
| 3 | - - if @available_keys.include?(deploy_key) | |
| 4 | - = link_to enable_project_deploy_key_path(@project, deploy_key), class: 'btn btn-small', method: :put do | |
| 5 | - %i.icon-plus | |
| 6 | - Enable | |
| 7 | - - else | |
| 8 | - - if deploy_key.projects.count > 1 | |
| 9 | - = link_to disable_project_deploy_key_path(@project, deploy_key), class: 'btn btn-small', method: :put do | |
| 10 | - %i.icon-off | |
| 11 | - Disable | |
| 12 | - - else | |
| 13 | - = link_to 'Remove', project_deploy_key_path(@project, deploy_key), confirm: 'You are going to remove deploy key. Are you sure?', method: :delete, class: "btn btn-remove delete-key btn-small pull-right" | |
| 14 | - | |
| 15 | - | |
| 16 | - = link_to project_deploy_key_path(deploy_key.projects.include?(@project) ? @project : deploy_key.projects.first, deploy_key) do | |
| 17 | - %i.icon-key | |
| 18 | - %strong= deploy_key.title | |
| 19 | - | |
| 20 | - %p.light.prepend-top-10 | |
| 21 | - - deploy_key.projects.map(&:name_with_namespace).each do |project_name| | |
| 22 | - %span.label= project_name | |
| 23 | - %small.pull-right | |
| 24 | - Created #{time_ago_in_words(deploy_key.created_at)} ago | |
| 25 | - |
app/views/deploy_keys/_form.html.haml
| ... | ... | @@ -1,23 +0,0 @@ |
| 1 | -%div | |
| 2 | - = form_for [@project, @key], url: project_deploy_keys_path do |f| | |
| 3 | - -if @key.errors.any? | |
| 4 | - .alert.alert-error | |
| 5 | - %ul | |
| 6 | - - @key.errors.full_messages.each do |msg| | |
| 7 | - %li= msg | |
| 8 | - | |
| 9 | - .clearfix | |
| 10 | - = f.label :title | |
| 11 | - .input= f.text_field :title | |
| 12 | - .clearfix | |
| 13 | - = f.label :key | |
| 14 | - .input | |
| 15 | - = f.text_area :key, class: [:xxlarge, :thin_area] | |
| 16 | - %p.hint | |
| 17 | - Paste a machine public key here. Read more about how generate it | |
| 18 | - = link_to "here", help_ssh_path | |
| 19 | - | |
| 20 | - .actions | |
| 21 | - = f.submit 'Create', class: "btn-create btn" | |
| 22 | - = link_to "Cancel", project_deploy_keys_path(@project), class: "btn btn-cancel" | |
| 23 | - |
app/views/deploy_keys/index.html.haml
| ... | ... | @@ -1,30 +0,0 @@ |
| 1 | -%p.slead | |
| 2 | - Deploy keys allow read-only access to repository. They can be used for CI, staging or production servers | |
| 3 | - | |
| 4 | -%p | |
| 5 | - You can create a deploy key or add existing one | |
| 6 | - = link_to new_project_deploy_key_path(@project), class: "btn btn-primary pull-right", title: "New Deploy Key" do | |
| 7 | - %i.icon-plus | |
| 8 | - New Deploy Key | |
| 9 | - | |
| 10 | -%hr.clearfix | |
| 11 | - | |
| 12 | -.row | |
| 13 | - .span5.enabled-keys | |
| 14 | - %h5.cgreen | |
| 15 | - Enabled deploy keys | |
| 16 | - %small for this project | |
| 17 | - %ul.bordered-list | |
| 18 | - = render @enabled_keys | |
| 19 | - - if @enabled_keys.blank? | |
| 20 | - .light-well | |
| 21 | - %p.nothing_here_message Create #{link_to 'new deploy key', new_project_deploy_key_path(@project)} or add existing one | |
| 22 | - .span5.available-keys | |
| 23 | - %h5 | |
| 24 | - Available deploy keys | |
| 25 | - %small from projects you are able to manage | |
| 26 | - %ul.bordered-list | |
| 27 | - = render @available_keys | |
| 28 | - - if @available_keys.blank? | |
| 29 | - .light-well | |
| 30 | - %p.nothing_here_message All deploy keys created in projects you own will be displayed here |
app/views/deploy_keys/new.html.haml
app/views/deploy_keys/show.html.haml
| ... | ... | @@ -1,13 +0,0 @@ |
| 1 | -%h3.page_title | |
| 2 | - Deploy key: | |
| 3 | - = @key.title | |
| 4 | - %small | |
| 5 | - created at | |
| 6 | - = @key.created_at.stamp("Aug 21, 2011") | |
| 7 | -.back_link | |
| 8 | - = link_to project_deploy_keys_path(@project) do | |
| 9 | - ← To keys list | |
| 10 | -%hr | |
| 11 | -%pre= @key.key | |
| 12 | -.pull-right | |
| 13 | - = link_to 'Remove', project_deploy_key_path(@project, @key), confirm: 'Are you sure?', method: :delete, class: "btn-remove btn delete-key" |
app/views/edit_tree/show.html.haml
| ... | ... | @@ -1,45 +0,0 @@ |
| 1 | -.file-editor | |
| 2 | - = form_tag(project_edit_tree_path(@project, @id), method: :put, class: "form-horizontal") do | |
| 3 | - .file_holder | |
| 4 | - .file_title | |
| 5 | - %i.icon-file | |
| 6 | - %span.file_name | |
| 7 | - = @path | |
| 8 | - %small | |
| 9 | - on | |
| 10 | - %strong= @ref | |
| 11 | - %span.options | |
| 12 | - .btn-group.tree-btn-group | |
| 13 | - = link_to "Cancel", project_blob_path(@project, @id), class: "btn btn-tiny btn-cancel", confirm: leave_edit_message | |
| 14 | - .file_content.code | |
| 15 | - %pre#editor= @blob.data | |
| 16 | - | |
| 17 | - .control-group.commit_message-group | |
| 18 | - = label_tag 'commit_message', class: "control-label" do | |
| 19 | - Commit message | |
| 20 | - .controls | |
| 21 | - = text_area_tag 'commit_message', '', placeholder: "Update #{@blob.name}", required: true, rows: 3 | |
| 22 | - .form-actions | |
| 23 | - = hidden_field_tag 'last_commit', @last_commit | |
| 24 | - = hidden_field_tag 'content', '', id: :file_content | |
| 25 | - .commit-button-annotation | |
| 26 | - = button_tag "Commit changes", class: 'btn commit-btn js-commit-button btn-primary' | |
| 27 | - .message | |
| 28 | - to branch | |
| 29 | - %strong= @ref | |
| 30 | - = link_to "Cancel", project_blob_path(@project, @id), class: "btn btn-cancel", confirm: leave_edit_message | |
| 31 | - | |
| 32 | -:javascript | |
| 33 | - ace.config.set("modePath", "#{Gitlab::Application.config.assets.prefix}/ace-src-noconflict") | |
| 34 | - var ace_mode = "#{@blob.language.try(:ace_mode)}"; | |
| 35 | - var editor = ace.edit("editor"); | |
| 36 | - if (ace_mode) { | |
| 37 | - editor.getSession().setMode('ace/mode/' + ace_mode); | |
| 38 | - } | |
| 39 | - | |
| 40 | - disableButtonIfEmptyField("#commit_message", ".js-commit-button"); | |
| 41 | - | |
| 42 | - $(".js-commit-button").click(function(){ | |
| 43 | - $("#file_content").val(editor.getValue()); | |
| 44 | - $(".file-editor form").submit(); | |
| 45 | - }); |
app/views/graphs/show.html.haml
| ... | ... | @@ -1,31 +0,0 @@ |
| 1 | -.loading-graph | |
| 2 | - %center | |
| 3 | - .loading | |
| 4 | - %h3.page_title Building repository graph. Please wait a moment. | |
| 5 | - | |
| 6 | -.stat-graph | |
| 7 | - .header.clearfix | |
| 8 | - .pull-right | |
| 9 | - %select | |
| 10 | - %option{:value => "commits"} Commits | |
| 11 | - %option{:value => "additions"} Additions | |
| 12 | - %option{:value => "deletions"} Deletions | |
| 13 | - %h3#date_header.page_title | |
| 14 | - %input#brush_change{:type => "hidden"} | |
| 15 | - .graphs | |
| 16 | - #contributors-master | |
| 17 | - #contributors.clearfix | |
| 18 | - %ol.contributors-list.clearfix | |
| 19 | - | |
| 20 | -:javascript | |
| 21 | - $(".stat-graph").hide(); | |
| 22 | - | |
| 23 | - $.ajax({ | |
| 24 | - type: "GET", | |
| 25 | - url: location.href, | |
| 26 | - complete: function() { | |
| 27 | - $(".loading-graph").hide(); | |
| 28 | - $(".stat-graph").show(); | |
| 29 | - }, | |
| 30 | - dataType: "script" | |
| 31 | - }); |
app/views/graphs/show.js.haml
| ... | ... | @@ -1,16 +0,0 @@ |
| 1 | -:plain | |
| 2 | - controller = new ContributorsStatGraph | |
| 3 | - controller.init(#{@log}) | |
| 4 | - | |
| 5 | - $("select").change( function () { | |
| 6 | - var field = $(this).val() | |
| 7 | - controller.set_current_field(field) | |
| 8 | - controller.redraw_master() | |
| 9 | - controller.redraw_authors() | |
| 10 | - }) | |
| 11 | - | |
| 12 | - $("#brush_change").change( function () { | |
| 13 | - controller.change_date_header() | |
| 14 | - controller.redraw_authors() | |
| 15 | - }) | |
| 16 | - |
app/views/groups/issues.html.haml
app/views/hooks/_data_ex.html.erb
| ... | ... | @@ -1,43 +0,0 @@ |
| 1 | -<% data_ex_str = <<eos | |
| 2 | -{ | |
| 3 | - "before": "95790bf891e76fee5e1747ab589903a6a1f80f22", | |
| 4 | - "after": "da1560886d4f094c3e6c9ef40349f7d38b5d27d7", | |
| 5 | - "ref": "refs/heads/master", | |
| 6 | - "user_id": 4, | |
| 7 | - "user_name": "John Smith", | |
| 8 | - "repository": { | |
| 9 | - "name": "Diaspora", | |
| 10 | - "url": "git@localhost:diaspora.git", | |
| 11 | - "description": "", | |
| 12 | - "homepage": "http://localhost/diaspora", | |
| 13 | - }, | |
| 14 | - "commits": [ | |
| 15 | - { | |
| 16 | - "id": "b6568db1bc1dcd7f8b4d5a946b0b91f9dacd7327", | |
| 17 | - "message": "Update Catalan translation to e38cb41.", | |
| 18 | - "timestamp": "2011-12-12T14:27:31+02:00", | |
| 19 | - "url": "http://localhost/diaspora/commits/b6568db1bc1dcd7f8b4d5a946b0b91f9dacd7327", | |
| 20 | - "author": { | |
| 21 | - "name": "Jordi Mallach", | |
| 22 | - "email": "jordi@softcatala.org", | |
| 23 | - } | |
| 24 | - }, | |
| 25 | - // ... | |
| 26 | - { | |
| 27 | - "id": "da1560886d4f094c3e6c9ef40349f7d38b5d27d7", | |
| 28 | - "message": "fixed readme", | |
| 29 | - "timestamp": "2012-01-03T23:36:29+02:00", | |
| 30 | - "url": "http://localhost/diaspora/commits/da1560886d4f094c3e6c9ef40349f7d38b5d27d7", | |
| 31 | - "author": { | |
| 32 | - "name": "GitLab dev user", | |
| 33 | - "email": "gitlabdev@dv6700.(none)", | |
| 34 | - }, | |
| 35 | - }, | |
| 36 | - ], | |
| 37 | - "total_commits_count": 4, | |
| 38 | -}; | |
| 39 | -eos | |
| 40 | -%> | |
| 41 | -<div class="<%= user_color_scheme_class%>"> | |
| 42 | - <%= raw Pygments::Lexer[:js].highlight(data_ex_str) %> | |
| 43 | -</div> |
app/views/hooks/index.html.haml
| ... | ... | @@ -1,34 +0,0 @@ |
| 1 | -- if can? current_user, :admin_project, @project | |
| 2 | - .alert.alert-info | |
| 3 | - %span | |
| 4 | - Post receive hooks for binding events when someone push to repository. | |
| 5 | - %br | |
| 6 | - Read more about web hooks | |
| 7 | - %strong #{link_to "here", help_web_hooks_path, class: "vlink"} | |
| 8 | - | |
| 9 | -= form_for [@project, @hook], as: :hook, url: project_hooks_path(@project), html: { class: 'form-inline' } do |f| | |
| 10 | - -if @hook.errors.any? | |
| 11 | - .alert.alert-error | |
| 12 | - - @hook.errors.full_messages.each do |msg| | |
| 13 | - %p= msg | |
| 14 | - .clearfix | |
| 15 | - = f.label :url, "URL:" | |
| 16 | - .input | |
| 17 | - = f.text_field :url, class: "text_field xxlarge" | |
| 18 | - | |
| 19 | - = f.submit "Add Web Hook", class: "btn btn-create" | |
| 20 | -%hr | |
| 21 | - | |
| 22 | --if @hooks.any? | |
| 23 | - .ui-box | |
| 24 | - %h5.title | |
| 25 | - Hooks (#{@hooks.count}) | |
| 26 | - %ul.well-list | |
| 27 | - - @hooks.each do |hook| | |
| 28 | - %li | |
| 29 | - %span.badge.badge-info POST | |
| 30 | - → | |
| 31 | - %span.monospace= hook.url | |
| 32 | - .pull-right | |
| 33 | - = link_to 'Test Hook', test_project_hook_path(@project, hook), class: "btn btn-small grouped" | |
| 34 | - = link_to 'Remove', project_hook_path(@project, hook), confirm: 'Are you sure?', method: :delete, class: "btn btn-remove btn-small grouped" |
app/views/issues/_filter.html.haml
| ... | ... | @@ -1,23 +0,0 @@ |
| 1 | -= form_tag project_issues_path(@project), method: 'get' do | |
| 2 | - %fieldset | |
| 3 | - %ul.nav.nav-pills.nav-stacked | |
| 4 | - %li{class: ("active" if !params[:status] || params[:status].blank?)} | |
| 5 | - = link_to project_issues_path(@project, status: nil) do | |
| 6 | - Open | |
| 7 | - %li{class: ("active" if params[:status] == 'assigned-to-me')} | |
| 8 | - = link_to project_issues_path(@project, status: 'assigned-to-me') do | |
| 9 | - Assigned to me | |
| 10 | - %li{class: ("active" if params[:status] == 'created-by-me')} | |
| 11 | - = link_to project_issues_path(@project, status: 'created-by-me') do | |
| 12 | - Created by me | |
| 13 | - %li{class: ("active" if params[:status] == 'closed')} | |
| 14 | - = link_to project_issues_path(@project, status: 'closed') do | |
| 15 | - Closed | |
| 16 | - %li{class: ("active" if params[:status] == 'all')} | |
| 17 | - = link_to project_issues_path(@project, status: 'all') do | |
| 18 | - All | |
| 19 | - | |
| 20 | - %fieldset | |
| 21 | - %hr | |
| 22 | - = link_to "Reset", project_issues_path(@project), class: 'btn pull-right' | |
| 23 | - |
app/views/issues/_form.html.haml
| ... | ... | @@ -1,95 +0,0 @@ |
| 1 | -%div.issue-form-holder | |
| 2 | - %h3.page_title= @issue.new_record? ? "New Issue" : "Edit Issue ##{@issue.id}" | |
| 3 | - = form_for [@project, @issue] do |f| | |
| 4 | - -if @issue.errors.any? | |
| 5 | - .alert.alert-error | |
| 6 | - - @issue.errors.full_messages.each do |msg| | |
| 7 | - %span= msg | |
| 8 | - %br | |
| 9 | - .ui-box.ui-box-show | |
| 10 | - .ui-box-head | |
| 11 | - .clearfix | |
| 12 | - = f.label :title do | |
| 13 | - %strong= "Subject *" | |
| 14 | - .input | |
| 15 | - = f.text_field :title, maxlength: 255, class: "xxlarge js-gfm-input", autofocus: true, required: true | |
| 16 | - .ui-box-body | |
| 17 | - .clearfix | |
| 18 | - .issue_assignee.pull-left | |
| 19 | - = f.label :assignee_id do | |
| 20 | - %i.icon-user | |
| 21 | - Assign to | |
| 22 | - .input | |
| 23 | - .pull-left | |
| 24 | - = f.select(:assignee_id, @project.team.members.sort_by(&:name).map {|p| [ p.name, p.id ] }, { include_blank: "Select a user" }, {class: 'chosen'}) | |
| 25 | - .pull-right | |
| 26 | - | |
| 27 | - = link_to 'Assign to me', '#', class: 'btn btn-small assign-to-me-link' | |
| 28 | - .issue_milestone.pull-left | |
| 29 | - = f.label :milestone_id do | |
| 30 | - %i.icon-time | |
| 31 | - Milestone | |
| 32 | - .input= f.select(:milestone_id, @project.milestones.active.all.collect {|p| [ p.title, p.id ] }, { include_blank: "Select milestone" }, {class: 'chosen'}) | |
| 33 | - | |
| 34 | - .ui-box-bottom | |
| 35 | - .clearfix | |
| 36 | - = f.label :label_list do | |
| 37 | - %i.icon-tag | |
| 38 | - Labels | |
| 39 | - .input | |
| 40 | - = f.text_field :label_list, maxlength: 2000, class: "xxlarge" | |
| 41 | - %p.hint Separate with comma. | |
| 42 | - | |
| 43 | - .clearfix | |
| 44 | - = f.label :description, "Details" | |
| 45 | - .input | |
| 46 | - = f.text_area :description, class: "xxlarge js-gfm-input", rows: 14 | |
| 47 | - %p.hint Issues are parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. | |
| 48 | - | |
| 49 | - | |
| 50 | - .actions | |
| 51 | - - if @issue.new_record? | |
| 52 | - = f.submit 'Submit new issue', class: "btn btn-create" | |
| 53 | - -else | |
| 54 | - = f.submit 'Save changes', class: "btn-save btn" | |
| 55 | - | |
| 56 | - - cancel_path = @issue.new_record? ? project_issues_path(@project) : project_issue_path(@project, @issue) | |
| 57 | - = link_to "Cancel", cancel_path, class: 'btn btn-cancel' | |
| 58 | - | |
| 59 | - | |
| 60 | - | |
| 61 | - | |
| 62 | -:javascript | |
| 63 | - $("#issue_label_list") | |
| 64 | - .bind( "keydown", function( event ) { | |
| 65 | - if ( event.keyCode === $.ui.keyCode.TAB && | |
| 66 | - $( this ).data( "autocomplete" ).menu.active ) { | |
| 67 | - event.preventDefault(); | |
| 68 | - } | |
| 69 | - }) | |
| 70 | - .bind( "click", function( event ) { | |
| 71 | - $( this ).autocomplete("search", ""); | |
| 72 | - }) | |
| 73 | - .autocomplete({ | |
| 74 | - minLength: 0, | |
| 75 | - source: function( request, response ) { | |
| 76 | - response( $.ui.autocomplete.filter( | |
| 77 | - #{raw labels_autocomplete_source}, extractLast( request.term ) ) ); | |
| 78 | - }, | |
| 79 | - focus: function() { | |
| 80 | - return false; | |
| 81 | - }, | |
| 82 | - select: function(event, ui) { | |
| 83 | - var terms = split( this.value ); | |
| 84 | - terms.pop(); | |
| 85 | - terms.push( ui.item.value ); | |
| 86 | - terms.push( "" ); | |
| 87 | - this.value = terms.join( ", " ); | |
| 88 | - return false; | |
| 89 | - } | |
| 90 | - }); | |
| 91 | - | |
| 92 | - $('.assign-to-me-link').on('click', function(e){ | |
| 93 | - $('#issue_assignee_id').val("#{current_user.id}").trigger("liszt:updated"); | |
| 94 | - e.preventDefault(); | |
| 95 | - }); |
app/views/issues/_head.html.haml
| ... | ... | @@ -1,10 +0,0 @@ |
| 1 | -%ul.nav.nav-tabs | |
| 2 | - = nav_link(controller: :issues) do | |
| 3 | - = link_to 'Browse Issues', project_issues_path(@project), class: "tab" | |
| 4 | - = nav_link(controller: :milestones) do | |
| 5 | - = link_to 'Milestones', project_milestones_path(@project), class: "tab" | |
| 6 | - = nav_link(controller: :labels) do | |
| 7 | - = link_to 'Labels', project_labels_path(@project), class: "tab" | |
| 8 | - %li.pull-right | |
| 9 | - = link_to project_issues_path(@project, :atom, { private_token: current_user.private_token }) do | |
| 10 | - %i.icon-rss |
app/views/issues/_issue.html.haml
| ... | ... | @@ -1,44 +0,0 @@ |
| 1 | -%li{ id: dom_id(issue), class: issue_css_classes(issue), url: project_issue_path(issue.project, issue) } | |
| 2 | - - if controller.controller_name == 'issues' | |
| 3 | - .issue-check | |
| 4 | - = check_box_tag dom_id(issue,"selected"), nil, false, 'data-id' => issue.id, class: "selected_issue", disabled: !can?(current_user, :modify_issue, issue) | |
| 5 | - | |
| 6 | - .issue-title | |
| 7 | - %span.light= "##{issue.id}" | |
| 8 | - = link_to_gfm truncate(issue.title, length: 100), project_issue_path(issue.project, issue), class: "row_title" | |
| 9 | - | |
| 10 | - .issue-info | |
| 11 | - - if issue.assignee | |
| 12 | - assigned to #{link_to_member(@project, issue.assignee)} | |
| 13 | - - else | |
| 14 | - unassigned | |
| 15 | - - if issue.votes_count > 0 | |
| 16 | - = render 'votes/votes_inline', votable: issue | |
| 17 | - - if issue.notes.any? | |
| 18 | - %span | |
| 19 | - %i.icon-comments | |
| 20 | - = issue.notes.count | |
| 21 | - - if issue.milestone_id? | |
| 22 | - %span | |
| 23 | - %i.icon-time | |
| 24 | - = issue.milestone.title | |
| 25 | - .pull-right | |
| 26 | - %small updated #{time_ago_in_words(issue.updated_at)} ago | |
| 27 | - | |
| 28 | - .issue-labels | |
| 29 | - - issue.labels.each do |label| | |
| 30 | - %span{class: "label #{label_css_class(label.name)}"} | |
| 31 | - %i.icon-tag | |
| 32 | - = label.name | |
| 33 | - | |
| 34 | - .issue-actions | |
| 35 | - - if can? current_user, :modify_issue, issue | |
| 36 | - - if issue.closed? | |
| 37 | - = link_to 'Reopen', project_issue_path(issue.project, issue, issue: {state_event: :reopen }, status_only: true), method: :put, class: "btn btn-small grouped reopen_issue", remote: true | |
| 38 | - - else | |
| 39 | - = link_to 'Close', project_issue_path(issue.project, issue, issue: {state_event: :close }, status_only: true), method: :put, class: "btn btn-small grouped close_issue", remote: true | |
| 40 | - = link_to edit_project_issue_path(issue.project, issue), class: "btn btn-small edit-issue-link grouped" do | |
| 41 | - %i.icon-edit | |
| 42 | - Edit | |
| 43 | - | |
| 44 | - |
app/views/issues/_issues.html.haml
| ... | ... | @@ -1,94 +0,0 @@ |
| 1 | -.ui-box | |
| 2 | - .title | |
| 3 | - = check_box_tag "check_all_issues", nil, false, class: "check_all_issues left" | |
| 4 | - .clearfix | |
| 5 | - .issues_bulk_update.hide | |
| 6 | - = form_tag bulk_update_project_issues_path(@project), method: :post do | |
| 7 | - %span.update_issues_text Update selected issues with | |
| 8 | - .left | |
| 9 | - = select_tag('update[status]', options_for_select(['open', 'closed']), prompt: "Status") | |
| 10 | - = select_tag('update[assignee_id]', options_from_collection_for_select(@project.team.members, "id", "name", params[:assignee_id]), prompt: "Assignee") | |
| 11 | - = select_tag('update[milestone_id]', options_from_collection_for_select(issues_active_milestones, "id", "title", params[:milestone_id]), prompt: "Milestone") | |
| 12 | - = hidden_field_tag 'update[issues_ids]', [] | |
| 13 | - = hidden_field_tag :status, params[:status] | |
| 14 | - = button_tag "Save", class: "btn update_selected_issues btn-small btn-save" | |
| 15 | - .issues-filters | |
| 16 | - %span Filter by | |
| 17 | - .dropdown.inline.prepend-left-10 | |
| 18 | - %a.dropdown-toggle.btn.btn-small{href: '#', "data-toggle" => "dropdown"} | |
| 19 | - %i.icon-tags | |
| 20 | - %span.light labels: | |
| 21 | - - if params[:label_name].present? | |
| 22 | - %strong= params[:label_name] | |
| 23 | - - else | |
| 24 | - Any | |
| 25 | - %b.caret | |
| 26 | - %ul.dropdown-menu | |
| 27 | - %li | |
| 28 | - = link_to project_issues_with_filter_path(@project, label_name: nil) do | |
| 29 | - Any | |
| 30 | - - issue_label_names.each do |label_name| | |
| 31 | - %li | |
| 32 | - = link_to project_issues_with_filter_path(@project, label_name: label_name) do | |
| 33 | - %span{class: "label #{label_css_class(label_name)}"} | |
| 34 | - %i.icon-tag | |
| 35 | - = label_name | |
| 36 | - .dropdown.inline.prepend-left-10 | |
| 37 | - %a.dropdown-toggle.btn.btn-small{href: '#', "data-toggle" => "dropdown"} | |
| 38 | - %i.icon-user | |
| 39 | - %span.light assignee: | |
| 40 | - - if @assignee.present? | |
| 41 | - %strong= @assignee.name | |
| 42 | - - elsif params[:assignee_id] == "0" | |
| 43 | - Unassigned | |
| 44 | - - else | |
| 45 | - Any | |
| 46 | - %b.caret | |
| 47 | - %ul.dropdown-menu | |
| 48 | - %li | |
| 49 | - = link_to project_issues_with_filter_path(@project, assignee_id: nil) do | |
| 50 | - Any | |
| 51 | - = link_to project_issues_with_filter_path(@project, assignee_id: 0) do | |
| 52 | - Unassigned | |
| 53 | - - @project.team.members.sort_by(&:name).each do |user| | |
| 54 | - %li | |
| 55 | - = link_to project_issues_with_filter_path(@project, assignee_id: user.id) do | |
| 56 | - = image_tag gravatar_icon(user.email), class: "avatar s16" | |
| 57 | - = user.name | |
| 58 | - | |
| 59 | - .dropdown.inline.prepend-left-10 | |
| 60 | - %a.dropdown-toggle.btn.btn-small{href: '#', "data-toggle" => "dropdown"} | |
| 61 | - %i.icon-time | |
| 62 | - %span.light milestone: | |
| 63 | - - if @milestone.present? | |
| 64 | - %strong= @milestone.title | |
| 65 | - - elsif params[:milestone_id] == "0" | |
| 66 | - Unspecified | |
| 67 | - - else | |
| 68 | - Any | |
| 69 | - %b.caret | |
| 70 | - %ul.dropdown-menu | |
| 71 | - %li | |
| 72 | - = link_to project_issues_with_filter_path(@project, milestone_id: nil) do | |
| 73 | - Any | |
| 74 | - = link_to project_issues_with_filter_path(@project, milestone_id: 0) do | |
| 75 | - Unspecified | |
| 76 | - - issues_active_milestones.each do |milestone| | |
| 77 | - %li | |
| 78 | - = link_to project_issues_with_filter_path(@project, milestone_id: milestone.id) do | |
| 79 | - %strong= milestone.title | |
| 80 | - %small.light= milestone.expires_at | |
| 81 | - | |
| 82 | - | |
| 83 | - %ul.well-list.issues-list | |
| 84 | - = render @issues | |
| 85 | - - if @issues.blank? | |
| 86 | - %li | |
| 87 | - %h4.nothing_here_message Nothing to show here | |
| 88 | - | |
| 89 | -- if @issues.present? | |
| 90 | - .pull-right | |
| 91 | - %span.issue_counter #{@issues.total_count} | |
| 92 | - issues for this filter | |
| 93 | - | |
| 94 | - = paginate @issues, remote: true, theme: "gitlab" |
app/views/issues/edit.html.haml
| ... | ... | @@ -1 +0,0 @@ |
| 1 | -= render "form" |
app/views/issues/index.atom.builder
| ... | ... | @@ -1,23 +0,0 @@ |
| 1 | -xml.instruct! | |
| 2 | -xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do | |
| 3 | - xml.title "#{@project.name} issues" | |
| 4 | - xml.link :href => project_issues_url(@project, :atom), :rel => "self", :type => "application/atom+xml" | |
| 5 | - xml.link :href => project_issues_url(@project), :rel => "alternate", :type => "text/html" | |
| 6 | - xml.id project_issues_url(@project) | |
| 7 | - xml.updated @issues.first.created_at.strftime("%Y-%m-%dT%H:%M:%SZ") if @issues.any? | |
| 8 | - | |
| 9 | - @issues.each do |issue| | |
| 10 | - xml.entry do | |
| 11 | - xml.id project_issue_url(@project, issue) | |
| 12 | - xml.link :href => project_issue_url(@project, issue) | |
| 13 | - xml.title truncate(issue.title, :length => 80) | |
| 14 | - xml.updated issue.created_at.strftime("%Y-%m-%dT%H:%M:%SZ") | |
| 15 | - xml.media :thumbnail, :width => "40", :height => "40", :url => gravatar_icon(issue.author_email) | |
| 16 | - xml.author do |author| | |
| 17 | - xml.name issue.author_name | |
| 18 | - xml.email issue.author_email | |
| 19 | - end | |
| 20 | - xml.summary issue.title | |
| 21 | - end | |
| 22 | - end | |
| 23 | -end |
app/views/issues/index.html.haml
| ... | ... | @@ -1,25 +0,0 @@ |
| 1 | -= render "issues/head" | |
| 2 | -.issues_content | |
| 3 | - %h3.page_title | |
| 4 | - Issues | |
| 5 | - %span (<span class=issue_counter>#{@issues.total_count}</span>) | |
| 6 | - .pull-right | |
| 7 | - .span6 | |
| 8 | - - if can? current_user, :write_issue, @project | |
| 9 | - = link_to new_project_issue_path(@project, issue: { assignee_id: params[:assignee_id], milestone_id: params[:milestone_id]}), class: "btn btn-primary pull-right", title: "New Issue", id: "new_issue_link" do | |
| 10 | - %i.icon-plus | |
| 11 | - New Issue | |
| 12 | - = form_tag project_issues_path(@project), method: :get, remote: true, id: "issue_search_form", class: 'pull-right' do | |
| 13 | - = hidden_field_tag :status, params[:status], id: 'search_status' | |
| 14 | - = hidden_field_tag :assignee_id, params[:assignee_id], id: 'search_assignee_id' | |
| 15 | - = hidden_field_tag :milestone_id, params[:milestone_id], id: 'search_milestone_id' | |
| 16 | - = hidden_field_tag :label_name, params[:label_name], id: 'search_label_name' | |
| 17 | - = search_field_tag :issue_search, nil, { placeholder: 'Search', class: 'issue_search input-xlarge append-right-10 search-text-input' } | |
| 18 | - | |
| 19 | - .clearfix | |
| 20 | - | |
| 21 | -.row | |
| 22 | - .span3 | |
| 23 | - = render 'filter', entity: 'issue' | |
| 24 | - .span9.issues-holder | |
| 25 | - = render "issues" |
app/views/issues/index.js.haml
app/views/issues/new.html.haml
| ... | ... | @@ -1 +0,0 @@ |
| 1 | -= render "form" |
app/views/issues/show.html.haml
| ... | ... | @@ -1,68 +0,0 @@ |
| 1 | -%h3.page_title | |
| 2 | - Issue ##{@issue.id} | |
| 3 | - | |
| 4 | - %small | |
| 5 | - created at | |
| 6 | - = @issue.created_at.stamp("Aug 21, 2011") | |
| 7 | - | |
| 8 | - %span.pull-right | |
| 9 | - = link_to new_project_issue_path(@project), class: "btn grouped", title: "New Issue", id: "new_issue_link" do | |
| 10 | - %i.icon-plus | |
| 11 | - New Issue | |
| 12 | - - if can?(current_user, :modify_issue, @issue) | |
| 13 | - - if @issue.closed? | |
| 14 | - = link_to 'Reopen', project_issue_path(@project, @issue, issue: {state_event: :reopen }, status_only: true), method: :put, class: "btn grouped reopen_issue" | |
| 15 | - - else | |
| 16 | - = link_to 'Close', project_issue_path(@project, @issue, issue: {state_event: :close }, status_only: true), method: :put, class: "btn grouped close_issue", title: "Close Issue" | |
| 17 | - | |
| 18 | - = link_to edit_project_issue_path(@project, @issue), class: "btn grouped" do | |
| 19 | - %i.icon-edit | |
| 20 | - Edit | |
| 21 | - | |
| 22 | -.pull-right | |
| 23 | - .span3#votes= render 'votes/votes_block', votable: @issue | |
| 24 | - | |
| 25 | -.back_link | |
| 26 | - = link_to project_issues_path(@project) do | |
| 27 | - ← To issues list | |
| 28 | - | |
| 29 | - | |
| 30 | -.ui-box.ui-box-show | |
| 31 | - .ui-box-head | |
| 32 | - %h4.box-title | |
| 33 | - - if @issue.closed? | |
| 34 | - .error.status_info Closed | |
| 35 | - = gfm escape_once(@issue.title) | |
| 36 | - | |
| 37 | - .ui-box-body | |
| 38 | - %cite.cgray | |
| 39 | - Created by #{link_to_member(@project, @issue.author)} | |
| 40 | - - if @issue.assignee | |
| 41 | - \ and currently assigned to #{link_to_member(@project, @issue.assignee)} | |
| 42 | - | |
| 43 | - - if @issue.milestone | |
| 44 | - - milestone = @issue.milestone | |
| 45 | - %cite.cgray and attached to milestone | |
| 46 | - %strong= link_to_gfm truncate(milestone.title, length: 20), project_milestone_path(milestone.project, milestone) | |
| 47 | - | |
| 48 | - .pull-right | |
| 49 | - - @issue.labels.each do |label| | |
| 50 | - %span{class: "label #{label_css_class(label.name)}"} | |
| 51 | - %i.icon-tag | |
| 52 | - = label.name | |
| 53 | - | |
| 54 | - | |
| 55 | - - if @issue.description.present? | |
| 56 | - .ui-box-bottom | |
| 57 | - .wiki | |
| 58 | - = preserve do | |
| 59 | - = markdown @issue.description | |
| 60 | - | |
| 61 | -- content_for :note_actions do | |
| 62 | - - if can?(current_user, :modify_issue, @issue) | |
| 63 | - - if @issue.closed? | |
| 64 | - = link_to 'Reopen Issue', project_issue_path(@project, @issue, issue: {state_event: :reopen }, status_only: true), method: :put, class: "btn grouped reopen_issue" | |
| 65 | - - else | |
| 66 | - = link_to 'Close Issue', project_issue_path(@project, @issue, issue: {state_event: :close }, status_only: true), method: :put, class: "btn grouped close_issue", title: "Close Issue" | |
| 67 | - | |
| 68 | -.voting_notes#notes= render "notes/notes_with_form" |
app/views/issues/update.js.haml
app/views/labels/_label.html.haml
| ... | ... | @@ -1,15 +0,0 @@ |
| 1 | -- frequency = @project.issues.tagged_with(label.name).count | |
| 2 | -%li | |
| 3 | - %strong | |
| 4 | - %span{class: "label #{label_css_class(label.name)}"} | |
| 5 | - %i.icon-tag | |
| 6 | - - if frequency.zero? | |
| 7 | - %span.light= label.name | |
| 8 | - - else | |
| 9 | - = label.name | |
| 10 | - .pull-right | |
| 11 | - - unless frequency.zero? | |
| 12 | - = link_to project_issues_path(label_name: label.name) do | |
| 13 | - %strong | |
| 14 | - = pluralize(frequency, 'issue') | |
| 15 | - = "»" |
app/views/labels/index.html.haml
| ... | ... | @@ -1,14 +0,0 @@ |
| 1 | -= render "issues/head" | |
| 2 | - | |
| 3 | -%h3.page_title | |
| 4 | - Labels | |
| 5 | -%br | |
| 6 | - | |
| 7 | -- if @labels.present? | |
| 8 | - %ul.bordered-list.labels-table | |
| 9 | - - @labels.each do |label| | |
| 10 | - = render 'label', label: label | |
| 11 | - | |
| 12 | -- else | |
| 13 | - .light-well | |
| 14 | - %h3.nothing_here_message Add first label to your issues or #{link_to 'generate', generate_project_labels_path(@project), method: :post} default set of labels |
app/views/layouts/project_resource.html.haml
| ... | ... | @@ -1,15 +0,0 @@ |
| 1 | -!!! 5 | |
| 2 | -%html{ lang: "en"} | |
| 3 | - = render "layouts/head", title: @project.name_with_namespace | |
| 4 | - %body{class: "#{app_theme} project", :'data-page' => body_data_page, :'data-project-id' => @project.id } | |
| 5 | - = render "layouts/head_panel", title: project_title(@project) | |
| 6 | - = render "layouts/init_auto_complete" | |
| 7 | - = render "layouts/flash" | |
| 8 | - - if can?(current_user, :download_code, @project) | |
| 9 | - = render 'shared/no_ssh' | |
| 10 | - | |
| 11 | - %nav.main-nav | |
| 12 | - .container= render 'layouts/nav/project' | |
| 13 | - | |
| 14 | - .container | |
| 15 | - .content= yield |
| ... | ... | @@ -0,0 +1,15 @@ |
| 1 | +!!! 5 | |
| 2 | +%html{ lang: "en"} | |
| 3 | + = render "layouts/head", title: @project.name_with_namespace | |
| 4 | + %body{class: "#{app_theme} project", :'data-page' => body_data_page, :'data-project-id' => @project.id } | |
| 5 | + = render "layouts/head_panel", title: project_title(@project) | |
| 6 | + = render "layouts/init_auto_complete" | |
| 7 | + = render "layouts/flash" | |
| 8 | + - if can?(current_user, :download_code, @project) | |
| 9 | + = render 'shared/no_ssh' | |
| 10 | + | |
| 11 | + %nav.main-nav | |
| 12 | + .container= render 'layouts/nav/project' | |
| 13 | + | |
| 14 | + .container | |
| 15 | + .content= yield | ... | ... |
app/views/merge_requests/_filter.html.haml
| ... | ... | @@ -1,20 +0,0 @@ |
| 1 | -= form_tag project_issues_path(@project), method: 'get' do | |
| 2 | - %fieldset | |
| 3 | - %ul.nav.nav-pills.nav-stacked | |
| 4 | - %li{class: ("active" if (params[:f] == 'open' || !params[:f]))} | |
| 5 | - = link_to project_merge_requests_path(@project, f: 'open', milestone_id: params[:milestone_id]) do | |
| 6 | - Open | |
| 7 | - %li{class: ("active" if params[:f] == "closed")} | |
| 8 | - = link_to project_merge_requests_path(@project, f: "closed", milestone_id: params[:milestone_id]) do | |
| 9 | - Closed | |
| 10 | - %li{class: ("active" if params[:f] == 'assigned-to-me')} | |
| 11 | - = link_to project_merge_requests_path(@project, f: 'assigned-to-me', milestone_id: params[:milestone_id]) do | |
| 12 | - Assigned To Me | |
| 13 | - %li{class: ("active" if params[:f] == 'all')} | |
| 14 | - = link_to project_merge_requests_path(@project, f: 'all', milestone_id: params[:milestone_id]) do | |
| 15 | - All | |
| 16 | - | |
| 17 | - %fieldset | |
| 18 | - %hr | |
| 19 | - = link_to "Reset", project_merge_requests_path(@project), class: 'btn pull-right' | |
| 20 | - |
app/views/merge_requests/_form.html.haml
| ... | ... | @@ -1,79 +0,0 @@ |
| 1 | -= form_for [@project, @merge_request], html: { class: "#{controller.action_name}-merge-request form-horizontal" } do |f| | |
| 2 | - -if @merge_request.errors.any? | |
| 3 | - .alert.alert-error | |
| 4 | - %ul | |
| 5 | - - @merge_request.errors.full_messages.each do |msg| | |
| 6 | - %li= msg | |
| 7 | - | |
| 8 | - %fieldset | |
| 9 | - %legend 1. Select Branches | |
| 10 | - | |
| 11 | - .row | |
| 12 | - .span5 | |
| 13 | - .mr_branch_box | |
| 14 | - %h5.cgray From (Head Branch) | |
| 15 | - .body | |
| 16 | - .padded= f.select(:source_branch, @repository.branch_names, { include_blank: "Select branch" }, {class: 'chosen span4'}) | |
| 17 | - .mr_source_commit | |
| 18 | - | |
| 19 | - .span2 | |
| 20 | - %center= image_tag "merge.png", class: 'mr_direction_tip' | |
| 21 | - .span5 | |
| 22 | - .mr_branch_box | |
| 23 | - %h5.cgray To (Base Branch) | |
| 24 | - .body | |
| 25 | - .padded= f.select(:target_branch, @repository.branch_names, { include_blank: "Select branch" }, {class: 'chosen span4'}) | |
| 26 | - .mr_target_commit | |
| 27 | - | |
| 28 | - %fieldset | |
| 29 | - %legend 2. Fill info | |
| 30 | - | |
| 31 | - .ui-box.ui-box-show | |
| 32 | - .ui-box-head | |
| 33 | - .clearfix | |
| 34 | - = f.label :title do | |
| 35 | - %strong= "Title *" | |
| 36 | - .input= f.text_field :title, class: "input-xxlarge pad js-gfm-input", maxlength: 255, rows: 5, required: true | |
| 37 | - .ui-box-body | |
| 38 | - .clearfix | |
| 39 | - .left | |
| 40 | - = f.label :assignee_id do | |
| 41 | - %i.icon-user | |
| 42 | - Assign to | |
| 43 | - .input= f.select(:assignee_id, @project.team.members.sort_by(&:name).map {|p| [ p.name, p.id ] }, { include_blank: "Select user" }, {class: 'chosen span3'}) | |
| 44 | - .left | |
| 45 | - = f.label :milestone_id do | |
| 46 | - %i.icon-time | |
| 47 | - Milestone | |
| 48 | - .input= f.select(:milestone_id, @project.milestones.active.all.map {|p| [ p.title, p.id ] }, { include_blank: "Select milestone" }, {class: 'chosen'}) | |
| 49 | - | |
| 50 | - .control-group | |
| 51 | - | |
| 52 | - .form-actions | |
| 53 | - - if @merge_request.new_record? | |
| 54 | - = f.submit 'Submit merge request', class: "btn btn-create" | |
| 55 | - -else | |
| 56 | - = f.submit 'Save changes', class: "btn btn-save" | |
| 57 | - - if @merge_request.new_record? | |
| 58 | - = link_to project_merge_requests_path(@project), class: "btn btn-cancel" do | |
| 59 | - Cancel | |
| 60 | - - else | |
| 61 | - = link_to project_merge_request_path(@project, @merge_request), class: "btn btn-cancel" do | |
| 62 | - Cancel | |
| 63 | - | |
| 64 | -:javascript | |
| 65 | - disableButtonIfEmptyField("#merge_request_title", ".btn-save"); | |
| 66 | - | |
| 67 | - var source_branch = $("#merge_request_source_branch") | |
| 68 | - , target_branch = $("#merge_request_target_branch"); | |
| 69 | - | |
| 70 | - $.get("#{branch_from_project_merge_requests_path(@project)}", {ref: source_branch.val() }); | |
| 71 | - $.get("#{branch_to_project_merge_requests_path(@project)}", {ref: target_branch.val() }); | |
| 72 | - | |
| 73 | - source_branch.live("change", function() { | |
| 74 | - $.get("#{branch_from_project_merge_requests_path(@project)}", {ref: $(this).val() }); | |
| 75 | - }); | |
| 76 | - | |
| 77 | - target_branch.live("change", function() { | |
| 78 | - $.get("#{branch_to_project_merge_requests_path(@project)}", {ref: $(this).val() }); | |
| 79 | - }); |
app/views/merge_requests/_head.html.haml
app/views/merge_requests/_merge_request.html.haml
| ... | ... | @@ -1,29 +0,0 @@ |
| 1 | -%li{ class: mr_css_classes(merge_request) } | |
| 2 | - .merge-request-title | |
| 3 | - %span.light= "##{merge_request.id}" | |
| 4 | - = link_to_gfm truncate(merge_request.title, length: 80), project_merge_request_path(merge_request.project, merge_request), class: "row_title" | |
| 5 | - - if merge_request.merged? | |
| 6 | - %small.pull-right | |
| 7 | - %i.icon-ok | |
| 8 | - = "MERGED" | |
| 9 | - - else | |
| 10 | - %span.pull-right | |
| 11 | - %i.icon-angle-right | |
| 12 | - = merge_request.target_branch | |
| 13 | - .merge-request-info | |
| 14 | - - if merge_request.author | |
| 15 | - authored by #{link_to_member(@project, merge_request.author)} | |
| 16 | - - if merge_request.votes_count > 0 | |
| 17 | - = render 'votes/votes_inline', votable: merge_request | |
| 18 | - - if merge_request.notes.any? | |
| 19 | - %span | |
| 20 | - %i.icon-comments | |
| 21 | - = merge_request.mr_and_commit_notes.count | |
| 22 | - - if merge_request.milestone_id? | |
| 23 | - %span | |
| 24 | - %i.icon-time | |
| 25 | - = merge_request.milestone.title | |
| 26 | - | |
| 27 | - | |
| 28 | - .pull-right | |
| 29 | - %small updated #{time_ago_in_words(merge_request.updated_at)} ago |
app/views/merge_requests/_show.html.haml
| ... | ... | @@ -1,37 +0,0 @@ |
| 1 | -.merge-request | |
| 2 | - = render "merge_requests/show/mr_title" | |
| 3 | - = render "merge_requests/show/how_to_merge" | |
| 4 | - = render "merge_requests/show/mr_box" | |
| 5 | - = render "merge_requests/show/mr_accept" | |
| 6 | - - if @project.gitlab_ci? | |
| 7 | - = render "merge_requests/show/mr_ci" | |
| 8 | - = render "merge_requests/show/commits" | |
| 9 | - | |
| 10 | - - if @commits.present? | |
| 11 | - %ul.nav.nav-tabs | |
| 12 | - %li.notes-tab{data: {action: 'notes'}} | |
| 13 | - = link_to project_merge_request_path(@project, @merge_request) do | |
| 14 | - %i.icon-comment | |
| 15 | - Discussion | |
| 16 | - %li.diffs-tab{data: {action: 'diffs'}} | |
| 17 | - = link_to diffs_project_merge_request_path(@project, @merge_request) do | |
| 18 | - %i.icon-list-alt | |
| 19 | - Diff | |
| 20 | - | |
| 21 | - .notes.tab-content.voting_notes#notes{ class: (controller.action_name == 'show') ? "" : "hide" } | |
| 22 | - = render "notes/notes_with_form" | |
| 23 | - .diffs.tab-content | |
| 24 | - = render "merge_requests/show/diffs" if @diffs | |
| 25 | - .status | |
| 26 | - | |
| 27 | -:javascript | |
| 28 | - var merge_request; | |
| 29 | - | |
| 30 | - merge_request = new MergeRequest({ | |
| 31 | - url_to_automerge_check: "#{automerge_check_project_merge_request_path(@project, @merge_request)}", | |
| 32 | - check_enable: #{@merge_request.unchecked? ? "true" : "false"}, | |
| 33 | - url_to_ci_check: "#{ci_status_project_merge_request_path(@project, @merge_request)}", | |
| 34 | - ci_enable: #{@project.gitlab_ci? ? "true" : "false"}, | |
| 35 | - current_status: "#{@merge_request.merge_status_name}", | |
| 36 | - action: "#{controller.action_name}" | |
| 37 | - }); |
app/views/merge_requests/automerge.js.haml
app/views/merge_requests/branch_from.js.haml
app/views/merge_requests/branch_to.js.haml
app/views/merge_requests/commits.js.haml
app/views/merge_requests/diffs.html.haml
| ... | ... | @@ -1 +0,0 @@ |
| 1 | -= render "show" |
app/views/merge_requests/diffs.js.haml
app/views/merge_requests/edit.html.haml
app/views/merge_requests/index.html.haml
| ... | ... | @@ -1,35 +0,0 @@ |
| 1 | -- if can? current_user, :write_merge_request, @project | |
| 2 | - = link_to new_project_merge_request_path(@project), class: "pull-right btn btn-primary", title: "New Merge Request" do | |
| 3 | - %i.icon-plus | |
| 4 | - New Merge Request | |
| 5 | -%h3.page_title | |
| 6 | - Merge Requests | |
| 7 | - | |
| 8 | -%br | |
| 9 | - | |
| 10 | - | |
| 11 | -.row | |
| 12 | - .span3 | |
| 13 | - = render 'filter' | |
| 14 | - .span9 | |
| 15 | - .ui-box | |
| 16 | - .title | |
| 17 | - = form_tag project_merge_requests_path(@project), id: "merge_requests_search_form", method: :get, class: :left do | |
| 18 | - = select_tag(:assignee_id, options_from_collection_for_select([unassigned_filter] + @project.users.all, "id", "name", params[:assignee_id]), prompt: "Assignee") | |
| 19 | - = select_tag(:milestone_id, options_from_collection_for_select([unassigned_filter] + @project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), prompt: "Milestone") | |
| 20 | - = hidden_field_tag :f, params[:f] | |
| 21 | - .clearfix | |
| 22 | - | |
| 23 | - %ul.well-list.mr-list | |
| 24 | - = render @merge_requests | |
| 25 | - - if @merge_requests.blank? | |
| 26 | - %li | |
| 27 | - %h4.nothing_here_message Nothing to show here | |
| 28 | - - if @merge_requests.present? | |
| 29 | - .pull-right | |
| 30 | - %span.cgray.pull-right #{@merge_requests.total_count} merge requests for this filter | |
| 31 | - | |
| 32 | - = paginate @merge_requests, theme: "gitlab" | |
| 33 | - | |
| 34 | -:javascript | |
| 35 | - $(merge_requestsPage); |
app/views/merge_requests/invalid.html.haml
| ... | ... | @@ -1,17 +0,0 @@ |
| 1 | -.merge-request | |
| 2 | - = render "merge_requests/show/mr_title" | |
| 3 | - = render "merge_requests/show/mr_box" | |
| 4 | - | |
| 5 | - .alert.alert-error | |
| 6 | - %h5 | |
| 7 | - %i.icon-exclamation-sign | |
| 8 | - We cannot find | |
| 9 | - %span.label-branch= @merge_request.source_branch | |
| 10 | - or | |
| 11 | - %span.label-branch= @merge_request.target_branch | |
| 12 | - branches in the repository. | |
| 13 | - %p | |
| 14 | - Maybe it was removed or never pushed. | |
| 15 | - %p | |
| 16 | - Please close Merge Request or change branches with existing one | |
| 17 | - |
app/views/merge_requests/new.html.haml
app/views/merge_requests/show.html.haml
| ... | ... | @@ -1 +0,0 @@ |
| 1 | -= render "show" |
app/views/merge_requests/show.js.haml
app/views/merge_requests/show/_commits.html.haml
| ... | ... | @@ -1,30 +0,0 @@ |
| 1 | -- if @commits.present? | |
| 2 | - .ui-box | |
| 3 | - %h5.title | |
| 4 | - %i.icon-list | |
| 5 | - Commits (#{@commits.count}) | |
| 6 | - .commits | |
| 7 | - - if @commits.count > 8 | |
| 8 | - %ul.first-commits.well-list | |
| 9 | - - @commits.first(8).each do |commit| | |
| 10 | - = render "commits/commit", commit: commit | |
| 11 | - %li.bottom | |
| 12 | - 8 of #{@commits.count} commits displayed. | |
| 13 | - %strong | |
| 14 | - %a.show-all-commits Click here to show all | |
| 15 | - %ul.all-commits.hide.well-list | |
| 16 | - - @commits.each do |commit| | |
| 17 | - = render "commits/commit", commit: commit | |
| 18 | - | |
| 19 | - - else | |
| 20 | - %ul.well-list | |
| 21 | - - @commits.each do |commit| | |
| 22 | - = render "commits/commit", commit: commit | |
| 23 | - | |
| 24 | -- else | |
| 25 | - %h4.nothing_here_message | |
| 26 | - Nothing to merge from | |
| 27 | - %span.label-branch #{@merge_request.source_branch} | |
| 28 | - to | |
| 29 | - %span.label-branch #{@merge_request.target_branch} | |
| 30 | - %br |
app/views/merge_requests/show/_diffs.html.haml
| ... | ... | @@ -1,10 +0,0 @@ |
| 1 | -- if @merge_request.valid_diffs? | |
| 2 | - = render "commits/diffs", diffs: @diffs | |
| 3 | -- elsif @merge_request.broken_diffs? | |
| 4 | - %h4.nothing_here_message | |
| 5 | - Can't load diff. | |
| 6 | - You can | |
| 7 | - = link_to "download it", project_merge_request_path(@project, @merge_request, format: :diff), class: "vlink" | |
| 8 | - instead. | |
| 9 | -- else | |
| 10 | - %h4.nothing_here_message Nothing to merge |
app/views/merge_requests/show/_how_to_merge.html.haml
| ... | ... | @@ -1,19 +0,0 @@ |
| 1 | -%div#modal_merge_info.modal.hide | |
| 2 | - .modal-header | |
| 3 | - %a.close{href: "#"} × | |
| 4 | - %h3 How To Merge | |
| 5 | - .modal-body | |
| 6 | - %p | |
| 7 | - %strong Step 1. | |
| 8 | - Checkout target branch and get recent objects from GitLab | |
| 9 | - %pre.dark | |
| 10 | - :preserve | |
| 11 | - git checkout #{@merge_request.target_branch} | |
| 12 | - git fetch origin | |
| 13 | - %p | |
| 14 | - %strong Step 2. | |
| 15 | - Merge source branch into target branch and push changes to GitLab | |
| 16 | - %pre.dark | |
| 17 | - :preserve | |
| 18 | - git merge origin/#{@merge_request.source_branch} | |
| 19 | - git push origin #{@merge_request.target_branch} |
app/views/merge_requests/show/_mr_accept.html.haml
| ... | ... | @@ -1,52 +0,0 @@ |
| 1 | -- unless @allowed_to_merge | |
| 2 | - .alert | |
| 3 | - %strong You don't have enough permissions to merge this MR | |
| 4 | - | |
| 5 | - | |
| 6 | -- if @show_merge_controls | |
| 7 | - .automerge_widget.can_be_merged{style: "display:none"} | |
| 8 | - .alert.alert-success | |
| 9 | - %span | |
| 10 | - = form_for [:automerge, @project, @merge_request], remote: true, method: :get do |f| | |
| 11 | - %p | |
| 12 | - You can accept this request automatically. | |
| 13 | - If you still want to do it manually - | |
| 14 | - %strong= link_to "click here", "#", class: "how_to_merge_link vlink", title: "How To Merge" | |
| 15 | - for instructions | |
| 16 | - .accept_group | |
| 17 | - = f.submit "Accept Merge Request", class: "btn success accept_merge_request" | |
| 18 | - - unless @project.root_ref? @merge_request.source_branch | |
| 19 | - .remove_branch_holder | |
| 20 | - = label_tag :should_remove_source_branch, class: "checkbox" do | |
| 21 | - = check_box_tag :should_remove_source_branch | |
| 22 | - Remove source-branch | |
| 23 | - .clearfix | |
| 24 | - | |
| 25 | - | |
| 26 | - .automerge_widget.no_satellite{style: "display:none"} | |
| 27 | - .alert.alert-error | |
| 28 | - %span | |
| 29 | - %strong This repository does not have satellite. Ask administrator to fix this issue | |
| 30 | - | |
| 31 | - .automerge_widget.cannot_be_merged{style: "display:none"} | |
| 32 | - .alert.alert-disabled | |
| 33 | - %span | |
| 34 | - = link_to "Show how to merge", "#", class: "how_to_merge_link btn btn-small padded", title: "How To Merge" | |
| 35 | - | |
| 36 | - %strong This request can't be merged with GitLab. You should do it manually | |
| 37 | - | |
| 38 | - .automerge_widget.unchecked | |
| 39 | - .alert | |
| 40 | - %strong | |
| 41 | - %i.icon-refresh | |
| 42 | - Checking for ability to automatically merge… | |
| 43 | - | |
| 44 | - .automerge_widget.already_cannot_be_merged{style: "display:none"} | |
| 45 | - .alert.alert-info | |
| 46 | - %strong This merge request already can not be merged. Try to reload page. | |
| 47 | - | |
| 48 | - .merge-in-progress.hide | |
| 49 | - %span.cgray | |
| 50 | - %i.icon-refresh.icon-spin | |
| 51 | - | |
| 52 | - Merge is in progress. Please wait. Page will be automatically reloaded. |
app/views/merge_requests/show/_mr_box.html.haml
| ... | ... | @@ -1,36 +0,0 @@ |
| 1 | -.ui-box.ui-box-show | |
| 2 | - .ui-box-head | |
| 3 | - %h4.box-title | |
| 4 | - = gfm escape_once(@merge_request.title) | |
| 5 | - - if @merge_request.merged? | |
| 6 | - .success.status_info | |
| 7 | - %i.icon-ok | |
| 8 | - Merged | |
| 9 | - - elsif @merge_request.closed? | |
| 10 | - .error.status_info Closed | |
| 11 | - | |
| 12 | - .ui-box-body | |
| 13 | - %div | |
| 14 | - %cite.cgray | |
| 15 | - Created at #{@merge_request.created_at.stamp("Aug 21, 2011")} by #{link_to_member(@project, @merge_request.author)} | |
| 16 | - - if @merge_request.assignee | |
| 17 | - \, currently assigned to #{link_to_member(@project, @merge_request.assignee)} | |
| 18 | - - if @merge_request.milestone | |
| 19 | - - milestone = @merge_request.milestone | |
| 20 | - %cite.cgray and attached to milestone | |
| 21 | - %strong= link_to_gfm truncate(milestone.title, length: 20), project_milestone_path(milestone.project, milestone) | |
| 22 | - | |
| 23 | - | |
| 24 | - - if @merge_request.closed? | |
| 25 | - .ui-box-bottom.alert-error | |
| 26 | - %span | |
| 27 | - %i.icon-remove | |
| 28 | - Closed by #{link_to_member(@project, @merge_request.closed_event.author)} | |
| 29 | - %small #{time_ago_in_words(@merge_request.closed_event.created_at)} ago. | |
| 30 | - - if @merge_request.merged? | |
| 31 | - .ui-box-bottom.alert-success | |
| 32 | - %span | |
| 33 | - %i.icon-ok | |
| 34 | - Merged by #{link_to_member(@project, @merge_request.merge_event.author)} | |
| 35 | - #{time_ago_in_words(@merge_request.merge_event.created_at)} ago. | |
| 36 | - |
app/views/merge_requests/show/_mr_ci.html.haml
| ... | ... | @@ -1,35 +0,0 @@ |
| 1 | -- if @commits.any? | |
| 2 | - .ci_widget.ci-success{style: "display:none"} | |
| 3 | - .alert.alert-success | |
| 4 | - %i.icon-ok | |
| 5 | - %strong CI build passed | |
| 6 | - for #{@merge_request.last_commit_short_sha}. | |
| 7 | - = link_to "Build page", ci_build_details_path(@merge_request) | |
| 8 | - | |
| 9 | - | |
| 10 | - .ci_widget.ci-failed{style: "display:none"} | |
| 11 | - .alert.alert-error | |
| 12 | - %i.icon-remove | |
| 13 | - %strong CI build failed | |
| 14 | - for #{@merge_request.last_commit_short_sha}. | |
| 15 | - = link_to "Build page", ci_build_details_path(@merge_request) | |
| 16 | - | |
| 17 | - - [:running, :pending].each do |status| | |
| 18 | - .ci_widget{class: "ci-#{status}", style: "display:none"} | |
| 19 | - .alert | |
| 20 | - %i.icon-time | |
| 21 | - %strong CI build #{status} | |
| 22 | - for #{@merge_request.last_commit_short_sha}. | |
| 23 | - = link_to "Build page", ci_build_details_path(@merge_request) | |
| 24 | - | |
| 25 | - .ci_widget | |
| 26 | - .alert | |
| 27 | - %strong | |
| 28 | - %i.icon-refresh | |
| 29 | - Checking for CI status for #{@merge_request.last_commit_short_sha} | |
| 30 | - | |
| 31 | - .ci_widget.ci-error{style: "display:none"} | |
| 32 | - .alert.alert-error | |
| 33 | - %i.icon-remove | |
| 34 | - %strong Cannot connect to CI server. Please check your setting | |
| 35 | - |
app/views/merge_requests/show/_mr_title.html.haml
| ... | ... | @@ -1,31 +0,0 @@ |
| 1 | -%h3.page_title | |
| 2 | - = "Merge Request ##{@merge_request.id}:" | |
| 3 | - | |
| 4 | - %span.label-branch= @merge_request.source_branch | |
| 5 | - → | |
| 6 | - %span.label-branch= @merge_request.target_branch | |
| 7 | - | |
| 8 | - %span.pull-right | |
| 9 | - - if can?(current_user, :modify_merge_request, @merge_request) | |
| 10 | - - if @merge_request.opened? | |
| 11 | - .left.btn-group | |
| 12 | - %a.btn.grouped.dropdown-toggle{ data: {toggle: :dropdown} } | |
| 13 | - %i.icon-download-alt | |
| 14 | - Download as | |
| 15 | - %span.caret | |
| 16 | - %ul.dropdown-menu | |
| 17 | - %li= link_to "Email Patches", project_merge_request_path(@project, @merge_request, format: :patch) | |
| 18 | - %li= link_to "Plain Diff", project_merge_request_path(@project, @merge_request, format: :diff) | |
| 19 | - | |
| 20 | - = link_to 'Close', project_merge_request_path(@project, @merge_request, merge_request: {state_event: :close }), method: :put, class: "btn grouped btn-close", title: "Close merge request" | |
| 21 | - | |
| 22 | - = link_to edit_project_merge_request_path(@project, @merge_request), class: "btn grouped" do | |
| 23 | - %i.icon-edit | |
| 24 | - Edit | |
| 25 | - | |
| 26 | -.pull-right | |
| 27 | - .span3#votes= render 'votes/votes_block', votable: @merge_request | |
| 28 | - | |
| 29 | -.back_link | |
| 30 | - = link_to project_merge_requests_path(@project) do | |
| 31 | - ← To merge requests |
app/views/milestones/_form.html.haml
| ... | ... | @@ -1,47 +0,0 @@ |
| 1 | -%h3.page_title= @milestone.new_record? ? "New Milestone" : "Edit Milestone ##{@milestone.id}" | |
| 2 | -.back_link | |
| 3 | - = link_to project_milestones_path(@project) do | |
| 4 | - ← To milestones | |
| 5 | - | |
| 6 | -%hr | |
| 7 | - | |
| 8 | -= form_for [@project, @milestone], html: {class: "new_milestone form-horizontal"} do |f| | |
| 9 | - -if @milestone.errors.any? | |
| 10 | - .alert.alert-error | |
| 11 | - %ul | |
| 12 | - - @milestone.errors.full_messages.each do |msg| | |
| 13 | - %li= msg | |
| 14 | - .row | |
| 15 | - .span6 | |
| 16 | - .control-group | |
| 17 | - = f.label :title, "Title", class: "control-label" | |
| 18 | - .controls | |
| 19 | - = f.text_field :title, maxlength: 255, class: "input-xlarge" | |
| 20 | - %p.hint Required | |
| 21 | - .control-group | |
| 22 | - = f.label :description, "Description", class: "control-label" | |
| 23 | - .controls | |
| 24 | - = f.text_area :description, maxlength: 2000, class: "input-xlarge", rows: 10 | |
| 25 | - %p.hint Milestones are parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. | |
| 26 | - .span6 | |
| 27 | - .control-group | |
| 28 | - = f.label :due_date, "Due Date", class: "control-label" | |
| 29 | - .input= f.hidden_field :due_date | |
| 30 | - .controls | |
| 31 | - .datepicker | |
| 32 | - | |
| 33 | - .form-actions | |
| 34 | - - if @milestone.new_record? | |
| 35 | - = f.submit 'Create milestone', class: "btn-save btn" | |
| 36 | - = link_to "Cancel", project_milestones_path(@project), class: "btn btn-cancel" | |
| 37 | - -else | |
| 38 | - = f.submit 'Save changes', class: "btn-save btn" | |
| 39 | - = link_to "Cancel", project_milestone_path(@project, @milestone), class: "btn btn-cancel" | |
| 40 | - | |
| 41 | - | |
| 42 | -:javascript | |
| 43 | - disableButtonIfEmptyField("#milestone_title", ".btn-save"); | |
| 44 | - $( ".datepicker" ).datepicker({ | |
| 45 | - dateFormat: "yy-mm-dd", | |
| 46 | - onSelect: function(dateText, inst) { $("#milestone_due_date").val(dateText) } | |
| 47 | - }).datepicker("setDate", $.datepicker.parseDate('yy-mm-dd', $('#milestone_due_date').val())); |
app/views/milestones/_issues.html.haml
| ... | ... | @@ -1,11 +0,0 @@ |
| 1 | -.ui-box | |
| 2 | - %h5.title= title | |
| 3 | - %ul.well-list | |
| 4 | - - issues.each do |issue| | |
| 5 | - %li | |
| 6 | - = link_to [@project, issue] do | |
| 7 | - %span.badge{class: issue.closed? ? 'badge-important' : 'badge-info'} ##{issue.id} | |
| 8 | - = link_to_gfm truncate(issue.title, length: 60), [@project, issue] | |
| 9 | - - if issue.assignee | |
| 10 | - .pull-right | |
| 11 | - = image_tag gravatar_icon(issue.assignee.email, 16), class: "avatar s16" |
app/views/milestones/_merge_request.html.haml
app/views/milestones/_milestone.html.haml
| ... | ... | @@ -1,28 +0,0 @@ |
| 1 | -%li{class: "milestone milestone-#{milestone.closed? ? 'closed' : 'open'}", id: dom_id(milestone) } | |
| 2 | - .pull-right | |
| 3 | - - if can?(current_user, :admin_milestone, milestone.project) and milestone.active? | |
| 4 | - = link_to edit_project_milestone_path(milestone.project, milestone), class: "btn btn-small edit-milestone-link grouped" do | |
| 5 | - %i.icon-edit | |
| 6 | - Edit | |
| 7 | - - if milestone.can_be_closed? | |
| 8 | - = link_to 'Close', project_milestone_path(@project, milestone, milestone: {state_event: :close }), method: :put, remote: true, class: "btn btn-small btn-remove" | |
| 9 | - %h4 | |
| 10 | - = link_to_gfm truncate(milestone.title, length: 100), project_milestone_path(milestone.project, milestone) | |
| 11 | - - if milestone.expired? and not milestone.closed? | |
| 12 | - %span.cred (Expired) | |
| 13 | - %small | |
| 14 | - = milestone.expires_at | |
| 15 | - - if milestone.is_empty? | |
| 16 | - %span.muted Empty | |
| 17 | - - else | |
| 18 | - %div | |
| 19 | - %div | |
| 20 | - = link_to project_issues_path(milestone.project, milestone_id: milestone.id) do | |
| 21 | - = pluralize milestone.issues.count, 'Issue' | |
| 22 | - | |
| 23 | - = link_to project_merge_requests_path(milestone.project, milestone_id: milestone.id) do | |
| 24 | - = pluralize milestone.merge_requests.count, 'Merge Request' | |
| 25 | - | |
| 26 | - %span.light #{milestone.percent_complete}% complete | |
| 27 | - .progress.progress-info | |
| 28 | - .bar{style: "width: #{milestone.percent_complete}%;"} |
app/views/milestones/edit.html.haml
| ... | ... | @@ -1 +0,0 @@ |
| 1 | -= render "form" |
app/views/milestones/index.html.haml
| ... | ... | @@ -1,32 +0,0 @@ |
| 1 | -= render "issues/head" | |
| 2 | -.milestones_content | |
| 3 | - %h3.page_title | |
| 4 | - Milestones | |
| 5 | - - if can? current_user, :admin_milestone, @project | |
| 6 | - = link_to new_project_milestone_path(@project), class: "pull-right btn btn-primary", title: "New Milestone" do | |
| 7 | - %i.icon-plus | |
| 8 | - New Milestone | |
| 9 | - %br | |
| 10 | - | |
| 11 | - .row | |
| 12 | - .span3 | |
| 13 | - %ul.nav.nav-pills.nav-stacked | |
| 14 | - %li{class: ("active" if (params[:f] == "active" || !params[:f]))} | |
| 15 | - = link_to project_milestones_path(@project, f: "active") do | |
| 16 | - Active | |
| 17 | - %li{class: ("active" if params[:f] == "closed")} | |
| 18 | - = link_to project_milestones_path(@project, f: "closed") do | |
| 19 | - Closed | |
| 20 | - %li{class: ("active" if params[:f] == "all")} | |
| 21 | - = link_to project_milestones_path(@project, f: "all") do | |
| 22 | - All | |
| 23 | - .span9 | |
| 24 | - .ui-box | |
| 25 | - %ul.well-list | |
| 26 | - = render @milestones | |
| 27 | - | |
| 28 | - - if @milestones.blank? | |
| 29 | - %li | |
| 30 | - %h3.nothing_here_message Nothing to show here | |
| 31 | - | |
| 32 | - = paginate @milestones, theme: "gitlab" |
app/views/milestones/new.html.haml
| ... | ... | @@ -1 +0,0 @@ |
| 1 | -= render "form" |
app/views/milestones/show.html.haml
| ... | ... | @@ -1,106 +0,0 @@ |
| 1 | -= render "issues/head" | |
| 2 | -.row | |
| 3 | - .span6 | |
| 4 | - %h3.page_title | |
| 5 | - Milestone ##{@milestone.id} | |
| 6 | - %small | |
| 7 | - = @milestone.expires_at | |
| 8 | - .back_link | |
| 9 | - = link_to project_milestones_path(@project) do | |
| 10 | - ← To milestones list | |
| 11 | - .span6 | |
| 12 | - .pull-right | |
| 13 | - - unless @milestone.closed? | |
| 14 | - = link_to new_project_issue_path(@project, issue: { milestone_id: @milestone.id }), class: "btn btn-small grouped", title: "New Issue" do | |
| 15 | - %i.icon-plus | |
| 16 | - New Issue | |
| 17 | - = link_to 'Browse Issues', project_issues_path(@milestone.project, milestone_id: @milestone.id), class: "btn edit-milestone-link small grouped" | |
| 18 | - - if can?(current_user, :admin_milestone, @project) | |
| 19 | - = link_to edit_project_milestone_path(@project, @milestone), class: "btn btn-small grouped" do | |
| 20 | - %i.icon-edit | |
| 21 | - Edit | |
| 22 | - | |
| 23 | - | |
| 24 | - | |
| 25 | -- if @milestone.can_be_closed? | |
| 26 | - %hr | |
| 27 | - %p | |
| 28 | - %span All issues for this milestone are closed. You may close milestone now. | |
| 29 | - = link_to 'Close Milestone', project_milestone_path(@project, @milestone, milestone: {state_event: :close }), method: :put, class: "btn btn-small btn-remove" | |
| 30 | - | |
| 31 | -.ui-box.ui-box-show | |
| 32 | - .ui-box-head | |
| 33 | - %h4.box-title | |
| 34 | - - if @milestone.closed? | |
| 35 | - .error.status_info Closed | |
| 36 | - - elsif @milestone.expired? | |
| 37 | - .error.status_info Expired | |
| 38 | - | |
| 39 | - = gfm escape_once(@milestone.title) | |
| 40 | - | |
| 41 | - .ui-box-body | |
| 42 | - %p | |
| 43 | - Progress: | |
| 44 | - #{@milestone.closed_items_count} closed | |
| 45 | - – | |
| 46 | - #{@milestone.open_items_count} open | |
| 47 | - %span.pull-right= @milestone.expires_at | |
| 48 | - .progress.progress-info | |
| 49 | - .bar{style: "width: #{@milestone.percent_complete}%;"} | |
| 50 | - | |
| 51 | - | |
| 52 | - - if @milestone.description.present? | |
| 53 | - .ui-box-bottom | |
| 54 | - = preserve do | |
| 55 | - = markdown @milestone.description | |
| 56 | - | |
| 57 | - | |
| 58 | -%ul.nav.nav-tabs | |
| 59 | - %li.active | |
| 60 | - = link_to '#tab-issues', 'data-toggle' => 'tab' do | |
| 61 | - Issues | |
| 62 | - %span.badge= @issues.count | |
| 63 | - %li | |
| 64 | - = link_to '#tab-merge-requests', 'data-toggle' => 'tab' do | |
| 65 | - Merge Requests | |
| 66 | - %span.badge= @merge_requests.count | |
| 67 | - %li | |
| 68 | - = link_to '#tab-participants', 'data-toggle' => 'tab' do | |
| 69 | - Participants | |
| 70 | - %span.badge= @users.count | |
| 71 | - | |
| 72 | - | |
| 73 | -.tab-content | |
| 74 | - .tab-pane.active#tab-issues | |
| 75 | - .row | |
| 76 | - .span4 | |
| 77 | - = render('issues', title: 'Unstarted Issues (open and unassigned)', issues: @issues.opened.unassigned) | |
| 78 | - .span4 | |
| 79 | - = render('issues', title: 'Ongoing Issues (open and assigned)', issues: @issues.opened.assigned) | |
| 80 | - .span4 | |
| 81 | - = render('issues', title: 'Completed Issues (closed)', issues: @issues.closed) | |
| 82 | - | |
| 83 | - .tab-pane#tab-merge-requests | |
| 84 | - .row | |
| 85 | - .span6 | |
| 86 | - .ui-box | |
| 87 | - %h5.title Open | |
| 88 | - %ul.well-list | |
| 89 | - - @merge_requests.opened.each do |merge_request| | |
| 90 | - = render 'merge_request', merge_request: merge_request | |
| 91 | - .span6 | |
| 92 | - .ui-box | |
| 93 | - %h5.title Closed | |
| 94 | - %ul.well-list | |
| 95 | - - @merge_requests.closed.each do |merge_request| | |
| 96 | - = render 'merge_request', merge_request: merge_request | |
| 97 | - | |
| 98 | - .tab-pane#tab-participants | |
| 99 | - %ul.bordered-list | |
| 100 | - - @users.each do |user| | |
| 101 | - %li | |
| 102 | - = link_to user, title: user.name, class: "dark" do | |
| 103 | - = image_tag gravatar_icon(user.email, 32), class: "avatar s32" | |
| 104 | - %strong= truncate(user.name, lenght: 40) | |
| 105 | - %br | |
| 106 | - %small.cgray= user.username |
app/views/milestones/update.js.haml
app/views/network/_head.html.haml
| ... | ... | @@ -1,26 +0,0 @@ |
| 1 | -%h3.page_title Project Network Graph | |
| 2 | -%hr | |
| 3 | - | |
| 4 | -.clearfix | |
| 5 | - .pull-left | |
| 6 | - = render partial: 'shared/ref_switcher', locals: {destination: 'graph'} | |
| 7 | - .pull-left | |
| 8 | - = form_tag project_network_path(@project, @id), method: :get do |f| | |
| 9 | - .control-group | |
| 10 | - = label_tag :filter_ref, "Show only selected ref", class: 'control-label light' | |
| 11 | - .controls | |
| 12 | - = check_box_tag :filter_ref, 1, @options[:filter_ref] | |
| 13 | - - @options.each do |key, value| | |
| 14 | - = hidden_field_tag(key, value, id: nil) unless key == "filter_ref" | |
| 15 | - | |
| 16 | - .search.pull-right | |
| 17 | - = form_tag project_network_path(@project, @id), method: :get do |f| | |
| 18 | - .control-group | |
| 19 | - = label_tag :search , "Looking for commit:", class: 'control-label light' | |
| 20 | - .controls | |
| 21 | - = text_field_tag :q, @options[:q], placeholder: "Input SHA", class: "search-input xlarge" | |
| 22 | - = button_tag type: 'submit', class: 'btn vtop' do | |
| 23 | - %i.icon-search | |
| 24 | - - @options.each do |key, value| | |
| 25 | - = hidden_field_tag(key, value, id: nil) unless key == "q" | |
| 26 | - |
app/views/network/show.html.haml
| ... | ... | @@ -1,18 +0,0 @@ |
| 1 | -= render "head" | |
| 2 | -.graph_holder | |
| 3 | - %h4 | |
| 4 | - %small You can move around the graph by using the arrow keys. | |
| 5 | - #holder.graph | |
| 6 | - .loading.loading-gray | |
| 7 | - | |
| 8 | -:javascript | |
| 9 | - var branch_graph; | |
| 10 | - $("#filter_ref").click(function() { | |
| 11 | - $(this).closest('form').submit(); | |
| 12 | - }); | |
| 13 | - branch_graph = new BranchGraph($("#holder"), { | |
| 14 | - url: '#{project_network_path(@project, @ref, @options.merge(format: :json))}', | |
| 15 | - commit_url: '#{project_commit_path(@project, 'ae45ca32').gsub("ae45ca32", "%s")}', | |
| 16 | - ref: '#{@ref}', | |
| 17 | - commit_id: '#{@commit.id}' | |
| 18 | - }); |
app/views/network/show.json.erb
| ... | ... | @@ -1,23 +0,0 @@ |
| 1 | -<% self.formats = ["html"] %> | |
| 2 | - | |
| 3 | -<%= raw( | |
| 4 | - { | |
| 5 | - days: @graph.days.compact.map { |d| [d.day, d.strftime("%b")] }, | |
| 6 | - commits: @graph.commits.map do |c| | |
| 7 | - { | |
| 8 | - parents: parents_zip_spaces(c.parents(@graph.map), c.parent_spaces), | |
| 9 | - author: { | |
| 10 | - name: c.author_name, | |
| 11 | - email: c.author_email, | |
| 12 | - icon: gravatar_icon(c.author_email, 20) | |
| 13 | - }, | |
| 14 | - time: c.time, | |
| 15 | - space: c.spaces.first, | |
| 16 | - refs: get_refs(c), | |
| 17 | - id: c.sha, | |
| 18 | - date: c.date, | |
| 19 | - message: c.message, | |
| 20 | - } | |
| 21 | - end | |
| 22 | - }.to_json | |
| 23 | -) %> |
app/views/notes/_diff_note_link.html.haml
| ... | ... | @@ -1,10 +0,0 @@ |
| 1 | -- note = @project.notes.new(@comments_target.merge({ line_code: line_code })) | |
| 2 | -= link_to "", | |
| 3 | - "javascript:;", | |
| 4 | - class: "add-diff-note js-add-diff-note-button", | |
| 5 | - data: { noteable_type: note.noteable_type, | |
| 6 | - noteable_id: note.noteable_id, | |
| 7 | - commit_id: note.commit_id, | |
| 8 | - line_code: note.line_code, | |
| 9 | - discussion_id: note.discussion_id }, | |
| 10 | - title: "Add a comment to this line" |
app/views/notes/_diff_notes_with_reply.html.haml
| ... | ... | @@ -1,11 +0,0 @@ |
| 1 | -- note = notes.first # example note | |
| 2 | -%tr.notes_holder | |
| 3 | - %td.notes_line{ colspan: 2 } | |
| 4 | - %span.btn.disabled | |
| 5 | - %i.icon-comment | |
| 6 | - = notes.count | |
| 7 | - %td.notes_content | |
| 8 | - %ul.notes{ rel: note.discussion_id } | |
| 9 | - = render notes | |
| 10 | - | |
| 11 | - = render "notes/discussion_reply_button", note: note |
app/views/notes/_discussion.html.haml
| ... | ... | @@ -1,63 +0,0 @@ |
| 1 | -- note = discussion_notes.first | |
| 2 | -.discussion.js-details-container.js-toggler-container.open{ class: note.discussion_id } | |
| 3 | - .discussion-header | |
| 4 | - .discussion-actions | |
| 5 | - = link_to "javascript:;", class: "js-details-target turn-on js-toggler-target" do | |
| 6 | - %i.icon-eye-close | |
| 7 | - Hide discussion | |
| 8 | - = link_to "javascript:;", class: "js-details-target turn-off js-toggler-target" do | |
| 9 | - %i.icon-eye-open | |
| 10 | - Show discussion | |
| 11 | - = image_tag gravatar_icon(note.author_email), class: "avatar s32" | |
| 12 | - %div | |
| 13 | - = link_to_member(@project, note.author, avatar: false) | |
| 14 | - - if note.for_merge_request? | |
| 15 | - - if note.diff | |
| 16 | - started a discussion on this merge request diff | |
| 17 | - = link_to_merge_request_diff_line_note(note) | |
| 18 | - - else | |
| 19 | - started | |
| 20 | - %strong | |
| 21 | - %i.icon-remove | |
| 22 | - outdated | |
| 23 | - discussion on this merge request diff | |
| 24 | - - elsif note.for_commit? | |
| 25 | - started a discussion on commit | |
| 26 | - #{link_to note.noteable.short_id, project_commit_path(@project, note.noteable)} | |
| 27 | - = link_to_commit_diff_line_note(note) if note.for_diff_line? | |
| 28 | - - else | |
| 29 | - %cite.cgray started a discussion | |
| 30 | - %div | |
| 31 | - - last_note = discussion_notes.last | |
| 32 | - last updated by | |
| 33 | - = link_to_member(@project, last_note.author, avatar: false) | |
| 34 | - %span.discussion-last-update | |
| 35 | - = time_ago_in_words(last_note.updated_at) | |
| 36 | - ago | |
| 37 | - .discussion-body | |
| 38 | - - if note.for_diff_line? | |
| 39 | - - if note.diff | |
| 40 | - .content | |
| 41 | - .file= render "notes/discussion_diff", discussion_notes: discussion_notes, note: note | |
| 42 | - - else | |
| 43 | - = link_to 'show outdated discussion', '#', class: 'js-show-outdated-discussion' | |
| 44 | - %div.hide.outdated-discussion | |
| 45 | - .content | |
| 46 | - .notes{ rel: discussion_notes.first.discussion_id } | |
| 47 | - = render discussion_notes | |
| 48 | - | |
| 49 | - | |
| 50 | - - else | |
| 51 | - .content | |
| 52 | - .notes{ rel: discussion_notes.first.discussion_id } | |
| 53 | - = render discussion_notes | |
| 54 | - = render "notes/discussion_reply_button", note: discussion_notes.first | |
| 55 | - | |
| 56 | - -# will be shown when the other one is hidden | |
| 57 | - .discussion-hidden.content.hide | |
| 58 | - .note | |
| 59 | - %em Hidden discussion. | |
| 60 | - = link_to "javascript:;", class: "js-details-target js-toggler-target" do | |
| 61 | - %i.icon-eye-open | |
| 62 | - Show | |
| 63 | - |
app/views/notes/_discussion_diff.html.haml
| ... | ... | @@ -1,24 +0,0 @@ |
| 1 | -- diff = note.diff | |
| 2 | -.header | |
| 3 | - - if diff.deleted_file | |
| 4 | - %span= diff.old_path | |
| 5 | - - else | |
| 6 | - %span= diff.new_path | |
| 7 | - - if diff.a_mode && diff.b_mode && diff.a_mode != diff.b_mode | |
| 8 | - %span.file-mode= "#{diff.a_mode} → #{diff.b_mode}" | |
| 9 | - %br/ | |
| 10 | -.content | |
| 11 | - %table | |
| 12 | - - each_diff_line_near(diff, note.diff_file_index, note.line_code) do |line, type, line_code, line_new, line_old| | |
| 13 | - %tr.line_holder{ id: line_code } | |
| 14 | - - if type == "match" | |
| 15 | - %td.old_line= "..." | |
| 16 | - %td.new_line= "..." | |
| 17 | - %td.line_content.matched= line | |
| 18 | - - else | |
| 19 | - %td.old_line= raw(type == "new" ? " " : line_old) | |
| 20 | - %td.new_line= raw(type == "old" ? " " : line_new) | |
| 21 | - %td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw "#{line} " | |
| 22 | - | |
| 23 | - - if line_code == note.line_code | |
| 24 | - = render "notes/diff_notes_with_reply", notes: discussion_notes |
app/views/notes/_discussion_reply_button.html.haml
| ... | ... | @@ -1,10 +0,0 @@ |
| 1 | -= link_to "javascript:;", | |
| 2 | - class: "btn reply-btn js-discussion-reply-button", | |
| 3 | - data: { noteable_type: note.noteable_type, | |
| 4 | - noteable_id: note.noteable_id, | |
| 5 | - commit_id: note.commit_id, | |
| 6 | - line_code: note.line_code, | |
| 7 | - discussion_id: note.discussion_id }, | |
| 8 | - title: "Add a reply" do | |
| 9 | - %i.icon-comment | |
| 10 | - Reply |
app/views/notes/_form.html.haml
| ... | ... | @@ -1,37 +0,0 @@ |
| 1 | -= form_for [@project, @note], remote: true, html: { multipart: true, id: nil, class: "new_note js-new-note-form common-note-form" } do |f| | |
| 2 | - | |
| 3 | - = note_target_fields | |
| 4 | - = f.hidden_field :commit_id | |
| 5 | - = f.hidden_field :line_code | |
| 6 | - = f.hidden_field :noteable_id | |
| 7 | - = f.hidden_field :noteable_type | |
| 8 | - | |
| 9 | - .note_text_and_preview.js-toggler-container | |
| 10 | - %a.js-note-preview-button.js-toggler-target.turn-off{ href: "javascript:;", title: "Preview", data: {url: preview_project_notes_path(@project)} } | |
| 11 | - %i.icon-eye-open | |
| 12 | - %a.js-note-edit-button.js-toggler-target.turn-off{ href: "javascript:;", title: "Edit" } | |
| 13 | - %i.icon-edit | |
| 14 | - | |
| 15 | - = f.text_area :note, size: 255, class: 'note_text js-note-text js-gfm-input turn-on' | |
| 16 | - .note_preview.js-note-preview.turn-off | |
| 17 | - | |
| 18 | - .hint | |
| 19 | - .pull-right Comments are parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. | |
| 20 | - .clearfix | |
| 21 | - | |
| 22 | - .note-form-actions | |
| 23 | - .buttons | |
| 24 | - = f.submit 'Add Comment', class: "btn comment-btn grouped js-comment-button" | |
| 25 | - = yield(:note_actions) | |
| 26 | - | |
| 27 | - %a.btn.grouped.js-close-discussion-note-form Cancel | |
| 28 | - | |
| 29 | - .note-form-option | |
| 30 | - %a.choose-btn.btn.btn-small.js-choose-note-attachment-button | |
| 31 | - %i.icon-paper-clip | |
| 32 | - %span Choose File ... | |
| 33 | - | |
| 34 | - %span.file_name.js-attachment-filename File name... | |
| 35 | - = f.file_field :attachment, class: "js-note-attachment-input hide" | |
| 36 | - | |
| 37 | - .clearfix |
app/views/notes/_form_errors.html.haml
app/views/notes/_note.html.haml
| ... | ... | @@ -1,37 +0,0 @@ |
| 1 | -%li{ id: dom_id(note), class: dom_class(note), data: { discussion: note.discussion_id } } | |
| 2 | - .note-header | |
| 3 | - .note-actions | |
| 4 | - = link_to "##{dom_id(note)}", name: dom_id(note) do | |
| 5 | - %i.icon-link | |
| 6 | - Link here | |
| 7 | - | |
| 8 | - - if(note.author_id == current_user.id) || can?(current_user, :admin_note, @project) | |
| 9 | - = link_to project_note_path(@project, note), title: "Remove comment", method: :delete, confirm: 'Are you sure you want to remove comment?', remote: true, class: "danger js-note-delete" do | |
| 10 | - %i.icon-trash.cred | |
| 11 | - = image_tag gravatar_icon(note.author_email), class: "avatar s32" | |
| 12 | - = link_to_member(@project, note.author, avatar: false) | |
| 13 | - %span.note-last-update | |
| 14 | - = time_ago_in_words(note.updated_at) | |
| 15 | - ago | |
| 16 | - | |
| 17 | - - if note.upvote? | |
| 18 | - %span.vote.upvote.label.label-success | |
| 19 | - %i.icon-thumbs-up | |
| 20 | - \+1 | |
| 21 | - - if note.downvote? | |
| 22 | - %span.vote.downvote.label.label-error | |
| 23 | - %i.icon-thumbs-down | |
| 24 | - \-1 | |
| 25 | - | |
| 26 | - | |
| 27 | - .note-body | |
| 28 | - = preserve do | |
| 29 | - = markdown(note.note) | |
| 30 | - - if note.attachment.url | |
| 31 | - - if note.attachment.image? | |
| 32 | - = image_tag note.attachment.url, class: 'note-image-attach' | |
| 33 | - .attachment.pull-right | |
| 34 | - = link_to note.attachment.secure_url, target: "_blank" do | |
| 35 | - %i.icon-paper-clip | |
| 36 | - = note.attachment_identifier | |
| 37 | - .clear |
app/views/notes/_notes.html.haml
| ... | ... | @@ -1,11 +0,0 @@ |
| 1 | -- if @discussions.present? | |
| 2 | - - @discussions.each do |discussion_notes| | |
| 3 | - - note = discussion_notes.first | |
| 4 | - - if note_for_main_target?(note) | |
| 5 | - = render discussion_notes | |
| 6 | - - else | |
| 7 | - = render 'discussion', discussion_notes: discussion_notes | |
| 8 | -- else | |
| 9 | - - @notes.each do |note| | |
| 10 | - - next unless note.author | |
| 11 | - = render 'note', note: note |
app/views/notes/_notes_with_form.html.haml
app/views/notes/create.js.haml
| ... | ... | @@ -1,18 +0,0 @@ |
| 1 | -- if @note.valid? | |
| 2 | - var noteHtml = "#{escape_javascript(render "notes/note", note: @note)}"; | |
| 3 | - | |
| 4 | - - if note_for_main_target?(@note) | |
| 5 | - NoteList.appendNewNote(#{@note.id}, noteHtml); | |
| 6 | - - else | |
| 7 | - :plain | |
| 8 | - var firstDiscussionNoteHtml = "#{escape_javascript(render "notes/diff_notes_with_reply", notes: [@note])}"; | |
| 9 | - NoteList.appendNewDiscussionNote("#{@note.discussion_id}", | |
| 10 | - firstDiscussionNoteHtml, | |
| 11 | - noteHtml); | |
| 12 | - | |
| 13 | -- else | |
| 14 | - var errorsHtml = "#{escape_javascript(render 'notes/form_errors', note: @note)}"; | |
| 15 | - - if note_for_main_target?(@note) | |
| 16 | - NoteList.errorsOnForm(errorsHtml); | |
| 17 | - - else | |
| 18 | - NoteList.errorsOnForm(errorsHtml, "#{@note.discussion_id}"); |
app/views/notes/index.js.haml
| ... | ... | @@ -0,0 +1,49 @@ |
| 1 | += render "head" | |
| 2 | + | |
| 3 | +#tree-holder.tree-holder | |
| 4 | + %ul.breadcrumb | |
| 5 | + %li | |
| 6 | + %i.icon-angle-right | |
| 7 | + = link_to project_tree_path(@project, @ref) do | |
| 8 | + = @project.name | |
| 9 | + - tree_breadcrumbs(@tree, 6) do |link| | |
| 10 | + \/ | |
| 11 | + %li= link | |
| 12 | + .clear | |
| 13 | + | |
| 14 | + .file_holder | |
| 15 | + .file_title | |
| 16 | + %i.icon-file | |
| 17 | + %span.file_name | |
| 18 | + = @blob.name | |
| 19 | + %small= number_to_human_size @blob.size | |
| 20 | + %span.options= render "projects/blob/actions" | |
| 21 | + .file_content.blame | |
| 22 | + %table | |
| 23 | + - current_line = 1 | |
| 24 | + - @blame.each do |commit, lines| | |
| 25 | + - commit = Commit.new(commit) | |
| 26 | + %tr | |
| 27 | + %td.blame-commit | |
| 28 | + %span.commit | |
| 29 | + = link_to commit.short_id(8), project_commit_path(@project, commit), class: "commit_short_id" | |
| 30 | + | |
| 31 | + = commit_author_link(commit, avatar: true, size: 16) | |
| 32 | + | |
| 33 | + = link_to_gfm truncate(commit.title, length: 20), project_commit_path(@project, commit.id), class: "row_title" | |
| 34 | + %td.lines.blame-numbers | |
| 35 | + %pre | |
| 36 | + - if lines.empty? | |
| 37 | + = current_line | |
| 38 | + - current_line += 1 | |
| 39 | + - else | |
| 40 | + - lines.each do |line| | |
| 41 | + = current_line | |
| 42 | + \ | |
| 43 | + - current_line += 1 | |
| 44 | + %td.lines | |
| 45 | + %pre | |
| 46 | + :erb | |
| 47 | + <% lines.each do |line| %> | |
| 48 | + <%= line %> | |
| 49 | + <% end %> | ... | ... |
| ... | ... | @@ -0,0 +1,12 @@ |
| 1 | +.btn-group.tree-btn-group | |
| 2 | + -# only show edit link for text files | |
| 3 | + - if @blob.text? | |
| 4 | + = link_to "edit", project_edit_tree_path(@project, @id), class: "btn btn-tiny", disabled: !allowed_tree_edit? | |
| 5 | + = link_to "raw", project_raw_path(@project, @id), class: "btn btn-tiny", target: "_blank" | |
| 6 | + -# only show normal/blame view links for text files | |
| 7 | + - if @blob.text? | |
| 8 | + - if current_page? project_blame_path(@project, @id) | |
| 9 | + = link_to "normal view", project_blob_path(@project, @id), class: "btn btn-tiny" | |
| 10 | + - else | |
| 11 | + = link_to "blame", project_blame_path(@project, @id), class: "btn btn-tiny" unless @blob.empty? | |
| 12 | + = link_to "history", project_commits_path(@project, @id), class: "btn btn-tiny" | ... | ... |
| ... | ... | @@ -0,0 +1,32 @@ |
| 1 | +%ul.breadcrumb | |
| 2 | + %li | |
| 3 | + %i.icon-angle-right | |
| 4 | + = link_to project_tree_path(@project, @ref) do | |
| 5 | + = @project.path | |
| 6 | + - tree_breadcrumbs(@tree, 6) do |title, path| | |
| 7 | + \/ | |
| 8 | + %li | |
| 9 | + - if path | |
| 10 | + - if path.end_with?(@path) | |
| 11 | + = link_to project_blob_path(@project, path) do | |
| 12 | + %span.cblue | |
| 13 | + = truncate(title, length: 40) | |
| 14 | + - else | |
| 15 | + = link_to truncate(title, length: 40), project_tree_path(@project, path) | |
| 16 | + - else | |
| 17 | + = link_to title, '#' | |
| 18 | + | |
| 19 | +%div#tree-content-holder.tree-content-holder | |
| 20 | + .file_holder | |
| 21 | + .file_title | |
| 22 | + %i.icon-file | |
| 23 | + %span.file_name | |
| 24 | + = blob.name | |
| 25 | + %small= number_to_human_size blob.size | |
| 26 | + %span.options= render "actions" | |
| 27 | + - if blob.text? | |
| 28 | + = render "text", blob: blob | |
| 29 | + - elsif blob.image? | |
| 30 | + = render "image", blob: blob | |
| 31 | + - else | |
| 32 | + = render "download", blob: blob | ... | ... |
| ... | ... | @@ -0,0 +1,14 @@ |
| 1 | +- if gitlab_markdown?(blob.name) | |
| 2 | + .file_content.wiki | |
| 3 | + = preserve do | |
| 4 | + = markdown(blob.data) | |
| 5 | +- elsif markup?(blob.name) | |
| 6 | + .file_content.wiki | |
| 7 | + = raw GitHub::Markup.render(blob.name, blob.data) | |
| 8 | +- else | |
| 9 | + .file_content.code | |
| 10 | + - unless blob.empty? | |
| 11 | + %div{class: user_color_scheme_class} | |
| 12 | + = raw blob.colorize(formatter: :gitlab) | |
| 13 | + - else | |
| 14 | + %p.nothing_here_message Empty file | ... | ... |
| ... | ... | @@ -0,0 +1,50 @@ |
| 1 | +.ui-box.ui-box-show | |
| 2 | + .ui-box-head | |
| 3 | + .pull-right | |
| 4 | + - if @notes_count > 0 | |
| 5 | + %span.btn.disabled.grouped | |
| 6 | + %i.icon-comment | |
| 7 | + = @notes_count | |
| 8 | + .left.btn-group | |
| 9 | + %a.btn.grouped.dropdown-toggle{ data: {toggle: :dropdown} } | |
| 10 | + %i.icon-download-alt | |
| 11 | + Download as | |
| 12 | + %span.caret | |
| 13 | + %ul.dropdown-menu | |
| 14 | + %li= link_to "Email Patches", project_commit_path(@project, @commit, format: :patch) | |
| 15 | + %li= link_to "Plain Diff", project_commit_path(@project, @commit, format: :diff) | |
| 16 | + = link_to project_tree_path(@project, @commit), class: "btn btn-primary grouped" do | |
| 17 | + %span Browse Code » | |
| 18 | + %h3.commit-title.page_title | |
| 19 | + = gfm escape_once(@commit.title) | |
| 20 | + - if @commit.description.present? | |
| 21 | + %pre.commit-description | |
| 22 | + = gfm escape_once(@commit.description) | |
| 23 | + .ui-box-body | |
| 24 | + .row | |
| 25 | + .span5 | |
| 26 | + .author | |
| 27 | + = commit_author_link(@commit, avatar: true, size: 32) | |
| 28 | + authored | |
| 29 | + %time{title: @commit.authored_date.stamp("Aug 21, 2011 9:23pm")} | |
| 30 | + #{time_ago_in_words(@commit.authored_date)} ago | |
| 31 | + - if @commit.different_committer? | |
| 32 | + .committer | |
| 33 | + → | |
| 34 | + = commit_committer_link(@commit) | |
| 35 | + committed | |
| 36 | + %time{title: @commit.committed_date.stamp("Aug 21, 2011 9:23pm")} | |
| 37 | + #{time_ago_in_words(@commit.committed_date)} ago | |
| 38 | + .span6.pull-right | |
| 39 | + .pull-right | |
| 40 | + .sha-block | |
| 41 | + %span.cgray commit | |
| 42 | + %span.label_commit= @commit.id | |
| 43 | + .clearfix | |
| 44 | + .pull-right | |
| 45 | + .sha-block | |
| 46 | + %span.cgray= pluralize(@commit.parents.count, "parent") | |
| 47 | + - @commit.parents.each do |parent| | |
| 48 | + = link_to parent.id[0...10], project_commit_path(@project, parent) | |
| 49 | + | |
| 50 | + | ... | ... |
| ... | ... | @@ -0,0 +1,11 @@ |
| 1 | += render "commit_box" | |
| 2 | + | |
| 3 | +- unless @commit.has_zero_stats? | |
| 4 | + %p.pull-right.cgray | |
| 5 | + This commit has | |
| 6 | + %span.cgreen #{@commit.stats.additions} additions | |
| 7 | + and | |
| 8 | + %span.cred #{@commit.stats.deletions} deletions | |
| 9 | + | |
| 10 | += render "projects/commits/diffs", diffs: @commit.diffs | |
| 11 | += render "projects/notes/notes_with_form" | ... | ... |
| ... | ... | @@ -0,0 +1,21 @@ |
| 1 | +%li.commit | |
| 2 | + .browse_code_link_holder | |
| 3 | + %p | |
| 4 | + %strong= link_to "Browse Code »", project_tree_path(@project, commit), class: "right" | |
| 5 | + %p | |
| 6 | + = link_to commit.short_id(8), project_commit_path(@project, commit), class: "commit_short_id" | |
| 7 | + = commit_author_link(commit, avatar: true, size: 24) | |
| 8 | + | |
| 9 | + = link_to_gfm truncate(commit.title, length: 70), project_commit_path(@project, commit.id), class: "row_title" | |
| 10 | + | |
| 11 | + %time.committed_ago{ datetime: commit.committed_date, title: commit.committed_date.stamp("Aug 21, 2011 9:23pm") } | |
| 12 | + = time_ago_in_words(commit.committed_date) | |
| 13 | + ago | |
| 14 | + | |
| 15 | + | |
| 16 | + %span.notes_count | |
| 17 | + - notes = @project.notes.for_commit_id(commit.id) | |
| 18 | + - if notes.any? | |
| 19 | + %span.badge.badge-info | |
| 20 | + %i.icon-comment | |
| 21 | + = notes.count | ... | ... |
| ... | ... | @@ -0,0 +1,9 @@ |
| 1 | +- @commits.group_by { |c| c.committed_date.to_date }.sort.reverse.each do |day, commits| | |
| 2 | + %div.ui-box | |
| 3 | + %h5.title | |
| 4 | + %i.icon-calendar | |
| 5 | + %span= day.stamp("28 Aug, 2010") | |
| 6 | + | |
| 7 | + .pull-right | |
| 8 | + %small= pluralize(commits.count, 'commit') | |
| 9 | + %ul.well-list= render commits | ... | ... |
| ... | ... | @@ -0,0 +1,26 @@ |
| 1 | +%ul.bordered-list | |
| 2 | + - diffs.each_with_index do |diff, i| | |
| 3 | + %li | |
| 4 | + - if diff.deleted_file | |
| 5 | + %span.deleted-file | |
| 6 | + %a{href: "#diff-#{i}"} | |
| 7 | + %i.icon-minus | |
| 8 | + = diff.old_path | |
| 9 | + - elsif diff.renamed_file | |
| 10 | + %span.renamed-file | |
| 11 | + %a{href: "#diff-#{i}"} | |
| 12 | + %i.icon-minus | |
| 13 | + = diff.old_path | |
| 14 | + = "->" | |
| 15 | + = diff.new_path | |
| 16 | + - elsif diff.new_file | |
| 17 | + %span.new-file | |
| 18 | + %a{href: "#diff-#{i}"} | |
| 19 | + %i.icon-plus | |
| 20 | + = diff.new_path | |
| 21 | + - else | |
| 22 | + %span.edit-file | |
| 23 | + %a{href: "#diff-#{i}"} | |
| 24 | + %i.icon-adjust | |
| 25 | + = diff.new_path | |
| 26 | + | ... | ... |
| ... | ... | @@ -0,0 +1,49 @@ |
| 1 | +- if @suppress_diff | |
| 2 | + .alert.alert-block | |
| 3 | + %p | |
| 4 | + %strong Warning! Large commit with more than #{Commit::DIFF_SAFE_SIZE} files changed. | |
| 5 | + %p To prevent performance issue we rejected diff information. | |
| 6 | + %p | |
| 7 | + But if you still want to see diff | |
| 8 | + = link_to "click this link", project_commit_path(@project, @commit, force_show_diff: true), class: "underlined_link" | |
| 9 | + | |
| 10 | +%p.cgray | |
| 11 | + Showing #{pluralize(diffs.count, "changed file")} | |
| 12 | +.file-stats | |
| 13 | + = render "projects/commits/diff_head", diffs: diffs | |
| 14 | + | |
| 15 | +.files | |
| 16 | + - unless @suppress_diff | |
| 17 | + - diffs.each_with_index do |diff, i| | |
| 18 | + - next if diff.diff.empty? | |
| 19 | + - file = Gitlab::Git::Blob.new(@repository, @commit.id, @ref, diff.new_path) | |
| 20 | + - file = Gitlab::Git::Blob.new(@repository, @commit.parent_id, @ref, diff.old_path) unless file.exists? | |
| 21 | + - next unless file.exists? | |
| 22 | + .file{id: "diff-#{i}"} | |
| 23 | + .header | |
| 24 | + - if diff.deleted_file | |
| 25 | + %span= diff.old_path | |
| 26 | + | |
| 27 | + - if @commit.parent_ids.present? | |
| 28 | + = link_to project_blob_path(@project, tree_join(@commit.parent_id, diff.new_path)), {:class => 'btn btn-tiny pull-right view-file'} do | |
| 29 | + View file @ | |
| 30 | + %span.commit-short-id= @commit.short_id(6) | |
| 31 | + - else | |
| 32 | + %span= diff.new_path | |
| 33 | + - if diff.a_mode && diff.b_mode && diff.a_mode != diff.b_mode | |
| 34 | + %span.file-mode= "#{diff.a_mode} → #{diff.b_mode}" | |
| 35 | + | |
| 36 | + = link_to project_blob_path(@project, tree_join(@commit.id, diff.new_path)), {:class => 'btn btn-tiny pull-right view-file'} do | |
| 37 | + View file @ | |
| 38 | + %span.commit-short-id= @commit.short_id(6) | |
| 39 | + | |
| 40 | + .content | |
| 41 | + -# Skipp all non non-supported blobs | |
| 42 | + - next unless file.respond_to?('text?') | |
| 43 | + - if file.text? | |
| 44 | + = render "projects/commits/text_file", diff: diff, index: i | |
| 45 | + - elsif file.image? | |
| 46 | + - old_file = Gitlab::Git::Blob.new(@repository, @commit.parent_id, @ref, diff.old_path) if @commit.parent_id | |
| 47 | + = render "projects/commits/image", diff: diff, old_file: old_file, file: file, index: i | |
| 48 | + - else | |
| 49 | + %p.nothing_here_message No preview for this file type | ... | ... |
| ... | ... | @@ -0,0 +1,27 @@ |
| 1 | +%ul.nav.nav-tabs | |
| 2 | + %li= render partial: 'shared/ref_switcher', locals: {destination: 'commits'} | |
| 3 | + | |
| 4 | + = nav_link(controller: [:commit, :commits]) do | |
| 5 | + = link_to 'Commits', project_commits_path(@project, @repository.root_ref) | |
| 6 | + = nav_link(controller: :compare) do | |
| 7 | + = link_to 'Compare', project_compare_index_path(@project) | |
| 8 | + | |
| 9 | + = nav_link(html_options: {class: branches_tab_class}) do | |
| 10 | + = link_to project_repository_path(@project) do | |
| 11 | + Branches | |
| 12 | + %span.badge= @repository.branches.length | |
| 13 | + | |
| 14 | + = nav_link(controller: :repositories, action: :tags) do | |
| 15 | + = link_to tags_project_repository_path(@project) do | |
| 16 | + Tags | |
| 17 | + %span.badge= @repository.tags.length | |
| 18 | + | |
| 19 | + = nav_link(controller: :repositories, action: :stats) do | |
| 20 | + = link_to stats_project_repository_path(@project) do | |
| 21 | + Stats | |
| 22 | + | |
| 23 | + | |
| 24 | + - if current_controller?(:commits) && current_user.private_token | |
| 25 | + %li.pull-right | |
| 26 | + = link_to project_commits_path(@project, @ref, {format: :atom, private_token: current_user.private_token}), title: "Feed" do | |
| 27 | + %i.icon-rss | ... | ... |
| ... | ... | @@ -0,0 +1,63 @@ |
| 1 | +- if diff.renamed_file || diff.new_file || diff.deleted_file | |
| 2 | + .image | |
| 3 | + %span.wrap | |
| 4 | + .frame{class: image_diff_class(diff)} | |
| 5 | + %img{src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} | |
| 6 | + %p.image-info= "#{number_to_human_size file.size}" | |
| 7 | +- else | |
| 8 | + .image | |
| 9 | + %div.two-up.view | |
| 10 | + %span.wrap | |
| 11 | + .frame.deleted | |
| 12 | + %a{href: project_tree_path(@project, tree_join(@commit.id, diff.old_path))} | |
| 13 | + %img{src: "data:#{old_file.mime_type};base64,#{Base64.encode64(old_file.data)}"} | |
| 14 | + %p.image-info.hide | |
| 15 | + %span.meta-filesize= "#{number_to_human_size old_file.size}" | |
| 16 | + | | |
| 17 | + %b W: | |
| 18 | + %span.meta-width | |
| 19 | + | | |
| 20 | + %b H: | |
| 21 | + %span.meta-height | |
| 22 | + %span.wrap | |
| 23 | + .frame.added | |
| 24 | + %a{href: project_tree_path(@project, tree_join(@commit.id, diff.new_path))} | |
| 25 | + %img{src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} | |
| 26 | + %p.image-info.hide | |
| 27 | + %span.meta-filesize= "#{number_to_human_size file.size}" | |
| 28 | + | | |
| 29 | + %b W: | |
| 30 | + %span.meta-width | |
| 31 | + | | |
| 32 | + %b H: | |
| 33 | + %span.meta-height | |
| 34 | + | |
| 35 | + %div.swipe.view.hide | |
| 36 | + .swipe-frame | |
| 37 | + .frame.deleted | |
| 38 | + %img{src: "data:#{old_file.mime_type};base64,#{Base64.encode64(old_file.data)}"} | |
| 39 | + .swipe-wrap | |
| 40 | + .frame.added | |
| 41 | + %img{src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} | |
| 42 | + %span.swipe-bar | |
| 43 | + %span.top-handle | |
| 44 | + %span.bottom-handle | |
| 45 | + | |
| 46 | + %div.onion-skin.view.hide | |
| 47 | + .onion-skin-frame | |
| 48 | + .frame.deleted | |
| 49 | + %img{src: "data:#{old_file.mime_type};base64,#{Base64.encode64(old_file.data)}"} | |
| 50 | + .frame.added | |
| 51 | + %img{src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} | |
| 52 | + .controls | |
| 53 | + .transparent | |
| 54 | + .drag-track | |
| 55 | + .dragger{:style => "left: 0px;"} | |
| 56 | + .opaque | |
| 57 | + | |
| 58 | + | |
| 59 | + .view-modes.hide | |
| 60 | + %ul.view-modes-menu | |
| 61 | + %li.two-up{data: {mode: 'two-up'}} 2-up | |
| 62 | + %li.swipe{data: {mode: 'swipe'}} Swipe | |
| 63 | + %li.onion-skin{data: {mode: 'onion-skin'}} Onion skin | |
| 0 | 64 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,23 @@ |
| 1 | +- too_big = diff.diff.lines.count > 1000 | |
| 2 | +- if too_big | |
| 3 | + %a.supp_diff_link Diff suppressed. Click to show | |
| 4 | + | |
| 5 | +%table.text-file{class: "#{'hide' if too_big}"} | |
| 6 | + - each_diff_line(diff, index) do |line, type, line_code, line_new, line_old| | |
| 7 | + %tr.line_holder{ id: line_code, class: "#{type}" } | |
| 8 | + - if type == "match" | |
| 9 | + %td.old_line= "..." | |
| 10 | + %td.new_line= "..." | |
| 11 | + %td.line_content.matched= line | |
| 12 | + - else | |
| 13 | + %td.old_line | |
| 14 | + = link_to raw(type == "new" ? " " : line_old), "##{line_code}", id: line_code | |
| 15 | + - if @comments_allowed | |
| 16 | + = render "projects/notes/diff_note_link", line_code: line_code | |
| 17 | + %td.new_line= link_to raw(type == "old" ? " " : line_new) , "##{line_code}", id: line_code | |
| 18 | + %td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw diff_line_content(line) | |
| 19 | + | |
| 20 | + - if @reply_allowed | |
| 21 | + - comments = @line_notes.select { |n| n.line_code == line_code }.sort_by(&:created_at) | |
| 22 | + - unless comments.empty? | |
| 23 | + = render "projects/notes/diff_notes_with_reply", notes: comments | ... | ... |
| ... | ... | @@ -0,0 +1,23 @@ |
| 1 | +xml.instruct! | |
| 2 | +xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do | |
| 3 | + xml.title "Recent commits to #{@project.name}:#{@ref}" | |
| 4 | + xml.link :href => project_commits_url(@project, @ref, format: :atom), :rel => "self", :type => "application/atom+xml" | |
| 5 | + xml.link :href => project_commits_url(@project, @ref), :rel => "alternate", :type => "text/html" | |
| 6 | + xml.id project_commits_url(@project) | |
| 7 | + xml.updated @commits.first.committed_date.strftime("%Y-%m-%dT%H:%M:%SZ") if @commits.any? | |
| 8 | + | |
| 9 | + @commits.each do |commit| | |
| 10 | + xml.entry do | |
| 11 | + xml.id project_commit_url(@project, :id => commit.id) | |
| 12 | + xml.link :href => project_commit_url(@project, :id => commit.id) | |
| 13 | + xml.title truncate(commit.title, :length => 80) | |
| 14 | + xml.updated commit.committed_date.strftime("%Y-%m-%dT%H:%M:%SZ") | |
| 15 | + xml.media :thumbnail, :width => "40", :height => "40", :url => gravatar_icon(commit.author_email) | |
| 16 | + xml.author do |author| | |
| 17 | + xml.name commit.author_name | |
| 18 | + xml.email commit.author_email | |
| 19 | + end | |
| 20 | + xml.summary gfm(commit.description) | |
| 21 | + end | |
| 22 | + end | |
| 23 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,15 @@ |
| 1 | += render "head" | |
| 2 | + | |
| 3 | +- if @path.present? | |
| 4 | + %ul.breadcrumb | |
| 5 | + = commits_breadcrumbs | |
| 6 | + | |
| 7 | +%div{id: dom_id(@project)} | |
| 8 | + #commits-list= render "commits" | |
| 9 | +.clear | |
| 10 | +.loading{ style: "display:none;"} | |
| 11 | + | |
| 12 | +- if @commits.count == @limit | |
| 13 | + :javascript | |
| 14 | + CommitsList.init("#{@ref}", #{@limit}); | |
| 15 | + | ... | ... |
| ... | ... | @@ -0,0 +1,37 @@ |
| 1 | +%div | |
| 2 | + - unless params[:to] | |
| 3 | + %p.slead | |
| 4 | + Fill input field with commit id like | |
| 5 | + %code.label-branch 4eedf23 | |
| 6 | + or branch/tag name like | |
| 7 | + %code.label-branch master | |
| 8 | + and press compare button for commits list, code diff. | |
| 9 | + | |
| 10 | + %br | |
| 11 | + | |
| 12 | + = form_tag project_compare_index_path(@project), method: :post do | |
| 13 | + .clearfix | |
| 14 | + .pull-left | |
| 15 | + - if params[:to] && params[:from] | |
| 16 | + = link_to 'switch', {from: params[:to], to: params[:from]}, {class: 'commits-compare-switch has_tooltip', title: 'Switch base of comparison'} | |
| 17 | + = text_field_tag :from, params[:from], placeholder: "master", class: "xlarge" | |
| 18 | + = "..." | |
| 19 | + = text_field_tag :to, params[:to], placeholder: "aa8b4ef", class: "xlarge" | |
| 20 | + .pull-left | |
| 21 | + | |
| 22 | + = submit_tag "Compare", class: "btn btn-primary wide commits-compare-btn" | |
| 23 | + - if @refs_are_same | |
| 24 | + .alert | |
| 25 | + %span Refs are the same | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | +:javascript | |
| 30 | + var availableTags = #{@project.repository.ref_names.to_json}; | |
| 31 | + | |
| 32 | + $("#from, #to").autocomplete({ | |
| 33 | + source: availableTags, | |
| 34 | + minLength: 1 | |
| 35 | + }); | |
| 36 | + | |
| 37 | + disableButtonIfEmptyField('#to', '.commits-compare-btn'); | ... | ... |
| ... | ... | @@ -0,0 +1,23 @@ |
| 1 | += render "projects/commits/head" | |
| 2 | + | |
| 3 | +%h3.page_title | |
| 4 | + Compare View | |
| 5 | +%hr | |
| 6 | + | |
| 7 | += render "form" | |
| 8 | + | |
| 9 | +- if @commits.size > 100 | |
| 10 | + .alert.alert-block | |
| 11 | + %p | |
| 12 | + %strong Warning! This comparison include 100+ commits. | |
| 13 | + %p To prevent performance issue we dont show diff information. | |
| 14 | + | |
| 15 | +- if @commits.present? | |
| 16 | + %div.ui-box | |
| 17 | + %h5.title | |
| 18 | + Commits (#{@commits.count}) | |
| 19 | + %ul.well-list= render Commit.decorate(@commits) | |
| 20 | + | |
| 21 | + - unless @diffs.empty? | |
| 22 | + %h4 Diff | |
| 23 | + = render "projects/commits/diffs", diffs: @diffs | ... | ... |
| ... | ... | @@ -0,0 +1,25 @@ |
| 1 | +%li | |
| 2 | + .pull-right | |
| 3 | + - if @available_keys.include?(deploy_key) | |
| 4 | + = link_to enable_project_deploy_key_path(@project, deploy_key), class: 'btn btn-small', method: :put do | |
| 5 | + %i.icon-plus | |
| 6 | + Enable | |
| 7 | + - else | |
| 8 | + - if deploy_key.projects.count > 1 | |
| 9 | + = link_to disable_project_deploy_key_path(@project, deploy_key), class: 'btn btn-small', method: :put do | |
| 10 | + %i.icon-off | |
| 11 | + Disable | |
| 12 | + - else | |
| 13 | + = link_to 'Remove', project_deploy_key_path(@project, deploy_key), confirm: 'You are going to remove deploy key. Are you sure?', method: :delete, class: "btn btn-remove delete-key btn-small pull-right" | |
| 14 | + | |
| 15 | + | |
| 16 | + = link_to project_deploy_key_path(deploy_key.projects.include?(@project) ? @project : deploy_key.projects.first, deploy_key) do | |
| 17 | + %i.icon-key | |
| 18 | + %strong= deploy_key.title | |
| 19 | + | |
| 20 | + %p.light.prepend-top-10 | |
| 21 | + - deploy_key.projects.map(&:name_with_namespace).each do |project_name| | |
| 22 | + %span.label= project_name | |
| 23 | + %small.pull-right | |
| 24 | + Created #{time_ago_in_words(deploy_key.created_at)} ago | |
| 25 | + | ... | ... |
| ... | ... | @@ -0,0 +1,23 @@ |
| 1 | +%div | |
| 2 | + = form_for [@project, @key], url: project_deploy_keys_path do |f| | |
| 3 | + -if @key.errors.any? | |
| 4 | + .alert.alert-error | |
| 5 | + %ul | |
| 6 | + - @key.errors.full_messages.each do |msg| | |
| 7 | + %li= msg | |
| 8 | + | |
| 9 | + .clearfix | |
| 10 | + = f.label :title | |
| 11 | + .input= f.text_field :title | |
| 12 | + .clearfix | |
| 13 | + = f.label :key | |
| 14 | + .input | |
| 15 | + = f.text_area :key, class: [:xxlarge, :thin_area] | |
| 16 | + %p.hint | |
| 17 | + Paste a machine public key here. Read more about how generate it | |
| 18 | + = link_to "here", help_ssh_path | |
| 19 | + | |
| 20 | + .actions | |
| 21 | + = f.submit 'Create', class: "btn-create btn" | |
| 22 | + = link_to "Cancel", project_deploy_keys_path(@project), class: "btn btn-cancel" | |
| 23 | + | ... | ... |
| ... | ... | @@ -0,0 +1,30 @@ |
| 1 | +%p.slead | |
| 2 | + Deploy keys allow read-only access to repository. They can be used for CI, staging or production servers | |
| 3 | + | |
| 4 | +%p | |
| 5 | + You can create a deploy key or add existing one | |
| 6 | + = link_to new_project_deploy_key_path(@project), class: "btn btn-primary pull-right", title: "New Deploy Key" do | |
| 7 | + %i.icon-plus | |
| 8 | + New Deploy Key | |
| 9 | + | |
| 10 | +%hr.clearfix | |
| 11 | + | |
| 12 | +.row | |
| 13 | + .span5.enabled-keys | |
| 14 | + %h5.cgreen | |
| 15 | + Enabled deploy keys | |
| 16 | + %small for this project | |
| 17 | + %ul.bordered-list | |
| 18 | + = render @enabled_keys | |
| 19 | + - if @enabled_keys.blank? | |
| 20 | + .light-well | |
| 21 | + %p.nothing_here_message Create #{link_to 'new deploy key', new_project_deploy_key_path(@project)} or add existing one | |
| 22 | + .span5.available-keys | |
| 23 | + %h5 | |
| 24 | + Available deploy keys | |
| 25 | + %small from projects you are able to manage | |
| 26 | + %ul.bordered-list | |
| 27 | + = render @available_keys | |
| 28 | + - if @available_keys.blank? | |
| 29 | + .light-well | |
| 30 | + %p.nothing_here_message All deploy keys created in projects you own will be displayed here | ... | ... |
| ... | ... | @@ -0,0 +1,13 @@ |
| 1 | +%h3.page_title | |
| 2 | + Deploy key: | |
| 3 | + = @key.title | |
| 4 | + %small | |
| 5 | + created at | |
| 6 | + = @key.created_at.stamp("Aug 21, 2011") | |
| 7 | +.back_link | |
| 8 | + = link_to project_deploy_keys_path(@project) do | |
| 9 | + ← To keys list | |
| 10 | +%hr | |
| 11 | +%pre= @key.key | |
| 12 | +.pull-right | |
| 13 | + = link_to 'Remove', project_deploy_key_path(@project, @key), confirm: 'Are you sure?', method: :delete, class: "btn-remove btn delete-key" | ... | ... |
| ... | ... | @@ -0,0 +1,45 @@ |
| 1 | +.file-editor | |
| 2 | + = form_tag(project_edit_tree_path(@project, @id), method: :put, class: "form-horizontal") do | |
| 3 | + .file_holder | |
| 4 | + .file_title | |
| 5 | + %i.icon-file | |
| 6 | + %span.file_name | |
| 7 | + = @path | |
| 8 | + %small | |
| 9 | + on | |
| 10 | + %strong= @ref | |
| 11 | + %span.options | |
| 12 | + .btn-group.tree-btn-group | |
| 13 | + = link_to "Cancel", project_blob_path(@project, @id), class: "btn btn-tiny btn-cancel", confirm: leave_edit_message | |
| 14 | + .file_content.code | |
| 15 | + %pre#editor= @blob.data | |
| 16 | + | |
| 17 | + .control-group.commit_message-group | |
| 18 | + = label_tag 'commit_message', class: "control-label" do | |
| 19 | + Commit message | |
| 20 | + .controls | |
| 21 | + = text_area_tag 'commit_message', '', placeholder: "Update #{@blob.name}", required: true, rows: 3 | |
| 22 | + .form-actions | |
| 23 | + = hidden_field_tag 'last_commit', @last_commit | |
| 24 | + = hidden_field_tag 'content', '', id: :file_content | |
| 25 | + .commit-button-annotation | |
| 26 | + = button_tag "Commit changes", class: 'btn commit-btn js-commit-button btn-primary' | |
| 27 | + .message | |
| 28 | + to branch | |
| 29 | + %strong= @ref | |
| 30 | + = link_to "Cancel", project_blob_path(@project, @id), class: "btn btn-cancel", confirm: leave_edit_message | |
| 31 | + | |
| 32 | +:javascript | |
| 33 | + ace.config.set("modePath", "#{Gitlab::Application.config.assets.prefix}/ace-src-noconflict") | |
| 34 | + var ace_mode = "#{@blob.language.try(:ace_mode)}"; | |
| 35 | + var editor = ace.edit("editor"); | |
| 36 | + if (ace_mode) { | |
| 37 | + editor.getSession().setMode('ace/mode/' + ace_mode); | |
| 38 | + } | |
| 39 | + | |
| 40 | + disableButtonIfEmptyField("#commit_message", ".js-commit-button"); | |
| 41 | + | |
| 42 | + $(".js-commit-button").click(function(){ | |
| 43 | + $("#file_content").val(editor.getValue()); | |
| 44 | + $(".file-editor form").submit(); | |
| 45 | + }); | ... | ... |
| ... | ... | @@ -0,0 +1,31 @@ |
| 1 | +.loading-graph | |
| 2 | + %center | |
| 3 | + .loading | |
| 4 | + %h3.page_title Building repository graph. Please wait a moment. | |
| 5 | + | |
| 6 | +.stat-graph | |
| 7 | + .header.clearfix | |
| 8 | + .pull-right | |
| 9 | + %select | |
| 10 | + %option{:value => "commits"} Commits | |
| 11 | + %option{:value => "additions"} Additions | |
| 12 | + %option{:value => "deletions"} Deletions | |
| 13 | + %h3#date_header.page_title | |
| 14 | + %input#brush_change{:type => "hidden"} | |
| 15 | + .graphs | |
| 16 | + #contributors-master | |
| 17 | + #contributors.clearfix | |
| 18 | + %ol.contributors-list.clearfix | |
| 19 | + | |
| 20 | +:javascript | |
| 21 | + $(".stat-graph").hide(); | |
| 22 | + | |
| 23 | + $.ajax({ | |
| 24 | + type: "GET", | |
| 25 | + url: location.href, | |
| 26 | + complete: function() { | |
| 27 | + $(".loading-graph").hide(); | |
| 28 | + $(".stat-graph").show(); | |
| 29 | + }, | |
| 30 | + dataType: "script" | |
| 31 | + }); | ... | ... |
| ... | ... | @@ -0,0 +1,16 @@ |
| 1 | +:plain | |
| 2 | + controller = new ContributorsStatGraph | |
| 3 | + controller.init(#{@log}) | |
| 4 | + | |
| 5 | + $("select").change( function () { | |
| 6 | + var field = $(this).val() | |
| 7 | + controller.set_current_field(field) | |
| 8 | + controller.redraw_master() | |
| 9 | + controller.redraw_authors() | |
| 10 | + }) | |
| 11 | + | |
| 12 | + $("#brush_change").change( function () { | |
| 13 | + controller.change_date_header() | |
| 14 | + controller.redraw_authors() | |
| 15 | + }) | |
| 16 | + | ... | ... |
| ... | ... | @@ -0,0 +1,43 @@ |
| 1 | +<% data_ex_str = <<eos | |
| 2 | +{ | |
| 3 | + "before": "95790bf891e76fee5e1747ab589903a6a1f80f22", | |
| 4 | + "after": "da1560886d4f094c3e6c9ef40349f7d38b5d27d7", | |
| 5 | + "ref": "refs/heads/master", | |
| 6 | + "user_id": 4, | |
| 7 | + "user_name": "John Smith", | |
| 8 | + "repository": { | |
| 9 | + "name": "Diaspora", | |
| 10 | + "url": "git@localhost:diaspora.git", | |
| 11 | + "description": "", | |
| 12 | + "homepage": "http://localhost/diaspora", | |
| 13 | + }, | |
| 14 | + "commits": [ | |
| 15 | + { | |
| 16 | + "id": "b6568db1bc1dcd7f8b4d5a946b0b91f9dacd7327", | |
| 17 | + "message": "Update Catalan translation to e38cb41.", | |
| 18 | + "timestamp": "2011-12-12T14:27:31+02:00", | |
| 19 | + "url": "http://localhost/diaspora/commits/b6568db1bc1dcd7f8b4d5a946b0b91f9dacd7327", | |
| 20 | + "author": { | |
| 21 | + "name": "Jordi Mallach", | |
| 22 | + "email": "jordi@softcatala.org", | |
| 23 | + } | |
| 24 | + }, | |
| 25 | + // ... | |
| 26 | + { | |
| 27 | + "id": "da1560886d4f094c3e6c9ef40349f7d38b5d27d7", | |
| 28 | + "message": "fixed readme", | |
| 29 | + "timestamp": "2012-01-03T23:36:29+02:00", | |
| 30 | + "url": "http://localhost/diaspora/commits/da1560886d4f094c3e6c9ef40349f7d38b5d27d7", | |
| 31 | + "author": { | |
| 32 | + "name": "GitLab dev user", | |
| 33 | + "email": "gitlabdev@dv6700.(none)", | |
| 34 | + }, | |
| 35 | + }, | |
| 36 | + ], | |
| 37 | + "total_commits_count": 4, | |
| 38 | +}; | |
| 39 | +eos | |
| 40 | +%> | |
| 41 | +<div class="<%= user_color_scheme_class%>"> | |
| 42 | + <%= raw Pygments::Lexer[:js].highlight(data_ex_str) %> | |
| 43 | +</div> | ... | ... |
| ... | ... | @@ -0,0 +1,34 @@ |
| 1 | +- if can? current_user, :admin_project, @project | |
| 2 | + .alert.alert-info | |
| 3 | + %span | |
| 4 | + Post receive hooks for binding events when someone push to repository. | |
| 5 | + %br | |
| 6 | + Read more about web hooks | |
| 7 | + %strong #{link_to "here", help_web_hooks_path, class: "vlink"} | |
| 8 | + | |
| 9 | += form_for [@project, @hook], as: :hook, url: project_hooks_path(@project), html: { class: 'form-inline' } do |f| | |
| 10 | + -if @hook.errors.any? | |
| 11 | + .alert.alert-error | |
| 12 | + - @hook.errors.full_messages.each do |msg| | |
| 13 | + %p= msg | |
| 14 | + .clearfix | |
| 15 | + = f.label :url, "URL:" | |
| 16 | + .input | |
| 17 | + = f.text_field :url, class: "text_field xxlarge" | |
| 18 | + | |
| 19 | + = f.submit "Add Web Hook", class: "btn btn-create" | |
| 20 | +%hr | |
| 21 | + | |
| 22 | +-if @hooks.any? | |
| 23 | + .ui-box | |
| 24 | + %h5.title | |
| 25 | + Hooks (#{@hooks.count}) | |
| 26 | + %ul.well-list | |
| 27 | + - @hooks.each do |hook| | |
| 28 | + %li | |
| 29 | + %span.badge.badge-info POST | |
| 30 | + → | |
| 31 | + %span.monospace= hook.url | |
| 32 | + .pull-right | |
| 33 | + = link_to 'Test Hook', test_project_hook_path(@project, hook), class: "btn btn-small grouped" | |
| 34 | + = link_to 'Remove', project_hook_path(@project, hook), confirm: 'Are you sure?', method: :delete, class: "btn btn-remove btn-small grouped" | ... | ... |
| ... | ... | @@ -0,0 +1,23 @@ |
| 1 | += form_tag project_issues_path(@project), method: 'get' do | |
| 2 | + %fieldset | |
| 3 | + %ul.nav.nav-pills.nav-stacked | |
| 4 | + %li{class: ("active" if !params[:status] || params[:status].blank?)} | |
| 5 | + = link_to project_issues_path(@project, status: nil) do | |
| 6 | + Open | |
| 7 | + %li{class: ("active" if params[:status] == 'assigned-to-me')} | |
| 8 | + = link_to project_issues_path(@project, status: 'assigned-to-me') do | |
| 9 | + Assigned to me | |
| 10 | + %li{class: ("active" if params[:status] == 'created-by-me')} | |
| 11 | + = link_to project_issues_path(@project, status: 'created-by-me') do | |
| 12 | + Created by me | |
| 13 | + %li{class: ("active" if params[:status] == 'closed')} | |
| 14 | + = link_to project_issues_path(@project, status: 'closed') do | |
| 15 | + Closed | |
| 16 | + %li{class: ("active" if params[:status] == 'all')} | |
| 17 | + = link_to project_issues_path(@project, status: 'all') do | |
| 18 | + All | |
| 19 | + | |
| 20 | + %fieldset | |
| 21 | + %hr | |
| 22 | + = link_to "Reset", project_issues_path(@project), class: 'btn pull-right' | |
| 23 | + | ... | ... |
| ... | ... | @@ -0,0 +1,95 @@ |
| 1 | +%div.issue-form-holder | |
| 2 | + %h3.page_title= @issue.new_record? ? "New Issue" : "Edit Issue ##{@issue.id}" | |
| 3 | + = form_for [@project, @issue] do |f| | |
| 4 | + -if @issue.errors.any? | |
| 5 | + .alert.alert-error | |
| 6 | + - @issue.errors.full_messages.each do |msg| | |
| 7 | + %span= msg | |
| 8 | + %br | |
| 9 | + .ui-box.ui-box-show | |
| 10 | + .ui-box-head | |
| 11 | + .clearfix | |
| 12 | + = f.label :title do | |
| 13 | + %strong= "Subject *" | |
| 14 | + .input | |
| 15 | + = f.text_field :title, maxlength: 255, class: "xxlarge js-gfm-input", autofocus: true, required: true | |
| 16 | + .ui-box-body | |
| 17 | + .clearfix | |
| 18 | + .issue_assignee.pull-left | |
| 19 | + = f.label :assignee_id do | |
| 20 | + %i.icon-user | |
| 21 | + Assign to | |
| 22 | + .input | |
| 23 | + .pull-left | |
| 24 | + = f.select(:assignee_id, @project.team.members.sort_by(&:name).map {|p| [ p.name, p.id ] }, { include_blank: "Select a user" }, {class: 'chosen'}) | |
| 25 | + .pull-right | |
| 26 | + | |
| 27 | + = link_to 'Assign to me', '#', class: 'btn btn-small assign-to-me-link' | |
| 28 | + .issue_milestone.pull-left | |
| 29 | + = f.label :milestone_id do | |
| 30 | + %i.icon-time | |
| 31 | + Milestone | |
| 32 | + .input= f.select(:milestone_id, @project.milestones.active.all.collect {|p| [ p.title, p.id ] }, { include_blank: "Select milestone" }, {class: 'chosen'}) | |
| 33 | + | |
| 34 | + .ui-box-bottom | |
| 35 | + .clearfix | |
| 36 | + = f.label :label_list do | |
| 37 | + %i.icon-tag | |
| 38 | + Labels | |
| 39 | + .input | |
| 40 | + = f.text_field :label_list, maxlength: 2000, class: "xxlarge" | |
| 41 | + %p.hint Separate with comma. | |
| 42 | + | |
| 43 | + .clearfix | |
| 44 | + = f.label :description, "Details" | |
| 45 | + .input | |
| 46 | + = f.text_area :description, class: "xxlarge js-gfm-input", rows: 14 | |
| 47 | + %p.hint Issues are parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. | |
| 48 | + | |
| 49 | + | |
| 50 | + .actions | |
| 51 | + - if @issue.new_record? | |
| 52 | + = f.submit 'Submit new issue', class: "btn btn-create" | |
| 53 | + -else | |
| 54 | + = f.submit 'Save changes', class: "btn-save btn" | |
| 55 | + | |
| 56 | + - cancel_path = @issue.new_record? ? project_issues_path(@project) : project_issue_path(@project, @issue) | |
| 57 | + = link_to "Cancel", cancel_path, class: 'btn btn-cancel' | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | +:javascript | |
| 63 | + $("#issue_label_list") | |
| 64 | + .bind( "keydown", function( event ) { | |
| 65 | + if ( event.keyCode === $.ui.keyCode.TAB && | |
| 66 | + $( this ).data( "autocomplete" ).menu.active ) { | |
| 67 | + event.preventDefault(); | |
| 68 | + } | |
| 69 | + }) | |
| 70 | + .bind( "click", function( event ) { | |
| 71 | + $( this ).autocomplete("search", ""); | |
| 72 | + }) | |
| 73 | + .autocomplete({ | |
| 74 | + minLength: 0, | |
| 75 | + source: function( request, response ) { | |
| 76 | + response( $.ui.autocomplete.filter( | |
| 77 | + #{raw labels_autocomplete_source}, extractLast( request.term ) ) ); | |
| 78 | + }, | |
| 79 | + focus: function() { | |
| 80 | + return false; | |
| 81 | + }, | |
| 82 | + select: function(event, ui) { | |
| 83 | + var terms = split( this.value ); | |
| 84 | + terms.pop(); | |
| 85 | + terms.push( ui.item.value ); | |
| 86 | + terms.push( "" ); | |
| 87 | + this.value = terms.join( ", " ); | |
| 88 | + return false; | |
| 89 | + } | |
| 90 | + }); | |
| 91 | + | |
| 92 | + $('.assign-to-me-link').on('click', function(e){ | |
| 93 | + $('#issue_assignee_id').val("#{current_user.id}").trigger("liszt:updated"); | |
| 94 | + e.preventDefault(); | |
| 95 | + }); | ... | ... |
| ... | ... | @@ -0,0 +1,10 @@ |
| 1 | +%ul.nav.nav-tabs | |
| 2 | + = nav_link(controller: :issues) do | |
| 3 | + = link_to 'Browse Issues', project_issues_path(@project), class: "tab" | |
| 4 | + = nav_link(controller: :milestones) do | |
| 5 | + = link_to 'Milestones', project_milestones_path(@project), class: "tab" | |
| 6 | + = nav_link(controller: :labels) do | |
| 7 | + = link_to 'Labels', project_labels_path(@project), class: "tab" | |
| 8 | + %li.pull-right | |
| 9 | + = link_to project_issues_path(@project, :atom, { private_token: current_user.private_token }) do | |
| 10 | + %i.icon-rss | ... | ... |
| ... | ... | @@ -0,0 +1,44 @@ |
| 1 | +%li{ id: dom_id(issue), class: issue_css_classes(issue), url: project_issue_path(issue.project, issue) } | |
| 2 | + - if controller.controller_name == 'issues' | |
| 3 | + .issue-check | |
| 4 | + = check_box_tag dom_id(issue,"selected"), nil, false, 'data-id' => issue.id, class: "selected_issue", disabled: !can?(current_user, :modify_issue, issue) | |
| 5 | + | |
| 6 | + .issue-title | |
| 7 | + %span.light= "##{issue.id}" | |
| 8 | + = link_to_gfm truncate(issue.title, length: 100), project_issue_path(issue.project, issue), class: "row_title" | |
| 9 | + | |
| 10 | + .issue-info | |
| 11 | + - if issue.assignee | |
| 12 | + assigned to #{link_to_member(@project, issue.assignee)} | |
| 13 | + - else | |
| 14 | + unassigned | |
| 15 | + - if issue.votes_count > 0 | |
| 16 | + = render 'votes/votes_inline', votable: issue | |
| 17 | + - if issue.notes.any? | |
| 18 | + %span | |
| 19 | + %i.icon-comments | |
| 20 | + = issue.notes.count | |
| 21 | + - if issue.milestone_id? | |
| 22 | + %span | |
| 23 | + %i.icon-time | |
| 24 | + = issue.milestone.title | |
| 25 | + .pull-right | |
| 26 | + %small updated #{time_ago_in_words(issue.updated_at)} ago | |
| 27 | + | |
| 28 | + .issue-labels | |
| 29 | + - issue.labels.each do |label| | |
| 30 | + %span{class: "label #{label_css_class(label.name)}"} | |
| 31 | + %i.icon-tag | |
| 32 | + = label.name | |
| 33 | + | |
| 34 | + .issue-actions | |
| 35 | + - if can? current_user, :modify_issue, issue | |
| 36 | + - if issue.closed? | |
| 37 | + = link_to 'Reopen', project_issue_path(issue.project, issue, issue: {state_event: :reopen }, status_only: true), method: :put, class: "btn btn-small grouped reopen_issue", remote: true | |
| 38 | + - else | |
| 39 | + = link_to 'Close', project_issue_path(issue.project, issue, issue: {state_event: :close }, status_only: true), method: :put, class: "btn btn-small grouped close_issue", remote: true | |
| 40 | + = link_to edit_project_issue_path(issue.project, issue), class: "btn btn-small edit-issue-link grouped" do | |
| 41 | + %i.icon-edit | |
| 42 | + Edit | |
| 43 | + | |
| 44 | + | ... | ... |
| ... | ... | @@ -0,0 +1,94 @@ |
| 1 | +.ui-box | |
| 2 | + .title | |
| 3 | + = check_box_tag "check_all_issues", nil, false, class: "check_all_issues left" | |
| 4 | + .clearfix | |
| 5 | + .issues_bulk_update.hide | |
| 6 | + = form_tag bulk_update_project_issues_path(@project), method: :post do | |
| 7 | + %span.update_issues_text Update selected issues with | |
| 8 | + .left | |
| 9 | + = select_tag('update[status]', options_for_select(['open', 'closed']), prompt: "Status") | |
| 10 | + = select_tag('update[assignee_id]', options_from_collection_for_select(@project.team.members, "id", "name", params[:assignee_id]), prompt: "Assignee") | |
| 11 | + = select_tag('update[milestone_id]', options_from_collection_for_select(issues_active_milestones, "id", "title", params[:milestone_id]), prompt: "Milestone") | |
| 12 | + = hidden_field_tag 'update[issues_ids]', [] | |
| 13 | + = hidden_field_tag :status, params[:status] | |
| 14 | + = button_tag "Save", class: "btn update_selected_issues btn-small btn-save" | |
| 15 | + .issues-filters | |
| 16 | + %span Filter by | |
| 17 | + .dropdown.inline.prepend-left-10 | |
| 18 | + %a.dropdown-toggle.btn.btn-small{href: '#', "data-toggle" => "dropdown"} | |
| 19 | + %i.icon-tags | |
| 20 | + %span.light labels: | |
| 21 | + - if params[:label_name].present? | |
| 22 | + %strong= params[:label_name] | |
| 23 | + - else | |
| 24 | + Any | |
| 25 | + %b.caret | |
| 26 | + %ul.dropdown-menu | |
| 27 | + %li | |
| 28 | + = link_to project_issues_with_filter_path(@project, label_name: nil) do | |
| 29 | + Any | |
| 30 | + - issue_label_names.each do |label_name| | |
| 31 | + %li | |
| 32 | + = link_to project_issues_with_filter_path(@project, label_name: label_name) do | |
| 33 | + %span{class: "label #{label_css_class(label_name)}"} | |
| 34 | + %i.icon-tag | |
| 35 | + = label_name | |
| 36 | + .dropdown.inline.prepend-left-10 | |
| 37 | + %a.dropdown-toggle.btn.btn-small{href: '#', "data-toggle" => "dropdown"} | |
| 38 | + %i.icon-user | |
| 39 | + %span.light assignee: | |
| 40 | + - if @assignee.present? | |
| 41 | + %strong= @assignee.name | |
| 42 | + - elsif params[:assignee_id] == "0" | |
| 43 | + Unassigned | |
| 44 | + - else | |
| 45 | + Any | |
| 46 | + %b.caret | |
| 47 | + %ul.dropdown-menu | |
| 48 | + %li | |
| 49 | + = link_to project_issues_with_filter_path(@project, assignee_id: nil) do | |
| 50 | + Any | |
| 51 | + = link_to project_issues_with_filter_path(@project, assignee_id: 0) do | |
| 52 | + Unassigned | |
| 53 | + - @project.team.members.sort_by(&:name).each do |user| | |
| 54 | + %li | |
| 55 | + = link_to project_issues_with_filter_path(@project, assignee_id: user.id) do | |
| 56 | + = image_tag gravatar_icon(user.email), class: "avatar s16" | |
| 57 | + = user.name | |
| 58 | + | |
| 59 | + .dropdown.inline.prepend-left-10 | |
| 60 | + %a.dropdown-toggle.btn.btn-small{href: '#', "data-toggle" => "dropdown"} | |
| 61 | + %i.icon-time | |
| 62 | + %span.light milestone: | |
| 63 | + - if @milestone.present? | |
| 64 | + %strong= @milestone.title | |
| 65 | + - elsif params[:milestone_id] == "0" | |
| 66 | + Unspecified | |
| 67 | + - else | |
| 68 | + Any | |
| 69 | + %b.caret | |
| 70 | + %ul.dropdown-menu | |
| 71 | + %li | |
| 72 | + = link_to project_issues_with_filter_path(@project, milestone_id: nil) do | |
| 73 | + Any | |
| 74 | + = link_to project_issues_with_filter_path(@project, milestone_id: 0) do | |
| 75 | + Unspecified | |
| 76 | + - issues_active_milestones.each do |milestone| | |
| 77 | + %li | |
| 78 | + = link_to project_issues_with_filter_path(@project, milestone_id: milestone.id) do | |
| 79 | + %strong= milestone.title | |
| 80 | + %small.light= milestone.expires_at | |
| 81 | + | |
| 82 | + | |
| 83 | + %ul.well-list.issues-list | |
| 84 | + = render @issues | |
| 85 | + - if @issues.blank? | |
| 86 | + %li | |
| 87 | + %h4.nothing_here_message Nothing to show here | |
| 88 | + | |
| 89 | +- if @issues.present? | |
| 90 | + .pull-right | |
| 91 | + %span.issue_counter #{@issues.total_count} | |
| 92 | + issues for this filter | |
| 93 | + | |
| 94 | + = paginate @issues, remote: true, theme: "gitlab" | ... | ... |
| ... | ... | @@ -0,0 +1 @@ |
| 1 | += render "form" | ... | ... |
| ... | ... | @@ -0,0 +1,23 @@ |
| 1 | +xml.instruct! | |
| 2 | +xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do | |
| 3 | + xml.title "#{@project.name} issues" | |
| 4 | + xml.link :href => project_issues_url(@project, :atom), :rel => "self", :type => "application/atom+xml" | |
| 5 | + xml.link :href => project_issues_url(@project), :rel => "alternate", :type => "text/html" | |
| 6 | + xml.id project_issues_url(@project) | |
| 7 | + xml.updated @issues.first.created_at.strftime("%Y-%m-%dT%H:%M:%SZ") if @issues.any? | |
| 8 | + | |
| 9 | + @issues.each do |issue| | |
| 10 | + xml.entry do | |
| 11 | + xml.id project_issue_url(@project, issue) | |
| 12 | + xml.link :href => project_issue_url(@project, issue) | |
| 13 | + xml.title truncate(issue.title, :length => 80) | |
| 14 | + xml.updated issue.created_at.strftime("%Y-%m-%dT%H:%M:%SZ") | |
| 15 | + xml.media :thumbnail, :width => "40", :height => "40", :url => gravatar_icon(issue.author_email) | |
| 16 | + xml.author do |author| | |
| 17 | + xml.name issue.author_name | |
| 18 | + xml.email issue.author_email | |
| 19 | + end | |
| 20 | + xml.summary issue.title | |
| 21 | + end | |
| 22 | + end | |
| 23 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,25 @@ |
| 1 | += render "head" | |
| 2 | +.issues_content | |
| 3 | + %h3.page_title | |
| 4 | + Issues | |
| 5 | + %span (<span class=issue_counter>#{@issues.total_count}</span>) | |
| 6 | + .pull-right | |
| 7 | + .span6 | |
| 8 | + - if can? current_user, :write_issue, @project | |
| 9 | + = link_to new_project_issue_path(@project, issue: { assignee_id: params[:assignee_id], milestone_id: params[:milestone_id]}), class: "btn btn-primary pull-right", title: "New Issue", id: "new_issue_link" do | |
| 10 | + %i.icon-plus | |
| 11 | + New Issue | |
| 12 | + = form_tag project_issues_path(@project), method: :get, remote: true, id: "issue_search_form", class: 'pull-right' do | |
| 13 | + = hidden_field_tag :status, params[:status], id: 'search_status' | |
| 14 | + = hidden_field_tag :assignee_id, params[:assignee_id], id: 'search_assignee_id' | |
| 15 | + = hidden_field_tag :milestone_id, params[:milestone_id], id: 'search_milestone_id' | |
| 16 | + = hidden_field_tag :label_name, params[:label_name], id: 'search_label_name' | |
| 17 | + = search_field_tag :issue_search, nil, { placeholder: 'Search', class: 'issue_search input-xlarge append-right-10 search-text-input' } | |
| 18 | + | |
| 19 | + .clearfix | |
| 20 | + | |
| 21 | +.row | |
| 22 | + .span3 | |
| 23 | + = render 'filter', entity: 'issue' | |
| 24 | + .span9.issues-holder | |
| 25 | + = render "issues" | ... | ... |
| ... | ... | @@ -0,0 +1 @@ |
| 1 | += render "form" | ... | ... |
| ... | ... | @@ -0,0 +1,68 @@ |
| 1 | +%h3.page_title | |
| 2 | + Issue ##{@issue.id} | |
| 3 | + | |
| 4 | + %small | |
| 5 | + created at | |
| 6 | + = @issue.created_at.stamp("Aug 21, 2011") | |
| 7 | + | |
| 8 | + %span.pull-right | |
| 9 | + = link_to new_project_issue_path(@project), class: "btn grouped", title: "New Issue", id: "new_issue_link" do | |
| 10 | + %i.icon-plus | |
| 11 | + New Issue | |
| 12 | + - if can?(current_user, :modify_issue, @issue) | |
| 13 | + - if @issue.closed? | |
| 14 | + = link_to 'Reopen', project_issue_path(@project, @issue, issue: {state_event: :reopen }, status_only: true), method: :put, class: "btn grouped reopen_issue" | |
| 15 | + - else | |
| 16 | + = link_to 'Close', project_issue_path(@project, @issue, issue: {state_event: :close }, status_only: true), method: :put, class: "btn grouped close_issue", title: "Close Issue" | |
| 17 | + | |
| 18 | + = link_to edit_project_issue_path(@project, @issue), class: "btn grouped" do | |
| 19 | + %i.icon-edit | |
| 20 | + Edit | |
| 21 | + | |
| 22 | +.pull-right | |
| 23 | + .span3#votes= render 'votes/votes_block', votable: @issue | |
| 24 | + | |
| 25 | +.back_link | |
| 26 | + = link_to project_issues_path(@project) do | |
| 27 | + ← To issues list | |
| 28 | + | |
| 29 | + | |
| 30 | +.ui-box.ui-box-show | |
| 31 | + .ui-box-head | |
| 32 | + %h4.box-title | |
| 33 | + - if @issue.closed? | |
| 34 | + .error.status_info Closed | |
| 35 | + = gfm escape_once(@issue.title) | |
| 36 | + | |
| 37 | + .ui-box-body | |
| 38 | + %cite.cgray | |
| 39 | + Created by #{link_to_member(@project, @issue.author)} | |
| 40 | + - if @issue.assignee | |
| 41 | + \ and currently assigned to #{link_to_member(@project, @issue.assignee)} | |
| 42 | + | |
| 43 | + - if @issue.milestone | |
| 44 | + - milestone = @issue.milestone | |
| 45 | + %cite.cgray and attached to milestone | |
| 46 | + %strong= link_to_gfm truncate(milestone.title, length: 20), project_milestone_path(milestone.project, milestone) | |
| 47 | + | |
| 48 | + .pull-right | |
| 49 | + - @issue.labels.each do |label| | |
| 50 | + %span{class: "label #{label_css_class(label.name)}"} | |
| 51 | + %i.icon-tag | |
| 52 | + = label.name | |
| 53 | + | |
| 54 | + | |
| 55 | + - if @issue.description.present? | |
| 56 | + .ui-box-bottom | |
| 57 | + .wiki | |
| 58 | + = preserve do | |
| 59 | + = markdown @issue.description | |
| 60 | + | |
| 61 | +- content_for :note_actions do | |
| 62 | + - if can?(current_user, :modify_issue, @issue) | |
| 63 | + - if @issue.closed? | |
| 64 | + = link_to 'Reopen Issue', project_issue_path(@project, @issue, issue: {state_event: :reopen }, status_only: true), method: :put, class: "btn grouped reopen_issue" | |
| 65 | + - else | |
| 66 | + = link_to 'Close Issue', project_issue_path(@project, @issue, issue: {state_event: :close }, status_only: true), method: :put, class: "btn grouped close_issue", title: "Close Issue" | |
| 67 | + | |
| 68 | +.voting_notes#notes= render "projects/notes/notes_with_form" | ... | ... |
| ... | ... | @@ -0,0 +1,15 @@ |
| 1 | +- frequency = @project.issues.tagged_with(label.name).count | |
| 2 | +%li | |
| 3 | + %strong | |
| 4 | + %span{class: "label #{label_css_class(label.name)}"} | |
| 5 | + %i.icon-tag | |
| 6 | + - if frequency.zero? | |
| 7 | + %span.light= label.name | |
| 8 | + - else | |
| 9 | + = label.name | |
| 10 | + .pull-right | |
| 11 | + - unless frequency.zero? | |
| 12 | + = link_to project_issues_path(label_name: label.name) do | |
| 13 | + %strong | |
| 14 | + = pluralize(frequency, 'issue') | |
| 15 | + = "»" | ... | ... |
| ... | ... | @@ -0,0 +1,14 @@ |
| 1 | += render "projects/issues/head" | |
| 2 | + | |
| 3 | +%h3.page_title | |
| 4 | + Labels | |
| 5 | +%br | |
| 6 | + | |
| 7 | +- if @labels.present? | |
| 8 | + %ul.bordered-list.labels-table | |
| 9 | + - @labels.each do |label| | |
| 10 | + = render 'label', label: label | |
| 11 | + | |
| 12 | +- else | |
| 13 | + .light-well | |
| 14 | + %h3.nothing_here_message Add first label to your issues or #{link_to 'generate', generate_project_labels_path(@project), method: :post} default set of labels | ... | ... |
| ... | ... | @@ -0,0 +1,20 @@ |
| 1 | += form_tag project_issues_path(@project), method: 'get' do | |
| 2 | + %fieldset | |
| 3 | + %ul.nav.nav-pills.nav-stacked | |
| 4 | + %li{class: ("active" if (params[:f] == 'open' || !params[:f]))} | |
| 5 | + = link_to project_merge_requests_path(@project, f: 'open', milestone_id: params[:milestone_id]) do | |
| 6 | + Open | |
| 7 | + %li{class: ("active" if params[:f] == "closed")} | |
| 8 | + = link_to project_merge_requests_path(@project, f: "closed", milestone_id: params[:milestone_id]) do | |
| 9 | + Closed | |
| 10 | + %li{class: ("active" if params[:f] == 'assigned-to-me')} | |
| 11 | + = link_to project_merge_requests_path(@project, f: 'assigned-to-me', milestone_id: params[:milestone_id]) do | |
| 12 | + Assigned To Me | |
| 13 | + %li{class: ("active" if params[:f] == 'all')} | |
| 14 | + = link_to project_merge_requests_path(@project, f: 'all', milestone_id: params[:milestone_id]) do | |
| 15 | + All | |
| 16 | + | |
| 17 | + %fieldset | |
| 18 | + %hr | |
| 19 | + = link_to "Reset", project_merge_requests_path(@project), class: 'btn pull-right' | |
| 20 | + | ... | ... |
| ... | ... | @@ -0,0 +1,79 @@ |
| 1 | += form_for [@project, @merge_request], html: { class: "#{controller.action_name}-merge-request form-horizontal" } do |f| | |
| 2 | + -if @merge_request.errors.any? | |
| 3 | + .alert.alert-error | |
| 4 | + %ul | |
| 5 | + - @merge_request.errors.full_messages.each do |msg| | |
| 6 | + %li= msg | |
| 7 | + | |
| 8 | + %fieldset | |
| 9 | + %legend 1. Select Branches | |
| 10 | + | |
| 11 | + .row | |
| 12 | + .span5 | |
| 13 | + .mr_branch_box | |
| 14 | + %h5.cgray From (Head Branch) | |
| 15 | + .body | |
| 16 | + .padded= f.select(:source_branch, @repository.branch_names, { include_blank: "Select branch" }, {class: 'chosen span4'}) | |
| 17 | + .mr_source_commit | |
| 18 | + | |
| 19 | + .span2 | |
| 20 | + %center= image_tag "merge.png", class: 'mr_direction_tip' | |
| 21 | + .span5 | |
| 22 | + .mr_branch_box | |
| 23 | + %h5.cgray To (Base Branch) | |
| 24 | + .body | |
| 25 | + .padded= f.select(:target_branch, @repository.branch_names, { include_blank: "Select branch" }, {class: 'chosen span4'}) | |
| 26 | + .mr_target_commit | |
| 27 | + | |
| 28 | + %fieldset | |
| 29 | + %legend 2. Fill info | |
| 30 | + | |
| 31 | + .ui-box.ui-box-show | |
| 32 | + .ui-box-head | |
| 33 | + .clearfix | |
| 34 | + = f.label :title do | |
| 35 | + %strong= "Title *" | |
| 36 | + .input= f.text_field :title, class: "input-xxlarge pad js-gfm-input", maxlength: 255, rows: 5, required: true | |
| 37 | + .ui-box-body | |
| 38 | + .clearfix | |
| 39 | + .left | |
| 40 | + = f.label :assignee_id do | |
| 41 | + %i.icon-user | |
| 42 | + Assign to | |
| 43 | + .input= f.select(:assignee_id, @project.team.members.sort_by(&:name).map {|p| [ p.name, p.id ] }, { include_blank: "Select user" }, {class: 'chosen span3'}) | |
| 44 | + .left | |
| 45 | + = f.label :milestone_id do | |
| 46 | + %i.icon-time | |
| 47 | + Milestone | |
| 48 | + .input= f.select(:milestone_id, @project.milestones.active.all.map {|p| [ p.title, p.id ] }, { include_blank: "Select milestone" }, {class: 'chosen'}) | |
| 49 | + | |
| 50 | + .control-group | |
| 51 | + | |
| 52 | + .form-actions | |
| 53 | + - if @merge_request.new_record? | |
| 54 | + = f.submit 'Submit merge request', class: "btn btn-create" | |
| 55 | + -else | |
| 56 | + = f.submit 'Save changes', class: "btn btn-save" | |
| 57 | + - if @merge_request.new_record? | |
| 58 | + = link_to project_merge_requests_path(@project), class: "btn btn-cancel" do | |
| 59 | + Cancel | |
| 60 | + - else | |
| 61 | + = link_to project_merge_request_path(@project, @merge_request), class: "btn btn-cancel" do | |
| 62 | + Cancel | |
| 63 | + | |
| 64 | +:javascript | |
| 65 | + disableButtonIfEmptyField("#merge_request_title", ".btn-save"); | |
| 66 | + | |
| 67 | + var source_branch = $("#merge_request_source_branch") | |
| 68 | + , target_branch = $("#merge_request_target_branch"); | |
| 69 | + | |
| 70 | + $.get("#{branch_from_project_merge_requests_path(@project)}", {ref: source_branch.val() }); | |
| 71 | + $.get("#{branch_to_project_merge_requests_path(@project)}", {ref: target_branch.val() }); | |
| 72 | + | |
| 73 | + source_branch.live("change", function() { | |
| 74 | + $.get("#{branch_from_project_merge_requests_path(@project)}", {ref: $(this).val() }); | |
| 75 | + }); | |
| 76 | + | |
| 77 | + target_branch.live("change", function() { | |
| 78 | + $.get("#{branch_to_project_merge_requests_path(@project)}", {ref: $(this).val() }); | |
| 79 | + }); | ... | ... |
app/views/projects/merge_requests/_merge_request.html.haml
0 → 100644
| ... | ... | @@ -0,0 +1,29 @@ |
| 1 | +%li{ class: mr_css_classes(merge_request) } | |
| 2 | + .merge-request-title | |
| 3 | + %span.light= "##{merge_request.id}" | |
| 4 | + = link_to_gfm truncate(merge_request.title, length: 80), project_merge_request_path(merge_request.project, merge_request), class: "row_title" | |
| 5 | + - if merge_request.merged? | |
| 6 | + %small.pull-right | |
| 7 | + %i.icon-ok | |
| 8 | + = "MERGED" | |
| 9 | + - else | |
| 10 | + %span.pull-right | |
| 11 | + %i.icon-angle-right | |
| 12 | + = merge_request.target_branch | |
| 13 | + .merge-request-info | |
| 14 | + - if merge_request.author | |
| 15 | + authored by #{link_to_member(@project, merge_request.author)} | |
| 16 | + - if merge_request.votes_count > 0 | |
| 17 | + = render 'votes/votes_inline', votable: merge_request | |
| 18 | + - if merge_request.notes.any? | |
| 19 | + %span | |
| 20 | + %i.icon-comments | |
| 21 | + = merge_request.mr_and_commit_notes.count | |
| 22 | + - if merge_request.milestone_id? | |
| 23 | + %span | |
| 24 | + %i.icon-time | |
| 25 | + = merge_request.milestone.title | |
| 26 | + | |
| 27 | + | |
| 28 | + .pull-right | |
| 29 | + %small updated #{time_ago_in_words(merge_request.updated_at)} ago | ... | ... |
| ... | ... | @@ -0,0 +1,37 @@ |
| 1 | +.merge-request | |
| 2 | + = render "projects/merge_requests/show/mr_title" | |
| 3 | + = render "projects/merge_requests/show/how_to_merge" | |
| 4 | + = render "projects/merge_requests/show/mr_box" | |
| 5 | + = render "projects/merge_requests/show/mr_accept" | |
| 6 | + - if @project.gitlab_ci? | |
| 7 | + = render "projects/merge_requests/show/mr_ci" | |
| 8 | + = render "projects/merge_requests/show/commits" | |
| 9 | + | |
| 10 | + - if @commits.present? | |
| 11 | + %ul.nav.nav-tabs | |
| 12 | + %li.notes-tab{data: {action: 'notes'}} | |
| 13 | + = link_to project_merge_request_path(@project, @merge_request) do | |
| 14 | + %i.icon-comment | |
| 15 | + Discussion | |
| 16 | + %li.diffs-tab{data: {action: 'diffs'}} | |
| 17 | + = link_to diffs_project_merge_request_path(@project, @merge_request) do | |
| 18 | + %i.icon-list-alt | |
| 19 | + Diff | |
| 20 | + | |
| 21 | + .notes.tab-content.voting_notes#notes{ class: (controller.action_name == 'show') ? "" : "hide" } | |
| 22 | + = render "projects/notes/notes_with_form" | |
| 23 | + .diffs.tab-content | |
| 24 | + = render "projects/merge_requests/show/diffs" if @diffs | |
| 25 | + .status | |
| 26 | + | |
| 27 | +:javascript | |
| 28 | + var merge_request; | |
| 29 | + | |
| 30 | + merge_request = new MergeRequest({ | |
| 31 | + url_to_automerge_check: "#{automerge_check_project_merge_request_path(@project, @merge_request)}", | |
| 32 | + check_enable: #{@merge_request.unchecked? ? "true" : "false"}, | |
| 33 | + url_to_ci_check: "#{ci_status_project_merge_request_path(@project, @merge_request)}", | |
| 34 | + ci_enable: #{@project.gitlab_ci? ? "true" : "false"}, | |
| 35 | + current_status: "#{@merge_request.merge_status_name}", | |
| 36 | + action: "#{controller.action_name}" | |
| 37 | + }); | ... | ... |
| ... | ... | @@ -0,0 +1 @@ |
| 1 | += render "show" | ... | ... |
| ... | ... | @@ -0,0 +1,35 @@ |
| 1 | +- if can? current_user, :write_merge_request, @project | |
| 2 | + = link_to new_project_merge_request_path(@project), class: "pull-right btn btn-primary", title: "New Merge Request" do | |
| 3 | + %i.icon-plus | |
| 4 | + New Merge Request | |
| 5 | +%h3.page_title | |
| 6 | + Merge Requests | |
| 7 | + | |
| 8 | +%br | |
| 9 | + | |
| 10 | + | |
| 11 | +.row | |
| 12 | + .span3 | |
| 13 | + = render 'filter' | |
| 14 | + .span9 | |
| 15 | + .ui-box | |
| 16 | + .title | |
| 17 | + = form_tag project_merge_requests_path(@project), id: "merge_requests_search_form", method: :get, class: :left do | |
| 18 | + = select_tag(:assignee_id, options_from_collection_for_select([unassigned_filter] + @project.users.all, "id", "name", params[:assignee_id]), prompt: "Assignee") | |
| 19 | + = select_tag(:milestone_id, options_from_collection_for_select([unassigned_filter] + @project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), prompt: "Milestone") | |
| 20 | + = hidden_field_tag :f, params[:f] | |
| 21 | + .clearfix | |
| 22 | + | |
| 23 | + %ul.well-list.mr-list | |
| 24 | + = render @merge_requests | |
| 25 | + - if @merge_requests.blank? | |
| 26 | + %li | |
| 27 | + %h4.nothing_here_message Nothing to show here | |
| 28 | + - if @merge_requests.present? | |
| 29 | + .pull-right | |
| 30 | + %span.cgray.pull-right #{@merge_requests.total_count} merge requests for this filter | |
| 31 | + | |
| 32 | + = paginate @merge_requests, theme: "gitlab" | |
| 33 | + | |
| 34 | +:javascript | |
| 35 | + $(merge_requestsPage); | ... | ... |
| ... | ... | @@ -0,0 +1,17 @@ |
| 1 | +.merge-request | |
| 2 | + = render "projects/merge_requests/show/mr_title" | |
| 3 | + = render "projects/merge_requests/show/mr_box" | |
| 4 | + | |
| 5 | + .alert.alert-error | |
| 6 | + %h5 | |
| 7 | + %i.icon-exclamation-sign | |
| 8 | + We cannot find | |
| 9 | + %span.label-branch= @merge_request.source_branch | |
| 10 | + or | |
| 11 | + %span.label-branch= @merge_request.target_branch | |
| 12 | + branches in the repository. | |
| 13 | + %p | |
| 14 | + Maybe it was removed or never pushed. | |
| 15 | + %p | |
| 16 | + Please close Merge Request or change branches with existing one | |
| 17 | + | ... | ... |
| ... | ... | @@ -0,0 +1 @@ |
| 1 | += render "show" | ... | ... |
app/views/projects/merge_requests/show/_commits.html.haml
0 → 100644
| ... | ... | @@ -0,0 +1,30 @@ |
| 1 | +- if @commits.present? | |
| 2 | + .ui-box | |
| 3 | + %h5.title | |
| 4 | + %i.icon-list | |
| 5 | + Commits (#{@commits.count}) | |
| 6 | + .commits | |
| 7 | + - if @commits.count > 8 | |
| 8 | + %ul.first-commits.well-list | |
| 9 | + - @commits.first(8).each do |commit| | |
| 10 | + = render "projects/commits/commit", commit: commit | |
| 11 | + %li.bottom | |
| 12 | + 8 of #{@commits.count} commits displayed. | |
| 13 | + %strong | |
| 14 | + %a.show-all-commits Click here to show all | |
| 15 | + %ul.all-commits.hide.well-list | |
| 16 | + - @commits.each do |commit| | |
| 17 | + = render "projects/commits/commit", commit: commit | |
| 18 | + | |
| 19 | + - else | |
| 20 | + %ul.well-list | |
| 21 | + - @commits.each do |commit| | |
| 22 | + = render "projects/commits/commit", commit: commit | |
| 23 | + | |
| 24 | +- else | |
| 25 | + %h4.nothing_here_message | |
| 26 | + Nothing to merge from | |
| 27 | + %span.label-branch #{@merge_request.source_branch} | |
| 28 | + to | |
| 29 | + %span.label-branch #{@merge_request.target_branch} | |
| 30 | + %br | ... | ... |
| ... | ... | @@ -0,0 +1,10 @@ |
| 1 | +- if @merge_request.valid_diffs? | |
| 2 | + = render "projects/commits/diffs", diffs: @diffs | |
| 3 | +- elsif @merge_request.broken_diffs? | |
| 4 | + %h4.nothing_here_message | |
| 5 | + Can't load diff. | |
| 6 | + You can | |
| 7 | + = link_to "download it", project_merge_request_path(@project, @merge_request, format: :diff), class: "vlink" | |
| 8 | + instead. | |
| 9 | +- else | |
| 10 | + %h4.nothing_here_message Nothing to merge | ... | ... |
app/views/projects/merge_requests/show/_how_to_merge.html.haml
0 → 100644
| ... | ... | @@ -0,0 +1,19 @@ |
| 1 | +%div#modal_merge_info.modal.hide | |
| 2 | + .modal-header | |
| 3 | + %a.close{href: "#"} × | |
| 4 | + %h3 How To Merge | |
| 5 | + .modal-body | |
| 6 | + %p | |
| 7 | + %strong Step 1. | |
| 8 | + Checkout target branch and get recent objects from GitLab | |
| 9 | + %pre.dark | |
| 10 | + :preserve | |
| 11 | + git checkout #{@merge_request.target_branch} | |
| 12 | + git fetch origin | |
| 13 | + %p | |
| 14 | + %strong Step 2. | |
| 15 | + Merge source branch into target branch and push changes to GitLab | |
| 16 | + %pre.dark | |
| 17 | + :preserve | |
| 18 | + git merge origin/#{@merge_request.source_branch} | |
| 19 | + git push origin #{@merge_request.target_branch} | ... | ... |
app/views/projects/merge_requests/show/_mr_accept.html.haml
0 → 100644
| ... | ... | @@ -0,0 +1,52 @@ |
| 1 | +- unless @allowed_to_merge | |
| 2 | + .alert | |
| 3 | + %strong You don't have enough permissions to merge this MR | |
| 4 | + | |
| 5 | + | |
| 6 | +- if @show_merge_controls | |
| 7 | + .automerge_widget.can_be_merged{style: "display:none"} | |
| 8 | + .alert.alert-success | |
| 9 | + %span | |
| 10 | + = form_for [:automerge, @project, @merge_request], remote: true, method: :get do |f| | |
| 11 | + %p | |
| 12 | + You can accept this request automatically. | |
| 13 | + If you still want to do it manually - | |
| 14 | + %strong= link_to "click here", "#", class: "how_to_merge_link vlink", title: "How To Merge" | |
| 15 | + for instructions | |
| 16 | + .accept_group | |
| 17 | + = f.submit "Accept Merge Request", class: "btn success accept_merge_request" | |
| 18 | + - unless @project.root_ref? @merge_request.source_branch | |
| 19 | + .remove_branch_holder | |
| 20 | + = label_tag :should_remove_source_branch, class: "checkbox" do | |
| 21 | + = check_box_tag :should_remove_source_branch | |
| 22 | + Remove source-branch | |
| 23 | + .clearfix | |
| 24 | + | |
| 25 | + | |
| 26 | + .automerge_widget.no_satellite{style: "display:none"} | |
| 27 | + .alert.alert-error | |
| 28 | + %span | |
| 29 | + %strong This repository does not have satellite. Ask administrator to fix this issue | |
| 30 | + | |
| 31 | + .automerge_widget.cannot_be_merged{style: "display:none"} | |
| 32 | + .alert.alert-disabled | |
| 33 | + %span | |
| 34 | + = link_to "Show how to merge", "#", class: "how_to_merge_link btn btn-small padded", title: "How To Merge" | |
| 35 | + | |
| 36 | + %strong This request can't be merged with GitLab. You should do it manually | |
| 37 | + | |
| 38 | + .automerge_widget.unchecked | |
| 39 | + .alert | |
| 40 | + %strong | |
| 41 | + %i.icon-refresh | |
| 42 | + Checking for ability to automatically merge… | |
| 43 | + | |
| 44 | + .automerge_widget.already_cannot_be_merged{style: "display:none"} | |
| 45 | + .alert.alert-info | |
| 46 | + %strong This merge request already can not be merged. Try to reload page. | |
| 47 | + | |
| 48 | + .merge-in-progress.hide | |
| 49 | + %span.cgray | |
| 50 | + %i.icon-refresh.icon-spin | |
| 51 | + | |
| 52 | + Merge is in progress. Please wait. Page will be automatically reloaded. | ... | ... |
app/views/projects/merge_requests/show/_mr_box.html.haml
0 → 100644
| ... | ... | @@ -0,0 +1,36 @@ |
| 1 | +.ui-box.ui-box-show | |
| 2 | + .ui-box-head | |
| 3 | + %h4.box-title | |
| 4 | + = gfm escape_once(@merge_request.title) | |
| 5 | + - if @merge_request.merged? | |
| 6 | + .success.status_info | |
| 7 | + %i.icon-ok | |
| 8 | + Merged | |
| 9 | + - elsif @merge_request.closed? | |
| 10 | + .error.status_info Closed | |
| 11 | + | |
| 12 | + .ui-box-body | |
| 13 | + %div | |
| 14 | + %cite.cgray | |
| 15 | + Created at #{@merge_request.created_at.stamp("Aug 21, 2011")} by #{link_to_member(@project, @merge_request.author)} | |
| 16 | + - if @merge_request.assignee | |
| 17 | + \, currently assigned to #{link_to_member(@project, @merge_request.assignee)} | |
| 18 | + - if @merge_request.milestone | |
| 19 | + - milestone = @merge_request.milestone | |
| 20 | + %cite.cgray and attached to milestone | |
| 21 | + %strong= link_to_gfm truncate(milestone.title, length: 20), project_milestone_path(milestone.project, milestone) | |
| 22 | + | |
| 23 | + | |
| 24 | + - if @merge_request.closed? | |
| 25 | + .ui-box-bottom.alert-error | |
| 26 | + %span | |
| 27 | + %i.icon-remove | |
| 28 | + Closed by #{link_to_member(@project, @merge_request.closed_event.author)} | |
| 29 | + %small #{time_ago_in_words(@merge_request.closed_event.created_at)} ago. | |
| 30 | + - if @merge_request.merged? | |
| 31 | + .ui-box-bottom.alert-success | |
| 32 | + %span | |
| 33 | + %i.icon-ok | |
| 34 | + Merged by #{link_to_member(@project, @merge_request.merge_event.author)} | |
| 35 | + #{time_ago_in_words(@merge_request.merge_event.created_at)} ago. | |
| 36 | + | ... | ... |
| ... | ... | @@ -0,0 +1,35 @@ |
| 1 | +- if @commits.any? | |
| 2 | + .ci_widget.ci-success{style: "display:none"} | |
| 3 | + .alert.alert-success | |
| 4 | + %i.icon-ok | |
| 5 | + %strong CI build passed | |
| 6 | + for #{@merge_request.last_commit_short_sha}. | |
| 7 | + = link_to "Build page", ci_build_details_path(@merge_request) | |
| 8 | + | |
| 9 | + | |
| 10 | + .ci_widget.ci-failed{style: "display:none"} | |
| 11 | + .alert.alert-error | |
| 12 | + %i.icon-remove | |
| 13 | + %strong CI build failed | |
| 14 | + for #{@merge_request.last_commit_short_sha}. | |
| 15 | + = link_to "Build page", ci_build_details_path(@merge_request) | |
| 16 | + | |
| 17 | + - [:running, :pending].each do |status| | |
| 18 | + .ci_widget{class: "ci-#{status}", style: "display:none"} | |
| 19 | + .alert | |
| 20 | + %i.icon-time | |
| 21 | + %strong CI build #{status} | |
| 22 | + for #{@merge_request.last_commit_short_sha}. | |
| 23 | + = link_to "Build page", ci_build_details_path(@merge_request) | |
| 24 | + | |
| 25 | + .ci_widget | |
| 26 | + .alert | |
| 27 | + %strong | |
| 28 | + %i.icon-refresh | |
| 29 | + Checking for CI status for #{@merge_request.last_commit_short_sha} | |
| 30 | + | |
| 31 | + .ci_widget.ci-error{style: "display:none"} | |
| 32 | + .alert.alert-error | |
| 33 | + %i.icon-remove | |
| 34 | + %strong Cannot connect to CI server. Please check your setting | |
| 35 | + | ... | ... |
app/views/projects/merge_requests/show/_mr_title.html.haml
0 → 100644
| ... | ... | @@ -0,0 +1,31 @@ |
| 1 | +%h3.page_title | |
| 2 | + = "Merge Request ##{@merge_request.id}:" | |
| 3 | + | |
| 4 | + %span.label-branch= @merge_request.source_branch | |
| 5 | + → | |
| 6 | + %span.label-branch= @merge_request.target_branch | |
| 7 | + | |
| 8 | + %span.pull-right | |
| 9 | + - if can?(current_user, :modify_merge_request, @merge_request) | |
| 10 | + - if @merge_request.opened? | |
| 11 | + .left.btn-group | |
| 12 | + %a.btn.grouped.dropdown-toggle{ data: {toggle: :dropdown} } | |
| 13 | + %i.icon-download-alt | |
| 14 | + Download as | |
| 15 | + %span.caret | |
| 16 | + %ul.dropdown-menu | |
| 17 | + %li= link_to "Email Patches", project_merge_request_path(@project, @merge_request, format: :patch) | |
| 18 | + %li= link_to "Plain Diff", project_merge_request_path(@project, @merge_request, format: :diff) | |
| 19 | + | |
| 20 | + = link_to 'Close', project_merge_request_path(@project, @merge_request, merge_request: {state_event: :close }), method: :put, class: "btn grouped btn-close", title: "Close merge request" | |
| 21 | + | |
| 22 | + = link_to edit_project_merge_request_path(@project, @merge_request), class: "btn grouped" do | |
| 23 | + %i.icon-edit | |
| 24 | + Edit | |
| 25 | + | |
| 26 | +.pull-right | |
| 27 | + .span3#votes= render 'votes/votes_block', votable: @merge_request | |
| 28 | + | |
| 29 | +.back_link | |
| 30 | + = link_to project_merge_requests_path(@project) do | |
| 31 | + ← To merge requests | ... | ... |
| ... | ... | @@ -0,0 +1,47 @@ |
| 1 | +%h3.page_title= @milestone.new_record? ? "New Milestone" : "Edit Milestone ##{@milestone.id}" | |
| 2 | +.back_link | |
| 3 | + = link_to project_milestones_path(@project) do | |
| 4 | + ← To milestones | |
| 5 | + | |
| 6 | +%hr | |
| 7 | + | |
| 8 | += form_for [@project, @milestone], html: {class: "new_milestone form-horizontal"} do |f| | |
| 9 | + -if @milestone.errors.any? | |
| 10 | + .alert.alert-error | |
| 11 | + %ul | |
| 12 | + - @milestone.errors.full_messages.each do |msg| | |
| 13 | + %li= msg | |
| 14 | + .row | |
| 15 | + .span6 | |
| 16 | + .control-group | |
| 17 | + = f.label :title, "Title", class: "control-label" | |
| 18 | + .controls | |
| 19 | + = f.text_field :title, maxlength: 255, class: "input-xlarge" | |
| 20 | + %p.hint Required | |
| 21 | + .control-group | |
| 22 | + = f.label :description, "Description", class: "control-label" | |
| 23 | + .controls | |
| 24 | + = f.text_area :description, maxlength: 2000, class: "input-xlarge", rows: 10 | |
| 25 | + %p.hint Milestones are parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. | |
| 26 | + .span6 | |
| 27 | + .control-group | |
| 28 | + = f.label :due_date, "Due Date", class: "control-label" | |
| 29 | + .input= f.hidden_field :due_date | |
| 30 | + .controls | |
| 31 | + .datepicker | |
| 32 | + | |
| 33 | + .form-actions | |
| 34 | + - if @milestone.new_record? | |
| 35 | + = f.submit 'Create milestone', class: "btn-save btn" | |
| 36 | + = link_to "Cancel", project_milestones_path(@project), class: "btn btn-cancel" | |
| 37 | + -else | |
| 38 | + = f.submit 'Save changes', class: "btn-save btn" | |
| 39 | + = link_to "Cancel", project_milestone_path(@project, @milestone), class: "btn btn-cancel" | |
| 40 | + | |
| 41 | + | |
| 42 | +:javascript | |
| 43 | + disableButtonIfEmptyField("#milestone_title", ".btn-save"); | |
| 44 | + $( ".datepicker" ).datepicker({ | |
| 45 | + dateFormat: "yy-mm-dd", | |
| 46 | + onSelect: function(dateText, inst) { $("#milestone_due_date").val(dateText) } | |
| 47 | + }).datepicker("setDate", $.datepicker.parseDate('yy-mm-dd', $('#milestone_due_date').val())); | ... | ... |
| ... | ... | @@ -0,0 +1,11 @@ |
| 1 | +.ui-box | |
| 2 | + %h5.title= title | |
| 3 | + %ul.well-list | |
| 4 | + - issues.each do |issue| | |
| 5 | + %li | |
| 6 | + = link_to [@project, issue] do | |
| 7 | + %span.badge{class: issue.closed? ? 'badge-important' : 'badge-info'} ##{issue.id} | |
| 8 | + = link_to_gfm truncate(issue.title, length: 60), [@project, issue] | |
| 9 | + - if issue.assignee | |
| 10 | + .pull-right | |
| 11 | + = image_tag gravatar_icon(issue.assignee.email, 16), class: "avatar s16" | ... | ... |
| ... | ... | @@ -0,0 +1,28 @@ |
| 1 | +%li{class: "milestone milestone-#{milestone.closed? ? 'closed' : 'open'}", id: dom_id(milestone) } | |
| 2 | + .pull-right | |
| 3 | + - if can?(current_user, :admin_milestone, milestone.project) and milestone.active? | |
| 4 | + = link_to edit_project_milestone_path(milestone.project, milestone), class: "btn btn-small edit-milestone-link grouped" do | |
| 5 | + %i.icon-edit | |
| 6 | + Edit | |
| 7 | + - if milestone.can_be_closed? | |
| 8 | + = link_to 'Close', project_milestone_path(@project, milestone, milestone: {state_event: :close }), method: :put, remote: true, class: "btn btn-small btn-remove" | |
| 9 | + %h4 | |
| 10 | + = link_to_gfm truncate(milestone.title, length: 100), project_milestone_path(milestone.project, milestone) | |
| 11 | + - if milestone.expired? and not milestone.closed? | |
| 12 | + %span.cred (Expired) | |
| 13 | + %small | |
| 14 | + = milestone.expires_at | |
| 15 | + - if milestone.is_empty? | |
| 16 | + %span.muted Empty | |
| 17 | + - else | |
| 18 | + %div | |
| 19 | + %div | |
| 20 | + = link_to project_issues_path(milestone.project, milestone_id: milestone.id) do | |
| 21 | + = pluralize milestone.issues.count, 'Issue' | |
| 22 | + | |
| 23 | + = link_to project_merge_requests_path(milestone.project, milestone_id: milestone.id) do | |
| 24 | + = pluralize milestone.merge_requests.count, 'Merge Request' | |
| 25 | + | |
| 26 | + %span.light #{milestone.percent_complete}% complete | |
| 27 | + .progress.progress-info | |
| 28 | + .bar{style: "width: #{milestone.percent_complete}%;"} | ... | ... |
| ... | ... | @@ -0,0 +1 @@ |
| 1 | += render "form" | ... | ... |
| ... | ... | @@ -0,0 +1,32 @@ |
| 1 | += render "projects/issues/head" | |
| 2 | +.milestones_content | |
| 3 | + %h3.page_title | |
| 4 | + Milestones | |
| 5 | + - if can? current_user, :admin_milestone, @project | |
| 6 | + = link_to new_project_milestone_path(@project), class: "pull-right btn btn-primary", title: "New Milestone" do | |
| 7 | + %i.icon-plus | |
| 8 | + New Milestone | |
| 9 | + %br | |
| 10 | + | |
| 11 | + .row | |
| 12 | + .span3 | |
| 13 | + %ul.nav.nav-pills.nav-stacked | |
| 14 | + %li{class: ("active" if (params[:f] == "active" || !params[:f]))} | |
| 15 | + = link_to project_milestones_path(@project, f: "active") do | |
| 16 | + Active | |
| 17 | + %li{class: ("active" if params[:f] == "closed")} | |
| 18 | + = link_to project_milestones_path(@project, f: "closed") do | |
| 19 | + Closed | |
| 20 | + %li{class: ("active" if params[:f] == "all")} | |
| 21 | + = link_to project_milestones_path(@project, f: "all") do | |
| 22 | + All | |
| 23 | + .span9 | |
| 24 | + .ui-box | |
| 25 | + %ul.well-list | |
| 26 | + = render @milestones | |
| 27 | + | |
| 28 | + - if @milestones.blank? | |
| 29 | + %li | |
| 30 | + %h3.nothing_here_message Nothing to show here | |
| 31 | + | |
| 32 | + = paginate @milestones, theme: "gitlab" | ... | ... |
| ... | ... | @@ -0,0 +1 @@ |
| 1 | += render "form" | ... | ... |
| ... | ... | @@ -0,0 +1,106 @@ |
| 1 | += render "projects/issues/head" | |
| 2 | +.row | |
| 3 | + .span6 | |
| 4 | + %h3.page_title | |
| 5 | + Milestone ##{@milestone.id} | |
| 6 | + %small | |
| 7 | + = @milestone.expires_at | |
| 8 | + .back_link | |
| 9 | + = link_to project_milestones_path(@project) do | |
| 10 | + ← To milestones list | |
| 11 | + .span6 | |
| 12 | + .pull-right | |
| 13 | + - unless @milestone.closed? | |
| 14 | + = link_to new_project_issue_path(@project, issue: { milestone_id: @milestone.id }), class: "btn btn-small grouped", title: "New Issue" do | |
| 15 | + %i.icon-plus | |
| 16 | + New Issue | |
| 17 | + = link_to 'Browse Issues', project_issues_path(@milestone.project, milestone_id: @milestone.id), class: "btn edit-milestone-link small grouped" | |
| 18 | + - if can?(current_user, :admin_milestone, @project) | |
| 19 | + = link_to edit_project_milestone_path(@project, @milestone), class: "btn btn-small grouped" do | |
| 20 | + %i.icon-edit | |
| 21 | + Edit | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | +- if @milestone.can_be_closed? | |
| 26 | + %hr | |
| 27 | + %p | |
| 28 | + %span All issues for this milestone are closed. You may close milestone now. | |
| 29 | + = link_to 'Close Milestone', project_milestone_path(@project, @milestone, milestone: {state_event: :close }), method: :put, class: "btn btn-small btn-remove" | |
| 30 | + | |
| 31 | +.ui-box.ui-box-show | |
| 32 | + .ui-box-head | |
| 33 | + %h4.box-title | |
| 34 | + - if @milestone.closed? | |
| 35 | + .error.status_info Closed | |
| 36 | + - elsif @milestone.expired? | |
| 37 | + .error.status_info Expired | |
| 38 | + | |
| 39 | + = gfm escape_once(@milestone.title) | |
| 40 | + | |
| 41 | + .ui-box-body | |
| 42 | + %p | |
| 43 | + Progress: | |
| 44 | + #{@milestone.closed_items_count} closed | |
| 45 | + – | |
| 46 | + #{@milestone.open_items_count} open | |
| 47 | + %span.pull-right= @milestone.expires_at | |
| 48 | + .progress.progress-info | |
| 49 | + .bar{style: "width: #{@milestone.percent_complete}%;"} | |
| 50 | + | |
| 51 | + | |
| 52 | + - if @milestone.description.present? | |
| 53 | + .ui-box-bottom | |
| 54 | + = preserve do | |
| 55 | + = markdown @milestone.description | |
| 56 | + | |
| 57 | + | |
| 58 | +%ul.nav.nav-tabs | |
| 59 | + %li.active | |
| 60 | + = link_to '#tab-issues', 'data-toggle' => 'tab' do | |
| 61 | + Issues | |
| 62 | + %span.badge= @issues.count | |
| 63 | + %li | |
| 64 | + = link_to '#tab-merge-requests', 'data-toggle' => 'tab' do | |
| 65 | + Merge Requests | |
| 66 | + %span.badge= @merge_requests.count | |
| 67 | + %li | |
| 68 | + = link_to '#tab-participants', 'data-toggle' => 'tab' do | |
| 69 | + Participants | |
| 70 | + %span.badge= @users.count | |
| 71 | + | |
| 72 | + | |
| 73 | +.tab-content | |
| 74 | + .tab-pane.active#tab-issues | |
| 75 | + .row | |
| 76 | + .span4 | |
| 77 | + = render('issues', title: 'Unstarted Issues (open and unassigned)', issues: @issues.opened.unassigned) | |
| 78 | + .span4 | |
| 79 | + = render('issues', title: 'Ongoing Issues (open and assigned)', issues: @issues.opened.assigned) | |
| 80 | + .span4 | |
| 81 | + = render('issues', title: 'Completed Issues (closed)', issues: @issues.closed) | |
| 82 | + | |
| 83 | + .tab-pane#tab-merge-requests | |
| 84 | + .row | |
| 85 | + .span6 | |
| 86 | + .ui-box | |
| 87 | + %h5.title Open | |
| 88 | + %ul.well-list | |
| 89 | + - @merge_requests.opened.each do |merge_request| | |
| 90 | + = render 'merge_request', merge_request: merge_request | |
| 91 | + .span6 | |
| 92 | + .ui-box | |
| 93 | + %h5.title Closed | |
| 94 | + %ul.well-list | |
| 95 | + - @merge_requests.closed.each do |merge_request| | |
| 96 | + = render 'merge_request', merge_request: merge_request | |
| 97 | + | |
| 98 | + .tab-pane#tab-participants | |
| 99 | + %ul.bordered-list | |
| 100 | + - @users.each do |user| | |
| 101 | + %li | |
| 102 | + = link_to user, title: user.name, class: "dark" do | |
| 103 | + = image_tag gravatar_icon(user.email, 32), class: "avatar s32" | |
| 104 | + %strong= truncate(user.name, lenght: 40) | |
| 105 | + %br | |
| 106 | + %small.cgray= user.username | ... | ... |
| ... | ... | @@ -0,0 +1,26 @@ |
| 1 | +%h3.page_title Project Network Graph | |
| 2 | +%hr | |
| 3 | + | |
| 4 | +.clearfix | |
| 5 | + .pull-left | |
| 6 | + = render partial: 'shared/ref_switcher', locals: {destination: 'graph'} | |
| 7 | + .pull-left | |
| 8 | + = form_tag project_network_path(@project, @id), method: :get do |f| | |
| 9 | + .control-group | |
| 10 | + = label_tag :filter_ref, "Show only selected ref", class: 'control-label light' | |
| 11 | + .controls | |
| 12 | + = check_box_tag :filter_ref, 1, @options[:filter_ref] | |
| 13 | + - @options.each do |key, value| | |
| 14 | + = hidden_field_tag(key, value, id: nil) unless key == "filter_ref" | |
| 15 | + | |
| 16 | + .search.pull-right | |
| 17 | + = form_tag project_network_path(@project, @id), method: :get do |f| | |
| 18 | + .control-group | |
| 19 | + = label_tag :search , "Looking for commit:", class: 'control-label light' | |
| 20 | + .controls | |
| 21 | + = text_field_tag :q, @options[:q], placeholder: "Input SHA", class: "search-input xlarge" | |
| 22 | + = button_tag type: 'submit', class: 'btn vtop' do | |
| 23 | + %i.icon-search | |
| 24 | + - @options.each do |key, value| | |
| 25 | + = hidden_field_tag(key, value, id: nil) unless key == "q" | |
| 26 | + | ... | ... |
| ... | ... | @@ -0,0 +1,18 @@ |
| 1 | += render "head" | |
| 2 | +.graph_holder | |
| 3 | + %h4 | |
| 4 | + %small You can move around the graph by using the arrow keys. | |
| 5 | + #holder.graph | |
| 6 | + .loading.loading-gray | |
| 7 | + | |
| 8 | +:javascript | |
| 9 | + var branch_graph; | |
| 10 | + $("#filter_ref").click(function() { | |
| 11 | + $(this).closest('form').submit(); | |
| 12 | + }); | |
| 13 | + branch_graph = new BranchGraph($("#holder"), { | |
| 14 | + url: '#{project_network_path(@project, @ref, @options.merge(format: :json))}', | |
| 15 | + commit_url: '#{project_commit_path(@project, 'ae45ca32').gsub("ae45ca32", "%s")}', | |
| 16 | + ref: '#{@ref}', | |
| 17 | + commit_id: '#{@commit.id}' | |
| 18 | + }); | ... | ... |
| ... | ... | @@ -0,0 +1,23 @@ |
| 1 | +<% self.formats = ["html"] %> | |
| 2 | + | |
| 3 | +<%= raw( | |
| 4 | + { | |
| 5 | + days: @graph.days.compact.map { |d| [d.day, d.strftime("%b")] }, | |
| 6 | + commits: @graph.commits.map do |c| | |
| 7 | + { | |
| 8 | + parents: parents_zip_spaces(c.parents(@graph.map), c.parent_spaces), | |
| 9 | + author: { | |
| 10 | + name: c.author_name, | |
| 11 | + email: c.author_email, | |
| 12 | + icon: gravatar_icon(c.author_email, 20) | |
| 13 | + }, | |
| 14 | + time: c.time, | |
| 15 | + space: c.spaces.first, | |
| 16 | + refs: get_refs(c), | |
| 17 | + id: c.sha, | |
| 18 | + date: c.date, | |
| 19 | + message: c.message, | |
| 20 | + } | |
| 21 | + end | |
| 22 | + }.to_json | |
| 23 | +) %> | ... | ... |
| ... | ... | @@ -0,0 +1,10 @@ |
| 1 | +- note = @project.notes.new(@comments_target.merge({ line_code: line_code })) | |
| 2 | += link_to "", | |
| 3 | + "javascript:;", | |
| 4 | + class: "add-diff-note js-add-diff-note-button", | |
| 5 | + data: { noteable_type: note.noteable_type, | |
| 6 | + noteable_id: note.noteable_id, | |
| 7 | + commit_id: note.commit_id, | |
| 8 | + line_code: note.line_code, | |
| 9 | + discussion_id: note.discussion_id }, | |
| 10 | + title: "Add a comment to this line" | ... | ... |
app/views/projects/notes/_diff_notes_with_reply.html.haml
0 → 100644
| ... | ... | @@ -0,0 +1,11 @@ |
| 1 | +- note = notes.first # example note | |
| 2 | +%tr.notes_holder | |
| 3 | + %td.notes_line{ colspan: 2 } | |
| 4 | + %span.btn.disabled | |
| 5 | + %i.icon-comment | |
| 6 | + = notes.count | |
| 7 | + %td.notes_content | |
| 8 | + %ul.notes{ rel: note.discussion_id } | |
| 9 | + = render notes | |
| 10 | + | |
| 11 | + = render "projects/notes/discussion_reply_button", note: note | ... | ... |
| ... | ... | @@ -0,0 +1,63 @@ |
| 1 | +- note = discussion_notes.first | |
| 2 | +.discussion.js-details-container.js-toggler-container.open{ class: note.discussion_id } | |
| 3 | + .discussion-header | |
| 4 | + .discussion-actions | |
| 5 | + = link_to "javascript:;", class: "js-details-target turn-on js-toggler-target" do | |
| 6 | + %i.icon-eye-close | |
| 7 | + Hide discussion | |
| 8 | + = link_to "javascript:;", class: "js-details-target turn-off js-toggler-target" do | |
| 9 | + %i.icon-eye-open | |
| 10 | + Show discussion | |
| 11 | + = image_tag gravatar_icon(note.author_email), class: "avatar s32" | |
| 12 | + %div | |
| 13 | + = link_to_member(@project, note.author, avatar: false) | |
| 14 | + - if note.for_merge_request? | |
| 15 | + - if note.diff | |
| 16 | + started a discussion on this merge request diff | |
| 17 | + = link_to_merge_request_diff_line_note(note) | |
| 18 | + - else | |
| 19 | + started | |
| 20 | + %strong | |
| 21 | + %i.icon-remove | |
| 22 | + outdated | |
| 23 | + discussion on this merge request diff | |
| 24 | + - elsif note.for_commit? | |
| 25 | + started a discussion on commit | |
| 26 | + #{link_to note.noteable.short_id, project_commit_path(@project, note.noteable)} | |
| 27 | + = link_to_commit_diff_line_note(note) if note.for_diff_line? | |
| 28 | + - else | |
| 29 | + %cite.cgray started a discussion | |
| 30 | + %div | |
| 31 | + - last_note = discussion_notes.last | |
| 32 | + last updated by | |
| 33 | + = link_to_member(@project, last_note.author, avatar: false) | |
| 34 | + %span.discussion-last-update | |
| 35 | + = time_ago_in_words(last_note.updated_at) | |
| 36 | + ago | |
| 37 | + .discussion-body | |
| 38 | + - if note.for_diff_line? | |
| 39 | + - if note.diff | |
| 40 | + .content | |
| 41 | + .file= render "projects/notes/discussion_diff", discussion_notes: discussion_notes, note: note | |
| 42 | + - else | |
| 43 | + = link_to 'show outdated discussion', '#', class: 'js-show-outdated-discussion' | |
| 44 | + %div.hide.outdated-discussion | |
| 45 | + .content | |
| 46 | + .notes{ rel: discussion_notes.first.discussion_id } | |
| 47 | + = render discussion_notes | |
| 48 | + | |
| 49 | + | |
| 50 | + - else | |
| 51 | + .content | |
| 52 | + .notes{ rel: discussion_notes.first.discussion_id } | |
| 53 | + = render discussion_notes | |
| 54 | + = render "projects/notes/discussion_reply_button", note: discussion_notes.first | |
| 55 | + | |
| 56 | + -# will be shown when the other one is hidden | |
| 57 | + .discussion-hidden.content.hide | |
| 58 | + .note | |
| 59 | + %em Hidden discussion. | |
| 60 | + = link_to "javascript:;", class: "js-details-target js-toggler-target" do | |
| 61 | + %i.icon-eye-open | |
| 62 | + Show | |
| 63 | + | ... | ... |
| ... | ... | @@ -0,0 +1,24 @@ |
| 1 | +- diff = note.diff | |
| 2 | +.header | |
| 3 | + - if diff.deleted_file | |
| 4 | + %span= diff.old_path | |
| 5 | + - else | |
| 6 | + %span= diff.new_path | |
| 7 | + - if diff.a_mode && diff.b_mode && diff.a_mode != diff.b_mode | |
| 8 | + %span.file-mode= "#{diff.a_mode} → #{diff.b_mode}" | |
| 9 | + %br/ | |
| 10 | +.content | |
| 11 | + %table | |
| 12 | + - each_diff_line_near(diff, note.diff_file_index, note.line_code) do |line, type, line_code, line_new, line_old| | |
| 13 | + %tr.line_holder{ id: line_code } | |
| 14 | + - if type == "match" | |
| 15 | + %td.old_line= "..." | |
| 16 | + %td.new_line= "..." | |
| 17 | + %td.line_content.matched= line | |
| 18 | + - else | |
| 19 | + %td.old_line= raw(type == "new" ? " " : line_old) | |
| 20 | + %td.new_line= raw(type == "old" ? " " : line_new) | |
| 21 | + %td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw "#{line} " | |
| 22 | + | |
| 23 | + - if line_code == note.line_code | |
| 24 | + = render "projects/notes/diff_notes_with_reply", notes: discussion_notes | ... | ... |
app/views/projects/notes/_discussion_reply_button.html.haml
0 → 100644
| ... | ... | @@ -0,0 +1,10 @@ |
| 1 | += link_to "javascript:;", | |
| 2 | + class: "btn reply-btn js-discussion-reply-button", | |
| 3 | + data: { noteable_type: note.noteable_type, | |
| 4 | + noteable_id: note.noteable_id, | |
| 5 | + commit_id: note.commit_id, | |
| 6 | + line_code: note.line_code, | |
| 7 | + discussion_id: note.discussion_id }, | |
| 8 | + title: "Add a reply" do | |
| 9 | + %i.icon-comment | |
| 10 | + Reply | ... | ... |
| ... | ... | @@ -0,0 +1,37 @@ |
| 1 | += form_for [@project, @note], remote: true, html: { multipart: true, id: nil, class: "new_note js-new-note-form common-note-form" } do |f| | |
| 2 | + | |
| 3 | + = note_target_fields | |
| 4 | + = f.hidden_field :commit_id | |
| 5 | + = f.hidden_field :line_code | |
| 6 | + = f.hidden_field :noteable_id | |
| 7 | + = f.hidden_field :noteable_type | |
| 8 | + | |
| 9 | + .note_text_and_preview.js-toggler-container | |
| 10 | + %a.js-note-preview-button.js-toggler-target.turn-off{ href: "javascript:;", title: "Preview", data: {url: preview_project_notes_path(@project)} } | |
| 11 | + %i.icon-eye-open | |
| 12 | + %a.js-note-edit-button.js-toggler-target.turn-off{ href: "javascript:;", title: "Edit" } | |
| 13 | + %i.icon-edit | |
| 14 | + | |
| 15 | + = f.text_area :note, size: 255, class: 'note_text js-note-text js-gfm-input turn-on' | |
| 16 | + .note_preview.js-note-preview.turn-off | |
| 17 | + | |
| 18 | + .hint | |
| 19 | + .pull-right Comments are parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. | |
| 20 | + .clearfix | |
| 21 | + | |
| 22 | + .note-form-actions | |
| 23 | + .buttons | |
| 24 | + = f.submit 'Add Comment', class: "btn comment-btn grouped js-comment-button" | |
| 25 | + = yield(:note_actions) | |
| 26 | + | |
| 27 | + %a.btn.grouped.js-close-discussion-note-form Cancel | |
| 28 | + | |
| 29 | + .note-form-option | |
| 30 | + %a.choose-btn.btn.btn-small.js-choose-note-attachment-button | |
| 31 | + %i.icon-paper-clip | |
| 32 | + %span Choose File ... | |
| 33 | + | |
| 34 | + %span.file_name.js-attachment-filename File name... | |
| 35 | + = f.file_field :attachment, class: "js-note-attachment-input hide" | |
| 36 | + | |
| 37 | + .clearfix | ... | ... |
| ... | ... | @@ -0,0 +1,37 @@ |
| 1 | +%li{ id: dom_id(note), class: dom_class(note), data: { discussion: note.discussion_id } } | |
| 2 | + .note-header | |
| 3 | + .note-actions | |
| 4 | + = link_to "##{dom_id(note)}", name: dom_id(note) do | |
| 5 | + %i.icon-link | |
| 6 | + Link here | |
| 7 | + | |
| 8 | + - if(note.author_id == current_user.id) || can?(current_user, :admin_note, @project) | |
| 9 | + = link_to project_note_path(@project, note), title: "Remove comment", method: :delete, confirm: 'Are you sure you want to remove comment?', remote: true, class: "danger js-note-delete" do | |
| 10 | + %i.icon-trash.cred | |
| 11 | + = image_tag gravatar_icon(note.author_email), class: "avatar s32" | |
| 12 | + = link_to_member(@project, note.author, avatar: false) | |
| 13 | + %span.note-last-update | |
| 14 | + = time_ago_in_words(note.updated_at) | |
| 15 | + ago | |
| 16 | + | |
| 17 | + - if note.upvote? | |
| 18 | + %span.vote.upvote.label.label-success | |
| 19 | + %i.icon-thumbs-up | |
| 20 | + \+1 | |
| 21 | + - if note.downvote? | |
| 22 | + %span.vote.downvote.label.label-error | |
| 23 | + %i.icon-thumbs-down | |
| 24 | + \-1 | |
| 25 | + | |
| 26 | + | |
| 27 | + .note-body | |
| 28 | + = preserve do | |
| 29 | + = markdown(note.note) | |
| 30 | + - if note.attachment.url | |
| 31 | + - if note.attachment.image? | |
| 32 | + = image_tag note.attachment.url, class: 'note-image-attach' | |
| 33 | + .attachment.pull-right | |
| 34 | + = link_to note.attachment.secure_url, target: "_blank" do | |
| 35 | + %i.icon-paper-clip | |
| 36 | + = note.attachment_identifier | |
| 37 | + .clear | ... | ... |
| ... | ... | @@ -0,0 +1,11 @@ |
| 1 | +- if @discussions.present? | |
| 2 | + - @discussions.each do |discussion_notes| | |
| 3 | + - note = discussion_notes.first | |
| 4 | + - if note_for_main_target?(note) | |
| 5 | + = render discussion_notes | |
| 6 | + - else | |
| 7 | + = render 'discussion', discussion_notes: discussion_notes | |
| 8 | +- else | |
| 9 | + - @notes.each do |note| | |
| 10 | + - next unless note.author | |
| 11 | + = render note | ... | ... |
| ... | ... | @@ -0,0 +1,18 @@ |
| 1 | +- if @note.valid? | |
| 2 | + var noteHtml = "#{escape_javascript(render @note)}"; | |
| 3 | + | |
| 4 | + - if note_for_main_target?(@note) | |
| 5 | + NoteList.appendNewNote(#{@note.id}, noteHtml); | |
| 6 | + - else | |
| 7 | + :plain | |
| 8 | + var firstDiscussionNoteHtml = "#{escape_javascript(render "projects/notes/diff_notes_with_reply", notes: [@note])}"; | |
| 9 | + NoteList.appendNewDiscussionNote("#{@note.discussion_id}", | |
| 10 | + firstDiscussionNoteHtml, | |
| 11 | + noteHtml); | |
| 12 | + | |
| 13 | +- else | |
| 14 | + var errorsHtml = "#{escape_javascript(render 'projects/notes/form_errors', note: @note)}"; | |
| 15 | + - if note_for_main_target?(@note) | |
| 16 | + NoteList.errorsOnForm(errorsHtml); | |
| 17 | + - else | |
| 18 | + NoteList.errorsOnForm(errorsHtml, "#{@note.discussion_id}"); | ... | ... |
| ... | ... | @@ -0,0 +1,54 @@ |
| 1 | += render "projects/commits/head" | |
| 2 | +.row | |
| 3 | + .span3 | |
| 4 | + = render "projects/repositories/filter" | |
| 5 | + .span9 | |
| 6 | + .alert | |
| 7 | + %p Protected branches designed to prevent push for all except #{link_to "masters", help_permissions_path, class: "vlink"}. | |
| 8 | + %p This ability allows: | |
| 9 | + %ul | |
| 10 | + %li keep stable branches secured | |
| 11 | + %li forced code review before merge to protected branches | |
| 12 | + %p Read more about project permissions #{link_to "here", help_permissions_path, class: "vlink"} | |
| 13 | + | |
| 14 | + - if can? current_user, :admin_project, @project | |
| 15 | + = form_for [@project, @protected_branch] do |f| | |
| 16 | + -if @protected_branch.errors.any? | |
| 17 | + .alert.alert-error | |
| 18 | + %ul | |
| 19 | + - @protected_branch.errors.full_messages.each do |msg| | |
| 20 | + %li= msg | |
| 21 | + | |
| 22 | + .entry.clearfix | |
| 23 | + = f.label :name, "Branch" | |
| 24 | + .span3 | |
| 25 | + = f.select(:name, @project.open_branches.map { |br| [br.name, br.name] } , {include_blank: "Select branch"}, {class: "chosen span3"}) | |
| 26 | + | |
| 27 | + = f.submit 'Protect', class: "btn-primary btn" | |
| 28 | + | |
| 29 | + - unless @branches.empty? | |
| 30 | + %table | |
| 31 | + %thead | |
| 32 | + %tr | |
| 33 | + %th Name | |
| 34 | + %th Last commit | |
| 35 | + %th | |
| 36 | + %tbody | |
| 37 | + - @branches.each do |branch| | |
| 38 | + %tr | |
| 39 | + %td | |
| 40 | + = link_to project_commits_path(@project, branch.name) do | |
| 41 | + %strong= branch.name | |
| 42 | + - if @project.root_ref?(branch.name) | |
| 43 | + %span.label default | |
| 44 | + %td | |
| 45 | + - if branch.commit | |
| 46 | + = link_to project_commit_path(@project, branch.commit.id) do | |
| 47 | + = truncate branch.commit.id.to_s, length: 10 | |
| 48 | + = time_ago_in_words(branch.commit.committed_date) | |
| 49 | + ago | |
| 50 | + - else | |
| 51 | + (branch was removed from repository) | |
| 52 | + %td | |
| 53 | + - if can? current_user, :admin_project, @project | |
| 54 | + = link_to 'Unprotect', [@project, branch], confirm: 'Branch will be writable for developers. Are you sure?', method: :delete, class: "btn btn-remove btn-small" | ... | ... |
| ... | ... | @@ -0,0 +1,8 @@ |
| 1 | +- @logs.each do |content_data| | |
| 2 | + - file_name = content_data[:file_name] | |
| 3 | + - commit = content_data[:commit] | |
| 4 | + | |
| 5 | + :plain | |
| 6 | + var row = $("table.table_#{@hex_path} tr.file_#{hexdigest(file_name)}"); | |
| 7 | + row.find("td.tree_time_ago").html('#{escape_javascript time_ago_in_words(commit.committed_date)} ago'); | |
| 8 | + row.find("td.tree_commit").html('#{escape_javascript render("projects/tree/tree_commit_column", commit: commit)}'); | ... | ... |
| ... | ... | @@ -0,0 +1,26 @@ |
| 1 | +- commit = Commit.new(Gitlab::Git::Commit.new(branch.commit)) | |
| 2 | +%tr | |
| 3 | + %td | |
| 4 | + = link_to project_commits_path(@project, branch.name) do | |
| 5 | + - if @project.protected_branch? branch.name | |
| 6 | + %i.icon-lock | |
| 7 | + - else | |
| 8 | + %i.icon-unlock | |
| 9 | + %strong= truncate(branch.name, length: 60) | |
| 10 | + - if branch.name == @repository.root_ref | |
| 11 | + %span.label default | |
| 12 | + %td | |
| 13 | + = link_to project_commit_path(@project, commit.id), class: 'commit_short_id' do | |
| 14 | + = commit.short_id | |
| 15 | + = image_tag gravatar_icon(commit.author_email), class: "avatar s16" | |
| 16 | + %span.light | |
| 17 | + = gfm escape_once(truncate(commit.title, length: 40)) | |
| 18 | + %span | |
| 19 | + = time_ago_in_words(commit.committed_date) | |
| 20 | + ago | |
| 21 | + %td | |
| 22 | + - if can? current_user, :download_code, @project | |
| 23 | + = link_to archive_project_repository_path(@project, ref: branch.name) do | |
| 24 | + %i.icon-download-alt | |
| 25 | + Download | |
| 26 | + | ... | ... |
| ... | ... | @@ -0,0 +1,19 @@ |
| 1 | +- commit = update | |
| 2 | +%tr | |
| 3 | + %td | |
| 4 | + = link_to project_commits_path(@project, commit.head.name) do | |
| 5 | + %strong | |
| 6 | + = commit.head.name | |
| 7 | + - if @project.root_ref?(commit.head.name) | |
| 8 | + %span.label default | |
| 9 | + | |
| 10 | + %td | |
| 11 | + %div | |
| 12 | + = link_to project_commits_path(@project, commit.id) do | |
| 13 | + %code= commit.short_id | |
| 14 | + = image_tag gravatar_icon(commit.author_email), class: "", width: 16 | |
| 15 | + = gfm escape_once(truncate(commit.title, length: 40)) | |
| 16 | + %td | |
| 17 | + %span.pull-right.cgray | |
| 18 | + = time_ago_in_words(commit.committed_date) | |
| 19 | + ago | ... | ... |
| ... | ... | @@ -0,0 +1,9 @@ |
| 1 | +%ul.nav.nav-pills.nav-stacked | |
| 2 | + = nav_link(path: 'repositories#show') do | |
| 3 | + = link_to 'Recent', project_repository_path(@project) | |
| 4 | + = nav_link(path: 'protected_branches#index') do | |
| 5 | + = link_to project_protected_branches_path(@project) do | |
| 6 | + Protected | |
| 7 | + %i.icon-lock | |
| 8 | + = nav_link(path: 'repositories#branches') do | |
| 9 | + = link_to 'All branches', branches_project_repository_path(@project) | ... | ... |
| ... | ... | @@ -0,0 +1,15 @@ |
| 1 | += render "projects/commits/head" | |
| 2 | +.row | |
| 3 | + .span3 | |
| 4 | + = render "filter" | |
| 5 | + .span9 | |
| 6 | + - unless @branches.empty? | |
| 7 | + %table | |
| 8 | + %thead | |
| 9 | + %tr | |
| 10 | + %th Name | |
| 11 | + %th Last commit | |
| 12 | + %th | |
| 13 | + %tbody | |
| 14 | + - @branches.each do |branch| | |
| 15 | + = render "projects/repositories/branch", branch: branch | ... | ... |
| ... | ... | @@ -0,0 +1,33 @@ |
| 1 | += render "projects/commits/head" | |
| 2 | +.row | |
| 3 | + .span6 | |
| 4 | + %div#activity-chart.chart | |
| 5 | + %hr | |
| 6 | + %p | |
| 7 | + %b Total commits: | |
| 8 | + %span= @stats.commits_count | |
| 9 | + %p | |
| 10 | + %b Total files in #{@repository.root_ref}: | |
| 11 | + %span= @stats.files_count | |
| 12 | + %p | |
| 13 | + %b Authors: | |
| 14 | + %span= @stats.authors_count | |
| 15 | + | |
| 16 | + | |
| 17 | + .span6 | |
| 18 | + %h4 Top 50 Committers: | |
| 19 | + %ol.styled | |
| 20 | + - @stats.authors[0...50].each do |author| | |
| 21 | + %li | |
| 22 | + = image_tag gravatar_icon(author.email, 16), class: 'avatar s16' | |
| 23 | + = author.name | |
| 24 | + %small.light= author.email | |
| 25 | + .pull-right | |
| 26 | + = author.commits | |
| 27 | + | |
| 28 | + | |
| 29 | +:javascript | |
| 30 | + var labels = [#{@graph.labels.to_json}]; | |
| 31 | + var commits = [#{@graph.commits.join(', ')}]; | |
| 32 | + var title = "Commit activity for last #{@graph.weeks} weeks"; | |
| 33 | + Chart.init(labels, commits, title); | ... | ... |
| ... | ... | @@ -0,0 +1,36 @@ |
| 1 | += render "projects/commits/head" | |
| 2 | +- unless @tags.empty? | |
| 3 | + %ul.bordered-list | |
| 4 | + - @tags.each do |tag| | |
| 5 | + - commit = Commit.new(Gitlab::Git::Commit.new(tag.commit)) | |
| 6 | + %li | |
| 7 | + %h5 | |
| 8 | + = link_to project_commits_path(@project, tag.name), class: "" do | |
| 9 | + %i.icon-tag | |
| 10 | + = tag.name | |
| 11 | + %small | |
| 12 | + = truncate(tag.message || '', length: 70) | |
| 13 | + .pull-right | |
| 14 | + %span.light | |
| 15 | + = time_ago_in_words(commit.committed_date) | |
| 16 | + ago | |
| 17 | + %div.prepend-left-20 | |
| 18 | + = link_to commit.short_id(8), project_commit_path(@project, commit), class: "monospace" | |
| 19 | + – | |
| 20 | + = link_to_gfm truncate(commit.title, length: 70), project_commit_path(@project, commit.id), class: "cdark" | |
| 21 | + | |
| 22 | + - if can? current_user, :download_code, @project | |
| 23 | + .pull-right | |
| 24 | + = link_to archive_project_repository_path(@project, ref: tag.name) do | |
| 25 | + %i.icon-download-alt | |
| 26 | + Download | |
| 27 | + | |
| 28 | + | |
| 29 | +- else | |
| 30 | + %h3.nothing_here_message | |
| 31 | + Repository has no tags yet. | |
| 32 | + %br | |
| 33 | + %small | |
| 34 | + Use git tag command to add a new one: | |
| 35 | + %br | |
| 36 | + %span.monospace git tag -a v1.4 -m 'version 1.4' | ... | ... |
| ... | ... | @@ -0,0 +1,48 @@ |
| 1 | +%h3.page_title | |
| 2 | + - if @service.activated? | |
| 3 | + %span.cgreen | |
| 4 | + %i.icon-circle | |
| 5 | + - else | |
| 6 | + %span.cgray | |
| 7 | + %i.icon-circle-blank | |
| 8 | + = @service.title | |
| 9 | + | |
| 10 | +%p= @service.description | |
| 11 | + | |
| 12 | +.back_link | |
| 13 | + = link_to project_services_path(@project) do | |
| 14 | + ← to services | |
| 15 | + | |
| 16 | +%hr | |
| 17 | + | |
| 18 | += form_for(@service, as: :service, url: project_service_path(@project, @service.to_param), method: :put) do |f| | |
| 19 | + - if @service.errors.any? | |
| 20 | + .alert.alert-error | |
| 21 | + %ul | |
| 22 | + - @service.errors.full_messages.each do |msg| | |
| 23 | + %li= msg | |
| 24 | + | |
| 25 | + | |
| 26 | + .control-group | |
| 27 | + = f.label :active, "Active", class: "control-label" | |
| 28 | + .controls | |
| 29 | + = f.check_box :active | |
| 30 | + | |
| 31 | + - @service.fields.each do |field| | |
| 32 | + - name = field[:name] | |
| 33 | + - type = field[:type] | |
| 34 | + - placeholder = field[:placeholder] | |
| 35 | + | |
| 36 | + .control-group | |
| 37 | + = f.label name, class: "control-label" | |
| 38 | + .controls | |
| 39 | + - if type == 'text' | |
| 40 | + = f.text_field name, class: "input-xlarge", placeholder: placeholder | |
| 41 | + - elsif type == 'checkbox' | |
| 42 | + = f.check_box name | |
| 43 | + | |
| 44 | + .form-actions | |
| 45 | + = f.submit 'Save', class: 'btn btn-save' | |
| 46 | + | |
| 47 | + - if @service.valid? && @service.activated? | |
| 48 | + = link_to 'Test settings', test_project_service_path(@project, @service.to_param), class: 'btn btn-small' | ... | ... |
| ... | ... | @@ -0,0 +1 @@ |
| 1 | += render 'form' | ... | ... |
| ... | ... | @@ -0,0 +1,16 @@ |
| 1 | +%h3.page_title Services | |
| 2 | +%br | |
| 3 | + | |
| 4 | +%ul.bordered-list | |
| 5 | + - @services.each do |service| | |
| 6 | + %li | |
| 7 | + %h4 | |
| 8 | + - if service.activated? | |
| 9 | + %span.cgreen | |
| 10 | + %i.icon-circle | |
| 11 | + - else | |
| 12 | + %span.cgray | |
| 13 | + %i.icon-circle-blank | |
| 14 | + = link_to edit_project_service_path(@project, service.to_param) do | |
| 15 | + = service.title | |
| 16 | + %p= service.description | ... | ... |
app/views/projects/snippets/show.html.haml
| ... | ... | @@ -0,0 +1,24 @@ |
| 1 | +%h3.page_title | |
| 2 | + = "New Team member(s)" | |
| 3 | +%hr | |
| 4 | += form_for @user_project_relation, as: :team_member, url: project_team_members_path(@project) do |f| | |
| 5 | + -if @user_project_relation.errors.any? | |
| 6 | + .alert.alert-error | |
| 7 | + %ul | |
| 8 | + - @user_project_relation.errors.full_messages.each do |msg| | |
| 9 | + %li= msg | |
| 10 | + | |
| 11 | + %h6 1. Choose people you want in the team | |
| 12 | + .clearfix | |
| 13 | + = f.label :user_ids, "People" | |
| 14 | + .input | |
| 15 | + = users_select_tag(:user_ids, multiple: true) | |
| 16 | + | |
| 17 | + %h6 2. Set access level for them | |
| 18 | + .clearfix | |
| 19 | + = f.label :project_access, "Project Access" | |
| 20 | + .input= select_tag :project_access, options_for_select(Project.access_options, @user_project_relation.project_access), class: "project-access-select chosen" | |
| 21 | + | |
| 22 | + .actions | |
| 23 | + = f.submit 'Add users', class: "btn btn-create" | |
| 24 | + = link_to "Cancel", project_team_index_path(@project), class: "btn btn-cancel" | ... | ... |
app/views/projects/team_members/_group_members.html.haml
0 → 100644
| ... | ... | @@ -0,0 +1,10 @@ |
| 1 | +.ui-box | |
| 2 | + %h5.title | |
| 3 | + %strong #{@group.name} Group | |
| 4 | + members (#{@group.users_groups.count}) | |
| 5 | + .pull-right | |
| 6 | + = link_to people_group_path(@group), class: 'btn btn-small' do | |
| 7 | + %i.icon-edit | |
| 8 | + %ul.well-list | |
| 9 | + - @group.users_groups.order('group_access DESC').each do |member| | |
| 10 | + = render 'users_groups/users_group', member: member, show_controls: false | ... | ... |
| ... | ... | @@ -0,0 +1,9 @@ |
| 1 | +.team-table | |
| 2 | + - can_admin_project = (can? current_user, :admin_project, @project) | |
| 3 | + .ui-box | |
| 4 | + %h5.title | |
| 5 | + %strong #{@project.name} Project | |
| 6 | + members (#{members.count}) | |
| 7 | + %ul.well-list | |
| 8 | + - members.each do |team_member| | |
| 9 | + = render 'team_member', member: team_member, current_user_can_admin_project: can_admin_project | ... | ... |
| ... | ... | @@ -0,0 +1,17 @@ |
| 1 | +- user = member.user | |
| 2 | +%li{id: dom_id(user), class: "team_member_row access-#{member.human_access.downcase}"} | |
| 3 | + .pull-right | |
| 4 | + - if current_user_can_admin_project | |
| 5 | + - unless @project.personal? && user == current_user | |
| 6 | + .pull-left | |
| 7 | + = form_for(member, as: :team_member, url: project_team_member_path(@project, member.user)) do |f| | |
| 8 | + = f.select :project_access, options_for_select(UsersProject.access_roles, member.project_access), {}, class: "medium project-access-select span2 trigger-submit" | |
| 9 | + | |
| 10 | + = link_to project_team_member_path(@project, user), confirm: remove_from_project_team_message(@project, user), method: :delete, class: "btn-tiny btn btn-remove", title: 'Remove user from team' do | |
| 11 | + %i.icon-minus.icon-white | |
| 12 | + = image_tag gravatar_icon(user.email, 32), class: "avatar s32" | |
| 13 | + %p | |
| 14 | + %strong= user.name | |
| 15 | + %span.cgray= user.username | |
| 16 | + | |
| 17 | + | ... | ... |
| ... | ... | @@ -0,0 +1,15 @@ |
| 1 | +%h3.page_title | |
| 2 | + = "Import team from another project" | |
| 3 | +%hr | |
| 4 | +%p.slead | |
| 5 | + Read more about project team import #{link_to "here", '#', class: 'vlink'}. | |
| 6 | += form_tag apply_import_project_team_members_path(@project), method: 'post' do | |
| 7 | + %p.slead Choose project you want to use as team source: | |
| 8 | + .padded | |
| 9 | + = label_tag :source_project_id, "Project" | |
| 10 | + .input= select_tag(:source_project_id, options_from_collection_for_select(current_user.authorized_projects, :id, :name_with_namespace), prompt: "Select project", class: "chosen xxlarge", required: true) | |
| 11 | + | |
| 12 | + .actions | |
| 13 | + = submit_tag 'Import', class: "btn btn-save" | |
| 14 | + = link_to "Cancel", project_team_index_path(@project), class: "btn btn-cancel" | |
| 15 | + | ... | ... |
| ... | ... | @@ -0,0 +1,16 @@ |
| 1 | +%h3.page_title | |
| 2 | + Users with access to this project | |
| 3 | + | |
| 4 | + - if can? current_user, :admin_team_member, @project | |
| 5 | + %span.pull-right | |
| 6 | + = link_to import_project_team_members_path(@project), class: "btn btn-small grouped", title: "Import team from another project" do | |
| 7 | + Import team from another project | |
| 8 | + = link_to new_project_team_member_path(@project), class: "btn btn-primary small grouped", title: "New Team Member" do | |
| 9 | + New Team Member | |
| 10 | + | |
| 11 | +%p.light | |
| 12 | + Read more about project permissions | |
| 13 | + %strong= link_to "here", help_permissions_path, class: "vlink" | |
| 14 | +- if @group | |
| 15 | + = render "group_members" | |
| 16 | += render "team", members: @users_projects | ... | ... |
| ... | ... | @@ -0,0 +1 @@ |
| 1 | += render "form" | ... | ... |
| ... | ... | @@ -0,0 +1,9 @@ |
| 1 | +%tr{ class: "tree-item #{tree_hex_class(blob_item)}" } | |
| 2 | + %td.tree-item-file-name | |
| 3 | + = tree_icon(type) | |
| 4 | + %strong= link_to truncate(blob_item.name, length: 40), project_blob_path(@project, tree_join(@id || @commit.id, blob_item.name)) | |
| 5 | + %td.tree_time_ago.cgray | |
| 6 | + %span.log_loading.hide | |
| 7 | + Loading commit data... | |
| 8 | + = image_tag "ajax_loader_tree.gif", width: 14 | |
| 9 | + %td.tree_commit{ colspan: 2 } | ... | ... |
| ... | ... | @@ -0,0 +1,13 @@ |
| 1 | +.file_holder#README | |
| 2 | + .file_title | |
| 3 | + %i.icon-file | |
| 4 | + = readme.name | |
| 5 | + .file_content.wiki | |
| 6 | + - if gitlab_markdown?(readme.name) | |
| 7 | + = preserve do | |
| 8 | + = markdown(readme.data) | |
| 9 | + - elsif plain_text_readme?(readme.name) | |
| 10 | + %pre.clean | |
| 11 | + = readme.data | |
| 12 | + - else | |
| 13 | + = raw GitHub::Markup.render(readme.name, readme.data) | ... | ... |
| ... | ... | @@ -0,0 +1,11 @@ |
| 1 | +- url = submodule_item.url(@ref) rescue '' | |
| 2 | +- name = submodule_item.basename | |
| 3 | +- return '' unless url | |
| 4 | +%tr{ class: "tree-item", url: url } | |
| 5 | + %td.tree-item-file-name | |
| 6 | + = image_tag "submodule.png" | |
| 7 | + %strong= truncate(name, length: 40) | |
| 8 | + %td | |
| 9 | + %code= submodule_item.id[0..10] | |
| 10 | + %td{ colspan: 2 } | |
| 11 | + = link_to truncate(url, length: 40), url | ... | ... |
| ... | ... | @@ -0,0 +1,51 @@ |
| 1 | +%ul.breadcrumb | |
| 2 | + %li | |
| 3 | + %i.icon-angle-right | |
| 4 | + = link_to project_tree_path(@project, @ref) do | |
| 5 | + = @project.path | |
| 6 | + - tree_breadcrumbs(tree, 6) do |title, path| | |
| 7 | + \/ | |
| 8 | + %li | |
| 9 | + - if path | |
| 10 | + = link_to truncate(title, length: 40), project_tree_path(@project, path) | |
| 11 | + - else | |
| 12 | + = link_to title, '#' | |
| 13 | + | |
| 14 | +%div#tree-content-holder.tree-content-holder | |
| 15 | + %table#tree-slider{class: "table_#{@hex_path} tree-table" } | |
| 16 | + %thead | |
| 17 | + %tr | |
| 18 | + %th Name | |
| 19 | + %th Last Update | |
| 20 | + %th | |
| 21 | + Last Commit | |
| 22 | + | |
| 23 | + %i.icon-angle-right | |
| 24 | + | |
| 25 | + %small.light | |
| 26 | + = link_to @commit.short_id, project_commit_path(@project, @commit) | |
| 27 | + – | |
| 28 | + = truncate(@commit.title, length: 50) | |
| 29 | + %th= link_to "history", project_commits_path(@project, @id), class: "btn btn-tiny pull-right" | |
| 30 | + | |
| 31 | + - if tree.up_dir? | |
| 32 | + %tr.tree-item | |
| 33 | + %td.tree-item-file-name | |
| 34 | + = image_tag "file_empty.png", size: '16x16' | |
| 35 | + = link_to "..", project_tree_path(@project, up_dir_path(tree)) | |
| 36 | + %td | |
| 37 | + %td | |
| 38 | + %td | |
| 39 | + | |
| 40 | + = render_tree(tree) | |
| 41 | + | |
| 42 | + - if tree.readme | |
| 43 | + = render "projects/tree/readme", readme: tree.readme | |
| 44 | + | |
| 45 | +%div.tree_progress | |
| 46 | + | |
| 47 | +:javascript | |
| 48 | + // Load last commit log for each file in tree | |
| 49 | + $('#tree-slider').waitForImages(function() { | |
| 50 | + ajaxGet('#{@logs_path}'); | |
| 51 | + }); | ... | ... |
| ... | ... | @@ -0,0 +1,9 @@ |
| 1 | +%tr{ class: "tree-item #{tree_hex_class(tree_item)}" } | |
| 2 | + %td.tree-item-file-name | |
| 3 | + = tree_icon(type) | |
| 4 | + %strong= link_to truncate(tree_item.name, length: 40), project_tree_path(@project, tree_join(@id || @commit.id, tree_item.name)) | |
| 5 | + %td.tree_time_ago.cgray | |
| 6 | + %span.log_loading.hide | |
| 7 | + Loading commit data... | |
| 8 | + = image_tag "ajax_loader_tree.gif", width: 14 | |
| 9 | + %td.tree_commit{ colspan: 2 } | ... | ... |
| ... | ... | @@ -0,0 +1,23 @@ |
| 1 | +%div.wall-page | |
| 2 | + %ul.notes | |
| 3 | + | |
| 4 | + - if can? current_user, :write_note, @project | |
| 5 | + .note-form-holder | |
| 6 | + = form_for [@project, @note], remote: true, html: { multipart: true, id: nil, class: "new_note wall-note-form" } do |f| | |
| 7 | + = note_target_fields | |
| 8 | + .note_text_and_preview | |
| 9 | + = f.text_area :note, size: 255, class: 'note_text js-note-text js-gfm-input turn-on' | |
| 10 | + .note-form-actions | |
| 11 | + .buttons | |
| 12 | + = f.submit 'Add Comment', class: "btn comment-btn grouped js-comment-button" | |
| 13 | + | |
| 14 | + .note-form-option | |
| 15 | + %a.choose-btn.btn.btn-small.js-choose-note-attachment-button | |
| 16 | + %i.icon-paper-clip | |
| 17 | + %span Choose File ... | |
| 18 | + | |
| 19 | + %span.file_name.js-attachment-filename File name... | |
| 20 | + = f.file_field :attachment, class: "js-note-attachment-input hide" | |
| 21 | + | |
| 22 | + .hint.pull-right CTRL + Enter to send message | |
| 23 | + .clearfix | ... | ... |
| ... | ... | @@ -0,0 +1,36 @@ |
| 1 | += form_for [@project, @wiki] do |f| | |
| 2 | + -if @wiki.errors.any? | |
| 3 | + #error_explanation | |
| 4 | + %h2= "#{pluralize(@wiki.errors.count, "error")} prohibited this wiki from being saved:" | |
| 5 | + %ul | |
| 6 | + - @wiki.errors.full_messages.each do |msg| | |
| 7 | + %li= msg | |
| 8 | + | |
| 9 | + .ui-box.ui-box-show | |
| 10 | + .ui-box-head | |
| 11 | + %h3.page_title | |
| 12 | + .edit-wiki-header | |
| 13 | + = @wiki.title.titleize | |
| 14 | + = f.hidden_field :title, value: @wiki.title | |
| 15 | + = f.select :format, options_for_select(GollumWiki::MARKUPS, {selected: @wiki.format}), {}, class: "pull-right input-medium" | |
| 16 | + = f.label :format, class: "pull-right", style: "padding-right: 20px;" | |
| 17 | + .ui-box-body | |
| 18 | + .input | |
| 19 | + %span.cgray | |
| 20 | + Wiki content is parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. | |
| 21 | + To link to a (new) page you can just type | |
| 22 | + %code [Link Title](page-slug) | |
| 23 | + \. | |
| 24 | + | |
| 25 | + .ui-box-bottom | |
| 26 | + = f.label :content | |
| 27 | + .input= f.text_area :content, class: 'span8 js-gfm-input' | |
| 28 | + .ui-box-bottom | |
| 29 | + = f.label :commit_message | |
| 30 | + .input= f.text_field :message, class: 'span8' | |
| 31 | + .actions | |
| 32 | + = f.submit 'Save', class: "btn-save btn" | |
| 33 | + - if @wiki && @wiki.persisted? | |
| 34 | + = link_to "Cancel", project_wiki_path(@project, @wiki), class: "btn btn-cancel" | |
| 35 | + - else | |
| 36 | + = link_to "Cancel", project_wiki_path(@project, :home), class: "btn btn-cancel" | ... | ... |
| ... | ... | @@ -0,0 +1,8 @@ |
| 1 | +%span.pull-right | |
| 2 | + - if (@wiki && @wiki.persisted?) | |
| 3 | + = link_to history_project_wiki_path(@project, @wiki), class: "btn btn-small grouped" do | |
| 4 | + Page History | |
| 5 | + - if can?(current_user, :write_wiki, @project) | |
| 6 | + = link_to edit_project_wiki_path(@project, @wiki), class: "btn btn-small grouped" do | |
| 7 | + %i.icon-edit | |
| 8 | + Edit | ... | ... |
| ... | ... | @@ -0,0 +1,19 @@ |
| 1 | +%ul.nav.nav-tabs | |
| 2 | + = nav_link(html_options: {class: params[:id] == 'home' ? 'active' : '' }) do | |
| 3 | + = link_to 'Home', project_wiki_path(@project, :home) | |
| 4 | + | |
| 5 | + = nav_link(path: 'wikis#pages') do | |
| 6 | + = link_to 'Pages', pages_project_wikis_path(@project) | |
| 7 | + | |
| 8 | + = nav_link(path: 'wikis#git_access') do | |
| 9 | + = link_to git_access_project_wikis_path(@project) do | |
| 10 | + %i.icon-download-alt | |
| 11 | + Git Access | |
| 12 | + | |
| 13 | + - if can?(current_user, :write_wiki, @project) | |
| 14 | + .pull-right | |
| 15 | + = link_to '#', class: "add-new-wiki btn btn-small btn-primary" do | |
| 16 | + %i.icon-plus | |
| 17 | + New Page | |
| 18 | + | |
| 19 | += render 'projects/wikis/new' | ... | ... |
| ... | ... | @@ -0,0 +1,12 @@ |
| 1 | +%div#modal-new-wiki.modal.hide | |
| 2 | + .modal-header | |
| 3 | + %a.close{href: "#"} × | |
| 4 | + %h3.page_title New Wiki Page | |
| 5 | + .modal-body | |
| 6 | + = label_tag :new_wiki_path do | |
| 7 | + %span Page slug | |
| 8 | + = text_field_tag :new_wiki_path, nil, placeholder: 'how-to-setup', class: 'input-xlarge', required: true, :'data-wikis-path' => project_wikis_path(@project) | |
| 9 | + %p.hint | |
| 10 | + Please dont use spaces and slashes | |
| 11 | + .modal-footer | |
| 12 | + = link_to 'Build', '#', class: 'build-new-wiki btn btn-create' | ... | ... |
| ... | ... | @@ -0,0 +1,10 @@ |
| 1 | += render 'nav' | |
| 2 | +%h3.page_title | |
| 3 | + Editing page | |
| 4 | + = render 'main_links' | |
| 5 | += render 'form' | |
| 6 | + | |
| 7 | +.pull-right | |
| 8 | + - if @wiki.persisted? && can?(current_user, :admin_wiki, @project) | |
| 9 | + = link_to project_wiki_path(@project, @wiki), confirm: "Are you sure you want to delete this page?", method: :delete, class: "btn btn-small btn-remove" do | |
| 10 | + Delete this page | ... | ... |
| ... | ... | @@ -0,0 +1,37 @@ |
| 1 | += render 'nav' | |
| 2 | +%h3.page_title | |
| 3 | + Git Access | |
| 4 | + %strong= @gollum_wiki.path_with_namespace | |
| 5 | + = render 'main_links' | |
| 6 | + | |
| 7 | +%br | |
| 8 | +.content | |
| 9 | + .project_clone_panel | |
| 10 | + .row | |
| 11 | + .span7 | |
| 12 | + .form-horizontal | |
| 13 | + .input-prepend.project_clone_holder | |
| 14 | + %button{class: "btn active", :"data-clone" => @gollum_wiki.ssh_url_to_repo} SSH | |
| 15 | + %button{class: "btn", :"data-clone" => @gollum_wiki.http_url_to_repo}= Gitlab.config.gitlab.protocol.upcase | |
| 16 | + = text_field_tag :project_clone, @gollum_wiki.url_to_repo, class: "one_click_select input-xxlarge", readonly: true | |
| 17 | + .git-empty | |
| 18 | + %fieldset | |
| 19 | + %legend Install Gollum: | |
| 20 | + %pre.dark | |
| 21 | + :preserve | |
| 22 | + gem install gollum | |
| 23 | + | |
| 24 | + %legend Clone Your Wiki: | |
| 25 | + %pre.dark | |
| 26 | + :preserve | |
| 27 | + git clone #{@gollum_wiki.ssh_url_to_repo} | |
| 28 | + cd #{@gollum_wiki.path} | |
| 29 | + | |
| 30 | + %legend Start Gollum And Edit Locally: | |
| 31 | + %pre.dark | |
| 32 | + :preserve | |
| 33 | + gollum | |
| 34 | + == Sinatra/1.3.5 has taken the stage on 4567 for development with backup from Thin | |
| 35 | + >> Thin web server (v1.5.0 codename Knife) | |
| 36 | + >> Maximum connections set to 1024 | |
| 37 | + >> Listening on 0.0.0.0:4567, CTRL+C to stop | ... | ... |
| ... | ... | @@ -0,0 +1,31 @@ |
| 1 | += render 'nav' | |
| 2 | +%h3.page_title | |
| 3 | + %span.light History for | |
| 4 | + = @wiki.title.titleize | |
| 5 | + = render 'main_links' | |
| 6 | +%br | |
| 7 | +%table | |
| 8 | + %thead | |
| 9 | + %tr | |
| 10 | + %th Page version | |
| 11 | + %th Author | |
| 12 | + %th Commit Message | |
| 13 | + %th Last updated | |
| 14 | + %th Format | |
| 15 | + %tbody | |
| 16 | + - @wiki.versions.each do |version| | |
| 17 | + - commit = version | |
| 18 | + %tr | |
| 19 | + %td | |
| 20 | + = link_to project_wiki_path(@project, @wiki, version_id: commit.id) do | |
| 21 | + = commit.short_id | |
| 22 | + %td | |
| 23 | + = commit_author_link(commit, avatar: true, size: 24) | |
| 24 | + %td | |
| 25 | + = commit.title | |
| 26 | + %td | |
| 27 | + = time_ago_in_words(version.date) | |
| 28 | + ago | |
| 29 | + %td | |
| 30 | + %strong | |
| 31 | + = @wiki.page.wiki.page(@wiki.page.name, commit.id).try(:format) | ... | ... |
| ... | ... | @@ -0,0 +1,25 @@ |
| 1 | += render 'nav' | |
| 2 | +%h3.page_title | |
| 3 | + All Pages | |
| 4 | + = render 'main_links' | |
| 5 | +%br | |
| 6 | +%table | |
| 7 | + %thead | |
| 8 | + %tr | |
| 9 | + %th Title | |
| 10 | + %th Format | |
| 11 | + %th Last updated | |
| 12 | + %th Updated by | |
| 13 | + %tbody | |
| 14 | + - @wiki_pages.each do |wiki_page| | |
| 15 | + %tr | |
| 16 | + %td | |
| 17 | + %strong= link_to wiki_page.title.titleize, project_wiki_path(@project, wiki_page) | |
| 18 | + %td | |
| 19 | + %strong= wiki_page.format | |
| 20 | + %td | |
| 21 | + = wiki_page.created_at.to_s(:short) do | |
| 22 | + (#{time_ago_in_words(wiki_page.created_at)} | |
| 23 | + ago) | |
| 24 | + %td | |
| 25 | + = commit_author_link(wiki_page.version, avatar: true, size: 24) | ... | ... |
| ... | ... | @@ -0,0 +1,16 @@ |
| 1 | += render 'nav' | |
| 2 | +%h3.page_title | |
| 3 | + = @wiki.title.titleize | |
| 4 | + = render 'main_links' | |
| 5 | +%br | |
| 6 | +- if @wiki.historical? | |
| 7 | + .warning_message | |
| 8 | + This is an old version of this page. | |
| 9 | + You can view the #{link_to "most recent version", project_wiki_path(@project, @wiki)} or browse the #{link_to "history", history_project_wiki_path(@project, @wiki)}. | |
| 10 | + | |
| 11 | +.file_holder | |
| 12 | + .file_content.wiki | |
| 13 | + = preserve do | |
| 14 | + = render_wiki_content(@wiki) | |
| 15 | + | |
| 16 | +%p.time Last edited by #{commit_author_link(@wiki.version, avatar: true, size: 16)} #{time_ago_in_words @wiki.created_at} ago | ... | ... |
app/views/protected_branches/index.html.haml
| ... | ... | @@ -1,54 +0,0 @@ |
| 1 | -= render "commits/head" | |
| 2 | -.row | |
| 3 | - .span3 | |
| 4 | - = render "repositories/filter" | |
| 5 | - .span9 | |
| 6 | - .alert | |
| 7 | - %p Protected branches designed to prevent push for all except #{link_to "masters", help_permissions_path, class: "vlink"}. | |
| 8 | - %p This ability allows: | |
| 9 | - %ul | |
| 10 | - %li keep stable branches secured | |
| 11 | - %li forced code review before merge to protected branches | |
| 12 | - %p Read more about project permissions #{link_to "here", help_permissions_path, class: "vlink"} | |
| 13 | - | |
| 14 | - - if can? current_user, :admin_project, @project | |
| 15 | - = form_for [@project, @protected_branch] do |f| | |
| 16 | - -if @protected_branch.errors.any? | |
| 17 | - .alert.alert-error | |
| 18 | - %ul | |
| 19 | - - @protected_branch.errors.full_messages.each do |msg| | |
| 20 | - %li= msg | |
| 21 | - | |
| 22 | - .entry.clearfix | |
| 23 | - = f.label :name, "Branch" | |
| 24 | - .span3 | |
| 25 | - = f.select(:name, @project.open_branches.map { |br| [br.name, br.name] } , {include_blank: "Select branch"}, {class: "chosen span3"}) | |
| 26 | - | |
| 27 | - = f.submit 'Protect', class: "btn-primary btn" | |
| 28 | - | |
| 29 | - - unless @branches.empty? | |
| 30 | - %table | |
| 31 | - %thead | |
| 32 | - %tr | |
| 33 | - %th Name | |
| 34 | - %th Last commit | |
| 35 | - %th | |
| 36 | - %tbody | |
| 37 | - - @branches.each do |branch| | |
| 38 | - %tr | |
| 39 | - %td | |
| 40 | - = link_to project_commits_path(@project, branch.name) do | |
| 41 | - %strong= branch.name | |
| 42 | - - if @project.root_ref?(branch.name) | |
| 43 | - %span.label default | |
| 44 | - %td | |
| 45 | - - if branch.commit | |
| 46 | - = link_to project_commit_path(@project, branch.commit.id) do | |
| 47 | - = truncate branch.commit.id.to_s, length: 10 | |
| 48 | - = time_ago_in_words(branch.commit.committed_date) | |
| 49 | - ago | |
| 50 | - - else | |
| 51 | - (branch was removed from repository) | |
| 52 | - %td | |
| 53 | - - if can? current_user, :admin_project, @project | |
| 54 | - = link_to 'Unprotect', [@project, branch], confirm: 'Branch will be writable for developers. Are you sure?', method: :delete, class: "btn btn-remove btn-small" |
app/views/refs/logs_tree.js.haml
| ... | ... | @@ -1,8 +0,0 @@ |
| 1 | -- @logs.each do |content_data| | |
| 2 | - - file_name = content_data[:file_name] | |
| 3 | - - commit = content_data[:commit] | |
| 4 | - | |
| 5 | - :plain | |
| 6 | - var row = $("table.table_#{@hex_path} tr.file_#{hexdigest(file_name)}"); | |
| 7 | - row.find("td.tree_time_ago").html('#{escape_javascript time_ago_in_words(commit.committed_date)} ago'); | |
| 8 | - row.find("td.tree_commit").html('#{escape_javascript render("tree/tree_commit_column", commit: commit)}'); |
app/views/repositories/_branch.html.haml
| ... | ... | @@ -1,26 +0,0 @@ |
| 1 | -- commit = Commit.new(Gitlab::Git::Commit.new(branch.commit)) | |
| 2 | -%tr | |
| 3 | - %td | |
| 4 | - = link_to project_commits_path(@project, branch.name) do | |
| 5 | - - if @project.protected_branch? branch.name | |
| 6 | - %i.icon-lock | |
| 7 | - - else | |
| 8 | - %i.icon-unlock | |
| 9 | - %strong= truncate(branch.name, length: 60) | |
| 10 | - - if branch.name == @repository.root_ref | |
| 11 | - %span.label default | |
| 12 | - %td | |
| 13 | - = link_to project_commit_path(@project, commit.id), class: 'commit_short_id' do | |
| 14 | - = commit.short_id | |
| 15 | - = image_tag gravatar_icon(commit.author_email), class: "avatar s16" | |
| 16 | - %span.light | |
| 17 | - = gfm escape_once(truncate(commit.title, length: 40)) | |
| 18 | - %span | |
| 19 | - = time_ago_in_words(commit.committed_date) | |
| 20 | - ago | |
| 21 | - %td | |
| 22 | - - if can? current_user, :download_code, @project | |
| 23 | - = link_to archive_project_repository_path(@project, ref: branch.name) do | |
| 24 | - %i.icon-download-alt | |
| 25 | - Download | |
| 26 | - |
app/views/repositories/_feed.html.haml
| ... | ... | @@ -1,19 +0,0 @@ |
| 1 | -- commit = update | |
| 2 | -%tr | |
| 3 | - %td | |
| 4 | - = link_to project_commits_path(@project, commit.head.name) do | |
| 5 | - %strong | |
| 6 | - = commit.head.name | |
| 7 | - - if @project.root_ref?(commit.head.name) | |
| 8 | - %span.label default | |
| 9 | - | |
| 10 | - %td | |
| 11 | - %div | |
| 12 | - = link_to project_commits_path(@project, commit.id) do | |
| 13 | - %code= commit.short_id | |
| 14 | - = image_tag gravatar_icon(commit.author_email), class: "", width: 16 | |
| 15 | - = gfm escape_once(truncate(commit.title, length: 40)) | |
| 16 | - %td | |
| 17 | - %span.pull-right.cgray | |
| 18 | - = time_ago_in_words(commit.committed_date) | |
| 19 | - ago |
app/views/repositories/_filter.html.haml
| ... | ... | @@ -1,9 +0,0 @@ |
| 1 | -%ul.nav.nav-pills.nav-stacked | |
| 2 | - = nav_link(path: 'repositories#show') do | |
| 3 | - = link_to 'Recent', project_repository_path(@project) | |
| 4 | - = nav_link(path: 'protected_branches#index') do | |
| 5 | - = link_to project_protected_branches_path(@project) do | |
| 6 | - Protected | |
| 7 | - %i.icon-lock | |
| 8 | - = nav_link(path: 'repositories#branches') do | |
| 9 | - = link_to 'All branches', branches_project_repository_path(@project) |
app/views/repositories/branches.html.haml
| ... | ... | @@ -1,15 +0,0 @@ |
| 1 | -= render "commits/head" | |
| 2 | -.row | |
| 3 | - .span3 | |
| 4 | - = render "filter" | |
| 5 | - .span9 | |
| 6 | - - unless @branches.empty? | |
| 7 | - %table | |
| 8 | - %thead | |
| 9 | - %tr | |
| 10 | - %th Name | |
| 11 | - %th Last commit | |
| 12 | - %th | |
| 13 | - %tbody | |
| 14 | - - @branches.each do |branch| | |
| 15 | - = render "repositories/branch", branch: branch |
app/views/repositories/show.html.haml
app/views/repositories/stats.html.haml
| ... | ... | @@ -1,33 +0,0 @@ |
| 1 | -= render "commits/head" | |
| 2 | -.row | |
| 3 | - .span6 | |
| 4 | - %div#activity-chart.chart | |
| 5 | - %hr | |
| 6 | - %p | |
| 7 | - %b Total commits: | |
| 8 | - %span= @stats.commits_count | |
| 9 | - %p | |
| 10 | - %b Total files in #{@repository.root_ref}: | |
| 11 | - %span= @stats.files_count | |
| 12 | - %p | |
| 13 | - %b Authors: | |
| 14 | - %span= @stats.authors_count | |
| 15 | - | |
| 16 | - | |
| 17 | - .span6 | |
| 18 | - %h4 Top 50 Committers: | |
| 19 | - %ol.styled | |
| 20 | - - @stats.authors[0...50].each do |author| | |
| 21 | - %li | |
| 22 | - = image_tag gravatar_icon(author.email, 16), class: 'avatar s16' | |
| 23 | - = author.name | |
| 24 | - %small.light= author.email | |
| 25 | - .pull-right | |
| 26 | - = author.commits | |
| 27 | - | |
| 28 | - | |
| 29 | -:javascript | |
| 30 | - var labels = [#{@graph.labels.to_json}]; | |
| 31 | - var commits = [#{@graph.commits.join(', ')}]; | |
| 32 | - var title = "Commit activity for last #{@graph.weeks} weeks"; | |
| 33 | - Chart.init(labels, commits, title); |
app/views/repositories/tags.html.haml
| ... | ... | @@ -1,36 +0,0 @@ |
| 1 | -= render "commits/head" | |
| 2 | -- unless @tags.empty? | |
| 3 | - %ul.bordered-list | |
| 4 | - - @tags.each do |tag| | |
| 5 | - - commit = Commit.new(Gitlab::Git::Commit.new(tag.commit)) | |
| 6 | - %li | |
| 7 | - %h5 | |
| 8 | - = link_to project_commits_path(@project, tag.name), class: "" do | |
| 9 | - %i.icon-tag | |
| 10 | - = tag.name | |
| 11 | - %small | |
| 12 | - = truncate(tag.message || '', length: 70) | |
| 13 | - .pull-right | |
| 14 | - %span.light | |
| 15 | - = time_ago_in_words(commit.committed_date) | |
| 16 | - ago | |
| 17 | - %div.prepend-left-20 | |
| 18 | - = link_to commit.short_id(8), project_commit_path(@project, commit), class: "monospace" | |
| 19 | - – | |
| 20 | - = link_to_gfm truncate(commit.title, length: 70), project_commit_path(@project, commit.id), class: "cdark" | |
| 21 | - | |
| 22 | - - if can? current_user, :download_code, @project | |
| 23 | - .pull-right | |
| 24 | - = link_to archive_project_repository_path(@project, ref: tag.name) do | |
| 25 | - %i.icon-download-alt | |
| 26 | - Download | |
| 27 | - | |
| 28 | - | |
| 29 | -- else | |
| 30 | - %h3.nothing_here_message | |
| 31 | - Repository has no tags yet. | |
| 32 | - %br | |
| 33 | - %small | |
| 34 | - Use git tag command to add a new one: | |
| 35 | - %br | |
| 36 | - %span.monospace git tag -a v1.4 -m 'version 1.4' |
app/views/services/_form.html.haml
| ... | ... | @@ -1,48 +0,0 @@ |
| 1 | -%h3.page_title | |
| 2 | - - if @service.activated? | |
| 3 | - %span.cgreen | |
| 4 | - %i.icon-circle | |
| 5 | - - else | |
| 6 | - %span.cgray | |
| 7 | - %i.icon-circle-blank | |
| 8 | - = @service.title | |
| 9 | - | |
| 10 | -%p= @service.description | |
| 11 | - | |
| 12 | -.back_link | |
| 13 | - = link_to project_services_path(@project) do | |
| 14 | - ← to services | |
| 15 | - | |
| 16 | -%hr | |
| 17 | - | |
| 18 | -= form_for(@service, as: :service, url: project_service_path(@project, @service.to_param), method: :put) do |f| | |
| 19 | - - if @service.errors.any? | |
| 20 | - .alert.alert-error | |
| 21 | - %ul | |
| 22 | - - @service.errors.full_messages.each do |msg| | |
| 23 | - %li= msg | |
| 24 | - | |
| 25 | - | |
| 26 | - .control-group | |
| 27 | - = f.label :active, "Active", class: "control-label" | |
| 28 | - .controls | |
| 29 | - = f.check_box :active | |
| 30 | - | |
| 31 | - - @service.fields.each do |field| | |
| 32 | - - name = field[:name] | |
| 33 | - - type = field[:type] | |
| 34 | - - placeholder = field[:placeholder] | |
| 35 | - | |
| 36 | - .control-group | |
| 37 | - = f.label name, class: "control-label" | |
| 38 | - .controls | |
| 39 | - - if type == 'text' | |
| 40 | - = f.text_field name, class: "input-xlarge", placeholder: placeholder | |
| 41 | - - elsif type == 'checkbox' | |
| 42 | - = f.check_box name | |
| 43 | - | |
| 44 | - .form-actions | |
| 45 | - = f.submit 'Save', class: 'btn btn-save' | |
| 46 | - | |
| 47 | - - if @service.valid? && @service.activated? | |
| 48 | - = link_to 'Test settings', test_project_service_path(@project, @service.to_param), class: 'btn btn-small' |
app/views/services/edit.html.haml
| ... | ... | @@ -1 +0,0 @@ |
| 1 | -= render 'form' |
app/views/services/index.html.haml
| ... | ... | @@ -1,16 +0,0 @@ |
| 1 | -%h3.page_title Services | |
| 2 | -%br | |
| 3 | - | |
| 4 | -%ul.bordered-list | |
| 5 | - - @services.each do |service| | |
| 6 | - %li | |
| 7 | - %h4 | |
| 8 | - - if service.activated? | |
| 9 | - %span.cgreen | |
| 10 | - %i.icon-circle | |
| 11 | - - else | |
| 12 | - %span.cgray | |
| 13 | - %i.icon-circle-blank | |
| 14 | - = link_to edit_project_service_path(@project, service.to_param) do | |
| 15 | - = service.title | |
| 16 | - %p= service.description |
app/views/shared/_merge_requests.html.haml
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | = link_to_project project |
| 7 | 7 | %ul.well-list.mr-list |
| 8 | 8 | - group[1].each do |merge_request| |
| 9 | - = render(partial: 'merge_requests/merge_request', locals: {merge_request: merge_request}) | |
| 9 | + = render 'projects/merge_requests/merge_request', merge_request: merge_request | |
| 10 | 10 | %hr |
| 11 | 11 | = paginate @merge_requests, theme: "gitlab" |
| 12 | 12 | ... | ... |
app/views/team_members/_form.html.haml
| ... | ... | @@ -1,24 +0,0 @@ |
| 1 | -%h3.page_title | |
| 2 | - = "New Team member(s)" | |
| 3 | -%hr | |
| 4 | -= form_for @user_project_relation, as: :team_member, url: project_team_members_path(@project) do |f| | |
| 5 | - -if @user_project_relation.errors.any? | |
| 6 | - .alert.alert-error | |
| 7 | - %ul | |
| 8 | - - @user_project_relation.errors.full_messages.each do |msg| | |
| 9 | - %li= msg | |
| 10 | - | |
| 11 | - %h6 1. Choose people you want in the team | |
| 12 | - .clearfix | |
| 13 | - = f.label :user_ids, "People" | |
| 14 | - .input | |
| 15 | - = users_select_tag(:user_ids, multiple: true) | |
| 16 | - | |
| 17 | - %h6 2. Set access level for them | |
| 18 | - .clearfix | |
| 19 | - = f.label :project_access, "Project Access" | |
| 20 | - .input= select_tag :project_access, options_for_select(Project.access_options, @user_project_relation.project_access), class: "project-access-select chosen" | |
| 21 | - | |
| 22 | - .actions | |
| 23 | - = f.submit 'Add users', class: "btn btn-create" | |
| 24 | - = link_to "Cancel", project_team_index_path(@project), class: "btn btn-cancel" |
app/views/team_members/_group_members.html.haml
| ... | ... | @@ -1,10 +0,0 @@ |
| 1 | -.ui-box | |
| 2 | - %h5.title | |
| 3 | - %strong #{@group.name} Group | |
| 4 | - members (#{@group.users_groups.count}) | |
| 5 | - .pull-right | |
| 6 | - = link_to people_group_path(@group), class: 'btn btn-small' do | |
| 7 | - %i.icon-edit | |
| 8 | - %ul.well-list | |
| 9 | - - @group.users_groups.order('group_access DESC').each do |member| | |
| 10 | - = render 'users_groups/users_group', member: member, show_controls: false |
app/views/team_members/_team.html.haml
| ... | ... | @@ -1,9 +0,0 @@ |
| 1 | -.team-table | |
| 2 | - - can_admin_project = (can? current_user, :admin_project, @project) | |
| 3 | - .ui-box | |
| 4 | - %h5.title | |
| 5 | - %strong #{@project.name} Project | |
| 6 | - members (#{members.count}) | |
| 7 | - %ul.well-list | |
| 8 | - - members.each do |team_member| | |
| 9 | - = render 'team_members/team_member', member: team_member, current_user_can_admin_project: can_admin_project |
app/views/team_members/_team_member.html.haml
| ... | ... | @@ -1,17 +0,0 @@ |
| 1 | -- user = member.user | |
| 2 | -%li{id: dom_id(user), class: "team_member_row access-#{member.human_access.downcase}"} | |
| 3 | - .pull-right | |
| 4 | - - if current_user_can_admin_project | |
| 5 | - - unless @project.personal? && user == current_user | |
| 6 | - .pull-left | |
| 7 | - = form_for(member, as: :team_member, url: project_team_member_path(@project, member.user)) do |f| | |
| 8 | - = f.select :project_access, options_for_select(UsersProject.access_roles, member.project_access), {}, class: "medium project-access-select span2 trigger-submit" | |
| 9 | - | |
| 10 | - = link_to project_team_member_path(@project, user), confirm: remove_from_project_team_message(@project, user), method: :delete, class: "btn-tiny btn btn-remove", title: 'Remove user from team' do | |
| 11 | - %i.icon-minus.icon-white | |
| 12 | - = image_tag gravatar_icon(user.email, 32), class: "avatar s32" | |
| 13 | - %p | |
| 14 | - %strong= user.name | |
| 15 | - %span.cgray= user.username | |
| 16 | - | |
| 17 | - |
app/views/team_members/import.html.haml
| ... | ... | @@ -1,15 +0,0 @@ |
| 1 | -%h3.page_title | |
| 2 | - = "Import team from another project" | |
| 3 | -%hr | |
| 4 | -%p.slead | |
| 5 | - Read more about project team import #{link_to "here", '#', class: 'vlink'}. | |
| 6 | -= form_tag apply_import_project_team_members_path(@project), method: 'post' do | |
| 7 | - %p.slead Choose project you want to use as team source: | |
| 8 | - .padded | |
| 9 | - = label_tag :source_project_id, "Project" | |
| 10 | - .input= select_tag(:source_project_id, options_from_collection_for_select(current_user.authorized_projects, :id, :name_with_namespace), prompt: "Select project", class: "chosen xxlarge", required: true) | |
| 11 | - | |
| 12 | - .actions | |
| 13 | - = submit_tag 'Import', class: "btn btn-save" | |
| 14 | - = link_to "Cancel", project_team_index_path(@project), class: "btn btn-cancel" | |
| 15 | - |
app/views/team_members/index.html.haml
| ... | ... | @@ -1,16 +0,0 @@ |
| 1 | -%h3.page_title | |
| 2 | - Users with access to this project | |
| 3 | - | |
| 4 | - - if can? current_user, :admin_team_member, @project | |
| 5 | - %span.pull-right | |
| 6 | - = link_to import_project_team_members_path(@project), class: "btn btn-small grouped", title: "Import team from another project" do | |
| 7 | - Import team from another project | |
| 8 | - = link_to new_project_team_member_path(@project), class: "btn btn-primary small grouped", title: "New Team Member" do | |
| 9 | - New Team Member | |
| 10 | - | |
| 11 | -%p.light | |
| 12 | - Read more about project permissions | |
| 13 | - %strong= link_to "here", help_permissions_path, class: "vlink" | |
| 14 | -- if @group | |
| 15 | - = render "team_members/group_members" | |
| 16 | -= render "team_members/team", members: @users_projects |
app/views/team_members/new.html.haml
| ... | ... | @@ -1 +0,0 @@ |
| 1 | -= render "team_members/form" |
app/views/team_members/update.js.haml
app/views/tree/_blob_item.html.haml
| ... | ... | @@ -1,9 +0,0 @@ |
| 1 | -%tr{ class: "tree-item #{tree_hex_class(blob_item)}" } | |
| 2 | - %td.tree-item-file-name | |
| 3 | - = tree_icon(type) | |
| 4 | - %strong= link_to truncate(blob_item.name, length: 40), project_blob_path(@project, tree_join(@id || @commit.id, blob_item.name)) | |
| 5 | - %td.tree_time_ago.cgray | |
| 6 | - %span.log_loading.hide | |
| 7 | - Loading commit data... | |
| 8 | - = image_tag "ajax_loader_tree.gif", width: 14 | |
| 9 | - %td.tree_commit{ colspan: 2 } |
app/views/tree/_readme.html.haml
| ... | ... | @@ -1,13 +0,0 @@ |
| 1 | -.file_holder#README | |
| 2 | - .file_title | |
| 3 | - %i.icon-file | |
| 4 | - = readme.name | |
| 5 | - .file_content.wiki | |
| 6 | - - if gitlab_markdown?(readme.name) | |
| 7 | - = preserve do | |
| 8 | - = markdown(readme.data) | |
| 9 | - - elsif plain_text_readme?(readme.name) | |
| 10 | - %pre.clean | |
| 11 | - = readme.data | |
| 12 | - - else | |
| 13 | - = raw GitHub::Markup.render(readme.name, readme.data) |
app/views/tree/_submodule_item.html.haml
| ... | ... | @@ -1,11 +0,0 @@ |
| 1 | -- url = submodule_item.url(@ref) rescue '' | |
| 2 | -- name = submodule_item.basename | |
| 3 | -- return '' unless url | |
| 4 | -%tr{ class: "tree-item", url: url } | |
| 5 | - %td.tree-item-file-name | |
| 6 | - = image_tag "submodule.png" | |
| 7 | - %strong= truncate(name, length: 40) | |
| 8 | - %td | |
| 9 | - %code= submodule_item.id[0..10] | |
| 10 | - %td{ colspan: 2 } | |
| 11 | - = link_to truncate(url, length: 40), url |
app/views/tree/_tree.html.haml
| ... | ... | @@ -1,51 +0,0 @@ |
| 1 | -%ul.breadcrumb | |
| 2 | - %li | |
| 3 | - %i.icon-angle-right | |
| 4 | - = link_to project_tree_path(@project, @ref) do | |
| 5 | - = @project.path | |
| 6 | - - tree_breadcrumbs(tree, 6) do |title, path| | |
| 7 | - \/ | |
| 8 | - %li | |
| 9 | - - if path | |
| 10 | - = link_to truncate(title, length: 40), project_tree_path(@project, path) | |
| 11 | - - else | |
| 12 | - = link_to title, '#' | |
| 13 | - | |
| 14 | -%div#tree-content-holder.tree-content-holder | |
| 15 | - %table#tree-slider{class: "table_#{@hex_path} tree-table" } | |
| 16 | - %thead | |
| 17 | - %tr | |
| 18 | - %th Name | |
| 19 | - %th Last Update | |
| 20 | - %th | |
| 21 | - Last Commit | |
| 22 | - | |
| 23 | - %i.icon-angle-right | |
| 24 | - | |
| 25 | - %small.light | |
| 26 | - = link_to @commit.short_id, project_commit_path(@project, @commit) | |
| 27 | - – | |
| 28 | - = truncate(@commit.title, length: 50) | |
| 29 | - %th= link_to "history", project_commits_path(@project, @id), class: "btn btn-tiny pull-right" | |
| 30 | - | |
| 31 | - - if tree.up_dir? | |
| 32 | - %tr.tree-item | |
| 33 | - %td.tree-item-file-name | |
| 34 | - = image_tag "file_empty.png", size: '16x16' | |
| 35 | - = link_to "..", project_tree_path(@project, up_dir_path(tree)) | |
| 36 | - %td | |
| 37 | - %td | |
| 38 | - %td | |
| 39 | - | |
| 40 | - = render_tree(tree) | |
| 41 | - | |
| 42 | - - if tree.readme | |
| 43 | - = render "tree/readme", readme: tree.readme | |
| 44 | - | |
| 45 | -%div.tree_progress | |
| 46 | - | |
| 47 | -:javascript | |
| 48 | - // Load last commit log for each file in tree | |
| 49 | - $('#tree-slider').waitForImages(function() { | |
| 50 | - ajaxGet('#{@logs_path}'); | |
| 51 | - }); |
app/views/tree/_tree_commit_column.html.haml
app/views/tree/_tree_item.html.haml
| ... | ... | @@ -1,9 +0,0 @@ |
| 1 | -%tr{ class: "tree-item #{tree_hex_class(tree_item)}" } | |
| 2 | - %td.tree-item-file-name | |
| 3 | - = tree_icon(type) | |
| 4 | - %strong= link_to truncate(tree_item.name, length: 40), project_tree_path(@project, tree_join(@id || @commit.id, tree_item.name)) | |
| 5 | - %td.tree_time_ago.cgray | |
| 6 | - %span.log_loading.hide | |
| 7 | - Loading commit data... | |
| 8 | - = image_tag "ajax_loader_tree.gif", width: 14 | |
| 9 | - %td.tree_commit{ colspan: 2 } |
app/views/tree/show.html.haml
app/views/walls/show.html.haml
| ... | ... | @@ -1,23 +0,0 @@ |
| 1 | -%div.wall-page | |
| 2 | - %ul.notes | |
| 3 | - | |
| 4 | - - if can? current_user, :write_note, @project | |
| 5 | - .note-form-holder | |
| 6 | - = form_for [@project, @note], remote: true, html: { multipart: true, id: nil, class: "new_note wall-note-form" } do |f| | |
| 7 | - = note_target_fields | |
| 8 | - .note_text_and_preview | |
| 9 | - = f.text_area :note, size: 255, class: 'note_text js-note-text js-gfm-input turn-on' | |
| 10 | - .note-form-actions | |
| 11 | - .buttons | |
| 12 | - = f.submit 'Add Comment', class: "btn comment-btn grouped js-comment-button" | |
| 13 | - | |
| 14 | - .note-form-option | |
| 15 | - %a.choose-btn.btn.btn-small.js-choose-note-attachment-button | |
| 16 | - %i.icon-paper-clip | |
| 17 | - %span Choose File ... | |
| 18 | - | |
| 19 | - %span.file_name.js-attachment-filename File name... | |
| 20 | - = f.file_field :attachment, class: "js-note-attachment-input hide" | |
| 21 | - | |
| 22 | - .hint.pull-right CTRL + Enter to send message | |
| 23 | - .clearfix |
app/views/wikis/_form.html.haml
| ... | ... | @@ -1,36 +0,0 @@ |
| 1 | -= form_for [@project, @wiki] do |f| | |
| 2 | - -if @wiki.errors.any? | |
| 3 | - #error_explanation | |
| 4 | - %h2= "#{pluralize(@wiki.errors.count, "error")} prohibited this wiki from being saved:" | |
| 5 | - %ul | |
| 6 | - - @wiki.errors.full_messages.each do |msg| | |
| 7 | - %li= msg | |
| 8 | - | |
| 9 | - .ui-box.ui-box-show | |
| 10 | - .ui-box-head | |
| 11 | - %h3.page_title | |
| 12 | - .edit-wiki-header | |
| 13 | - = @wiki.title.titleize | |
| 14 | - = f.hidden_field :title, value: @wiki.title | |
| 15 | - = f.select :format, options_for_select(GollumWiki::MARKUPS, {selected: @wiki.format}), {}, class: "pull-right input-medium" | |
| 16 | - = f.label :format, class: "pull-right", style: "padding-right: 20px;" | |
| 17 | - .ui-box-body | |
| 18 | - .input | |
| 19 | - %span.cgray | |
| 20 | - Wiki content is parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. | |
| 21 | - To link to a (new) page you can just type | |
| 22 | - %code [Link Title](page-slug) | |
| 23 | - \. | |
| 24 | - | |
| 25 | - .ui-box-bottom | |
| 26 | - = f.label :content | |
| 27 | - .input= f.text_area :content, class: 'span8 js-gfm-input' | |
| 28 | - .ui-box-bottom | |
| 29 | - = f.label :commit_message | |
| 30 | - .input= f.text_field :message, class: 'span8' | |
| 31 | - .actions | |
| 32 | - = f.submit 'Save', class: "btn-save btn" | |
| 33 | - - if @wiki && @wiki.persisted? | |
| 34 | - = link_to "Cancel", project_wiki_path(@project, @wiki), class: "btn btn-cancel" | |
| 35 | - - else | |
| 36 | - = link_to "Cancel", project_wiki_path(@project, :home), class: "btn btn-cancel" |
app/views/wikis/_main_links.html.haml
| ... | ... | @@ -1,8 +0,0 @@ |
| 1 | -%span.pull-right | |
| 2 | - - if (@wiki && @wiki.persisted?) | |
| 3 | - = link_to history_project_wiki_path(@project, @wiki), class: "btn btn-small grouped" do | |
| 4 | - Page History | |
| 5 | - - if can?(current_user, :write_wiki, @project) | |
| 6 | - = link_to edit_project_wiki_path(@project, @wiki), class: "btn btn-small grouped" do | |
| 7 | - %i.icon-edit | |
| 8 | - Edit |
app/views/wikis/_nav.html.haml
| ... | ... | @@ -1,19 +0,0 @@ |
| 1 | -%ul.nav.nav-tabs | |
| 2 | - = nav_link(html_options: {class: params[:id] == 'home' ? 'active' : '' }) do | |
| 3 | - = link_to 'Home', project_wiki_path(@project, :home) | |
| 4 | - | |
| 5 | - = nav_link(path: 'wikis#pages') do | |
| 6 | - = link_to 'Pages', pages_project_wikis_path(@project) | |
| 7 | - | |
| 8 | - = nav_link(path: 'wikis#git_access') do | |
| 9 | - = link_to git_access_project_wikis_path(@project) do | |
| 10 | - %i.icon-download-alt | |
| 11 | - Git Access | |
| 12 | - | |
| 13 | - - if can?(current_user, :write_wiki, @project) | |
| 14 | - .pull-right | |
| 15 | - = link_to '#', class: "add-new-wiki btn btn-small btn-primary" do | |
| 16 | - %i.icon-plus | |
| 17 | - New Page | |
| 18 | - | |
| 19 | -= render 'wikis/new' |
app/views/wikis/_new.html.haml
| ... | ... | @@ -1,12 +0,0 @@ |
| 1 | -%div#modal-new-wiki.modal.hide | |
| 2 | - .modal-header | |
| 3 | - %a.close{href: "#"} × | |
| 4 | - %h3.page_title New Wiki Page | |
| 5 | - .modal-body | |
| 6 | - = label_tag :new_wiki_path do | |
| 7 | - %span Page slug | |
| 8 | - = text_field_tag :new_wiki_path, nil, placeholder: 'how-to-setup', class: 'input-xlarge', required: true, :'data-wikis-path' => project_wikis_path(@project) | |
| 9 | - %p.hint | |
| 10 | - Please dont use spaces and slashes | |
| 11 | - .modal-footer | |
| 12 | - = link_to 'Build', '#', class: 'build-new-wiki btn btn-create' |
app/views/wikis/edit.html.haml
| ... | ... | @@ -1,10 +0,0 @@ |
| 1 | -= render 'wikis/nav' | |
| 2 | -%h3.page_title | |
| 3 | - Editing page | |
| 4 | - = render 'main_links' | |
| 5 | -= render 'form' | |
| 6 | - | |
| 7 | -.pull-right | |
| 8 | - - if @wiki.persisted? && can?(current_user, :admin_wiki, @project) | |
| 9 | - = link_to project_wiki_path(@project, @wiki), confirm: "Are you sure you want to delete this page?", method: :delete, class: "btn btn-small btn-remove" do | |
| 10 | - Delete this page |
app/views/wikis/empty.html.haml
app/views/wikis/git_access.html.haml
| ... | ... | @@ -1,37 +0,0 @@ |
| 1 | -= render 'wikis/nav' | |
| 2 | -%h3.page_title | |
| 3 | - Git Access | |
| 4 | - %strong= @gollum_wiki.path_with_namespace | |
| 5 | - = render 'main_links' | |
| 6 | - | |
| 7 | -%br | |
| 8 | -.content | |
| 9 | - .project_clone_panel | |
| 10 | - .row | |
| 11 | - .span7 | |
| 12 | - .form-horizontal | |
| 13 | - .input-prepend.project_clone_holder | |
| 14 | - %button{class: "btn active", :"data-clone" => @gollum_wiki.ssh_url_to_repo} SSH | |
| 15 | - %button{class: "btn", :"data-clone" => @gollum_wiki.http_url_to_repo}= Gitlab.config.gitlab.protocol.upcase | |
| 16 | - = text_field_tag :project_clone, @gollum_wiki.url_to_repo, class: "one_click_select input-xxlarge", readonly: true | |
| 17 | - .git-empty | |
| 18 | - %fieldset | |
| 19 | - %legend Install Gollum: | |
| 20 | - %pre.dark | |
| 21 | - :preserve | |
| 22 | - gem install gollum | |
| 23 | - | |
| 24 | - %legend Clone Your Wiki: | |
| 25 | - %pre.dark | |
| 26 | - :preserve | |
| 27 | - git clone #{@gollum_wiki.ssh_url_to_repo} | |
| 28 | - cd #{@gollum_wiki.path} | |
| 29 | - | |
| 30 | - %legend Start Gollum And Edit Locally: | |
| 31 | - %pre.dark | |
| 32 | - :preserve | |
| 33 | - gollum | |
| 34 | - == Sinatra/1.3.5 has taken the stage on 4567 for development with backup from Thin | |
| 35 | - >> Thin web server (v1.5.0 codename Knife) | |
| 36 | - >> Maximum connections set to 1024 | |
| 37 | - >> Listening on 0.0.0.0:4567, CTRL+C to stop |
app/views/wikis/history.html.haml
| ... | ... | @@ -1,31 +0,0 @@ |
| 1 | -= render 'wikis/nav' | |
| 2 | -%h3.page_title | |
| 3 | - %span.light History for | |
| 4 | - = @wiki.title.titleize | |
| 5 | - = render 'main_links' | |
| 6 | -%br | |
| 7 | -%table | |
| 8 | - %thead | |
| 9 | - %tr | |
| 10 | - %th Page version | |
| 11 | - %th Author | |
| 12 | - %th Commit Message | |
| 13 | - %th Last updated | |
| 14 | - %th Format | |
| 15 | - %tbody | |
| 16 | - - @wiki.versions.each do |version| | |
| 17 | - - commit = version | |
| 18 | - %tr | |
| 19 | - %td | |
| 20 | - = link_to project_wiki_path(@project, @wiki, version_id: commit.id) do | |
| 21 | - = commit.short_id | |
| 22 | - %td | |
| 23 | - = commit_author_link(commit, avatar: true, size: 24) | |
| 24 | - %td | |
| 25 | - = commit.title | |
| 26 | - %td | |
| 27 | - = time_ago_in_words(version.date) | |
| 28 | - ago | |
| 29 | - %td | |
| 30 | - %strong | |
| 31 | - = @wiki.page.wiki.page(@wiki.page.name, commit.id).try(:format) |
app/views/wikis/pages.html.haml
| ... | ... | @@ -1,25 +0,0 @@ |
| 1 | -= render 'wikis/nav' | |
| 2 | -%h3.page_title | |
| 3 | - All Pages | |
| 4 | - = render 'main_links' | |
| 5 | -%br | |
| 6 | -%table | |
| 7 | - %thead | |
| 8 | - %tr | |
| 9 | - %th Title | |
| 10 | - %th Format | |
| 11 | - %th Last updated | |
| 12 | - %th Updated by | |
| 13 | - %tbody | |
| 14 | - - @wiki_pages.each do |wiki_page| | |
| 15 | - %tr | |
| 16 | - %td | |
| 17 | - %strong= link_to wiki_page.title.titleize, project_wiki_path(@project, wiki_page) | |
| 18 | - %td | |
| 19 | - %strong= wiki_page.format | |
| 20 | - %td | |
| 21 | - = wiki_page.created_at.to_s(:short) do | |
| 22 | - (#{time_ago_in_words(wiki_page.created_at)} | |
| 23 | - ago) | |
| 24 | - %td | |
| 25 | - = commit_author_link(wiki_page.version, avatar: true, size: 24) |
app/views/wikis/show.html.haml
| ... | ... | @@ -1,16 +0,0 @@ |
| 1 | -= render 'wikis/nav' | |
| 2 | -%h3.page_title | |
| 3 | - = @wiki.title.titleize | |
| 4 | - = render 'main_links' | |
| 5 | -%br | |
| 6 | -- if @wiki.historical? | |
| 7 | - .warning_message | |
| 8 | - This is an old version of this page. | |
| 9 | - You can view the #{link_to "most recent version", project_wiki_path(@project, @wiki)} or browse the #{link_to "history", history_project_wiki_path(@project, @wiki)}. | |
| 10 | - | |
| 11 | -.file_holder | |
| 12 | - .file_content.wiki | |
| 13 | - = preserve do | |
| 14 | - = render_wiki_content(@wiki) | |
| 15 | - | |
| 16 | -%p.time Last edited by #{commit_author_link(@wiki.version, avatar: true, size: 16)} #{time_ago_in_words @wiki.created_at} ago |
config/routes.rb
| ... | ... | @@ -160,135 +160,135 @@ Gitlab::Application.routes.draw do |
| 160 | 160 | get :autocomplete_sources |
| 161 | 161 | end |
| 162 | 162 | |
| 163 | - resources :blob, only: [:show], constraints: {id: /.+/} | |
| 164 | - resources :raw, only: [:show], constraints: {id: /.+/} | |
| 165 | - resources :tree, only: [:show], constraints: {id: /.+/, format: /(html|js)/ } | |
| 166 | - resources :edit_tree, only: [:show, :update], constraints: {id: /.+/}, path: 'edit' | |
| 167 | - resources :commit, only: [:show], constraints: {id: /[[:alnum:]]{6,40}/} | |
| 168 | - resources :commits, only: [:show], constraints: {id: /(?:[^.]|\.(?!atom$))+/, format: /atom/} | |
| 169 | - resources :compare, only: [:index, :create] | |
| 170 | - resources :blame, only: [:show], constraints: {id: /.+/} | |
| 171 | - resources :network, only: [:show], constraints: {id: /(?:[^.]|\.(?!json$))+/, format: /json/} | |
| 172 | - resources :graphs, only: [:show], constraints: {id: /(?:[^.]|\.(?!json$))+/, format: /json/} | |
| 173 | - match "/compare/:from...:to" => "compare#show", as: "compare", via: [:get, :post], constraints: {from: /.+/, to: /.+/} | |
| 174 | - | |
| 175 | 163 | scope module: :projects do |
| 176 | - resources :snippets do | |
| 177 | - member do | |
| 178 | - get "raw" | |
| 164 | + resources :blob, only: [:show], constraints: {id: /.+/} | |
| 165 | + resources :raw, only: [:show], constraints: {id: /.+/} | |
| 166 | + resources :tree, only: [:show], constraints: {id: /.+/, format: /(html|js)/ } | |
| 167 | + resources :edit_tree, only: [:show, :update], constraints: {id: /.+/}, path: 'edit' | |
| 168 | + resources :commit, only: [:show], constraints: {id: /[[:alnum:]]{6,40}/} | |
| 169 | + resources :commits, only: [:show], constraints: {id: /(?:[^.]|\.(?!atom$))+/, format: /atom/} | |
| 170 | + resources :compare, only: [:index, :create] | |
| 171 | + resources :blame, only: [:show], constraints: {id: /.+/} | |
| 172 | + resources :network, only: [:show], constraints: {id: /(?:[^.]|\.(?!json$))+/, format: /json/} | |
| 173 | + resources :graphs, only: [:show], constraints: {id: /(?:[^.]|\.(?!json$))+/, format: /json/} | |
| 174 | + match "/compare/:from...:to" => "compare#show", as: "compare", via: [:get, :post], constraints: {from: /.+/, to: /.+/} | |
| 175 | + | |
| 176 | + resources :snippets do | |
| 177 | + member do | |
| 178 | + get "raw" | |
| 179 | + end | |
| 179 | 180 | end |
| 180 | - end | |
| 181 | - end | |
| 182 | 181 | |
| 183 | - resources :wikis, only: [:show, :edit, :destroy, :create] do | |
| 184 | - collection do | |
| 185 | - get :pages | |
| 186 | - put ':id' => 'wikis#update' | |
| 187 | - get :git_access | |
| 188 | - end | |
| 182 | + resources :wikis, only: [:show, :edit, :destroy, :create] do | |
| 183 | + collection do | |
| 184 | + get :pages | |
| 185 | + put ':id' => 'wikis#update' | |
| 186 | + get :git_access | |
| 187 | + end | |
| 189 | 188 | |
| 190 | - member do | |
| 191 | - get "history" | |
| 189 | + member do | |
| 190 | + get "history" | |
| 191 | + end | |
| 192 | 192 | end |
| 193 | - end | |
| 194 | 193 | |
| 195 | - resource :wall, only: [:show] do | |
| 196 | - member do | |
| 197 | - get 'notes' | |
| 194 | + resource :wall, only: [:show] do | |
| 195 | + member do | |
| 196 | + get 'notes' | |
| 197 | + end | |
| 198 | 198 | end |
| 199 | - end | |
| 200 | 199 | |
| 201 | - resource :repository, only: [:show] do | |
| 202 | - member do | |
| 203 | - get "branches" | |
| 204 | - get "tags" | |
| 205 | - get "stats" | |
| 206 | - get "archive" | |
| 200 | + resource :repository, only: [:show] do | |
| 201 | + member do | |
| 202 | + get "branches" | |
| 203 | + get "tags" | |
| 204 | + get "stats" | |
| 205 | + get "archive" | |
| 206 | + end | |
| 207 | 207 | end |
| 208 | - end | |
| 209 | 208 | |
| 210 | - resources :services, constraints: { id: /[^\/]+/ }, only: [:index, :edit, :update] do | |
| 211 | - member do | |
| 212 | - get :test | |
| 209 | + resources :services, constraints: { id: /[^\/]+/ }, only: [:index, :edit, :update] do | |
| 210 | + member do | |
| 211 | + get :test | |
| 212 | + end | |
| 213 | 213 | end |
| 214 | - end | |
| 215 | 214 | |
| 216 | - resources :deploy_keys do | |
| 217 | - member do | |
| 218 | - put :enable | |
| 219 | - put :disable | |
| 215 | + resources :deploy_keys do | |
| 216 | + member do | |
| 217 | + put :enable | |
| 218 | + put :disable | |
| 219 | + end | |
| 220 | 220 | end |
| 221 | - end | |
| 222 | 221 | |
| 223 | - resources :protected_branches, only: [:index, :create, :destroy] | |
| 222 | + resources :protected_branches, only: [:index, :create, :destroy] | |
| 224 | 223 | |
| 225 | - resources :refs, only: [] do | |
| 226 | - collection do | |
| 227 | - get "switch" | |
| 228 | - end | |
| 224 | + resources :refs, only: [] do | |
| 225 | + collection do | |
| 226 | + get "switch" | |
| 227 | + end | |
| 229 | 228 | |
| 230 | - member do | |
| 231 | - # tree viewer logs | |
| 232 | - get "logs_tree", constraints: { id: /[a-zA-Z.\/0-9_\-#%+]+/ } | |
| 233 | - get "logs_tree/:path" => "refs#logs_tree", | |
| 234 | - as: :logs_file, | |
| 235 | - constraints: { | |
| 236 | - id: /[a-zA-Z.0-9\/_\-#%+]+/, | |
| 237 | - path: /.*/ | |
| 238 | - } | |
| 229 | + member do | |
| 230 | + # tree viewer logs | |
| 231 | + get "logs_tree", constraints: { id: /[a-zA-Z.\/0-9_\-#%+]+/ } | |
| 232 | + get "logs_tree/:path" => "refs#logs_tree", | |
| 233 | + as: :logs_file, | |
| 234 | + constraints: { | |
| 235 | + id: /[a-zA-Z.0-9\/_\-#%+]+/, | |
| 236 | + path: /.*/ | |
| 237 | + } | |
| 238 | + end | |
| 239 | 239 | end |
| 240 | - end | |
| 241 | 240 | |
| 242 | - resources :merge_requests, constraints: {id: /\d+/}, except: [:destroy] do | |
| 243 | - member do | |
| 244 | - get :diffs | |
| 245 | - get :automerge | |
| 246 | - get :automerge_check | |
| 247 | - get :ci_status | |
| 248 | - end | |
| 241 | + resources :merge_requests, constraints: {id: /\d+/}, except: [:destroy] do | |
| 242 | + member do | |
| 243 | + get :diffs | |
| 244 | + get :automerge | |
| 245 | + get :automerge_check | |
| 246 | + get :ci_status | |
| 247 | + end | |
| 249 | 248 | |
| 250 | - collection do | |
| 251 | - get :branch_from | |
| 252 | - get :branch_to | |
| 249 | + collection do | |
| 250 | + get :branch_from | |
| 251 | + get :branch_to | |
| 252 | + end | |
| 253 | 253 | end |
| 254 | - end | |
| 255 | 254 | |
| 256 | - resources :hooks, only: [:index, :create, :destroy] do | |
| 257 | - member do | |
| 258 | - get :test | |
| 255 | + resources :hooks, only: [:index, :create, :destroy] do | |
| 256 | + member do | |
| 257 | + get :test | |
| 258 | + end | |
| 259 | 259 | end |
| 260 | - end | |
| 261 | 260 | |
| 262 | - resources :team, controller: 'team_members', only: [:index] | |
| 263 | - resources :milestones, except: [:destroy] | |
| 261 | + resources :team, controller: 'team_members', only: [:index] | |
| 262 | + resources :milestones, except: [:destroy] | |
| 264 | 263 | |
| 265 | - resources :labels, only: [:index] do | |
| 266 | - collection do | |
| 267 | - post :generate | |
| 264 | + resources :labels, only: [:index] do | |
| 265 | + collection do | |
| 266 | + post :generate | |
| 267 | + end | |
| 268 | 268 | end |
| 269 | - end | |
| 270 | 269 | |
| 271 | - resources :issues, except: [:destroy] do | |
| 272 | - collection do | |
| 273 | - post :bulk_update | |
| 270 | + resources :issues, except: [:destroy] do | |
| 271 | + collection do | |
| 272 | + post :bulk_update | |
| 273 | + end | |
| 274 | 274 | end |
| 275 | - end | |
| 276 | 275 | |
| 277 | - resources :team_members, except: [:index, :edit] do | |
| 278 | - collection do | |
| 276 | + resources :team_members, except: [:index, :edit] do | |
| 277 | + collection do | |
| 279 | 278 | |
| 280 | - # Used for import team | |
| 281 | - # from another project | |
| 282 | - get :import | |
| 283 | - post :apply_import | |
| 279 | + # Used for import team | |
| 280 | + # from another project | |
| 281 | + get :import | |
| 282 | + post :apply_import | |
| 283 | + end | |
| 284 | 284 | end |
| 285 | - end | |
| 286 | 285 | |
| 287 | - resources :notes, only: [:index, :create, :destroy] do | |
| 288 | - collection do | |
| 289 | - post :preview | |
| 286 | + resources :notes, only: [:index, :create, :destroy] do | |
| 287 | + collection do | |
| 288 | + post :preview | |
| 289 | + end | |
| 290 | + end | |
| 290 | 291 | end |
| 291 | - end | |
| 292 | 292 | end |
| 293 | 293 | |
| 294 | 294 | root to: "dashboard#show" | ... | ... |