diff options
author | Palaparthy Adityachandra | 2020-08-05 13:20:13 +0530 |
---|---|---|
committer | GitHub | 2020-08-05 13:20:13 +0530 |
commit | f4ce8c9e3f20d0d4c873bfb8b0dd4d83ac0b8a58 (patch) | |
tree | 53af62921e2f872bd833d54065d277b58038eedf | |
parent | 11b63b322b85655e60fa26e248cae77ce96e1b9b (diff) | |
parent | 9153e9e705a47e6d25fee58cd84e4abefc2ec549 (diff) | |
download | workshop_booking-f4ce8c9e3f20d0d4c873bfb8b0dd4d83ac0b8a58.tar.gz workshop_booking-f4ce8c9e3f20d0d4c873bfb8b0dd4d83ac0b8a58.tar.bz2 workshop_booking-f4ce8c9e3f20d0d4c873bfb8b0dd4d83ac0b8a58.zip |
Merge pull request #157 from FOSSEE/fix_issues
Multiple fixes
-rw-r--r-- | workshop_app/templates/workshop_app/activation.html | 14 | ||||
-rw-r--r-- | workshop_app/templates/workshop_app/edit_workshop_type.html | 2 | ||||
-rw-r--r-- | workshop_app/templates/workshop_app/login.html | 20 | ||||
-rw-r--r-- | workshop_app/templates/workshop_app/propose_workshop.html | 15 | ||||
-rw-r--r-- | workshop_app/views.py | 3 | ||||
-rw-r--r-- | workshop_portal/urls.py | 4 |
6 files changed, 45 insertions, 13 deletions
diff --git a/workshop_app/templates/workshop_app/activation.html b/workshop_app/templates/workshop_app/activation.html index 9975920..465752a 100644 --- a/workshop_app/templates/workshop_app/activation.html +++ b/workshop_app/templates/workshop_app/activation.html @@ -5,10 +5,12 @@ {% endblock %} {% block header %} - <nav class="navbar navbar-default navbar-custom"> + <nav class="navbar navbar-default navbar-dark bg-dark"> <div class="container-fluid"> <div class="navbar-header"> - <a class="navbar-brand" href="#">FOSSEE Python Workshops</a> + <a class="navbar-brand text-white" href="/"> + FOSSEE Workshops + </a> </div> <ul class="nav navbar-nav navbar-right"> {% if request.user.profile.is_email_verified %} @@ -31,8 +33,8 @@ {% if status == '2' %} <div class="container"> <div class="jumbotron"> - <p> Your email is already verified, Please view your profile - <a href="{% url 'workshop_app:view_profile' %}">here</a> + <p> Your email is already verified, Click + <a href="{% url 'workshop_app:index' %}">here</a> </p> </div> </div> @@ -50,8 +52,8 @@ {% elif status == '0' %} <div class="container"> <div class="jumbotron"> - <p> Your account has been activated. Please view your profile - <a href="{% url 'workshop_app:view_profile' %}">here</a> + <p> Your account has been activated. Click + <a href="{% url 'workshop_app:index' %}">here</a> </p> </div> </div> diff --git a/workshop_app/templates/workshop_app/edit_workshop_type.html b/workshop_app/templates/workshop_app/edit_workshop_type.html index 90900e4..eab67f2 100644 --- a/workshop_app/templates/workshop_app/edit_workshop_type.html +++ b/workshop_app/templates/workshop_app/edit_workshop_type.html @@ -80,7 +80,7 @@ </div> {% if form.id.value %} <div class="col-1"> - <a href="{% url 'delete_attachment_file' form.id.value %}"><button class="btn btn-md btn-danger float-right" type="button">Delete</button></a> + <a href="{% url 'workshop_app:delete_attachment_file' form.id.value %}"><button class="btn btn-md btn-danger float-right" type="button">Delete</button></a> </div> {% endif %} </div> diff --git a/workshop_app/templates/workshop_app/login.html b/workshop_app/templates/workshop_app/login.html index dae22bc..38a1c17 100644 --- a/workshop_app/templates/workshop_app/login.html +++ b/workshop_app/templates/workshop_app/login.html @@ -12,6 +12,26 @@ <div class="card-body"> <form class="px-3 py-3" method="post"> {% csrf_token %} + {% if form.errors %} + {% for field in form %} + {% for error in field.errors %} + <div class="alert alert-dismissible alert-danger"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ error|escape }}</strong> + </div> + {% endfor %} + {% endfor %} + {% for error in form.non_field_errors %} + <div class="alert alert-dismissible alert-danger"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ error|escape }}</strong> + </div> + {% endfor %} + {% endif %} <div class="form-group"> <label for="id_username">Username</label> {{ form.username }} diff --git a/workshop_app/templates/workshop_app/propose_workshop.html b/workshop_app/templates/workshop_app/propose_workshop.html index 2c87100..2d9f2ef 100644 --- a/workshop_app/templates/workshop_app/propose_workshop.html +++ b/workshop_app/templates/workshop_app/propose_workshop.html @@ -32,14 +32,15 @@ $('#disp_tnc').click(function (e) { e.preventDefault() if ($('#id_workshop_type').val() === '') - $('.modal-body').html("<p class='text-danger'>Please select a workshop_type first!</p>") - else + $('.modal-body').html("<p class='text-danger'>Please select a workshop type</p>") + else { $.ajax({ - url: '/workshop_type_tnc/' + $('#id_workshop_type').val(), + url: '/workshop/type_tnc/' + $('#id_workshop_type').val(), success: function (data) { $('.modal-body').html(data.tnc) } }) + } }) }); </script> @@ -77,9 +78,11 @@ <br> {{ form.date }} <br> - {{ form.tnc_accepted }} I accept the <a href="#" id="disp_tnc" data-toggle="modal" - data-target="#exampleModalCenter">terms and - conditions</a> + {{ form.tnc_accepted }} I accept the + <a href="#" id="disp_tnc" data-toggle="modal" + data-target="#exampleModalCenter"> + terms and conditions + </a> <br> {% if form.errors %} <br> diff --git a/workshop_app/views.py b/workshop_app/views.py index cf2867c..7be17d9 100644 --- a/workshop_app/views.py +++ b/workshop_app/views.py @@ -9,6 +9,7 @@ try: except ImportError: from io import BytesIO as string_io from datetime import datetime +import os from django.contrib.auth import login, logout, authenticate from django.contrib.auth.decorators import login_required @@ -411,6 +412,8 @@ def delete_attachment_file(request, file_id): file = AttachmentFile.objects.filter(id=file_id) if file.exists(): file = file.first() + if os.path.exists(file.attachments.path): + os.remove(file.attachments.path) file.delete() messages.add_message(request, messages.INFO, "Attachment deleted") return redirect( diff --git a/workshop_portal/urls.py b/workshop_portal/urls.py index 8adddd8..45f1407 100644 --- a/workshop_portal/urls.py +++ b/workshop_portal/urls.py @@ -14,8 +14,10 @@ Including another URLconf 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import url, include +from django.conf.urls.static import static from django.contrib import admin from workshop_portal import views +from django.conf import settings urlpatterns = [ @@ -25,3 +27,5 @@ urlpatterns = [ url(r'^reset/', include('django.contrib.auth.urls')), url(r'^page/', include('cms.urls')), ] + +urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) |