-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: refactor code for "add instrument name"
- remove "alias" field from "InstrumentName" model; - move "publish_name" to a separate .py file - use "csrf_protect" decorator for "publish_name" - extract the common code in "mansonryView.html" and "stdView.html" Refs: #163
- Loading branch information
1 parent
888e84b
commit 8079346
Showing
9 changed files
with
216 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
web-app/django/VIM/apps/instruments/templates/instruments/includes/instrumentContainer.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{% load static %} | ||
|
||
<div class="instrument-img-container"> | ||
<img src="{% static instrument.thumbnail.url %}" class="card-img-top rounded p-2 img-fluid instrument-img" alt="instrument thumbnail" onerror="this.onerror=null;this.src='{% static "instruments/images/no-image.svg" %}';" /> | ||
<div class="middle-button-group"> | ||
{% if user.is_authenticated %} | ||
<button type="button" | ||
class="btn" | ||
data-bs-toggle="modal" | ||
data-bs-target="#addNameModal" | ||
data-instrument-name="{{ instrument.instrumentname_set.first.name|title }}" | ||
data-instrument-wikidata-id="{{ instrument.wikidata_id }}"> | ||
Add instrument name | ||
</button> | ||
<button type="button" | ||
class="btn" | ||
data-bs-toggle="modal" | ||
data-bs-target="#uploadImagesModal" | ||
data-instrument-name="{{ instrument.instrumentname_set.first.name|title }}" | ||
data-instrument-wikidata-id="{{ instrument.wikidata_id }}"> | ||
Upload new images | ||
</button> | ||
{% endif %} | ||
<a class="btn" | ||
href="https://www.wikidata.org/wiki/{{ instrument.wikidata_id }}" | ||
target="_blank">View on Wikidata</a> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.