From 8827eea8643bba95571edf2ea0f769b18e8369c2 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Tue, 24 May 2016 08:28:18 +0100 Subject: Updated commits UI Closes #14633 --- app/views/projects/commits/_commit.html.haml | 21 ++++++++++----------- app/views/projects/commits/_commits.html.haml | 17 +++++------------ app/views/projects/commits/show.html.haml | 11 ++++------- .../projects/merge_requests/show/_commits.html.haml | 3 ++- 4 files changed, 21 insertions(+), 31 deletions(-) (limited to 'app/views/projects') diff --git a/app/views/projects/commits/_commit.html.haml b/app/views/projects/commits/_commit.html.haml index 367027182b6..288b95c3e6e 100644 --- a/app/views/projects/commits/_commit.html.haml +++ b/app/views/projects/commits/_commit.html.haml @@ -9,26 +9,25 @@ = cache(cache_key) do %li.commit.js-toggle-container{ id: "commit-#{commit.short_id}" } + = commit_author_avatar(commit) .commit-row-title %span.item-title - = link_to_gfm commit.title, namespace_project_commit_path(project.namespace, project, commit.id), class: "commit-row-message" + = link_to_gfm commit.title, namespace_project_commit_path(project.namespace, project, commit.id), class: "commit-row-message commit-link" - if commit.description? %a.text-expander.js-toggle-button ... - .pull-right + .commit-actions - if commit.status - = render_commit_status(commit) + = render_commit_status(commit, cssclass: 'btn btn-transparent') = clipboard_button(clipboard_text: commit.id) - = link_to commit.short_id, namespace_project_commit_path(project.namespace, project, commit), class: "commit_short_id" + = link_to commit.short_id, namespace_project_commit_path(project.namespace, project, commit), class: "commit-short-id btn btn-transparent commit-link" + = link_to_browse_code(project, commit) - if commit.description? - .commit-row-description.js-toggle-content - %pre - = preserve(markdown(escape_once(commit.description), pipeline: :single_line, author: commit.author)) + %pre.commit-row-description.js-toggle-content + = preserve(markdown(escape_once(commit.description), pipeline: :single_line, author: commit.author)) .commit-row-info - by = commit_author_link(commit, avatar: true, size: 24) - .committed_ago - #{time_ago_with_tooltip(commit.committed_date)}   - = link_to_browse_code(project, commit) + authored + #{time_ago_with_tooltip(commit.committed_date)}   diff --git a/app/views/projects/commits/_commits.html.haml b/app/views/projects/commits/_commits.html.haml index 7283a78a64e..dd12eae8f7e 100644 --- a/app/views/projects/commits/_commits.html.haml +++ b/app/views/projects/commits/_commits.html.haml @@ -4,18 +4,11 @@ - commits, hidden = limited_commits(@commits) - commits.chunk { |c| c.committed_date.in_time_zone.to_date }.each do |day, commits| - .row.commits-row - .col-md-2.hidden-xs.hidden-sm - %h5.commits-row-date - %i.fa.fa-calendar - %span= day.strftime('%d %b, %Y') - .light - = pluralize(commits.count, 'commit') - .col-md-10.col-sm-12 - %ul.content-list - = render commits, project: project - %hr.lists-separator + %li.commit-header= "#{day.strftime('%d %b, %Y')} #{pluralize(commits.count, 'commit')}" + %li.commits-row + %ul.list-unstyled.commit-list + = render commits, project: project - if hidden > 0 - .alert.alert-warning + %li.alert.alert-warning #{number_with_delimiter(hidden)} additional commits have been omitted to prevent performance issues. diff --git a/app/views/projects/commits/show.html.haml b/app/views/projects/commits/show.html.haml index 76ba0bea36d..51ca4eb903e 100644 --- a/app/views/projects/commits/show.html.haml +++ b/app/views/projects/commits/show.html.haml @@ -23,21 +23,18 @@ Create Merge Request .control - = form_tag(namespace_project_commits_path(@project.namespace, @project, @id), method: :get, class: 'pull-left commits-search-form') do - = search_field_tag :search, params[:search], { placeholder: 'Filter by commit message', id: 'commits-search', class: 'form-control search-text-input', spellcheck: false } - + = form_tag(namespace_project_commits_path(@project.namespace, @project, @id), method: :get, class: 'commits-search-form') do + = search_field_tag :search, params[:search], { placeholder: 'Filter by commit message', id: 'commits-search', class: 'form-control search-text-input input-short', spellcheck: false } - if current_user && current_user.private_token .control = link_to namespace_project_commits_path(@project.namespace, @project, @ref, {format: :atom, private_token: current_user.private_token}), title: "Commits Feed", class: 'btn' do = icon("rss") - - %ul.breadcrumb.repo-breadcrumb = commits_breadcrumbs %div{id: dom_id(@project)} - #commits-list.content_list= render "commits", project: @project - .clear + %ol#commits-list.list-unstyled.content_list + = render "commits", project: @project = spinner :javascript diff --git a/app/views/projects/merge_requests/show/_commits.html.haml b/app/views/projects/merge_requests/show/_commits.html.haml index a8f09f855d4..0b05785430b 100644 --- a/app/views/projects/merge_requests/show/_commits.html.haml +++ b/app/views/projects/merge_requests/show/_commits.html.haml @@ -2,4 +2,5 @@ = icon("sort-amount-desc") Most recent commits displayed first -= render "projects/commits/commits", project: @merge_request.project +%ol#commits-list.list-unstyled + = render "projects/commits/commits", project: @merge_request.project -- cgit v1.2.1 From 79b375e17876105cefcbc5c451e785aceedb0002 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Tue, 24 May 2016 14:00:49 +0100 Subject: Updated some commit UI colors Fixed issue with tree view styles --- app/views/projects/commits/_commit.html.haml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app/views/projects') diff --git a/app/views/projects/commits/_commit.html.haml b/app/views/projects/commits/_commit.html.haml index 288b95c3e6e..f79c9448f60 100644 --- a/app/views/projects/commits/_commit.html.haml +++ b/app/views/projects/commits/_commit.html.haml @@ -12,15 +12,15 @@ = commit_author_avatar(commit) .commit-row-title %span.item-title - = link_to_gfm commit.title, namespace_project_commit_path(project.namespace, project, commit.id), class: "commit-row-message commit-link" + = link_to_gfm commit.title, namespace_project_commit_path(project.namespace, project, commit.id), class: "commit-row-message" - if commit.description? %a.text-expander.js-toggle-button ... .commit-actions - if commit.status = render_commit_status(commit, cssclass: 'btn btn-transparent') - = clipboard_button(clipboard_text: commit.id) - = link_to commit.short_id, namespace_project_commit_path(project.namespace, project, commit), class: "commit-short-id btn btn-transparent commit-link" + = clipboard_button({ clipboard_text: commit.id }, css_class: 'btn-transparent') + = link_to commit.short_id, namespace_project_commit_path(project.namespace, project, commit), class: "commit-short-id btn btn-transparent" = link_to_browse_code(project, commit) - if commit.description? @@ -30,4 +30,4 @@ .commit-row-info = commit_author_link(commit, avatar: true, size: 24) authored - #{time_ago_with_tooltip(commit.committed_date)}   + #{time_ago_with_tooltip(commit.committed_date)} -- cgit v1.2.1 From 8b40a7745be84659c10db02e3bbb74126bd42414 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Tue, 24 May 2016 17:06:49 +0100 Subject: Updated tests --- app/views/projects/commits/_commit.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views/projects') diff --git a/app/views/projects/commits/_commit.html.haml b/app/views/projects/commits/_commit.html.haml index f79c9448f60..d6661deb5ff 100644 --- a/app/views/projects/commits/_commit.html.haml +++ b/app/views/projects/commits/_commit.html.haml @@ -19,7 +19,7 @@ .commit-actions - if commit.status = render_commit_status(commit, cssclass: 'btn btn-transparent') - = clipboard_button({ clipboard_text: commit.id }, css_class: 'btn-transparent') + = clipboard_button_with_class({ clipboard_text: commit.id }, css_class: 'btn-transparent') = link_to commit.short_id, namespace_project_commit_path(project.namespace, project, commit), class: "commit-short-id btn btn-transparent" = link_to_browse_code(project, commit) -- cgit v1.2.1 From 97cee7e231689a7dee2f193411f3cd7962c6ea52 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Tue, 31 May 2016 11:04:18 +0100 Subject: Improved spacing on mobile --- app/views/projects/commits/_commit.html.haml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app/views/projects') diff --git a/app/views/projects/commits/_commit.html.haml b/app/views/projects/commits/_commit.html.haml index d6661deb5ff..58ccd31442a 100644 --- a/app/views/projects/commits/_commit.html.haml +++ b/app/views/projects/commits/_commit.html.haml @@ -13,10 +13,12 @@ .commit-row-title %span.item-title = link_to_gfm commit.title, namespace_project_commit_path(project.namespace, project, commit.id), class: "commit-row-message" + - if commit.status + = render_commit_status(commit, cssclass: 'visible-xs-inline') - if commit.description? - %a.text-expander.js-toggle-button ... + %a.text-expander.hidden-xs.js-toggle-button ... - .commit-actions + .commit-actions.hidden-xs - if commit.status = render_commit_status(commit, cssclass: 'btn btn-transparent') = clipboard_button_with_class({ clipboard_text: commit.id }, css_class: 'btn-transparent') -- cgit v1.2.1 From d5afb1324f2fb9b9c19df3806662e159bbe4ffb3 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Tue, 31 May 2016 11:17:13 +0100 Subject: Sends correct parameter to commit_author_link for avatar --- app/views/projects/commits/_commit.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views/projects') diff --git a/app/views/projects/commits/_commit.html.haml b/app/views/projects/commits/_commit.html.haml index 58ccd31442a..66df5fe5e20 100644 --- a/app/views/projects/commits/_commit.html.haml +++ b/app/views/projects/commits/_commit.html.haml @@ -30,6 +30,6 @@ = preserve(markdown(escape_once(commit.description), pipeline: :single_line, author: commit.author)) .commit-row-info - = commit_author_link(commit, avatar: true, size: 24) + = commit_author_link(commit, avatar: false, size: 24) authored #{time_ago_with_tooltip(commit.committed_date)} -- cgit v1.2.1 From e5a83a9a94f7fbedb2fcce645248e1198dcf474f Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Wed, 1 Jun 2016 10:17:32 +0100 Subject: Added short commit ID to mobile --- app/views/projects/commits/_commit.html.haml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'app/views/projects') diff --git a/app/views/projects/commits/_commit.html.haml b/app/views/projects/commits/_commit.html.haml index 66df5fe5e20..757f4e7e8e0 100644 --- a/app/views/projects/commits/_commit.html.haml +++ b/app/views/projects/commits/_commit.html.haml @@ -13,6 +13,9 @@ .commit-row-title %span.item-title = link_to_gfm commit.title, namespace_project_commit_path(project.namespace, project, commit.id), class: "commit-row-message" + %span.commit-row-message.visible-xs-inline + · + = commit.short_id - if commit.status = render_commit_status(commit, cssclass: 'visible-xs-inline') - if commit.description? -- cgit v1.2.1 From 41c2ea9b7a036da7064b433de43c19e578cc7531 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Tue, 7 Jun 2016 16:09:46 +0100 Subject: Vertical alignment of buttons in commit row --- app/views/projects/commits/_commit.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views/projects') diff --git a/app/views/projects/commits/_commit.html.haml b/app/views/projects/commits/_commit.html.haml index 757f4e7e8e0..a959b34a539 100644 --- a/app/views/projects/commits/_commit.html.haml +++ b/app/views/projects/commits/_commit.html.haml @@ -9,7 +9,7 @@ = cache(cache_key) do %li.commit.js-toggle-container{ id: "commit-#{commit.short_id}" } - = commit_author_avatar(commit) + = commit_author_avatar(commit, size: 36) .commit-row-title %span.item-title = link_to_gfm commit.title, namespace_project_commit_path(project.namespace, project, commit.id), class: "commit-row-message" -- cgit v1.2.1 From 9d09bd08e541c42dc05e336293cc2917b3a60df8 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Thu, 2 Jun 2016 08:30:38 +0100 Subject: Due date can be removed from milestones Closes #15063 --- app/views/projects/milestones/_form.html.haml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'app/views/projects') diff --git a/app/views/projects/milestones/_form.html.haml b/app/views/projects/milestones/_form.html.haml index f5e2b927da8..cbf1ba04170 100644 --- a/app/views/projects/milestones/_form.html.haml +++ b/app/views/projects/milestones/_form.html.haml @@ -19,6 +19,7 @@ = f.label :due_date, "Due Date", class: "control-label" .col-sm-10 = f.text_field :due_date, class: "datepicker form-control", placeholder: "Select due date" + %a.inline.prepend-top-5.js-clear-due-date{ href: "#" } Clear due date .form-actions - if @milestone.new_record? @@ -27,10 +28,3 @@ -else = f.submit 'Save changes', class: "btn-save btn" = link_to "Cancel", namespace_project_milestone_path(@project.namespace, @project, @milestone), class: "btn btn-cancel" - - -:javascript - $(".datepicker").datepicker({ - dateFormat: "yy-mm-dd", - onSelect: function(dateText, inst) { $("#milestone_due_date").val(dateText) } - }).datepicker("setDate", $.datepicker.parseDate('yy-mm-dd', $('#milestone_due_date').val())); -- cgit v1.2.1 From 49c06ba39133ea3f3468729d661264f77219d251 Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Fri, 10 Jun 2016 14:17:10 +0100 Subject: Only show issues closing MR when present --- app/views/projects/issues/_merge_requests.html.haml | 2 -- 1 file changed, 2 deletions(-) (limited to 'app/views/projects') diff --git a/app/views/projects/issues/_merge_requests.html.haml b/app/views/projects/issues/_merge_requests.html.haml index 75f36579b11..d8075371853 100644 --- a/app/views/projects/issues/_merge_requests.html.haml +++ b/app/views/projects/issues/_merge_requests.html.haml @@ -24,8 +24,6 @@ MERGED - elsif merge_request.closed? CLOSED - %li - = render partial: 'projects/issues/closed_by_box', locals: {merge_request_count: @merge_requests.count} - if @closed_by_merge_requests.present? %li = render partial: 'projects/issues/closed_by_box', locals: {merge_request_count: @merge_requests.count} -- cgit v1.2.1 From c7941acd1e410fedb431efe13dc3b74dfa7f9f8a Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Fri, 10 Jun 2016 14:22:50 +0100 Subject: Don't try to count a relation with aliases 98f147e84d2bd8f2278452ac0852118452c76d4a fixed this for issues in HTML, but not MRs or Atom feeds. --- app/views/projects/issues/index.atom.builder | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/views/projects') diff --git a/app/views/projects/issues/index.atom.builder b/app/views/projects/issues/index.atom.builder index 7ad7c9c87e8..36957560de0 100644 --- a/app/views/projects/issues/index.atom.builder +++ b/app/views/projects/issues/index.atom.builder @@ -4,7 +4,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear xml.link href: namespace_project_issues_url(@project.namespace, @project, format: :atom, private_token: current_user.try(:private_token)), rel: "self", type: "application/atom+xml" xml.link href: namespace_project_issues_url(@project.namespace, @project), rel: "alternate", type: "text/html" xml.id namespace_project_issues_url(@project.namespace, @project) - xml.updated @issues.first.created_at.xmlschema if @issues.any? + xml.updated @issues.first.created_at.xmlschema if @issues.reorder(nil).any? - xml << render(partial: 'issues/issue', collection: @issues) if @issues.any? + xml << render(partial: 'issues/issue', collection: @issues) if @issues.reorder(nil).any? end -- cgit v1.2.1 From 18e16e427d331415db042afd3c8dd5689db32a53 Mon Sep 17 00:00:00 2001 From: Connor Shea Date: Tue, 7 Jun 2016 15:07:00 -0600 Subject: Replace raphael-rails with raphael.js so it can be split from the rest of the JavaScript. The gem isn't maintained anymore anyway. Added a network folder with an application.js including raphael components, since that's the only page using it currently. --- app/views/projects/network/show.html.haml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'app/views/projects') diff --git a/app/views/projects/network/show.html.haml b/app/views/projects/network/show.html.haml index bf9baaea889..3c155e97f72 100644 --- a/app/views/projects/network/show.html.haml +++ b/app/views/projects/network/show.html.haml @@ -1,4 +1,5 @@ - page_title "Network", @ref +- page_specific_javascripts asset_path("network/application.js") = render "projects/commits/head" = render "head" %div{ class: (container_class) } @@ -14,14 +15,5 @@ = check_box_tag :filter_ref, 1, @options[:filter_ref] %span Begin with the selected commit - .network-graph + .network-graph{ data: { url: "#{escape_javascript(@url)}", commit_url: "#{escape_javascript(@commit_url)}", ref: "#{escape_javascript(@ref)}", commit_id: "#{escape_javascript(@commit.id)}" } } = spinner nil, true - -:javascript - network_graph = new Network({ - url: "#{escape_javascript(@url)}", - commit_url: "#{escape_javascript(@commit_url)}", - ref: "#{escape_javascript(@ref)}", - commit_id: '#{@commit.id}' - }) - new ShortcutsNetwork(network_graph.branch_graph) -- cgit v1.2.1 From 7163229738c4fa534d7909ea168d0612ef89fbef Mon Sep 17 00:00:00 2001 From: Connor Shea Date: Wed, 8 Jun 2016 11:28:35 -0600 Subject: Fix failing test. --- app/views/projects/network/show.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views/projects') diff --git a/app/views/projects/network/show.html.haml b/app/views/projects/network/show.html.haml index 3c155e97f72..e4ab064eda8 100644 --- a/app/views/projects/network/show.html.haml +++ b/app/views/projects/network/show.html.haml @@ -15,5 +15,5 @@ = check_box_tag :filter_ref, 1, @options[:filter_ref] %span Begin with the selected commit - .network-graph{ data: { url: "#{escape_javascript(@url)}", commit_url: "#{escape_javascript(@commit_url)}", ref: "#{escape_javascript(@ref)}", commit_id: "#{escape_javascript(@commit.id)}" } } + .network-graph{ data: { url: '#{escape_javascript(@url)}', commit_url: '#{escape_javascript(@commit_url)}', ref: '#{escape_javascript(@ref)}', commit_id: '#{escape_javascript(@commit.id)}' } } = spinner nil, true -- cgit v1.2.1 From a9d14ddcedb7c126b8ee4942b0ca6e794ff996f8 Mon Sep 17 00:00:00 2001 From: "Luke \"Jared\" Bennett" Date: Thu, 9 Jun 2016 18:26:14 +0100 Subject: added whitespace toggle to diffs page and set it to return the project compare path with the selected whitespace params Updated CHANGELOG Moved CHANGELOG entry --- app/views/projects/diffs/_diffs.html.haml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/views/projects') diff --git a/app/views/projects/diffs/_diffs.html.haml b/app/views/projects/diffs/_diffs.html.haml index d9c4b410d32..1e8d99f06eb 100644 --- a/app/views/projects/diffs/_diffs.html.haml +++ b/app/views/projects/diffs/_diffs.html.haml @@ -11,6 +11,8 @@ = commit_diff_whitespace_link(@project, @commit, class: 'hidden-xs') - elsif current_controller?(:merge_requests) = diff_merge_request_whitespace_link(@project, @merge_request, class: 'hidden-xs') + - elsif current_controller?(:compare) + = diff_compare_whitespace_link(@project, params[:from], params[:to], class: 'hidden-xs') .btn-group = inline_diff_btn = parallel_diff_btn -- cgit v1.2.1 From 30bf8dcc144784a3f8bc37b3a98bf8e393d05953 Mon Sep 17 00:00:00 2001 From: "Luke \"Jared\" Bennett" Date: Wed, 1 Jun 2016 00:07:05 +0100 Subject: Pipeline artifacts download button wording improved Updated CHANGELOG Removed CHANGELOG entry --- app/views/projects/ci/pipelines/_pipeline.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views/projects') diff --git a/app/views/projects/ci/pipelines/_pipeline.html.haml b/app/views/projects/ci/pipelines/_pipeline.html.haml index a0ffa065067..b8d8758fd2b 100644 --- a/app/views/projects/ci/pipelines/_pipeline.html.haml +++ b/app/views/projects/ci/pipelines/_pipeline.html.haml @@ -60,7 +60,7 @@ %li = link_to download_namespace_project_build_artifacts_path(@project.namespace, @project, build), rel: 'nofollow' do = icon("download") - %span #{build.name} + %span Download '#{build.name}' artifacts - if can?(current_user, :update_pipeline, @project) - if pipeline.retryable? -- cgit v1.2.1 From cf7da039bedcad5163ce9deedccc94206d4c485a Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Fri, 29 Apr 2016 15:14:38 +0200 Subject: commit status --- .../projects/environments/_environment.html.haml | 58 ++++++++++++++++++++++ .../projects/environments/_header_title.html.haml | 1 + app/views/projects/environments/index.html.haml | 22 ++++++++ app/views/projects/environments/show.html.haml | 30 +++++++++++ 4 files changed, 111 insertions(+) create mode 100644 app/views/projects/environments/_environment.html.haml create mode 100644 app/views/projects/environments/_header_title.html.haml create mode 100644 app/views/projects/environments/index.html.haml create mode 100644 app/views/projects/environments/show.html.haml (limited to 'app/views/projects') diff --git a/app/views/projects/environments/_environment.html.haml b/app/views/projects/environments/_environment.html.haml new file mode 100644 index 00000000000..e3216aea6cd --- /dev/null +++ b/app/views/projects/environments/_environment.html.haml @@ -0,0 +1,58 @@ +%tr.commit + - commit = build.commit + - status = build.status + + %td + %strong + = link_to build.environment, namespace_project_environment_path(@project.namespace, @project, build.environment), class: "monospace" + + %td.commit-link + = link_to namespace_project_pipeline_path(@project.namespace, @project, commit.id), class: "ci-status ci-#{commit.status}" do + = ci_icon_for_status(commit.status) + %strong ##{commit.id} + + %td.commit-link + = link_to namespace_project_build_path(@project.namespace, @project, build.id), class: "ci-status ci-#{build.status}" do + = ci_icon_for_status(build.status) + %strong ##{build.id} + + %td + %div.branch-commit + - if commit.ref + = link_to commit.ref, namespace_project_commits_path(@project.namespace, @project, commit.ref), class: "monospace" + · + = link_to commit.short_sha, namespace_project_commit_path(@project.namespace, @project, commit.sha), class: "commit-id monospace" + + %p + %span + - if commit_data = commit.commit_data + = link_to_gfm commit_data.title, namespace_project_commit_path(@project.namespace, @project, commit_data.id), class: "commit-row-message" + - else + Cant find HEAD commit for this branch + + %td + - if build.started_at && build.finished_at + %p + %i.fa.fa-clock-o +   + #{duration_in_words(build.finished_at, build.started_at)} + - if build.finished_at + %p + %i.fa.fa-calendar +   + #{time_ago_with_tooltip(build.finished_at)} + + %td + .controls.hidden-xs.pull-right + - manual = commit.builds.latest.manual_actions.to_a + - if manual.any? + .dropdown.inline + %button.dropdown-toggle.btn{type: 'button', 'data-toggle' => 'dropdown'} + = icon('play') + %b.caret + %ul.dropdown-menu.dropdown-menu-align-right + - manual.each do |manual_build| + %li + = link_to '#', rel: 'nofollow' do + %i.fa.fa-play + %span #{manual_build.name} diff --git a/app/views/projects/environments/_header_title.html.haml b/app/views/projects/environments/_header_title.html.haml new file mode 100644 index 00000000000..e056fccad5d --- /dev/null +++ b/app/views/projects/environments/_header_title.html.haml @@ -0,0 +1 @@ +- header_title project_title(@project, "Environments", project_environments_path(@project)) diff --git a/app/views/projects/environments/index.html.haml b/app/views/projects/environments/index.html.haml new file mode 100644 index 00000000000..e94bc97be9d --- /dev/null +++ b/app/views/projects/environments/index.html.haml @@ -0,0 +1,22 @@ +- page_title "Environments" += render "header_title" + +.gray-content-block + Environments for this project + +%ul.content-list + - if @environments.blank? + %li + .nothing-here-block No environments to show + - else + .table-holder + %table.table.builds + %tbody + %th Environment + %th Pipeline ID + %th Build ID + %th Changes + %th + %th + - @environments.each do |build| + = render "environment", build: build diff --git a/app/views/projects/environments/show.html.haml b/app/views/projects/environments/show.html.haml new file mode 100644 index 00000000000..ce2d9cf7d71 --- /dev/null +++ b/app/views/projects/environments/show.html.haml @@ -0,0 +1,30 @@ +- page_title "Environments" + += render "header_title" + +.gray-content-block + Latest deployments for + %strong + = @environment + +%ul.content-list + - if @builds.blank? + %li + .nothing-here-block No builds to show for specific environment + - else + .table-holder + %table.table.builds + %thead + %tr + %th Status + %th Build ID + %th Commit + %th Ref + %th Name + %th Duration + %th Finished at + %th + + = render @builds, commit_sha: true, ref: true, allow_retry: true + + = paginate @builds, theme: 'gitlab' -- cgit v1.2.1 From 907c0e6796b69f9577c147dd489cf55748c749ac Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Fri, 10 Jun 2016 23:36:54 +0200 Subject: Added initial version of deployments --- .../projects/deployments/_deployment.html.haml | 32 ++++++++++ .../projects/environments/_environment.html.haml | 68 +++++++--------------- app/views/projects/environments/index.html.haml | 38 ++++++------ app/views/projects/environments/show.html.haml | 46 +++++++-------- app/views/projects/pipelines/_head.html.haml | 6 ++ 5 files changed, 99 insertions(+), 91 deletions(-) create mode 100644 app/views/projects/deployments/_deployment.html.haml (limited to 'app/views/projects') diff --git a/app/views/projects/deployments/_deployment.html.haml b/app/views/projects/deployments/_deployment.html.haml new file mode 100644 index 00000000000..363c394d6d3 --- /dev/null +++ b/app/views/projects/deployments/_deployment.html.haml @@ -0,0 +1,32 @@ +%tr.deployment + %td + %strong= "##{environment.id}" + + %td + %div.branch-commit + - if deployment.ref + = link_to last.ref, namespace_project_commits_path(@project.namespace, @project, deployment.ref), class: "monospace" + · + = link_to deployment.short_sha, namespace_project_commit_path(@project.namespace, @project, deployment.sha), class: "commit-id monospace" + + %p + %span + - if commit_title = deployment.commit_title + = link_to_gfm commit_title, namespace_project_commit_path(@project.namespace, @project, deployment.sha), class: "commit-row-message" + - else + Cant find HEAD commit for this branch + + %td + - if deployment.deployable + = link_to [@project.namespace.becomes(Namespace), @project, deployment.deployable], class: "monospace" do + = "#{deployment.deployable.name} (##{deployment.deployable.id})" + + %td + %p + %i.fa.fa-calendar +   + #{time_ago_with_tooltip(deployment.created_at)} + + %td + - if can?(current_user, :update_deployment, @project) && deployment.deployable + = link_to [@project.namespace.becomes(Namespace), @project, deployment.deployable, :retry], method: :post, title: 'Retry', class: 'btn btn-build' diff --git a/app/views/projects/environments/_environment.html.haml b/app/views/projects/environments/_environment.html.haml index e3216aea6cd..a4c88fface2 100644 --- a/app/views/projects/environments/_environment.html.haml +++ b/app/views/projects/environments/_environment.html.haml @@ -1,58 +1,32 @@ -%tr.commit - - commit = build.commit - - status = build.status +- last_deployment = environment.last_deployment +%tr.environment %td %strong - = link_to build.environment, namespace_project_environment_path(@project.namespace, @project, build.environment), class: "monospace" - - %td.commit-link - = link_to namespace_project_pipeline_path(@project.namespace, @project, commit.id), class: "ci-status ci-#{commit.status}" do - = ci_icon_for_status(commit.status) - %strong ##{commit.id} - - %td.commit-link - = link_to namespace_project_build_path(@project.namespace, @project, build.id), class: "ci-status ci-#{build.status}" do - = ci_icon_for_status(build.status) - %strong ##{build.id} + = link_to environment.name, namespace_project_environment_path(@project.namespace, @project, environment), class: "monospace" %td - %div.branch-commit - - if commit.ref - = link_to commit.ref, namespace_project_commits_path(@project.namespace, @project, commit.ref), class: "monospace" - · - = link_to commit.short_sha, namespace_project_commit_path(@project.namespace, @project, commit.sha), class: "commit-id monospace" + - if last_deployment + %div.branch-commit + - if last_deployment.ref + = link_to last.ref, namespace_project_commits_path(@project.namespace, @project, last_deployment.ref), class: "monospace" + · + = link_to last_deployment.short_sha, namespace_project_commit_path(@project.namespace, @project, last_deployment.sha), class: "commit-id monospace" + %p + %span + - if commit_title = last_deployment.commit_title + = link_to_gfm commit_title, namespace_project_commit_path(@project.namespace, @project, last_deployment.sha), class: "commit-row-message" + - else + Cant find HEAD commit for this branch + - else %p - %span - - if commit_data = commit.commit_data - = link_to_gfm commit_data.title, namespace_project_commit_path(@project.namespace, @project, commit_data.id), class: "commit-row-message" - - else - Cant find HEAD commit for this branch + No deployments yet %td - - if build.started_at && build.finished_at - %p - %i.fa.fa-clock-o -   - #{duration_in_words(build.finished_at, build.started_at)} - - if build.finished_at - %p - %i.fa.fa-calendar -   - #{time_ago_with_tooltip(build.finished_at)} + %p + %i.fa.fa-calendar +   + #{time_ago_with_tooltip(last_deployment.created_at)} %td - .controls.hidden-xs.pull-right - - manual = commit.builds.latest.manual_actions.to_a - - if manual.any? - .dropdown.inline - %button.dropdown-toggle.btn{type: 'button', 'data-toggle' => 'dropdown'} - = icon('play') - %b.caret - %ul.dropdown-menu.dropdown-menu-align-right - - manual.each do |manual_build| - %li - = link_to '#', rel: 'nofollow' do - %i.fa.fa-play - %span #{manual_build.name} diff --git a/app/views/projects/environments/index.html.haml b/app/views/projects/environments/index.html.haml index e94bc97be9d..40d35ef3881 100644 --- a/app/views/projects/environments/index.html.haml +++ b/app/views/projects/environments/index.html.haml @@ -1,22 +1,22 @@ +- @no_container = true - page_title "Environments" -= render "header_title" += render "projects/pipelines/head" -.gray-content-block - Environments for this project +%div{ class: (container_class) } + .gray-content-block + Environments for this project -%ul.content-list - - if @environments.blank? - %li - .nothing-here-block No environments to show - - else - .table-holder - %table.table.builds - %tbody - %th Environment - %th Pipeline ID - %th Build ID - %th Changes - %th - %th - - @environments.each do |build| - = render "environment", build: build + %ul.content-list + - if @environments.blank? + %li + .nothing-here-block No environments to show + - else + .table-holder + %table.table.builds + %tbody + %th Environment + %th Last deployment + %th Date + %th + - @environments.each do |environment| + = render 'environment', environment: environment diff --git a/app/views/projects/environments/show.html.haml b/app/views/projects/environments/show.html.haml index ce2d9cf7d71..de5e686044f 100644 --- a/app/views/projects/environments/show.html.haml +++ b/app/views/projects/environments/show.html.haml @@ -1,30 +1,26 @@ +- @no_container = true - page_title "Environments" += render "projects/pipelines/head" -= render "header_title" +%div{ class: (container_class) } + .gray-content-block + Latest deployments for + %strong= @environment.name -.gray-content-block - Latest deployments for - %strong - = @environment + %ul.content-list + - if @deployments.blank? + %li + .nothing-here-block No deployment for specific environment + - else + .table-holder + %table.table.builds + %thead + %tr + %th Commit + %th Context + %th Date + %th -%ul.content-list - - if @builds.blank? - %li - .nothing-here-block No builds to show for specific environment - - else - .table-holder - %table.table.builds - %thead - %tr - %th Status - %th Build ID - %th Commit - %th Ref - %th Name - %th Duration - %th Finished at - %th + = render @deployments - = render @builds, commit_sha: true, ref: true, allow_retry: true - - = paginate @builds, theme: 'gitlab' + = paginate @deployments, theme: 'gitlab' diff --git a/app/views/projects/pipelines/_head.html.haml b/app/views/projects/pipelines/_head.html.haml index f278d4e0538..3562d91dfbd 100644 --- a/app/views/projects/pipelines/_head.html.haml +++ b/app/views/projects/pipelines/_head.html.haml @@ -13,3 +13,9 @@ %span Builds %span.badge.count.builds_counter= number_with_delimiter(@project.running_or_pending_build_count) + + - if project_nav_tab? :environments + = nav_link(controller: %w(environments)) do + = link_to project_environments_path(@project), title: 'Environments', class: 'shortcuts-environments' do + %span + Environments -- cgit v1.2.1 From 4f00b93ddd07d8a31a04b37dbe150340e84ccfd8 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Sat, 11 Jun 2016 00:15:53 +0200 Subject: Add deployment views --- app/views/projects/deployments/_deployment.html.haml | 14 ++++++-------- app/views/projects/environments/_environment.html.haml | 9 ++++----- app/views/projects/environments/index.html.haml | 11 +++++++---- app/views/projects/environments/new.html.haml | 15 +++++++++++++++ app/views/projects/environments/show.html.haml | 15 ++++++++++----- app/views/projects/pipelines/_head.html.haml | 1 + 6 files changed, 43 insertions(+), 22 deletions(-) create mode 100644 app/views/projects/environments/new.html.haml (limited to 'app/views/projects') diff --git a/app/views/projects/deployments/_deployment.html.haml b/app/views/projects/deployments/_deployment.html.haml index 363c394d6d3..539c297cad3 100644 --- a/app/views/projects/deployments/_deployment.html.haml +++ b/app/views/projects/deployments/_deployment.html.haml @@ -1,11 +1,11 @@ %tr.deployment %td - %strong= "##{environment.id}" + %strong= "##{deployment.iid}" %td %div.branch-commit - if deployment.ref - = link_to last.ref, namespace_project_commits_path(@project.namespace, @project, deployment.ref), class: "monospace" + = link_to deployment.ref, namespace_project_commits_path(@project.namespace, @project, deployment.ref), class: "monospace" · = link_to deployment.short_sha, namespace_project_commit_path(@project.namespace, @project, deployment.sha), class: "commit-id monospace" @@ -18,15 +18,13 @@ %td - if deployment.deployable - = link_to [@project.namespace.becomes(Namespace), @project, deployment.deployable], class: "monospace" do + = link_to namespace_project_build_path(@project.namespace, @project, deployment.deployable), class: "monospace" do = "#{deployment.deployable.name} (##{deployment.deployable.id})" %td - %p - %i.fa.fa-calendar -   - #{time_ago_with_tooltip(deployment.created_at)} + #{time_ago_with_tooltip(deployment.created_at)} %td - if can?(current_user, :update_deployment, @project) && deployment.deployable - = link_to [@project.namespace.becomes(Namespace), @project, deployment.deployable, :retry], method: :post, title: 'Retry', class: 'btn btn-build' + .pull-right + = link_to 'Retry', retry_namespace_project_build_path(@project.namespace, @project, deployment.deployable), method: :post, class: 'btn btn-build' diff --git a/app/views/projects/environments/_environment.html.haml b/app/views/projects/environments/_environment.html.haml index a4c88fface2..16d04832e1a 100644 --- a/app/views/projects/environments/_environment.html.haml +++ b/app/views/projects/environments/_environment.html.haml @@ -9,7 +9,7 @@ - if last_deployment %div.branch-commit - if last_deployment.ref - = link_to last.ref, namespace_project_commits_path(@project.namespace, @project, last_deployment.ref), class: "monospace" + = link_to last_deployment.ref, namespace_project_commits_path(@project.namespace, @project, last_deployment.ref), class: "monospace" · = link_to last_deployment.short_sha, namespace_project_commit_path(@project.namespace, @project, last_deployment.sha), class: "commit-id monospace" @@ -24,9 +24,8 @@ No deployments yet %td - %p - %i.fa.fa-calendar -   - #{time_ago_with_tooltip(last_deployment.created_at)} + - if last_deployment + %p + #{time_ago_with_tooltip(last_deployment.created_at)} %td diff --git a/app/views/projects/environments/index.html.haml b/app/views/projects/environments/index.html.haml index 40d35ef3881..2da8d068e9f 100644 --- a/app/views/projects/environments/index.html.haml +++ b/app/views/projects/environments/index.html.haml @@ -3,16 +3,19 @@ = render "projects/pipelines/head" %div{ class: (container_class) } - .gray-content-block - Environments for this project + - if can?(current_user, :create_environment, @project) + .top-area + .nav-controls + = link_to new_namespace_project_environment_path(@project.namespace, @project), class: 'btn btn-create' do + New environment - %ul.content-list + %ul.content-list.environments - if @environments.blank? %li .nothing-here-block No environments to show - else .table-holder - %table.table.builds + %table.table %tbody %th Environment %th Last deployment diff --git a/app/views/projects/environments/new.html.haml b/app/views/projects/environments/new.html.haml new file mode 100644 index 00000000000..5e8bc596f1e --- /dev/null +++ b/app/views/projects/environments/new.html.haml @@ -0,0 +1,15 @@ +- page_title "New Environment" + +%h3.page-title + New Environment +%hr + += form_for @environment, url: namespace_project_environments_path(@project.namespace, @project), html: { id: "new-environment-form", class: "form-horizontal js-new-environment-form js-requires-input" } do |f| + = form_errors(@environment) + .form-group + = f.label :ref, 'Name', class: 'control-label' + .col-sm-10 + = f.text_field :name, required: true, tabindex: 2, class: 'form-control' + .form-actions + = f.submit 'Create', class: 'btn btn-create', tabindex: 3 + = link_to 'Cancel', namespace_project_environments_path(@project.namespace, @project), class: 'btn btn-cancel' diff --git a/app/views/projects/environments/show.html.haml b/app/views/projects/environments/show.html.haml index de5e686044f..dc07ad1a769 100644 --- a/app/views/projects/environments/show.html.haml +++ b/app/views/projects/environments/show.html.haml @@ -3,21 +3,26 @@ = render "projects/pipelines/head" %div{ class: (container_class) } - .gray-content-block - Latest deployments for - %strong= @environment.name + .top-area + .col-md-9 + %h3= @environment.name.titleize + + .col-md-3 + .nav-controls + = link_to 'Destroy', namespace_project_environment_path(@project.namespace, @project, @environment), data: { confirm: 'Are you sure?' }, class: 'btn btn-danger', method: :post %ul.content-list - if @deployments.blank? %li - .nothing-here-block No deployment for specific environment + .nothing-here-block No deployments for #{@environment.name} - else .table-holder %table.table.builds %thead %tr + %th ID %th Commit - %th Context + %th Build %th Date %th diff --git a/app/views/projects/pipelines/_head.html.haml b/app/views/projects/pipelines/_head.html.haml index 3562d91dfbd..8374cb4223d 100644 --- a/app/views/projects/pipelines/_head.html.haml +++ b/app/views/projects/pipelines/_head.html.haml @@ -19,3 +19,4 @@ = link_to project_environments_path(@project), title: 'Environments', class: 'shortcuts-environments' do %span Environments + %span.badge.count.environments_counter= number_with_delimiter(@project.environments.count) -- cgit v1.2.1 From 0fdfd2dd6e01648f4daf6853f11a3ffc9a678a55 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Mon, 23 May 2016 22:59:35 -0700 Subject: Fix Error 500 when viewing a blob with binary characters after the 1024-byte mark Here was the problem: 1. When determining whether a given blob is viewable text, gitlab_git reads the first 1024 bytes and checks with Linguist whether it is a text or binary file. 2. If the blob is text, GitLab will attempt to display it. 3. However, if the text has binary characters after the first 1024 bytes, then GitLab will attempt to load the entire contents, but the encoding will be ASCII-8BIT since there are binary characters. 4. The Error 500 results when GitLab attempts to display a mix UTF-8 and ASCII-8BIT. To fix this, we load as much data as we are willing to display so that the detection will work properly. Requires an update to gitlab_git: gitlab-org/gitlab_git!86 Closes #13826 --- app/views/projects/diffs/_diffs.html.haml | 1 + app/views/projects/diffs/_file.html.haml | 2 ++ 2 files changed, 3 insertions(+) (limited to 'app/views/projects') diff --git a/app/views/projects/diffs/_diffs.html.haml b/app/views/projects/diffs/_diffs.html.haml index d9c4b410d32..6c11afbe420 100644 --- a/app/views/projects/diffs/_diffs.html.haml +++ b/app/views/projects/diffs/_diffs.html.haml @@ -24,6 +24,7 @@ - diff_commit = commit_for_diff(diff_file) - blob = project.repository.blob_for_diff(diff_commit, diff_file) - next unless blob + - blob.load_all_data!(project.repository) unless blob.only_display_raw? = render 'projects/diffs/file', i: index, project: project, diff_file: diff_file, diff_commit: diff_commit, blob: blob, diff_refs: diff_refs diff --git a/app/views/projects/diffs/_file.html.haml b/app/views/projects/diffs/_file.html.haml index e5983c58039..2395ea3c275 100644 --- a/app/views/projects/diffs/_file.html.haml +++ b/app/views/projects/diffs/_file.html.haml @@ -49,6 +49,8 @@ = render "projects/diffs/parallel_view", diff_file: diff_file, project: project, blob: blob, index: i - else = render "projects/diffs/text_file", diff_file: diff_file, index: i + - elsif blob.only_display_raw? + .nothing-here-block This file is too large to display. - elsif blob.image? - old_file = project.repository.prev_blob_for_diff(diff_commit, diff_file) = render "projects/diffs/image", diff_file: diff_file, old_file: old_file, file: blob, index: i, diff_refs: diff_refs -- cgit v1.2.1 From c1f37964ed04e34fd8606d9b2a63f9d6798766f5 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Sun, 12 Jun 2016 19:13:14 -0700 Subject: Fix typo causing related branches to Error 500 --- app/views/projects/issues/_related_branches.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views/projects') diff --git a/app/views/projects/issues/_related_branches.html.haml b/app/views/projects/issues/_related_branches.html.haml index b9bb6fe559d..c6fc499a7b8 100644 --- a/app/views/projects/issues/_related_branches.html.haml +++ b/app/views/projects/issues/_related_branches.html.haml @@ -6,7 +6,7 @@ %li - sha = @project.repository.find_branch(branch).target - pipeline = @project.pipeline(sha, branch) if sha - - if ci_copipelinemmit + - if pipeline %span.related-branch-ci-status = render_pipeline_status(pipeline) %span.related-branch-info -- cgit v1.2.1 From 0e50fa24a5b4ff7665a68da2a1221b5cae9e5633 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 13 Jun 2016 12:32:53 +0300 Subject: Remove counters from Pipeline navigation Signed-off-by: Dmitriy Zaporozhets --- app/views/projects/pipelines/_head.html.haml | 2 -- 1 file changed, 2 deletions(-) (limited to 'app/views/projects') diff --git a/app/views/projects/pipelines/_head.html.haml b/app/views/projects/pipelines/_head.html.haml index f278d4e0538..d0ba0d27d7c 100644 --- a/app/views/projects/pipelines/_head.html.haml +++ b/app/views/projects/pipelines/_head.html.haml @@ -5,11 +5,9 @@ = link_to project_pipelines_path(@project), title: 'Pipelines', class: 'shortcuts-pipelines' do %span Pipelines - %span.badge.count.ci_counter= number_with_delimiter(@project.pipelines.running_or_pending.count) - if project_nav_tab? :builds = nav_link(controller: %w(builds)) do = link_to project_builds_path(@project), title: 'Builds', class: 'shortcuts-builds' do %span Builds - %span.badge.count.builds_counter= number_with_delimiter(@project.running_or_pending_build_count) -- cgit v1.2.1 From aea4041ce96f18afea70da15af3cbe1be4fa1f94 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Wed, 18 May 2016 15:21:51 -0500 Subject: Allow to expire build artifacts --- app/views/projects/builds/_sidebar.html.haml | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'app/views/projects') diff --git a/app/views/projects/builds/_sidebar.html.haml b/app/views/projects/builds/_sidebar.html.haml index 5d931389dfb..d1a0da29ef7 100644 --- a/app/views/projects/builds/_sidebar.html.haml +++ b/app/views/projects/builds/_sidebar.html.haml @@ -44,6 +44,15 @@ %p.build-detail-row %span.build-light-text Erased: #{time_ago_with_tooltip(@build.erased_at)} + - elsif @build.artifacts_expired? + %p.build-detail-row.artifacts-expired.alert.alert-warning + The artifacts were removed #{time_ago_with_tooltip(@build.artifacts_expire_at)} + - elsif @build.artifacts_expire_at + %p.build-detail-row.artifacts-expired.alert.alert-info + The artifacts will be removed at #{time_ago_with_tooltip(@build.artifacts_expire_at)} + .pull-right + = link_to keep_artifacts_namespace_project_build_artifacts_path(@project.namespace, @project, @build), class: 'btn btn-sm btn-primary' do + Keep %p.build-detail-row %span.build-light-text Runner: - if @build.runner && current_user && current_user.admin -- cgit v1.2.1 From ffe8dbde9b2aec2425e7859aeed5ad1642c53938 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Wed, 8 Jun 2016 17:18:54 +0200 Subject: Move keep to ArtifactsController --- app/views/projects/builds/_sidebar.html.haml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'app/views/projects') diff --git a/app/views/projects/builds/_sidebar.html.haml b/app/views/projects/builds/_sidebar.html.haml index d1a0da29ef7..e1fdd7019ff 100644 --- a/app/views/projects/builds/_sidebar.html.haml +++ b/app/views/projects/builds/_sidebar.html.haml @@ -44,15 +44,16 @@ %p.build-detail-row %span.build-light-text Erased: #{time_ago_with_tooltip(@build.erased_at)} - - elsif @build.artifacts_expired? - %p.build-detail-row.artifacts-expired.alert.alert-warning - The artifacts were removed #{time_ago_with_tooltip(@build.artifacts_expire_at)} - - elsif @build.artifacts_expire_at - %p.build-detail-row.artifacts-expired.alert.alert-info - The artifacts will be removed at #{time_ago_with_tooltip(@build.artifacts_expire_at)} - .pull-right - = link_to keep_artifacts_namespace_project_build_artifacts_path(@project.namespace, @project, @build), class: 'btn btn-sm btn-primary' do - Keep + - else + - if @build.artifacts_expired? + .artifacts-expired.alert.alert-warning + The artifacts were removed #{time_ago_with_tooltip(@build.artifacts_expire_at)} + - elsif @build.artifacts_expire_at + .artifacts-expired.alert.alert-warning + The artifacts will be removed in #{duration_in_words(@build.artifacts_expire_at, Time.now)} + .pull-right + = link_to keep_namespace_project_build_artifacts_path(@project.namespace, @project, @build), class: 'btn btn-xs btn-primary', method: :post do + Keep %p.build-detail-row %span.build-light-text Runner: - if @build.runner && current_user && current_user.admin -- cgit v1.2.1 From b9977525394ac714e31c1751690c7b993eb8d830 Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Fri, 10 Jun 2016 16:43:25 +0100 Subject: Only show branches for revert / cherry-pick Tags are immutable, so we can't add a commit to either revert or cherry-pick another commit to them. --- app/views/projects/commit/_change.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views/projects') diff --git a/app/views/projects/commit/_change.html.haml b/app/views/projects/commit/_change.html.haml index 44ef1fdbbe3..d9b800a4ded 100644 --- a/app/views/projects/commit/_change.html.haml +++ b/app/views/projects/commit/_change.html.haml @@ -17,7 +17,7 @@ .form-group.branch = label_tag 'target_branch', target_label, class: 'control-label' .col-sm-10 - = select_tag "target_branch", grouped_options_refs, class: "select2 select2-sm js-target-branch" + = select_tag "target_branch", project_branches, class: "select2 select2-sm js-target-branch" - if can?(current_user, :push_code, @project) .js-create-merge-request-container .checkbox -- cgit v1.2.1 From fab1c4a81b7eef247abe6bdd3775cf0ce42badc1 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Fri, 10 Jun 2016 14:40:25 +0200 Subject: Show the artifacts expiration prompt in Build Artifacts widget --- app/views/projects/builds/_sidebar.html.haml | 35 ++++++++++++++-------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'app/views/projects') diff --git a/app/views/projects/builds/_sidebar.html.haml b/app/views/projects/builds/_sidebar.html.haml index e1fdd7019ff..0741426b5af 100644 --- a/app/views/projects/builds/_sidebar.html.haml +++ b/app/views/projects/builds/_sidebar.html.haml @@ -11,17 +11,28 @@ %p.build-detail-row #{@build.coverage}% - - if can?(current_user, :read_build, @project) && @build.artifacts? + - if can?(current_user, :read_build, @project) && (@build.artifacts? || @build.artifacts_expired?) .block{ class: ("block-first" if !@build.coverage) } .title Build artifacts - .btn-group.btn-group-justified{ role: :group } - = link_to download_namespace_project_build_artifacts_path(@project.namespace, @project, @build), class: 'btn btn-sm btn-default' do - Download + - if @build.artifacts_expired? + .artifacts-expired.alert.alert-warning + The artifacts were removed #{time_ago_with_tooltip(@build.artifacts_expire_at)} + - elsif @build.artifacts_expire_at + .artifacts-expired.alert.alert-warning + The artifacts will be removed in #{time_interval_in_words(@build.artifacts_expire_in)} + - if @build.artifacts? + .btn-group.btn-group-justified{ role: :group } + - if @build.artifacts_expire_at + = link_to keep_namespace_project_build_artifacts_path(@project.namespace, @project, @build), class: 'btn btn-sm btn-default' do + Keep + + = link_to download_namespace_project_build_artifacts_path(@project.namespace, @project, @build), class: 'btn btn-sm btn-default' do + Download - - if @build.artifacts_metadata? - = link_to browse_namespace_project_build_artifacts_path(@project.namespace, @project, @build), class: 'btn btn-sm btn-default' do - Browse + - if @build.artifacts_metadata? + = link_to browse_namespace_project_build_artifacts_path(@project.namespace, @project, @build), class: 'btn btn-sm btn-default' do + Browse .block{ class: ("block-first" if !@build.coverage && !(can?(current_user, :read_build, @project) && @build.artifacts?)) } .title @@ -44,16 +55,6 @@ %p.build-detail-row %span.build-light-text Erased: #{time_ago_with_tooltip(@build.erased_at)} - - else - - if @build.artifacts_expired? - .artifacts-expired.alert.alert-warning - The artifacts were removed #{time_ago_with_tooltip(@build.artifacts_expire_at)} - - elsif @build.artifacts_expire_at - .artifacts-expired.alert.alert-warning - The artifacts will be removed in #{duration_in_words(@build.artifacts_expire_at, Time.now)} - .pull-right - = link_to keep_namespace_project_build_artifacts_path(@project.namespace, @project, @build), class: 'btn btn-xs btn-primary', method: :post do - Keep %p.build-detail-row %span.build-light-text Runner: - if @build.runner && current_user && current_user.admin -- cgit v1.2.1 From 304979f89777f4aca52b382fdbe3a593dc7e50f3 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Fri, 10 Jun 2016 15:11:53 +0200 Subject: Allow to show the time in the future --- app/views/projects/builds/_sidebar.html.haml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'app/views/projects') diff --git a/app/views/projects/builds/_sidebar.html.haml b/app/views/projects/builds/_sidebar.html.haml index 0741426b5af..14571145313 100644 --- a/app/views/projects/builds/_sidebar.html.haml +++ b/app/views/projects/builds/_sidebar.html.haml @@ -16,11 +16,14 @@ .title Build artifacts - if @build.artifacts_expired? - .artifacts-expired.alert.alert-warning - The artifacts were removed #{time_ago_with_tooltip(@build.artifacts_expire_at)} + %p + The artifacts were removed + #{time_ago_with_tooltip(@build.artifacts_expire_at)} - elsif @build.artifacts_expire_at - .artifacts-expired.alert.alert-warning - The artifacts will be removed in #{time_interval_in_words(@build.artifacts_expire_in)} + %p + The artifacts will be removed in + #{time_ago_with_tooltip(@build.artifacts_expire_at)} + - if @build.artifacts? .btn-group.btn-group-justified{ role: :group } - if @build.artifacts_expire_at -- cgit v1.2.1 From 9281709b41ce5be5637194cda191a6dd76ddd495 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Fri, 10 Jun 2016 20:40:25 +0100 Subject: Added missing span element around time --- app/views/projects/builds/_sidebar.html.haml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/views/projects') diff --git a/app/views/projects/builds/_sidebar.html.haml b/app/views/projects/builds/_sidebar.html.haml index 14571145313..af69490019d 100644 --- a/app/views/projects/builds/_sidebar.html.haml +++ b/app/views/projects/builds/_sidebar.html.haml @@ -16,13 +16,13 @@ .title Build artifacts - if @build.artifacts_expired? - %p + %p.build-detail-row The artifacts were removed #{time_ago_with_tooltip(@build.artifacts_expire_at)} - elsif @build.artifacts_expire_at - %p + %p.build-detail-row The artifacts will be removed in - #{time_ago_with_tooltip(@build.artifacts_expire_at)} + %span.js-artifacts-remove= @build.artifacts_expire_at - if @build.artifacts? .btn-group.btn-group-justified{ role: :group } -- cgit v1.2.1 From b0b1b85d7197b211c472779c07410de70b39e548 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Mon, 13 Jun 2016 11:12:38 +0100 Subject: Fixed spacing with row below in build sidebar --- app/views/projects/builds/_sidebar.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views/projects') diff --git a/app/views/projects/builds/_sidebar.html.haml b/app/views/projects/builds/_sidebar.html.haml index af69490019d..7127acf388b 100644 --- a/app/views/projects/builds/_sidebar.html.haml +++ b/app/views/projects/builds/_sidebar.html.haml @@ -37,7 +37,7 @@ = link_to browse_namespace_project_build_artifacts_path(@project.namespace, @project, @build), class: 'btn btn-sm btn-default' do Browse - .block{ class: ("block-first" if !@build.coverage && !(can?(current_user, :read_build, @project) && @build.artifacts?)) } + .block{ class: ("block-first" if !@build.coverage && !(can?(current_user, :read_build, @project) && (@build.artifacts? || @build.artifacts_expired?))) } .title Build details - if @build.retryable? -- cgit v1.2.1 From 22e97dd702182aa51586972bb54861ee8b19846b Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Wed, 8 Jun 2016 17:04:41 +0100 Subject: Fixed issue with MR buttons being in a group Also removed some inline code --- .../merge_requests/widget/_merged.html.haml | 59 ++++++++-------------- .../merge_requests/widget/_merged_buttons.haml | 4 +- 2 files changed, 23 insertions(+), 40 deletions(-) (limited to 'app/views/projects') diff --git a/app/views/projects/merge_requests/widget/_merged.html.haml b/app/views/projects/merge_requests/widget/_merged.html.haml index ec4beae9727..19b5d0ff066 100644 --- a/app/views/projects/merge_requests/widget/_merged.html.haml +++ b/app/views/projects/merge_requests/widget/_merged.html.haml @@ -6,46 +6,29 @@ - if @merge_request.merge_event by #{link_to_member(@project, @merge_request.merge_event.author, avatar: true)} #{time_ago_with_tooltip(@merge_request.merge_event.created_at)} - %div - - if !@merge_request.source_branch_exists? || (params[:delete_source] == 'true') + - if !@merge_request.source_branch_exists? || (params[:delete_source] == 'true') + %p + The changes were merged into + #{link_to @merge_request.target_branch, namespace_project_commits_path(@project.namespace, @project, @merge_request.target_branch), class: "label-branch"}. + The source branch has been removed. + = render 'projects/merge_requests/widget/merged_buttons' + - elsif @merge_request.can_remove_source_branch?(current_user) + .remove_source_branch_widget %p The changes were merged into #{link_to @merge_request.target_branch, namespace_project_commits_path(@project.namespace, @project, @merge_request.target_branch), class: "label-branch"}. - The source branch has been removed. - = render 'projects/merge_requests/widget/merged_buttons' - - elsif @merge_request.can_remove_source_branch?(current_user) - .remove_source_branch_widget - %p - The changes were merged into - #{link_to @merge_request.target_branch, namespace_project_commits_path(@project.namespace, @project, @merge_request.target_branch), class: "label-branch"}. - You can remove the source branch now. - = render 'projects/merge_requests/widget/merged_buttons', source_branch_exists: true - .remove_source_branch_widget.failed.hide - %p - Failed to remove source branch '#{@merge_request.source_branch}'. - - .remove_source_branch_in_progress.hide - %p - = icon('spinner spin') - Removing source branch '#{@merge_request.source_branch}'. Please wait, this page will be automatically reloaded. - - :javascript - $('.remove_source_branch').on('click', function() { - $('.remove_source_branch_widget').hide(); - $('.remove_source_branch_in_progress').show(); - }); - - $(".remove_source_branch").on("ajax:success", function (e, data, status, xhr) { - location.reload(); - }); + You can remove the source branch now. + = render 'projects/merge_requests/widget/merged_buttons', source_branch_exists: true + .remove_source_branch_widget.failed.hide + %p + Failed to remove source branch '#{@merge_request.source_branch}'. - $(".remove_source_branch").on("ajax:error", function (e, data, status, xhr) { - $('.remove_source_branch_widget').hide(); - $('.remove_source_branch_in_progress').hide(); - $('.remove_source_branch_widget.failed').show(); - }); - - else + .remove_source_branch_in_progress.hide %p - The changes were merged into - #{link_to @merge_request.target_branch, namespace_project_commits_path(@project.namespace, @project, @merge_request.target_branch), class: "label-branch"}. - = render 'projects/merge_requests/widget/merged_buttons' + = icon('spinner spin') + Removing source branch '#{@merge_request.source_branch}'. Please wait, this page will be automatically reloaded. + - else + %p + The changes were merged into + #{link_to @merge_request.target_branch, namespace_project_commits_path(@project.namespace, @project, @merge_request.target_branch), class: "label-branch"}. + = render 'projects/merge_requests/widget/merged_buttons' diff --git a/app/views/projects/merge_requests/widget/_merged_buttons.haml b/app/views/projects/merge_requests/widget/_merged_buttons.haml index 56167509af9..d836a253507 100644 --- a/app/views/projects/merge_requests/widget/_merged_buttons.haml +++ b/app/views/projects/merge_requests/widget/_merged_buttons.haml @@ -3,9 +3,9 @@ - mr_can_be_cherry_picked = @merge_request.can_be_cherry_picked? - if can_remove_source_branch || mr_can_be_reverted || mr_can_be_cherry_picked - .btn-group + .clearfix.merged-buttons - if can_remove_source_branch - = link_to namespace_project_branch_path(@merge_request.source_project.namespace, @merge_request.source_project, @merge_request.source_branch), remote: true, method: :delete, class: "btn btn-default btn-grouped btn-sm remove_source_branch" do + = link_to namespace_project_branch_path(@merge_request.source_project.namespace, @merge_request.source_project, @merge_request.source_branch), remote: true, method: :delete, class: "btn btn-default btn-sm remove_source_branch" do = icon('trash-o') Remove Source Branch - if mr_can_be_reverted -- cgit v1.2.1 From 672aec4a2da36d9ee755156be4a907f4b8d96347 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Mon, 13 Jun 2016 15:00:51 +0100 Subject: Improved views --- .../projects/environments/_environment.html.haml | 4 +-- app/views/projects/environments/index.html.haml | 27 ++++++++--------- app/views/projects/environments/new.html.haml | 24 +++++++-------- app/views/projects/environments/show.html.haml | 35 +++++++++++----------- 4 files changed, 44 insertions(+), 46 deletions(-) (limited to 'app/views/projects') diff --git a/app/views/projects/environments/_environment.html.haml b/app/views/projects/environments/_environment.html.haml index 16d04832e1a..5ca57bd153d 100644 --- a/app/views/projects/environments/_environment.html.haml +++ b/app/views/projects/environments/_environment.html.haml @@ -3,7 +3,7 @@ %tr.environment %td %strong - = link_to environment.name, namespace_project_environment_path(@project.namespace, @project, environment), class: "monospace" + = link_to environment.name, namespace_project_environment_path(@project.namespace, @project, environment) %td - if last_deployment @@ -27,5 +27,3 @@ - if last_deployment %p #{time_ago_with_tooltip(last_deployment.created_at)} - - %td diff --git a/app/views/projects/environments/index.html.haml b/app/views/projects/environments/index.html.haml index 2da8d068e9f..4a445a157ec 100644 --- a/app/views/projects/environments/index.html.haml +++ b/app/views/projects/environments/index.html.haml @@ -9,17 +9,16 @@ = link_to new_namespace_project_environment_path(@project.namespace, @project), class: 'btn btn-create' do New environment - %ul.content-list.environments - - if @environments.blank? - %li - .nothing-here-block No environments to show - - else - .table-holder - %table.table - %tbody - %th Environment - %th Last deployment - %th Date - %th - - @environments.each do |environment| - = render 'environment', environment: environment + - if @environments.blank? + %ul.content-list.environments + %li.nothing-here-block + No environments to show + - else + .table-holder + %table.table + %tbody + %th Environment + %th Last deployment + %th Date + - @environments.each do |environment| + = render 'environment', environment: environment diff --git a/app/views/projects/environments/new.html.haml b/app/views/projects/environments/new.html.haml index 5e8bc596f1e..c7abac6e49f 100644 --- a/app/views/projects/environments/new.html.haml +++ b/app/views/projects/environments/new.html.haml @@ -1,15 +1,15 @@ - page_title "New Environment" += render "projects/pipelines/head" -%h3.page-title - New Environment -%hr +.row.prepend-top-default.append-bottom-default + .col-lg-3 + %h4.prepend-top-0 + New Environment -= form_for @environment, url: namespace_project_environments_path(@project.namespace, @project), html: { id: "new-environment-form", class: "form-horizontal js-new-environment-form js-requires-input" } do |f| - = form_errors(@environment) - .form-group - = f.label :ref, 'Name', class: 'control-label' - .col-sm-10 - = f.text_field :name, required: true, tabindex: 2, class: 'form-control' - .form-actions - = f.submit 'Create', class: 'btn btn-create', tabindex: 3 - = link_to 'Cancel', namespace_project_environments_path(@project.namespace, @project), class: 'btn btn-cancel' + = form_for @environment, url: namespace_project_environments_path(@project.namespace, @project), html: { id: "new-environment-form", class: "col-lg-9 js-new-environment-form js-requires-input" } do |f| + = form_errors(@environment) + .form-group + = f.label :ref, 'Environment name', class: 'label-light' + = f.text_field :name, required: true, class: 'form-control' + = f.submit 'Create environment', class: 'btn btn-create' + = link_to "Cancel", namespace_project_environments_path(@project.namespace, @project), class: "btn btn-cancel" diff --git a/app/views/projects/environments/show.html.haml b/app/views/projects/environments/show.html.haml index dc07ad1a769..f5e30d75b42 100644 --- a/app/views/projects/environments/show.html.haml +++ b/app/views/projects/environments/show.html.haml @@ -9,23 +9,24 @@ .col-md-3 .nav-controls - = link_to 'Destroy', namespace_project_environment_path(@project.namespace, @project, @environment), data: { confirm: 'Are you sure?' }, class: 'btn btn-danger', method: :post + = link_to 'Destroy', namespace_project_environment_path(@project.namespace, @project, @environment), data: { confirm: 'Are you sure?' }, class: 'btn btn-danger', method: :delete - %ul.content-list - - if @deployments.blank? - %li - .nothing-here-block No deployments for #{@environment.name} - - else - .table-holder - %table.table.builds - %thead - %tr - %th ID - %th Commit - %th Build - %th Date - %th + - if @deployments.blank? + %ul.content-list + %li.nothing-here-block + No deployments for + %strong= @environment.name + - else + .table-holder + %table.table.builds + %thead + %tr + %th ID + %th Commit + %th Build + %th Date + %th - = render @deployments + = render @deployments - = paginate @deployments, theme: 'gitlab' + = paginate @deployments, theme: 'gitlab' -- cgit v1.2.1 From 278a0e1a0fb094dc2eceec0d82d9a56be81c8046 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Mon, 13 Jun 2016 19:19:11 +0200 Subject: Fix keep action of build artifacts widget --- app/views/projects/builds/_sidebar.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views/projects') diff --git a/app/views/projects/builds/_sidebar.html.haml b/app/views/projects/builds/_sidebar.html.haml index 7127acf388b..cab21f0cf19 100644 --- a/app/views/projects/builds/_sidebar.html.haml +++ b/app/views/projects/builds/_sidebar.html.haml @@ -27,7 +27,7 @@ - if @build.artifacts? .btn-group.btn-group-justified{ role: :group } - if @build.artifacts_expire_at - = link_to keep_namespace_project_build_artifacts_path(@project.namespace, @project, @build), class: 'btn btn-sm btn-default' do + = link_to keep_namespace_project_build_artifacts_path(@project.namespace, @project, @build), class: 'btn btn-sm btn-default', method: :post do Keep = link_to download_namespace_project_build_artifacts_path(@project.namespace, @project, @build), class: 'btn btn-sm btn-default' do -- cgit v1.2.1 From a9dd1beea414e4160fe7b25539c1a3fbd6606d10 Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Date: Mon, 13 Jun 2016 14:30:40 -0500 Subject: Remove div between ul and li --- app/views/projects/commits/_head.html.haml | 4 ++-- app/views/projects/issues/_head.html.haml | 4 ++-- app/views/projects/pipelines/_head.html.haml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'app/views/projects') diff --git a/app/views/projects/commits/_head.html.haml b/app/views/projects/commits/_head.html.haml index a72e8ba73ad..c8aa849c217 100644 --- a/app/views/projects/commits/_head.html.haml +++ b/app/views/projects/commits/_head.html.haml @@ -1,6 +1,6 @@ .scrolling-tabs-container - %ul.nav-links.sub-nav.scrolling-tabs - %div{ class: (container_class) } + .nav-links.sub-nav.scrolling-tabs + %ul{ class: (container_class) } .fade-left = nav_link(controller: %w(tree blob blame edit_tree new_tree find_file)) do = link_to project_files_path(@project) do diff --git a/app/views/projects/issues/_head.html.haml b/app/views/projects/issues/_head.html.haml index 166dae248b6..403adb7426b 100644 --- a/app/views/projects/issues/_head.html.haml +++ b/app/views/projects/issues/_head.html.haml @@ -1,5 +1,5 @@ -%ul.nav-links.sub-nav - %div{ class: (container_class) } +.nav-links.sub-nav + %ul{ class: (container_class) } - if project_nav_tab?(:issues) && !current_controller?(:merge_requests) = nav_link(controller: :issues) do = link_to url_for_project_issues(@project, only_path: true), title: 'Issues' do diff --git a/app/views/projects/pipelines/_head.html.haml b/app/views/projects/pipelines/_head.html.haml index d0ba0d27d7c..fcaf8c0b013 100644 --- a/app/views/projects/pipelines/_head.html.haml +++ b/app/views/projects/pipelines/_head.html.haml @@ -1,5 +1,5 @@ -%ul.nav-links.sub-nav - %div{ class: (container_class) } +.nav-links.sub-nav + %ul{ class: (container_class) } - if project_nav_tab? :pipelines = nav_link(controller: :pipelines) do = link_to project_pipelines_path(@project), title: 'Pipelines', class: 'shortcuts-pipelines' do -- cgit v1.2.1 From 17c22156c5fa5663aae65178ed38cbeef9a80b7e Mon Sep 17 00:00:00 2001 From: David Alexander Date: Mon, 14 Mar 2016 09:13:35 -0400 Subject: Initial implementation of user access request to projects --- .../projects/project_members/_pending.html.haml | 21 +++++++++++++++++++++ .../project_members/_project_member.html.haml | 15 +++++++++++++-- app/views/projects/project_members/index.html.haml | 3 ++- 3 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 app/views/projects/project_members/_pending.html.haml (limited to 'app/views/projects') diff --git a/app/views/projects/project_members/_pending.html.haml b/app/views/projects/project_members/_pending.html.haml new file mode 100644 index 00000000000..88ac36937ac --- /dev/null +++ b/app/views/projects/project_members/_pending.html.haml @@ -0,0 +1,21 @@ +.panel.panel-default + .panel-heading + %strong #{@project.name} + candidates + %small + (#{members.count}) + .controls + = form_tag namespace_project_project_members_path(@project.namespace, @project), method: :get, class: 'form-inline member-search-form' do + .form-group + = search_field_tag :search, params[:search], { placeholder: 'Find existing member by name', class: 'form-control', spellcheck: false } + = button_tag class: 'btn', title: 'Search' do + = icon("search") + %ul.content-list + - members.each do |project_member| + = render 'project_member', member: project_member + +:javascript + $('form.member-search-form').on('submit', function (event) { + event.preventDefault(); + Turbolinks.visit(this.action + '?' + $(this).serialize()); + }); diff --git a/app/views/projects/project_members/_project_member.html.haml b/app/views/projects/project_members/_project_member.html.haml index 268f140d7db..3faf5dba8a2 100644 --- a/app/views/projects/project_members/_project_member.html.haml +++ b/app/views/projects/project_members/_project_member.html.haml @@ -13,6 +13,9 @@ - if user.blocked? %label.label.label-danger %strong Blocked + - if member.request? + %span.label.label-info + Pending Approval - else = image_tag avatar_icon(member.invite_email, 24), class: "avatar s24", alt: '' %strong @@ -27,7 +30,6 @@ - if can?(current_user, :admin_project_member, @project) = link_to resend_invite_namespace_project_project_member_path(@project.namespace, @project, member), method: :post, class: "btn-xs btn", title: 'Resend invite' do Resend invite - - if can?(current_user, :admin_project_member, @project) .pull-right %strong= member.human_access @@ -35,10 +37,19 @@ = button_tag class: "btn-xs btn-grouped inline btn js-toggle-button", title: 'Edit access level', type: 'button' do = icon('pencil') + - if member.request? +   + = link_to approval_namespace_project_project_member_path(@project.namespace, @project, member), + class: "btn-xs btn btn-success", + title: 'Grant access', type: 'button' do + %i.fa.fa-check.fa-inverse - if can?(current_user, :destroy_project_member, member)   - - if current_user == user + - if member.request? + = link_to namespace_project_project_member_path(@project.namespace, @project, member), data: { confirm: remove_from_project_team_message(@project, member) }, method: :delete, class: "btn-xs btn btn-remove", title: 'Deny access' do + %i.fa.fa-times.fa-inverse + - elsif current_user == user = link_to leave_namespace_project_project_members_path(@project.namespace, @project), data: { confirm: leave_project_message(@project) }, method: :delete, class: "btn-xs btn btn-remove", title: 'Leave project' do = icon("sign-out") Leave diff --git a/app/views/projects/project_members/index.html.haml b/app/views/projects/project_members/index.html.haml index 15dc064e7ea..d5a19799c49 100644 --- a/app/views/projects/project_members/index.html.haml +++ b/app/views/projects/project_members/index.html.haml @@ -12,8 +12,9 @@ %p.light Users with access to this project are listed below. = render "new_project_member" + = render "pending", members: @project_members.request - = render "team", members: @project_members + = render "team", members: @project_members.non_request - if @group = render "group_members", members: @group_members -- cgit v1.2.1 From d26f81239a33b80694783ee35f0da0e2ed082c9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Mon, 18 Apr 2016 18:53:32 +0200 Subject: Add request access for groups MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- app/views/projects/notes/_note.html.haml | 2 +- .../project_members/_group_members.html.haml | 13 +++-- .../project_members/_new_project_member.html.haml | 2 +- .../projects/project_members/_pending.html.haml | 21 ------- .../project_members/_project_member.html.haml | 66 ---------------------- .../_shared_group_members.html.haml | 6 +- app/views/projects/project_members/_team.html.haml | 3 +- app/views/projects/project_members/index.html.haml | 3 +- 8 files changed, 18 insertions(+), 98 deletions(-) delete mode 100644 app/views/projects/project_members/_pending.html.haml delete mode 100644 app/views/projects/project_members/_project_member.html.haml (limited to 'app/views/projects') diff --git a/app/views/projects/notes/_note.html.haml b/app/views/projects/notes/_note.html.haml index bcdbff08011..112a532f9d3 100644 --- a/app/views/projects/notes/_note.html.haml +++ b/app/views/projects/notes/_note.html.haml @@ -17,7 +17,7 @@ %a{ href: "##{dom_id(note)}" } = time_ago_with_tooltip(note.created_at, placement: 'bottom', html_class: 'note-created-ago') .note-actions - - access = note.project.team.human_max_access(note.author.id) + - access = max_access_level(note.project, note.author) - if access %span.note-role.hidden-xs= access - if current_user diff --git a/app/views/projects/project_members/_group_members.html.haml b/app/views/projects/project_members/_group_members.html.haml index 6671ee2c6d6..78c12d52a78 100644 --- a/app/views/projects/project_members/_group_members.html.haml +++ b/app/views/projects/project_members/_group_members.html.haml @@ -9,8 +9,13 @@ = link_to group_group_members_path(@group), class: 'btn' do Manage group members %ul.content-list - - members.limit(20).each do |member| - = render 'groups/group_members/group_member', member: member, show_controls: false - - if members.count > 20 + = render partial: 'shared/members/member', + collection: members.limit(20), + as: :member, + locals: { show_controls: false } + - if members.size > 20 %li - and #{members.count - 20} more. For full list visit #{link_to 'group members page', group_group_members_path(@group)} + and + = members.size - 20 + more. For full list visit + = link_to 'group members page', group_group_members_path(@group) diff --git a/app/views/projects/project_members/_new_project_member.html.haml b/app/views/projects/project_members/_new_project_member.html.haml index f0f3bb3c177..82892a33358 100644 --- a/app/views/projects/project_members/_new_project_member.html.haml +++ b/app/views/projects/project_members/_new_project_member.html.haml @@ -9,7 +9,7 @@ .form-group = f.label :access_level, "Project Access", class: 'control-label' .col-sm-10 - = select_tag :access_level, options_for_select(ProjectMember.access_roles, @project_member.access_level), class: "project-access-select select2" + = select_tag :access_level, options_for_select(ProjectMember.access_level_roles, @project_member.access_level), class: "project-access-select select2" .help-block Read more about role permissions %strong= link_to "here", help_page_path("permissions", "permissions"), class: "vlink" diff --git a/app/views/projects/project_members/_pending.html.haml b/app/views/projects/project_members/_pending.html.haml deleted file mode 100644 index 88ac36937ac..00000000000 --- a/app/views/projects/project_members/_pending.html.haml +++ /dev/null @@ -1,21 +0,0 @@ -.panel.panel-default - .panel-heading - %strong #{@project.name} - candidates - %small - (#{members.count}) - .controls - = form_tag namespace_project_project_members_path(@project.namespace, @project), method: :get, class: 'form-inline member-search-form' do - .form-group - = search_field_tag :search, params[:search], { placeholder: 'Find existing member by name', class: 'form-control', spellcheck: false } - = button_tag class: 'btn', title: 'Search' do - = icon("search") - %ul.content-list - - members.each do |project_member| - = render 'project_member', member: project_member - -:javascript - $('form.member-search-form').on('submit', function (event) { - event.preventDefault(); - Turbolinks.visit(this.action + '?' + $(this).serialize()); - }); diff --git a/app/views/projects/project_members/_project_member.html.haml b/app/views/projects/project_members/_project_member.html.haml deleted file mode 100644 index 3faf5dba8a2..00000000000 --- a/app/views/projects/project_members/_project_member.html.haml +++ /dev/null @@ -1,66 +0,0 @@ -- user = member.user -- return unless user || member.invite? - -%li{class: "#{dom_class(member)} js-toggle-container project_member_row access-#{member.human_access.downcase}", id: dom_id(member)} - %span.list-item-name - - if member.user - = image_tag avatar_icon(user, 24), class: "avatar s24", alt: '' - %strong - = link_to user.name, user_path(user) - %span.cgray= user.username - - if user == current_user - %span.label.label-success It's you - - if user.blocked? - %label.label.label-danger - %strong Blocked - - if member.request? - %span.label.label-info - Pending Approval - - else - = image_tag avatar_icon(member.invite_email, 24), class: "avatar s24", alt: '' - %strong - = member.invite_email - %span.cgray - invited - - if member.created_by - by - = link_to member.created_by.name, user_path(member.created_by) - = time_ago_with_tooltip(member.created_at) - - - if can?(current_user, :admin_project_member, @project) - = link_to resend_invite_namespace_project_project_member_path(@project.namespace, @project, member), method: :post, class: "btn-xs btn", title: 'Resend invite' do - Resend invite - - if can?(current_user, :admin_project_member, @project) - .pull-right - %strong= member.human_access - - if can?(current_user, :update_project_member, member) - = button_tag class: "btn-xs btn-grouped inline btn js-toggle-button", - title: 'Edit access level', type: 'button' do - = icon('pencil') - - if member.request? -   - = link_to approval_namespace_project_project_member_path(@project.namespace, @project, member), - class: "btn-xs btn btn-success", - title: 'Grant access', type: 'button' do - %i.fa.fa-check.fa-inverse - - - if can?(current_user, :destroy_project_member, member) -   - - if member.request? - = link_to namespace_project_project_member_path(@project.namespace, @project, member), data: { confirm: remove_from_project_team_message(@project, member) }, method: :delete, class: "btn-xs btn btn-remove", title: 'Deny access' do - %i.fa.fa-times.fa-inverse - - elsif current_user == user - = link_to leave_namespace_project_project_members_path(@project.namespace, @project), data: { confirm: leave_project_message(@project) }, method: :delete, class: "btn-xs btn btn-remove", title: 'Leave project' do - = icon("sign-out") - Leave - - else - = link_to namespace_project_project_member_path(@project.namespace, @project, member), data: { confirm: remove_from_project_team_message(@project, member) }, method: :delete, remote: true, class: "btn-xs btn btn-remove", title: 'Remove user from team' do - = icon('trash') - - .edit-member.hide.js-toggle-content - %br - = form_for member, as: :project_member, url: namespace_project_project_member_path(@project.namespace, @project, member), remote: true do |f| - .prepend-top-10 - = f.select :access_level, options_for_select(ProjectMember.access_roles, member.access_level), {}, class: 'form-control' - .prepend-top-10 - = f.submit 'Save', class: 'btn btn-save' diff --git a/app/views/projects/project_members/_shared_group_members.html.haml b/app/views/projects/project_members/_shared_group_members.html.haml index ae13f8428f0..952844acefc 100644 --- a/app/views/projects/project_members/_shared_group_members.html.haml +++ b/app/views/projects/project_members/_shared_group_members.html.haml @@ -14,8 +14,10 @@ %i.fa.fa-pencil-square-o Edit group members %ul.content-list - - shared_group.group_members.order('access_level DESC').limit(20).each do |member| - = render 'groups/group_members/group_member', member: member, show_controls: false, show_roles: false + = render partial: 'shared/members/member', + collection: shared_group.group_members.order(access_level: :desc).limit(20), + as: :member, + locals: { show_controls: false, show_roles: false } - if shared_group_users_count > 20 %li and #{shared_group_users_count - 20} more. For full list visit #{link_to 'group members page', group_group_members_path(shared_group)} diff --git a/app/views/projects/project_members/_team.html.haml b/app/views/projects/project_members/_team.html.haml index e8dce30425f..03207614258 100644 --- a/app/views/projects/project_members/_team.html.haml +++ b/app/views/projects/project_members/_team.html.haml @@ -11,8 +11,7 @@ = button_tag class: 'btn', title: 'Search' do = icon("search") %ul.content-list - - members.each do |project_member| - = render 'project_member', member: project_member + = render partial: 'shared/members/member', collection: members, as: :member :javascript $('form.member-search-form').on('submit', function (event) { diff --git a/app/views/projects/project_members/index.html.haml b/app/views/projects/project_members/index.html.haml index d5a19799c49..61a82724d69 100644 --- a/app/views/projects/project_members/index.html.haml +++ b/app/views/projects/project_members/index.html.haml @@ -12,7 +12,8 @@ %p.light Users with access to this project are listed below. = render "new_project_member" - = render "pending", members: @project_members.request + + = render "shared/members/requests", entity: @project, members: @project_members = render "team", members: @project_members.non_request -- cgit v1.2.1 From 515205d3c1c6655302ed0ae44cc5954dead7ae79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Thu, 2 Jun 2016 18:05:06 +0200 Subject: UI and copywriting improvements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit + Move 'Edit Project/Group' out of membership-related partial + Show the access request buttons only to logged-in users + Put the request access buttons out of in a more visible button + Improve the copy in the #remove_member_message helper Signed-off-by: Rémy Coutable --- app/views/projects/_home_panel.html.haml | 11 +++++++---- app/views/projects/buttons/_notifications.html.haml | 2 +- app/views/projects/notes/_note.html.haml | 2 +- app/views/projects/project_members/_group_members.html.haml | 10 ++++------ app/views/projects/project_members/index.html.haml | 4 ++-- 5 files changed, 15 insertions(+), 14 deletions(-) (limited to 'app/views/projects') diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml index f5bc1b4e409..2b19ee93eea 100644 --- a/app/views/projects/_home_panel.html.haml +++ b/app/views/projects/_home_panel.html.haml @@ -29,10 +29,13 @@ .project-clone-holder = render "shared/clone_panel" - .project-repo-buttons.btn-group.project-right-buttons - = render "projects/buttons/download" - = render 'projects/buttons/dropdown' - = render 'projects/buttons/notifications' + .project-repo-buttons.project-right-buttons + - if current_user + = render 'shared/members/access_request_buttons', source: @project + .btn-group + = render "projects/buttons/download" + = render 'projects/buttons/dropdown' + = render 'projects/buttons/notifications' :javascript new Star(); diff --git a/app/views/projects/buttons/_notifications.html.haml b/app/views/projects/buttons/_notifications.html.haml index 3b97dc9328f..a7a97181096 100644 --- a/app/views/projects/buttons/_notifications.html.haml +++ b/app/views/projects/buttons/_notifications.html.haml @@ -1,7 +1,7 @@ - if @notification_setting = form_for @notification_setting, url: namespace_project_notification_setting_path(@project.namespace.becomes(Namespace), @project), method: :patch, remote: true, html: { class: 'inline', id: 'notification-form' } do |f| = f.hidden_field :level - .dropdown + .dropdown.hidden-sm %button.btn.btn-default.notifications-btn#notifications-button{ data: { toggle: "dropdown" }, aria: { haspopup: "true", expanded: "false" } } = icon('bell') = notification_title(@notification_setting.level) diff --git a/app/views/projects/notes/_note.html.haml b/app/views/projects/notes/_note.html.haml index 112a532f9d3..bcdbff08011 100644 --- a/app/views/projects/notes/_note.html.haml +++ b/app/views/projects/notes/_note.html.haml @@ -17,7 +17,7 @@ %a{ href: "##{dom_id(note)}" } = time_ago_with_tooltip(note.created_at, placement: 'bottom', html_class: 'note-created-ago') .note-actions - - access = max_access_level(note.project, note.author) + - access = note.project.team.human_max_access(note.author.id) - if access %span.note-role.hidden-xs= access - if current_user diff --git a/app/views/projects/project_members/_group_members.html.haml b/app/views/projects/project_members/_group_members.html.haml index 78c12d52a78..cb6136c215a 100644 --- a/app/views/projects/project_members/_group_members.html.haml +++ b/app/views/projects/project_members/_group_members.html.haml @@ -6,8 +6,9 @@ (#{members.count}) - if can?(current_user, :admin_group_member, @group) .controls - = link_to group_group_members_path(@group), class: 'btn' do - Manage group members + = link_to 'Manage group members', + group_group_members_path(@group), + class: 'btn' %ul.content-list = render partial: 'shared/members/member', collection: members.limit(20), @@ -15,7 +16,4 @@ locals: { show_controls: false } - if members.size > 20 %li - and - = members.size - 20 - more. For full list visit - = link_to 'group members page', group_group_members_path(@group) + and #{members.count - 20} more. For full list visit #{link_to 'group members page', group_group_members_path(@group)} diff --git a/app/views/projects/project_members/index.html.haml b/app/views/projects/project_members/index.html.haml index 61a82724d69..357ccccaf1d 100644 --- a/app/views/projects/project_members/index.html.haml +++ b/app/views/projects/project_members/index.html.haml @@ -13,9 +13,9 @@ Users with access to this project are listed below. = render "new_project_member" - = render "shared/members/requests", entity: @project, members: @project_members + = render 'shared/members/requests', membership_source: @project, members: @project_members.request - = render "team", members: @project_members.non_request + = render 'team', members: @project_members.non_request - if @group = render "group_members", members: @group_members -- cgit v1.2.1 From bb6f246790fb3a6b85ab2fd9341566557da64a23 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Tue, 14 Jun 2016 14:43:45 +0200 Subject: Authorize environments controller actions --- app/views/projects/environments/new.html.haml | 2 +- app/views/projects/environments/show.html.haml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'app/views/projects') diff --git a/app/views/projects/environments/new.html.haml b/app/views/projects/environments/new.html.haml index c7abac6e49f..ade41d9de2d 100644 --- a/app/views/projects/environments/new.html.haml +++ b/app/views/projects/environments/new.html.haml @@ -9,7 +9,7 @@ = form_for @environment, url: namespace_project_environments_path(@project.namespace, @project), html: { id: "new-environment-form", class: "col-lg-9 js-new-environment-form js-requires-input" } do |f| = form_errors(@environment) .form-group - = f.label :ref, 'Environment name', class: 'label-light' + = f.label :name, 'Environment name', class: 'label-light' = f.text_field :name, required: true, class: 'form-control' = f.submit 'Create environment', class: 'btn btn-create' = link_to "Cancel", namespace_project_environments_path(@project.namespace, @project), class: "btn btn-cancel" diff --git a/app/views/projects/environments/show.html.haml b/app/views/projects/environments/show.html.haml index f5e30d75b42..1d39bef9427 100644 --- a/app/views/projects/environments/show.html.haml +++ b/app/views/projects/environments/show.html.haml @@ -9,7 +9,8 @@ .col-md-3 .nav-controls - = link_to 'Destroy', namespace_project_environment_path(@project.namespace, @project, @environment), data: { confirm: 'Are you sure?' }, class: 'btn btn-danger', method: :delete + - if can?(current_user, :update_environment, @project) + = link_to 'Destroy', namespace_project_environment_path(@project.namespace, @project, @environment), data: { confirm: 'Are you sure?' }, class: 'btn btn-danger', method: :delete - if @deployments.blank? %ul.content-list -- cgit v1.2.1 From 30877effb15d8a3eccc13925549a4c97de93c58e Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Tue, 14 Jun 2016 14:47:00 +0200 Subject: Test environment controller specs --- app/views/projects/deployments/_deployment.html.haml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app/views/projects') diff --git a/app/views/projects/deployments/_deployment.html.haml b/app/views/projects/deployments/_deployment.html.haml index 539c297cad3..1ac17af8b58 100644 --- a/app/views/projects/deployments/_deployment.html.haml +++ b/app/views/projects/deployments/_deployment.html.haml @@ -27,4 +27,8 @@ %td - if can?(current_user, :update_deployment, @project) && deployment.deployable .pull-right - = link_to 'Retry', retry_namespace_project_build_path(@project.namespace, @project, deployment.deployable), method: :post, class: 'btn btn-build' + = link_to retry_namespace_project_build_path(@project.namespace, @project, deployment.deployable), method: :post, class: 'btn btn-build' do + - if deployment.last? + Retry + - else + Rollback -- cgit v1.2.1 From dc41a933f4f9a79e7160e38f248d33d7beb99bb6 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Tue, 14 Jun 2016 16:11:28 +0200 Subject: Update scss to make the views look nicer --- app/views/projects/deployments/_deployment.html.haml | 2 +- app/views/projects/environments/_environment.html.haml | 7 +++---- app/views/projects/environments/index.html.haml | 2 +- app/views/projects/environments/show.html.haml | 6 +++--- 4 files changed, 8 insertions(+), 9 deletions(-) (limited to 'app/views/projects') diff --git a/app/views/projects/deployments/_deployment.html.haml b/app/views/projects/deployments/_deployment.html.haml index 1ac17af8b58..28c003d22a8 100644 --- a/app/views/projects/deployments/_deployment.html.haml +++ b/app/views/projects/deployments/_deployment.html.haml @@ -9,7 +9,7 @@ · = link_to deployment.short_sha, namespace_project_commit_path(@project.namespace, @project, deployment.sha), class: "commit-id monospace" - %p + %p.commit-title %span - if commit_title = deployment.commit_title = link_to_gfm commit_title, namespace_project_commit_path(@project.namespace, @project, deployment.sha), class: "commit-row-message" diff --git a/app/views/projects/environments/_environment.html.haml b/app/views/projects/environments/_environment.html.haml index 5ca57bd153d..c2e6d11f941 100644 --- a/app/views/projects/environments/_environment.html.haml +++ b/app/views/projects/environments/_environment.html.haml @@ -13,17 +13,16 @@ · = link_to last_deployment.short_sha, namespace_project_commit_path(@project.namespace, @project, last_deployment.sha), class: "commit-id monospace" - %p + %p.commit-title %span - if commit_title = last_deployment.commit_title = link_to_gfm commit_title, namespace_project_commit_path(@project.namespace, @project, last_deployment.sha), class: "commit-row-message" - else Cant find HEAD commit for this branch - else - %p + %p.commit-title No deployments yet %td - if last_deployment - %p - #{time_ago_with_tooltip(last_deployment.created_at)} + #{time_ago_with_tooltip(last_deployment.created_at)} diff --git a/app/views/projects/environments/index.html.haml b/app/views/projects/environments/index.html.haml index 4a445a157ec..fa1046bbe1a 100644 --- a/app/views/projects/environments/index.html.haml +++ b/app/views/projects/environments/index.html.haml @@ -15,7 +15,7 @@ No environments to show - else .table-holder - %table.table + %table.table.environments %tbody %th Environment %th Last deployment diff --git a/app/views/projects/environments/show.html.haml b/app/views/projects/environments/show.html.haml index 1d39bef9427..6454101004a 100644 --- a/app/views/projects/environments/show.html.haml +++ b/app/views/projects/environments/show.html.haml @@ -5,7 +5,7 @@ %div{ class: (container_class) } .top-area .col-md-9 - %h3= @environment.name.titleize + %h3.page-title= @environment.name.titleize .col-md-3 .nav-controls @@ -13,13 +13,13 @@ = link_to 'Destroy', namespace_project_environment_path(@project.namespace, @project, @environment), data: { confirm: 'Are you sure?' }, class: 'btn btn-danger', method: :delete - if @deployments.blank? - %ul.content-list + %ul.content-list.environments %li.nothing-here-block No deployments for %strong= @environment.name - else .table-holder - %table.table.builds + %table.table.environments %thead %tr %th ID -- cgit v1.2.1 From 14a02a6a95353948d00f8f973b35b80ac06f4599 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Tue, 14 Jun 2016 18:34:48 +0200 Subject: Improve design after review --- app/views/projects/deployments/_commit.html.haml | 12 ++++++++++++ app/views/projects/deployments/_deployment.html.haml | 17 +++-------------- app/views/projects/environments/_environment.html.haml | 13 +------------ app/views/projects/environments/index.html.haml | 3 +-- app/views/projects/environments/new.html.haml | 3 ++- app/views/projects/environments/show.html.haml | 2 +- 6 files changed, 20 insertions(+), 30 deletions(-) create mode 100644 app/views/projects/deployments/_commit.html.haml (limited to 'app/views/projects') diff --git a/app/views/projects/deployments/_commit.html.haml b/app/views/projects/deployments/_commit.html.haml new file mode 100644 index 00000000000..0f9d9512d88 --- /dev/null +++ b/app/views/projects/deployments/_commit.html.haml @@ -0,0 +1,12 @@ +%div.branch-commit + - if deployment.ref + = link_to deployment.ref, namespace_project_commits_path(@project.namespace, @project, deployment.ref), class: "monospace" + · + = link_to deployment.short_sha, namespace_project_commit_path(@project.namespace, @project, deployment.sha), class: "commit-id monospace" + + %p.commit-title + %span + - if commit_title = deployment.commit_title + = link_to_gfm commit_title, namespace_project_commit_path(@project.namespace, @project, deployment.sha), class: "commit-row-message" + - else + Cant find HEAD commit for this branch diff --git a/app/views/projects/deployments/_deployment.html.haml b/app/views/projects/deployments/_deployment.html.haml index 28c003d22a8..f065f28c6ee 100644 --- a/app/views/projects/deployments/_deployment.html.haml +++ b/app/views/projects/deployments/_deployment.html.haml @@ -3,29 +3,18 @@ %strong= "##{deployment.iid}" %td - %div.branch-commit - - if deployment.ref - = link_to deployment.ref, namespace_project_commits_path(@project.namespace, @project, deployment.ref), class: "monospace" - · - = link_to deployment.short_sha, namespace_project_commit_path(@project.namespace, @project, deployment.sha), class: "commit-id monospace" - - %p.commit-title - %span - - if commit_title = deployment.commit_title - = link_to_gfm commit_title, namespace_project_commit_path(@project.namespace, @project, deployment.sha), class: "commit-row-message" - - else - Cant find HEAD commit for this branch + = render 'projects/deployments/commit', deployment: deployment %td - if deployment.deployable - = link_to namespace_project_build_path(@project.namespace, @project, deployment.deployable), class: "monospace" do + = link_to namespace_project_build_path(@project.namespace, @project, deployment.deployable) do = "#{deployment.deployable.name} (##{deployment.deployable.id})" %td #{time_ago_with_tooltip(deployment.created_at)} %td - - if can?(current_user, :update_deployment, @project) && deployment.deployable + - if can?(current_user, :update_deployment, deployment) && deployment.deployable .pull-right = link_to retry_namespace_project_build_path(@project.namespace, @project, deployment.deployable), method: :post, class: 'btn btn-build' do - if deployment.last? diff --git a/app/views/projects/environments/_environment.html.haml b/app/views/projects/environments/_environment.html.haml index c2e6d11f941..eafa246d05f 100644 --- a/app/views/projects/environments/_environment.html.haml +++ b/app/views/projects/environments/_environment.html.haml @@ -7,18 +7,7 @@ %td - if last_deployment - %div.branch-commit - - if last_deployment.ref - = link_to last_deployment.ref, namespace_project_commits_path(@project.namespace, @project, last_deployment.ref), class: "monospace" - · - = link_to last_deployment.short_sha, namespace_project_commit_path(@project.namespace, @project, last_deployment.sha), class: "commit-id monospace" - - %p.commit-title - %span - - if commit_title = last_deployment.commit_title - = link_to_gfm commit_title, namespace_project_commit_path(@project.namespace, @project, last_deployment.sha), class: "commit-row-message" - - else - Cant find HEAD commit for this branch + = render 'projects/deployments/commit', deployment: last_deployment - else %p.commit-title No deployments yet diff --git a/app/views/projects/environments/index.html.haml b/app/views/projects/environments/index.html.haml index fa1046bbe1a..ae9e77e7d89 100644 --- a/app/views/projects/environments/index.html.haml +++ b/app/views/projects/environments/index.html.haml @@ -20,5 +20,4 @@ %th Environment %th Last deployment %th Date - - @environments.each do |environment| - = render 'environment', environment: environment + = render @environments diff --git a/app/views/projects/environments/new.html.haml b/app/views/projects/environments/new.html.haml index ade41d9de2d..533f624c4e2 100644 --- a/app/views/projects/environments/new.html.haml +++ b/app/views/projects/environments/new.html.haml @@ -1,3 +1,4 @@ +- @no_container = true - page_title "New Environment" = render "projects/pipelines/head" @@ -6,7 +7,7 @@ %h4.prepend-top-0 New Environment - = form_for @environment, url: namespace_project_environments_path(@project.namespace, @project), html: { id: "new-environment-form", class: "col-lg-9 js-new-environment-form js-requires-input" } do |f| + = form_for @environment, url: namespace_project_environments_path(@project.namespace, @project), html: { class: "col-lg-9" } do |f| = form_errors(@environment) .form-group = f.label :name, 'Environment name', class: 'label-light' diff --git a/app/views/projects/environments/show.html.haml b/app/views/projects/environments/show.html.haml index 6454101004a..b41b1651a81 100644 --- a/app/views/projects/environments/show.html.haml +++ b/app/views/projects/environments/show.html.haml @@ -9,7 +9,7 @@ .col-md-3 .nav-controls - - if can?(current_user, :update_environment, @project) + - if can?(current_user, :update_environment, @environment) = link_to 'Destroy', namespace_project_environment_path(@project.namespace, @project, @environment), data: { confirm: 'Are you sure?' }, class: 'btn btn-danger', method: :delete - if @deployments.blank? -- cgit v1.2.1 From 00526440092bb82beb86b87376dd1ea6178bf05f Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Wed, 15 Jun 2016 12:07:06 +0200 Subject: Improve forms and specs --- app/views/projects/environments/_form.html.haml | 7 +++++++ app/views/projects/environments/new.html.haml | 13 +++---------- app/views/projects/environments/show.html.haml | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) create mode 100644 app/views/projects/environments/_form.html.haml (limited to 'app/views/projects') diff --git a/app/views/projects/environments/_form.html.haml b/app/views/projects/environments/_form.html.haml new file mode 100644 index 00000000000..c07f4bd510c --- /dev/null +++ b/app/views/projects/environments/_form.html.haml @@ -0,0 +1,7 @@ += form_for @environment, url: namespace_project_environments_path(@project.namespace, @project), html: { class: 'col-lg-9' } do |f| + = form_errors(@environment) + .form-group + = f.label :name, 'Name', class: 'label-light' + = f.text_field :name, required: true, class: 'form-control' + = f.submit 'Create environment', class: 'btn btn-create' + = link_to 'Cancel', namespace_project_environments_path(@project.namespace, @project), class: 'btn btn-cancel' diff --git a/app/views/projects/environments/new.html.haml b/app/views/projects/environments/new.html.haml index 533f624c4e2..54465828ba9 100644 --- a/app/views/projects/environments/new.html.haml +++ b/app/views/projects/environments/new.html.haml @@ -1,16 +1,9 @@ -- @no_container = true -- page_title "New Environment" -= render "projects/pipelines/head" +- page_title 'New Environment' .row.prepend-top-default.append-bottom-default .col-lg-3 %h4.prepend-top-0 New Environment + %p Environments allow you to track deployments of your application - = form_for @environment, url: namespace_project_environments_path(@project.namespace, @project), html: { class: "col-lg-9" } do |f| - = form_errors(@environment) - .form-group - = f.label :name, 'Environment name', class: 'label-light' - = f.text_field :name, required: true, class: 'form-control' - = f.submit 'Create environment', class: 'btn btn-create' - = link_to "Cancel", namespace_project_environments_path(@project.namespace, @project), class: "btn btn-cancel" + = render 'form' diff --git a/app/views/projects/environments/show.html.haml b/app/views/projects/environments/show.html.haml index b41b1651a81..069b77b5adf 100644 --- a/app/views/projects/environments/show.html.haml +++ b/app/views/projects/environments/show.html.haml @@ -10,7 +10,7 @@ .col-md-3 .nav-controls - if can?(current_user, :update_environment, @environment) - = link_to 'Destroy', namespace_project_environment_path(@project.namespace, @project, @environment), data: { confirm: 'Are you sure?' }, class: 'btn btn-danger', method: :delete + = link_to 'Destroy', namespace_project_environment_path(@project.namespace, @project, @environment), data: { confirm: 'Are you sure you want to delete this environment?' }, class: 'btn btn-danger', method: :delete - if @deployments.blank? %ul.content-list.environments -- cgit v1.2.1 From f30d1fdf94a373649b2b570bbd6d77cbe817ebe0 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Wed, 15 Jun 2016 12:53:10 +0200 Subject: Add support for Docker Registry manifest v1 --- app/views/projects/container_registry/_tag.html.haml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'app/views/projects') diff --git a/app/views/projects/container_registry/_tag.html.haml b/app/views/projects/container_registry/_tag.html.haml index 4e9f936539b..d5fa07fd180 100644 --- a/app/views/projects/container_registry/_tag.html.haml +++ b/app/views/projects/container_registry/_tag.html.haml @@ -9,11 +9,19 @@ - else \- %td - = number_to_human_size(tag.total_size) - · - = pluralize(tag.layers.size, "layer") + - if tag.total_size + = number_to_human_size(tag.total_size) + · + = pluralize(tag.layers.size, "layer") + - else + .light + \- %td + - if tag.created_at = time_ago_in_words(tag.created_at) + - else + .light + \- - if can?(current_user, :update_container_image, @project) %td.content .controls.hidden-xs.pull-right -- cgit v1.2.1 From eb26755d63dbe3b4c32230a2ec8730a0d889f292 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Wed, 15 Jun 2016 12:56:02 +0200 Subject: Create_deployment ability is need to create retry or rollback deployment --- app/views/projects/deployments/_deployment.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views/projects') diff --git a/app/views/projects/deployments/_deployment.html.haml b/app/views/projects/deployments/_deployment.html.haml index f065f28c6ee..d08dd92f1f6 100644 --- a/app/views/projects/deployments/_deployment.html.haml +++ b/app/views/projects/deployments/_deployment.html.haml @@ -14,7 +14,7 @@ #{time_ago_with_tooltip(deployment.created_at)} %td - - if can?(current_user, :update_deployment, deployment) && deployment.deployable + - if can?(current_user, :create_deployment, deployment) && deployment.deployable .pull-right = link_to retry_namespace_project_build_path(@project.namespace, @project, deployment.deployable), method: :post, class: 'btn btn-build' do - if deployment.last? -- cgit v1.2.1 From d8b399a8c6051a3bdef56e8d7c63ac1d40ddc071 Mon Sep 17 00:00:00 2001 From: Fatih Acet Date: Wed, 15 Jun 2016 15:14:23 +0300 Subject: Fix project star tooltip in to show actual message. --- app/views/projects/buttons/_star.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views/projects') diff --git a/app/views/projects/buttons/_star.html.haml b/app/views/projects/buttons/_star.html.haml index 02dbb2985a4..71cf5582a4c 100644 --- a/app/views/projects/buttons/_star.html.haml +++ b/app/views/projects/buttons/_star.html.haml @@ -1,5 +1,5 @@ - if current_user - = link_to toggle_star_namespace_project_path(@project.namespace, @project), class: 'btn star-btn toggle-star has-tooltip', method: :post, remote: true, title: "Star project" do + = link_to toggle_star_namespace_project_path(@project.namespace, @project), { class: 'btn star-btn toggle-star has-tooltip', method: :post, remote: true, title: current_user.starred?(@project) ? 'Unstar project' : 'Star project' } do - if current_user.starred?(@project) = icon('star fw') %span.starred Unstar -- cgit v1.2.1 From 3213023dd657ba6c5c6d690fae2ca44a409b16fd Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Wed, 15 Jun 2016 16:16:21 +0200 Subject: Show created_at in table column --- app/views/projects/container_registry/_tag.html.haml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'app/views/projects') diff --git a/app/views/projects/container_registry/_tag.html.haml b/app/views/projects/container_registry/_tag.html.haml index d5fa07fd180..f35faa6afb5 100644 --- a/app/views/projects/container_registry/_tag.html.haml +++ b/app/views/projects/container_registry/_tag.html.haml @@ -17,11 +17,11 @@ .light \- %td - - if tag.created_at - = time_ago_in_words(tag.created_at) - - else - .light - \- + - if tag.created_at + = time_ago_in_words(tag.created_at) + - else + .light + \- - if can?(current_user, :update_container_image, @project) %td.content .controls.hidden-xs.pull-right -- cgit v1.2.1 From 56ca4859552cc23d5fee88f056952535034e99c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Wed, 15 Jun 2016 13:42:46 +0200 Subject: Fix wrong partial path in JS view MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- app/views/projects/project_members/update.js.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views/projects') diff --git a/app/views/projects/project_members/update.js.haml b/app/views/projects/project_members/update.js.haml index 2fb3a41d541..45f8ef89060 100644 --- a/app/views/projects/project_members/update.js.haml +++ b/app/views/projects/project_members/update.js.haml @@ -1,2 +1,2 @@ :plain - $("##{dom_id(@project_member)}").replaceWith('#{escape_javascript(render("project_member", member: @project_member))}'); + $("##{dom_id(@project_member)}").replaceWith('#{escape_javascript(render('shared/members/member', member: @project_member))}'); -- cgit v1.2.1 From 0cb7d834f7c428bce4341aef55ac35285cb0071c Mon Sep 17 00:00:00 2001 From: Alfredo Sumaran Date: Tue, 14 Jun 2016 11:48:42 -0500 Subject: Add handler icon to prioritized labels --- app/views/projects/labels/index.html.haml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app/views/projects') diff --git a/app/views/projects/labels/index.html.haml b/app/views/projects/labels/index.html.haml index 6e1baa46b05..aa4d69550ec 100644 --- a/app/views/projects/labels/index.html.haml +++ b/app/views/projects/labels/index.html.haml @@ -4,9 +4,10 @@ = render "projects/issues/head" %div{ class: (container_class) } - .top-area + .top-area.adjust .nav-text - Labels can be applied to issues and merge requests. + Labels can be applied to issues and merge requests. Star a label to make it a priority label. Order the prioritized labels to change their relative priority, by dragging. + .nav-controls - if can?(current_user, :admin_label, @project) = link_to new_namespace_project_label_path(@project.namespace, @project), class: "btn btn-new" do @@ -19,10 +20,9 @@ .prioritized-labels{ class: ('hide' if hide) } %h5 Prioritized Labels %ul.content-list.manage-labels-list.js-prioritized-labels{ "data-url" => set_priorities_namespace_project_labels_path(@project.namespace, @project) } + %p.empty-message{ class: ('hidden' unless @prioritized_labels.empty?) } No prioritized labels yet - if @prioritized_labels.present? = render @prioritized_labels - - else - %p.empty-message No prioritized labels yet .other-labels - if can?(current_user, :admin_label, @project) %h5{ class: ('hide' if hide) } Other Labels -- cgit v1.2.1 From 01d9bffdd82c098a8c2e368e39a590e5c753dbc7 Mon Sep 17 00:00:00 2001 From: Connor Shea Date: Wed, 15 Jun 2016 12:43:32 -0600 Subject: Improve New Project page for mobile. Separate the New Project page's "Project path" grouped fields into separate fields. Fixes #18599. --- app/views/projects/new.html.haml | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'app/views/projects') diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml index f9ac16b32f3..47a2f2889d8 100644 --- a/app/views/projects/new.html.haml +++ b/app/views/projects/new.html.haml @@ -11,21 +11,17 @@ .project-edit-content = form_for @project, html: { class: 'new_project form-horizontal js-requires-input' } do |f| - .form-group.project-name-holder + .form-group + = f.label :path, class: 'control-label' do + Project owner + .col-sm-10 + = f.select :namespace_id, namespaces_options(:current_user), {}, {class: 'select2 js-select-namespace', tabindex: 1} + + .form-group = f.label :path, class: 'control-label' do - Project path + Project name .col-sm-10 - .input-group - - if current_user.can_select_namespace? - .input-group-addon - = root_url - = f.select :namespace_id, namespaces_options(params[:namespace_id] || :current_user, display_path: true), {}, {class: 'select2 js-select-namespace', tabindex: 1} - .input-group-addon - \/ - - else - .input-group-addon - #{root_url}#{current_user.username}/ - = f.text_field :path, placeholder: "my-awesome-project", class: "form-control", tabindex: 2, autofocus: true, required: true + = f.text_field :path, placeholder: "my-awesome-project", class: "form-control", tabindex: 2, autofocus: true, required: true - if current_user.can_create_group? .help-block -- cgit v1.2.1 From 190685741c47aff3ec53fb55308a36b46d1ef8d2 Mon Sep 17 00:00:00 2001 From: Connor Shea Date: Wed, 15 Jun 2016 12:55:05 -0600 Subject: Move group creation text to below the 'Project owner' field. --- app/views/projects/new.html.haml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'app/views/projects') diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml index 47a2f2889d8..7e8b8f83467 100644 --- a/app/views/projects/new.html.haml +++ b/app/views/projects/new.html.haml @@ -17,17 +17,17 @@ .col-sm-10 = f.select :namespace_id, namespaces_options(:current_user), {}, {class: 'select2 js-select-namespace', tabindex: 1} + - if current_user.can_create_group? + .help-block + Want to house several dependent projects under the same namespace? + = link_to "Create a group", new_group_path + .form-group = f.label :path, class: 'control-label' do Project name .col-sm-10 = f.text_field :path, placeholder: "my-awesome-project", class: "form-control", tabindex: 2, autofocus: true, required: true - - if current_user.can_create_group? - .help-block - Want to house several dependent projects under the same namespace? - = link_to "Create a group", new_group_path - - if import_sources_enabled? .project-import.js-toggle-container .form-group -- cgit v1.2.1