Commit c8bfdbf1a2e1caea07ba7dce01713e7963f6bbe1
1 parent
7236d561
Change conditions while downloading source files to download by file extension
Showing
3 changed files
with
11 additions
and
7 deletions
collector/storage/static/storage/js/document.js
... | ... | @@ -96,7 +96,11 @@ $(function () { |
96 | 96 | $(this).modalForm({formURL: $(this).data("id")}); |
97 | 97 | }); |
98 | 98 | |
99 | - $(".retake-doc-for-annotation").each(function () { | |
99 | + $(".retake-doc-for-anno").each(function () { | |
100 | + $(this).modalForm({formURL: $(this).data("id")}); | |
101 | + }); | |
102 | + | |
103 | + $(".retake-doc-for-anno-for-prev-annot").each(function () { | |
100 | 104 | $(this).modalForm({formURL: $(this).data("id")}); |
101 | 105 | }); |
102 | 106 | }); |
... | ... |
collector/storage/templates/storage/review.html
... | ... | @@ -59,23 +59,23 @@ |
59 | 59 | {% if document.processing_status.key == "correct" %} |
60 | 60 | <br><br> |
61 | 61 | {% if request.user|belongs_to_group:"Editors" %} |
62 | - <a class="retake-doc-for-annotation btn btn-danger" | |
62 | + <a class="retake-doc-for-anno btn btn-danger" | |
63 | 63 | href="{% url 'retake_doc_for_anno' document.id %}"> |
64 | 64 | Zwróć dokument do anotacji <i class="material-icons def-col-button">undo</i> |
65 | 65 | </a> |
66 | 66 | <br><br> |
67 | - <a class="retake-doc-for-annotation btn btn-danger" | |
67 | + <a class="retake-doc-for-anno-for-prev-annot btn btn-danger" | |
68 | 68 | href="{% url 'retake_doc_for_anno_for_prev_annot' document.id %}"> |
69 | - Zwróć dokument do anotacji do poprzedniego anotatora<i class="material-icons def-col-button">undo</i> | |
69 | + Zwróć dokument do anotacji do poprzedniego anotatora <i class="material-icons def-col-button">undo</i> | |
70 | 70 | </a> |
71 | 71 | {% else %} |
72 | 72 | <span title="Opcja dostępna tylko dla grupy Redaktorzy"> |
73 | - <a class="retake-doc-for-annotation btn btn-danger disable-click" | |
73 | + <a class="retake-doc-for-anno btn btn-danger disable-click" | |
74 | 74 | href="{% url 'retake_doc_for_anno' document.id %}"> |
75 | 75 | Zwróć dokument do anotacji <i class="material-icons def-col-button">undo</i> |
76 | 76 | </a> |
77 | 77 | <br><br> |
78 | - <a class="retake-doc-for-annotation btn btn-danger disable-click" | |
78 | + <a class="retake-doc-for-anno-for-prev-annot btn btn-danger disable-click" | |
79 | 79 | href="{% url 'retake_doc_for_anno_for_prev_annot' document.id %}"> |
80 | 80 | Zwróć dokument do anotacji do poprzedniego anotatora <i class="material-icons def-col-button">undo</i> |
81 | 81 | </a> |
... | ... |
collector/storage/views.py
... | ... | @@ -1012,7 +1012,7 @@ def download_source(request, doc_id, redirect_view): |
1012 | 1012 | source_dir = Document.objects.get(id=doc_id).path |
1013 | 1013 | filenames = os.listdir(source_dir) |
1014 | 1014 | for filename in filenames: |
1015 | - if os.path.splitext(filename)[0] == 'source': | |
1015 | + if os.path.splitext(filename)[1] in ['.pdf', '.doc', '.rtf']: | |
1016 | 1016 | filepath = source_dir + '/' + filename |
1017 | 1017 | path = open(filepath, 'rb') |
1018 | 1018 | mime_type, _ = mimetypes.guess_type(filepath) |
... | ... |