Button to request the full access url of a submission. Fixes #618
- Legacy-Id: 2890
This commit is contained in:
parent
cc6af53359
commit
917d287182
|
@ -317,7 +317,7 @@ class AutoPostForm(forms.Form):
|
|||
subject = 'Confirmation for Auto-Post of I-D %s' % self.draft.filename
|
||||
from_email = settings.IDST_FROM_EMAIL
|
||||
to_email = self.cleaned_data['email']
|
||||
send_mail(request, from_email, to_email, subject, 'submit/confirm_autopost.txt',
|
||||
send_mail(request, to_email, from_email, subject, 'submit/confirm_autopost.txt',
|
||||
{'draft': self.draft, 'domain': Site.objects.get_current().domain })
|
||||
|
||||
def save_submitter_info(self):
|
||||
|
|
|
@ -10,6 +10,7 @@ urlpatterns = patterns('ietf.submit.views',
|
|||
url(r'^status/(?P<submission_id>\d+)/cancel/$', 'draft_cancel', name='draft_cancel'),
|
||||
url(r'^status/(?P<submission_id>\d+)/approve/$', 'draft_approve', name='draft_approve'),
|
||||
url(r'^status/(?P<submission_id>\d+)/force/$', 'draft_force', name='draft_force'),
|
||||
url(r'^status/(?P<submission_id>\d+)/request/$', 'full_url_request', name='full_url_request'),
|
||||
url(r'^status/(?P<submission_id>\d+)/(?P<submission_hash>[a-f\d]+)/$', 'draft_status', name='draft_status_by_hash'),
|
||||
url(r'^status/(?P<submission_id>\d+)/(?P<submission_hash>[a-f\d]+)/cancel/$', 'draft_cancel', name='draft_cancel_by_hash'),
|
||||
url(r'^status/(?P<submission_id>\d+)/(?P<submission_hash>[a-f\d]+)/edit/$', 'draft_edit', name='draft_edit_by_hash'),
|
||||
|
|
|
@ -3,7 +3,10 @@ import re
|
|||
import datetime
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.sites.models import Site
|
||||
|
||||
from ietf.idtracker.models import InternetDraft, PersonOrOrgInfo, IETFWG
|
||||
from ietf.utils.mail import send_mail
|
||||
|
||||
|
||||
# Some usefull states
|
||||
|
@ -20,6 +23,15 @@ INITIAL_VERSION_APPROVAL_REQUESTED = 10
|
|||
NONE_WG = 1027
|
||||
|
||||
|
||||
def request_full_url(request, submission):
|
||||
subject = 'Full url for managing submission of draft %s' % submission.filename
|
||||
from_email = settings.IDST_FROM_EMAIL
|
||||
to_email = ['%s <%s>' % i.email() for i in submission.tempidauthors_set.all()]
|
||||
send_mail(request, to_email, from_email, subject, 'submit/request_full_url.txt',
|
||||
{'submission': submission,
|
||||
'domain': Site.objects.get_current().domain})
|
||||
|
||||
|
||||
def perform_post(submission):
|
||||
group_id = submission.group_acronym and submission.group_acronym.pk or NONE_WG
|
||||
updated = False
|
||||
|
|
|
@ -12,7 +12,8 @@ from ietf.submit.models import IdSubmissionDetail, IdApprovedDetail
|
|||
from ietf.submit.forms import UploadForm, AutoPostForm, MetaDataForm
|
||||
from ietf.submit.utils import (DraftValidation, perform_post, remove_docs,
|
||||
get_person_for_user, is_secretariat,
|
||||
UPLOADED, WAITING_AUTHENTICATION, CANCELED,
|
||||
request_full_url, UPLOADED,
|
||||
WAITING_AUTHENTICATION, CANCELED,
|
||||
INITIAL_VERSION_APPROVAL_REQUESTED,
|
||||
MANUAL_POST_REQUESTED, POSTED)
|
||||
from ietf.utils.mail import send_mail
|
||||
|
@ -75,7 +76,7 @@ def _can_cancel(user, detail, submission_hash):
|
|||
return False
|
||||
|
||||
def _can_edit(user, detail, submission_hash):
|
||||
if detail.status_id != 'UPLOADED':
|
||||
if detail.status_id != UPLOADED:
|
||||
return None
|
||||
if is_secretariat(user):
|
||||
return True
|
||||
|
@ -134,12 +135,16 @@ def draft_status(request, submission_id, submission_hash=None, message=None):
|
|||
can_force_post = _can_force_post(request.user, detail)
|
||||
can_approve = _can_approve(request.user, detail)
|
||||
can_cancel = _can_cancel(request.user, detail, submission_hash)
|
||||
allow_edit = False
|
||||
allow_edit = None
|
||||
message = ('success', 'Your submission is pending of email authentication. An email has been sent you with instructions')
|
||||
else:
|
||||
return HttpResponseRedirect(reverse(draft_edit, None, kwargs={'submission_id': detail.submission_id}))
|
||||
else:
|
||||
auto_post_form = AutoPostForm(draft=detail, validation=validation)
|
||||
|
||||
show_notify_button = False
|
||||
if allow_edit == False or can_cancel == False:
|
||||
show_notify_button = True
|
||||
return render_to_response('submit/draft_status.html',
|
||||
{'selected': 'status',
|
||||
'detail': detail,
|
||||
|
@ -153,6 +158,7 @@ def draft_status(request, submission_id, submission_hash=None, message=None):
|
|||
'can_approve': can_approve,
|
||||
'can_cancel': can_cancel,
|
||||
'submission_hash': submission_hash,
|
||||
'show_notify_button': show_notify_button,
|
||||
},
|
||||
context_instance=RequestContext(request))
|
||||
|
||||
|
@ -221,3 +227,10 @@ def draft_approve(request, submission_id, check_function=_can_approve):
|
|||
|
||||
def draft_force(request, submission_id):
|
||||
return draft_approve(request, submission_id, check_function=_can_force_post)
|
||||
|
||||
|
||||
def full_url_request(request, submission_id):
|
||||
detail = get_object_or_404(IdSubmissionDetail, submission_id=submission_id)
|
||||
request_full_url(request, detail)
|
||||
message = ('success', 'An email has been sent to draft authors to inform them of the full access url')
|
||||
return draft_status(request, submission_id, message=message)
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
Follow this link to confirm you Auto-Post of I-D {{ draft.filename }}-{{ draft.revision }}
|
||||
|
||||
I-D Submission Tool URL: http://{{ domain }}/submit/status/{{ draft.submission_id }}/confirm/{{ draft.auth_key }}/
|
||||
|
||||
Remember that you can cancel the submission from:
|
||||
http://{{ domain }}/submit/status/{{ draft.submission_id }}/{{ draft.get_hash }}/
|
||||
|
|
|
@ -218,6 +218,22 @@ returned to the submitter.
|
|||
</p>
|
||||
{% endif %}
|
||||
|
||||
{% if show_notify_button %}
|
||||
<div class="metadata-errors">
|
||||
<p>
|
||||
You are not allowed to modify or cancel this submission. You only can modify or cancel this submission from the same url you were redirected after the submission.
|
||||
</p>
|
||||
<p>
|
||||
If you are the submitter check your browser history to find this url. You can share it with any person you need.
|
||||
</p>
|
||||
<p>
|
||||
If you are one of the authors you can request the url from wich you can modify or cancel this submission by clicking the next button. An email will be sent to the draft authors and to the submitter (if its email is available).
|
||||
</p>
|
||||
<form method="post" action="{% url full_url_request detail.submission_id %}">
|
||||
<input type="submit" value="Request full access url" />
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
<p>
|
||||
The IETF is an organized activity of the <a href="http://www.isoc.org">Internet Society</a>
|
||||
<br>Please send problem reports to <a href="mailto:ietf-action@ietf.org">ietf-action@ietf.org</a>.
|
||||
|
|
3
ietf/templates/submit/request_full_url.txt
Normal file
3
ietf/templates/submit/request_full_url.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
Follow this link to get full access to the submission of I-D {{ submission.filename }}-{{ submission.revision }}
|
||||
|
||||
http://{{ domain }}/submit/status/{{ submission.submission_id }}/{{ submission.get_hash }}/
|
Loading…
Reference in a new issue