From a72bb0cdce1e51cd36c14b031d2e024edc9f7e05 Mon Sep 17 00:00:00 2001 From: Kun Fang Date: Tue, 23 Jul 2024 10:44:51 -0400 Subject: [PATCH] feat: initialize image uploading & name edting Refs: #128 --- .../static/instruments/css/detail.css | 18 +++++++ .../templates/instruments/detail.html | 52 +++++++++++++------ .../includes/imageUploadModal.html | 31 +++++++++++ 3 files changed, 85 insertions(+), 16 deletions(-) create mode 100644 web-app/django/VIM/apps/instruments/templates/instruments/includes/imageUploadModal.html diff --git a/web-app/django/VIM/apps/instruments/static/instruments/css/detail.css b/web-app/django/VIM/apps/instruments/static/instruments/css/detail.css index 7cb5e4f..2e4ae64 100644 --- a/web-app/django/VIM/apps/instruments/static/instruments/css/detail.css +++ b/web-app/django/VIM/apps/instruments/static/instruments/css/detail.css @@ -97,3 +97,21 @@ th[scope='row'] { .btn.publish { background-color: #28a745; } +.btn-primary { + background-color: #435334; + border: 1px solid #435334; +} +.btn-primary:hover { + background-color: #9eb384; + border: 1px solid #9eb384; +} +.form-label { + color: #435334; +} +.image-header { + display: flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: space-between; + align-items: flex-start; +} diff --git a/web-app/django/VIM/apps/instruments/templates/instruments/detail.html b/web-app/django/VIM/apps/instruments/templates/instruments/detail.html index 2fe1dc7..4b530fa 100644 --- a/web-app/django/VIM/apps/instruments/templates/instruments/detail.html +++ b/web-app/django/VIM/apps/instruments/templates/instruments/detail.html @@ -89,11 +89,13 @@

type="text" value="{{ instrumentname.language.en_label }}" /> -
- - - -
+ {% if user.is_authenticated %} +
+ + + +
+ {% endif %} @@ -102,11 +104,13 @@

{{ instrumentname.name }} -
- - - -
+ {% if user.is_authenticated %} +
+ + + +
+ {% endif %} @@ -117,11 +121,13 @@

type="text" value="{{ instrumentname.source_name }}" /> -
- - - -
+ {% if user.is_authenticated %} +
+ + + +
+ {% endif %} @@ -131,7 +137,21 @@

- Image + +
+ Image + {% if user.is_authenticated %} + + {% include "instruments/includes/imageUploadModal.html" %} + + {% endif %} +
+
diff --git a/web-app/django/VIM/apps/instruments/templates/instruments/includes/imageUploadModal.html b/web-app/django/VIM/apps/instruments/templates/instruments/includes/imageUploadModal.html new file mode 100644 index 0000000..9c8824a --- /dev/null +++ b/web-app/django/VIM/apps/instruments/templates/instruments/includes/imageUploadModal.html @@ -0,0 +1,31 @@ +