diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-06-05 13:37:08 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-06-05 13:37:08 +0000 |
commit | 5a026152b745d5a716c522bc58a76682ee534e25 (patch) | |
tree | 0579a0d6522650f0ae929b6d200d2ddcc746db6c /app/views | |
parent | 6f7bf4e4f0ea40c4f69354b8ce75c77af4fab5cb (diff) | |
parent | 5256b5cc060338fb597e3519a18bf6a3faa4cf8c (diff) | |
download | gitlab-ce-5a026152b745d5a716c522bc58a76682ee534e25.tar.gz |
Merge branch 'warn-about-referenced-users' into 'master'
Show warning when a comment will add 10 or more people to the discussion.
Addresses internal issue https://dev.gitlab.org/gitlab/gitlabhq/issues/2054
New issue:
![Screen_Shot_2015-06-02_at_14.48.46](https://gitlab.com/gitlab-org/gitlab-ce/uploads/6771ff8748b9b548a9f0f32a5a8b9bb1/Screen_Shot_2015-06-02_at_14.48.46.png)
New comment:
![Screen_Shot_2015-06-02_at_14.48.51](https://gitlab.com/gitlab-org/gitlab-ce/uploads/25ec5f06490e1e6b36e453e055a7b403/Screen_Shot_2015-06-02_at_14.48.51.png)
See merge request !754
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/layouts/_head.html.haml | 4 | ||||
-rw-r--r-- | app/views/layouts/_page.html.haml | 2 | ||||
-rw-r--r-- | app/views/layouts/application.html.haml | 2 | ||||
-rw-r--r-- | app/views/layouts/project.html.haml | 8 | ||||
-rw-r--r-- | app/views/projects/_issuable_form.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/_md_preview.html.haml | 37 | ||||
-rw-r--r-- | app/views/projects/issues/_form.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/merge_requests/_form.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/merge_requests/_new_submit.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/milestones/_form.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/notes/_form.html.haml | 7 | ||||
-rw-r--r-- | app/views/projects/wikis/_form.html.haml | 3 |
12 files changed, 39 insertions, 34 deletions
diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml index b1a57d9824e..4d8c5656a25 100644 --- a/app/views/layouts/_head.html.haml +++ b/app/views/layouts/_head.html.haml @@ -15,8 +15,10 @@ %meta{name: 'viewport', content: 'width=device-width, initial-scale=1, maximum-scale=1'} %meta{name: 'theme-color', content: '#474D57'} - = yield(:meta_tags) + = yield :meta_tags = render 'layouts/google_analytics' if extra_config.has_key?('google_analytics_id') = render 'layouts/piwik' if extra_config.has_key?('piwik_url') && extra_config.has_key?('piwik_site_id') = render 'layouts/bootlint' if Rails.env.development? + + = yield :scripts_head diff --git a/app/views/layouts/_page.html.haml b/app/views/layouts/_page.html.haml index c1283734d25..54fcbca6bc6 100644 --- a/app/views/layouts/_page.html.haml +++ b/app/views/layouts/_page.html.haml @@ -22,5 +22,3 @@ = render "layouts/flash" .clearfix = yield - -= yield :embedded_scripts diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 155825cc4c2..ff23913d7d6 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -8,3 +8,5 @@ = render "layouts/header/public", title: header_title = render 'layouts/page', sidebar: sidebar + + = yield :scripts_body diff --git a/app/views/layouts/project.html.haml b/app/views/layouts/project.html.haml index 4aeb9d397d2..03c7ba8c73f 100644 --- a/app/views/layouts/project.html.haml +++ b/app/views/layouts/project.html.haml @@ -2,7 +2,13 @@ - header_title project_title(@project) - sidebar "project" unless sidebar -- content_for :embedded_scripts do +- content_for :scripts_head do + -if current_user + :javascript + window.project_uploads_path = "#{namespace_project_uploads_path @project.namespace, @project}"; + window.markdown_preview_path = "#{markdown_preview_namespace_project_path(@project.namespace, @project)}"; + +- content_for :scripts_body do = render "layouts/init_auto_complete" if current_user = render template: "layouts/application" diff --git a/app/views/projects/_issuable_form.html.haml b/app/views/projects/_issuable_form.html.haml index 2c5b24b8130..491e2107da4 100644 --- a/app/views/projects/_issuable_form.html.haml +++ b/app/views/projects/_issuable_form.html.haml @@ -24,7 +24,7 @@ = f.label :description, 'Description', class: 'control-label' .col-sm-10 - = render layout: 'projects/md_preview', locals: { preview_class: "wiki" } do + = render layout: 'projects/md_preview', locals: { preview_class: "wiki", referenced_users: true } do = render 'projects/zen', f: f, attr: :description, classes: 'description form-control' .col-sm-12.hint diff --git a/app/views/projects/_md_preview.html.haml b/app/views/projects/_md_preview.html.haml index b869fd6e12a..a831481cf80 100644 --- a/app/views/projects/_md_preview.html.haml +++ b/app/views/projects/_md_preview.html.haml @@ -1,13 +1,24 @@ -%ul.nav.nav-tabs - %li.active - = link_to '#md-write-holder', class: 'js-md-write-button' do - Write - %li - = link_to '#md-preview-holder', class: 'js-md-preview-button', - data: { url: markdown_preview_namespace_project_path(@project.namespace, @project) } do - Preview -%div - .md-write-holder - = yield - .md.md-preview-holder.hide - .js-md-preview{class: (preview_class if defined?(preview_class))} +.md-area + .md-header.clearfix + %ul.nav.nav-tabs + %li.active + = link_to '#md-write-holder', class: 'js-md-write-button' do + Write + %li + = link_to '#md-preview-holder', class: 'js-md-preview-button' do + Preview + + - if defined?(referenced_users) && referenced_users + %span.referenced-users.pull-left.hide + = icon('exclamation-triangle') + You are about to add + %strong + %span.js-referenced-users-count 0 + people + to the discussion. Proceed with caution. + + %div + .md-write-holder + = yield + .md.md-preview-holder.hide + .js-md-preview{class: (preview_class if defined?(preview_class))} diff --git a/app/views/projects/issues/_form.html.haml b/app/views/projects/issues/_form.html.haml index 7d7217eb2a8..8d2564be55e 100644 --- a/app/views/projects/issues/_form.html.haml +++ b/app/views/projects/issues/_form.html.haml @@ -10,5 +10,3 @@ $('#issue_assignee_id').val("#{current_user.id}").trigger("change"); e.preventDefault(); }); - - window.project_uploads_path = "#{namespace_project_uploads_path @project.namespace, @project}"; diff --git a/app/views/projects/merge_requests/_form.html.haml b/app/views/projects/merge_requests/_form.html.haml index 1c7160bce5f..be73f087449 100644 --- a/app/views/projects/merge_requests/_form.html.haml +++ b/app/views/projects/merge_requests/_form.html.haml @@ -8,5 +8,3 @@ $('#merge_request_assignee_id').val("#{current_user.id}").trigger("change"); e.preventDefault(); }); - - window.project_uploads_path = "#{namespace_project_uploads_path @project.namespace, @project}"; diff --git a/app/views/projects/merge_requests/_new_submit.html.haml b/app/views/projects/merge_requests/_new_submit.html.haml index 9a2edbf0a8c..6792104569b 100644 --- a/app/views/projects/merge_requests/_new_submit.html.haml +++ b/app/views/projects/merge_requests/_new_submit.html.haml @@ -51,8 +51,6 @@ e.preventDefault(); }); - window.project_uploads_path = "#{namespace_project_uploads_path @project.namespace, @project}"; - :javascript var merge_request merge_request = new MergeRequest({ diff --git a/app/views/projects/milestones/_form.html.haml b/app/views/projects/milestones/_form.html.haml index 95b7070ce5c..5650607f31f 100644 --- a/app/views/projects/milestones/_form.html.haml +++ b/app/views/projects/milestones/_form.html.haml @@ -50,5 +50,3 @@ dateFormat: "yy-mm-dd", onSelect: function(dateText, inst) { $("#milestone_due_date").val(dateText) } }).datepicker("setDate", $.datepicker.parseDate('yy-mm-dd', $('#milestone_due_date').val())); - - window.project_uploads_path = "#{namespace_project_uploads_path @project.namespace, @project}"; diff --git a/app/views/projects/notes/_form.html.haml b/app/views/projects/notes/_form.html.haml index 2ada6cb6700..f28b3e9b508 100644 --- a/app/views/projects/notes/_form.html.haml +++ b/app/views/projects/notes/_form.html.haml @@ -5,7 +5,7 @@ = f.hidden_field :noteable_id = f.hidden_field :noteable_type - = render layout: 'projects/md_preview', locals: { preview_class: "note-text" } do + = render layout: 'projects/md_preview', locals: { preview_class: "note-text", referenced_users: true } do = render 'projects/zen', f: f, attr: :note, classes: 'note_text js-note-text' @@ -15,10 +15,7 @@ .error-alert .note-form-actions - .buttons + .buttons.clearfix = f.submit 'Add Comment', class: "btn comment-btn btn-grouped js-comment-button" = yield(:note_actions) %a.btn.grouped.js-close-discussion-note-form Cancel - -:javascript - window.project_uploads_path = "#{namespace_project_uploads_path @project.namespace, @project}"; diff --git a/app/views/projects/wikis/_form.html.haml b/app/views/projects/wikis/_form.html.haml index 9fbfa0b1aeb..2a8ceaa2844 100644 --- a/app/views/projects/wikis/_form.html.haml +++ b/app/views/projects/wikis/_form.html.haml @@ -41,6 +41,3 @@ - else = f.submit 'Create page', class: "btn-create btn" = link_to "Cancel", namespace_project_wiki_path(@project.namespace, @project, :home), class: "btn btn-cancel" - -:javascript - window.project_uploads_path = "#{namespace_project_uploads_path @project.namespace, @project}"; |