Added new issue by email modal window

This commit is contained in:
Phil Hughes 2016-06-30 10:08:14 +01:00
parent e616fbfd42
commit 7964ea1bad
4 changed files with 44 additions and 1 deletions

View File

@ -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;
}
}

View File

@ -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

View File

@ -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).

View File

@ -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