summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-06-30 10:08:14 +0100
committerPhil Hughes <me@iamphill.com>2016-06-30 10:08:14 +0100
commit7964ea1bad6607becce3d2028650ef01b167bc60 (patch)
tree583e6bfbddc19d4bad367065d59bf9754b7b9da6
parente616fbfd425f838ca83fe01c3adf10e6b8e5a934 (diff)
downloadgitlab-ce-7964ea1bad6607becce3d2028650ef01b167bc60.tar.gz
Added new issue by email modal window
-rw-r--r--app/assets/stylesheets/pages/issues.scss17
-rw-r--r--app/models/project.rb2
-rw-r--r--app/views/projects/issues/_issue_by_email.html.haml20
-rw-r--r--app/views/projects/issues/index.html.haml6
4 files changed, 44 insertions, 1 deletions
diff --git a/app/assets/stylesheets/pages/issues.scss b/app/assets/stylesheets/pages/issues.scss
index 4e35ca329e4..80f7ef16360 100644
--- a/app/assets/stylesheets/pages/issues.scss
+++ b/app/assets/stylesheets/pages/issues.scss
@@ -91,3 +91,20 @@ form.edit-issue {
.issue-form .select2-container {
width: 250px !important;
}
+
+.issues-footer {
+ padding-top: $gl-padding;
+ padding-bottom: 37px;
+}
+
+.issue-email-modal-btn {
+ padding: 0;
+ color: $gl-link-color;
+ background-color: transparent;
+ border: 0;
+ outline: 0;
+
+ &:hover {
+ text-decoration: underline;
+ }
+}
diff --git a/app/models/project.rb b/app/models/project.rb
index ad2a3ec6cf8..9fb6a462b6f 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -529,7 +529,7 @@ class Project < ActiveRecord::Base
end
def new_issue_address(author)
- if Gitlab::IncomingEmail.enabled?
+ if Gitlab::IncomingEmail.enabled? && author
Gitlab::IncomingEmail.reply_address(
"#{path_with_namespace}+#{author.authentication_token}")
end
diff --git a/app/views/projects/issues/_issue_by_email.html.haml b/app/views/projects/issues/_issue_by_email.html.haml
new file mode 100644
index 00000000000..395d8b4b256
--- /dev/null
+++ b/app/views/projects/issues/_issue_by_email.html.haml
@@ -0,0 +1,20 @@
+#issue-email-modal.modal.fade{ tabindex: "-1", role: "dialog" }
+ .modal-dialog{ role: "document" }
+ .modal-content
+ .modal-header
+ %button.close{ type: "button", data: { dismiss: "modal" }, aria: { label: "close" } }
+ %span{ aria: { hidden: "true" } }= icon("times")
+ %h4.modal-title
+ Create new issue by email
+ .modal-body
+ %p
+ Write an email to
+ = succeed "." do
+ %a{ href: "mailto:#{email}" }= email
+ (This is a private email address, so keep it secret.)
+ %p
+ Send an email to this address to create an issue.
+ %p
+ Use the subject line as the title of your issue.
+ %p
+ Use the message as the body of your issue (feel free to include some nice markdown).
diff --git a/app/views/projects/issues/index.html.haml b/app/views/projects/issues/index.html.haml
index cd876b5ea62..68befa5196f 100644
--- a/app/views/projects/issues/index.html.haml
+++ b/app/views/projects/issues/index.html.haml
@@ -1,5 +1,6 @@
- @no_container = true
- page_title "Issues"
+- new_issue_email = @project.new_issue_address(current_user)
= render "projects/issues/head"
= content_for :meta_tags do
@@ -24,3 +25,8 @@
.issues-holder
= render "issues"
+ - if new_issue_email
+ .issues-footer.text-center
+ %button.issue-email-modal-btn{ type: "button", data: { toggle: "modal", target: "#issue-email-modal" } }
+ Email a new issue to this project
+ = render "issue_by_email", email: new_issue_email