diff --git a/scipost/static/scipost/assets/css/_form.scss b/scipost/static/scipost/assets/css/_form.scss index 40042b021b6e4dee4774cd93a9319305b6cea251..6b48198edc22fde86f80ed2667fa689e563b8cfc 100644 --- a/scipost/static/scipost/assets/css/_form.scss +++ b/scipost/static/scipost/assets/css/_form.scss @@ -5,3 +5,13 @@ .form-control { font-family: inherit; } + +.has-error .form-control { + border-color: #d9534f; +} + +.form-control + .help-block { + margin-top: 3px; + display: inline-block; + font-weight: 600; +} diff --git a/scipost/static/scipost/assets/css/_page_header.scss b/scipost/static/scipost/assets/css/_page_header.scss new file mode 100644 index 0000000000000000000000000000000000000000..61042dabdecf156180cca0a650c8073d549620af --- /dev/null +++ b/scipost/static/scipost/assets/css/_page_header.scss @@ -0,0 +1,4 @@ +.page-header { + background-color: #f4f4f4; + padding: 10px; +} diff --git a/scipost/static/scipost/assets/css/style.scss b/scipost/static/scipost/assets/css/style.scss index a1043306673bb2e3ffb8d58b96bb4ec031792e20..3b7db7f8bc6232a4d49cca20749123d9fba32d30 100644 --- a/scipost/static/scipost/assets/css/style.scss +++ b/scipost/static/scipost/assets/css/style.scss @@ -14,4 +14,5 @@ @import "form"; @import "messages"; @import "navbar"; +@import "page_header"; @import "type"; diff --git a/scipost/templates/scipost/base.html b/scipost/templates/scipost/base.html index 2bedef9de0857fbfb823f74ed24c21783a37cd06..4a3105f7a1ef8dc2fa23b523e0415cbd2438dd72 100644 --- a/scipost/templates/scipost/base.html +++ b/scipost/templates/scipost/base.html @@ -28,12 +28,16 @@ {% include 'scipost/navbar.html' %} {% include 'scipost/messages.html' %} + + <div class="container"> + {% block page_header %}{% endblock page_header %} + + {% block content %}{% endblock content %} + </div> + {% block bodysup %} {% endblock bodysup %} - {% block content %} - {% endblock content %} - {% include 'scipost/footer.html' %} <script type="text/x-mathjax-config"> diff --git a/theses/forms.py b/theses/forms.py index 2252e8f78f958752e9eb8fb8d92560b3bc5af3e5..0690f6cc80f822c63ab70892e1364ce838aa0d36 100644 --- a/theses/forms.py +++ b/theses/forms.py @@ -42,6 +42,10 @@ class VetThesisLinkForm(RequestThesisLinkForm): justification = forms.CharField(widget=forms.Textarea( attrs={'rows': 5, 'cols': 40}), label='Justification (optional)', required=False) + def __init__(self, *args, **kwargs): + super(VetThesisLinkForm, self).__init__(*args, **kwargs) + self.order_fields(['action_option', 'refusal_reason', 'justification']) + def vet_request(self, thesislink, user): if int(self.cleaned_data['action_option']) == VetThesisLinkForm.ACCEPT: thesislink.vetted = True diff --git a/theses/templates/theses/request_thesislink.html b/theses/templates/theses/request_thesislink.html index 1ccedd0e6e21411c33b8ca7974a86528e7948652..6795e8065bb6f42c8dc05719cae224e87306339e 100644 --- a/theses/templates/theses/request_thesislink.html +++ b/theses/templates/theses/request_thesislink.html @@ -1,20 +1,28 @@ {% extends 'scipost/base.html' %} +{% load bootstrap %} + {% block pagetitle %}: request Thesis Link{% endblock pagetitle %} -{% block bodysup %} +{% block page_header %} +<div class="row"> + <div class="col-12"> + <h1 class="page-header">Request Activation of a Thesis Link</h1> + </div> +</div> +{% endblock page_header %} -<section> - <div class="flex-greybox"> - <h1>Request Activation of a Thesis Link:</h1> +{% block content %} +<div class="row"> + <div class="col-12 col-md-8"> + <form action="{% url 'theses:request_thesislink' %}" method="post"> + {% csrf_token %} + <table> + {{ form|bootstrap }} + </table> + <input class="btn btn-primary" type="submit" value="Submit"/> + </form> </div> - <form action="{% url 'theses:request_thesislink' %}" method="post"> - {% csrf_token %} - <table> - {{ form.as_table }} - </table> - <input type="submit" value="Submit"/> - </form> -</section> +</div> -{% endblock bodysup %} +{% endblock content %} diff --git a/theses/templates/theses/unvetted_thesislinks.html b/theses/templates/theses/unvetted_thesislinks.html index f2245e0a6f698670eb439883a4483b8eea19d28c..6846720a4d81155ee3d888a68a48187bc4df8ad8 100644 --- a/theses/templates/theses/unvetted_thesislinks.html +++ b/theses/templates/theses/unvetted_thesislinks.html @@ -6,21 +6,23 @@ {% endblock headsup %} -{% block bodysup %} +{% block content %} - -<h1>Unvetted Thesis Links</h1> -<ul> - {% for thesislink in thesislinks %} - <li> - {{ thesislink.author }} - {{ thesislink.title }} - - <a href = "{% url 'theses:vet_thesislink' pk=thesislink.id %}">vet</a> - </li> - {% empty %} - <li> - No unvetted thesis links. - </li> - {% endfor %} -</ul> - -{% endblock bodysup %} +<div class="row"> + <div class="col-12"> + <h1>Unvetted Thesis Links</h1> + <ul> + {% for thesislink in thesislinks %} + <li> + {{ thesislink.author }} - {{ thesislink.title }} - + <a href = "{% url 'theses:vet_thesislink' pk=thesislink.id %}">vet</a> + </li> + {% empty %} + <li> + No unvetted thesis links. + </li> + {% endfor %} + </ul> + </div> +</div> +{% endblock content %} diff --git a/theses/templates/theses/vet_thesislink.html b/theses/templates/theses/vet_thesislink.html index 3694c92f0f94b02e57dd15fb4102e2ff4dbba7df..8822dfff11c61f69a0a0ded2b8e5ea12b0004f33 100644 --- a/theses/templates/theses/vet_thesislink.html +++ b/theses/templates/theses/vet_thesislink.html @@ -1,16 +1,22 @@ {% extends 'scipost/base.html' %} +{% load bootstrap %} + {% block pagetitle %}: Unvetted Thesis Links{% endblock pagetitle %} {% block headsup %} {% endblock headsup %} -{% block bodysup %} +{% block content %} -<form action="" method="post">{% csrf_token %} - {{ form.as_p }} - <input type="submit" value="Update" /> -</form> +<div class="row"> + <div class="col-12"> + <form action="" method="post">{% csrf_token %} + {{ form|bootstrap }} + <input class="btn btn-primary" type="submit" value="Update" /> + </form> + </div> +</div> -{% endblock bodysup %} +{% endblock content %} diff --git a/theses/views.py b/theses/views.py index 34c9f035e737fb1aea998b2530b806184b105746..858e8c33d6a80f79da959a55f93f2716c40e4348 100644 --- a/theses/views.py +++ b/theses/views.py @@ -38,6 +38,7 @@ class RequestThesisLink(CreateView): success_url = reverse_lazy('scipost:personal_page') def form_valid(self, form): + form.instance.requested_by = self.request.user.contributor messages.add_message(self.request, messages.SUCCESS, strings.acknowledge_request_thesis_link) return super(RequestThesisLink, self).form_valid(form)