mirror of
https://github.com/Radiquum/photos.git
synced 2025-04-05 15:54:31 +00:00
feat/admin: add alt text edit field
This commit is contained in:
parent
54356276db
commit
92114d9741
2 changed files with 11 additions and 1 deletions
|
@ -249,6 +249,7 @@ def Edit(id):
|
||||||
date = datetime.fromtimestamp(float(float(str(obj["date"])[:10]))).strftime(
|
date = datetime.fromtimestamp(float(float(str(obj["date"])[:10]))).strftime(
|
||||||
"%d/%m/%Y"
|
"%d/%m/%Y"
|
||||||
)
|
)
|
||||||
|
alt=obj["alt"]
|
||||||
return render_template(
|
return render_template(
|
||||||
"edit.html",
|
"edit.html",
|
||||||
name=name,
|
name=name,
|
||||||
|
@ -256,6 +257,7 @@ def Edit(id):
|
||||||
tags=":".join(tags),
|
tags=":".join(tags),
|
||||||
urls=urls,
|
urls=urls,
|
||||||
date=date,
|
date=date,
|
||||||
|
alt=alt,
|
||||||
page_title=f"Edit - {name}",
|
page_title=f"Edit - {name}",
|
||||||
s3_endpoint=os.getenv("AWS_ENDPOINT"),
|
s3_endpoint=os.getenv("AWS_ENDPOINT"),
|
||||||
s3_bucket=os.getenv("AWS_BUCKET"),
|
s3_bucket=os.getenv("AWS_BUCKET"),
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
enctype="multipart/form-data">
|
enctype="multipart/form-data">
|
||||||
|
|
||||||
<div class="flex flex-col gap-2">
|
<div class="flex flex-col gap-2">
|
||||||
<img src="{{ s3_endpoint }}/{{ s3_bucket }}/{{ img }}" alt="" class="w-[296px] object-scale-down rounded-lg" />
|
<img src="{{ s3_endpoint }}/{{ s3_bucket }}/{{ img }}" alt="" class="w-[296px] object-cover rounded-lg" />
|
||||||
<div id="datepicker-inline" inline-datepicker datepicker-buttons datepicker-format="dd/mm/yyyy"
|
<div id="datepicker-inline" inline-datepicker datepicker-buttons datepicker-format="dd/mm/yyyy"
|
||||||
datepicker-title="Shoot Date" data-date="{{ date }}"></div>
|
datepicker-title="Shoot Date" data-date="{{ date }}"></div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -35,6 +35,14 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="w-full">
|
||||||
|
<label for="url-input"
|
||||||
|
class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Description</label>
|
||||||
|
<textarea id="alt-text" rows="4" name="alt"
|
||||||
|
class="block p-2.5 text-sm text-gray-900 w-full h-full resize-none bg-gray-50 rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
||||||
|
placeholder="Alt-Text" draggable="false">{{ alt }}</textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="w-full flex flex-wrap gap-2">
|
<div class="w-full flex flex-wrap gap-2">
|
||||||
<button type="submit" id="btn-submit"
|
<button type="submit" id="btn-submit"
|
||||||
class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 me-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800">Save</button>
|
class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 me-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800">Save</button>
|
||||||
|
|
Loading…
Add table
Reference in a new issue