Commit bccb11397518cd5061c62608aad692a083c49e9b
Exists in
master
and in
5 other branches
Merge branch 'dev' of https://github.com/amadeusproject/amadeuslms into dev
Showing
3 changed files
with
5 additions
and
23 deletions
Show diff stats
files/templates/files/delete_file.html
... | ... | @@ -15,16 +15,6 @@ |
15 | 15 | <!-- Card --> |
16 | 16 | <form class="form-horizontal" method="post" id="form-delete-file" enctype="multipart/form-data"> |
17 | 17 | {% csrf_token %} |
18 | - {% if messages %} | |
19 | - {% for message in messages %} | |
20 | - <div class="alert alert-{{ message.tags }} alert-dismissible" role="alert"> | |
21 | - <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | |
22 | - <span aria-hidden="true">×</span> | |
23 | - </button> | |
24 | - <p>{{ message }}</p> | |
25 | - </div> | |
26 | - {% endfor %} | |
27 | - {% endif %} | |
28 | 18 | <fieldset> |
29 | 19 | <div class="col-md-12"> |
30 | 20 | {% trans "Are you sure to delete " %}<a href="{{ file.file_url.url }}" target="_blank" > {{ file.name }} </a> of {{ file.topic.name }}? |
... | ... | @@ -62,6 +52,7 @@ |
62 | 52 | $('#file_{{ file.slug }}').remove(); |
63 | 53 | $('#file_edit_icon_{{ file.slug }}').remove(); |
64 | 54 | $('#file_edit_{{ file.slug }}').remove(); |
55 | + alertify.success(" {% trans 'File successfully deleted!' %} "); | |
65 | 56 | }, |
66 | 57 | error: function(data){ |
67 | 58 | // $('.erro-update').html(data.responseText); |
... | ... | @@ -74,4 +65,4 @@ |
74 | 65 | }); |
75 | 66 | </script> |
76 | 67 | {% endblock script_file %} |
77 | -<!-- EndModal --> | |
78 | 68 | \ No newline at end of file |
69 | +<!-- EndModal --> | ... | ... |
files/templates/files/update_file.html
... | ... | @@ -15,16 +15,6 @@ |
15 | 15 | <!-- Card --> |
16 | 16 | <form class="form-horizontal" method="post" id="form-update-file" enctype="multipart/form-data"> |
17 | 17 | {% csrf_token %} |
18 | - {% if messages %} | |
19 | - {% for message in messages %} | |
20 | - <div class="alert alert-{{ message.tags }} alert-dismissible" role="alert"> | |
21 | - <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | |
22 | - <span aria-hidden="true">×</span> | |
23 | - </button> | |
24 | - <p>{{ message }}</p> | |
25 | - </div> | |
26 | - {% endfor %} | |
27 | - {% endif %} | |
28 | 18 | <fieldset> |
29 | 19 | {% for field in form %} |
30 | 20 | <div class="form-group is-empy{% if form.has_error %} has-error {% endif %} is-fileinput"> |
... | ... | @@ -106,6 +96,7 @@ |
106 | 96 | $('#fileUpdateModal').modal('hide'); |
107 | 97 | $('#file_edit_{{ file.slug }}').replaceWith(data); |
108 | 98 | $('#file_{{ file.slug }}').replaceWith(data); |
99 | + alertify.success(" {% trans 'File successfully updated!' %} "); | |
109 | 100 | }, |
110 | 101 | error: function(data){ |
111 | 102 | $('.erro-update').html(data.responseText); |
... | ... | @@ -117,4 +108,4 @@ |
117 | 108 | }); |
118 | 109 | </script> |
119 | 110 | {% endblock script_file %} |
120 | -<!-- EndModal --> | |
121 | 111 | \ No newline at end of file |
112 | +<!-- EndModal --> | ... | ... |
links/views.py
... | ... | @@ -115,7 +115,7 @@ class DeleteLink(LoginRequiredMixin, HasRoleMixin, LogMixin, generic.DeleteView) |
115 | 115 | |
116 | 116 | def dispatch(self, *args, **kwargs): |
117 | 117 | link = get_object_or_404(Link, slug = self.kwargs.get('slug')) |
118 | - if(not (link.topic.owner == self.request.user) and not(has_role(self.request.user, 'system_admin')) ): | |
118 | + if(not (has_role(self.request.user, 'professor')) or not(has_role(self.request.user, 'system_admin')) ): | |
119 | 119 | return self.handle_no_permission() |
120 | 120 | return super(DeleteLink, self).dispatch(*args, **kwargs) |
121 | 121 | ... | ... |