appstore: draft add to wishlist form + process

This commit is contained in:
Alexandre Aubin
2023-08-18 03:33:01 +02:00
parent efb4555a5c
commit 1995213f52
5 changed files with 190 additions and 14 deletions

View File

@ -25,8 +25,8 @@
<a
class="inline-block rounded border text-blue-600 border-blue-500 px-4 pt-3 text-sm font-medium hover:bg-blue-500 hover:text-white"
href="#"
class="inline-block rounded-md border text-blue-600 border-blue-500 px-4 pt-3 text-sm font-medium hover:bg-blue-500 hover:text-white"
href="{{ url_for('add_to_wishlist') }}"
>
<i class="fa fa-plus fa-fw" aria-hidden="true"></i>
Add an app to the wishlist
@ -55,7 +55,7 @@
</thead>
<tbody class="divide-y divide-gray-200">
{% for infos in wishlist %}
{% for app, infos in wishlist.items() %}
<tr>
<td class="px-4 py-2 font-bold text-gray-900 max-w-[10em]">
{{ infos['name'] }}
@ -67,7 +67,7 @@
href="{{ infos['website'] }}"
class="inline-block"
>
<i class="fa fa-globe rounded border px-3 py-2 hover:bg-gray-100" aria-hidden="true"></i>
<i class="fa fa-globe rounded-md border px-3 py-2 hover:bg-gray-100" aria-hidden="true"></i>
</a>
{% endif %}
</td>
@ -77,14 +77,14 @@
href="{{ infos['upstream'] }}"
class="inline-block"
>
<i class="fa fa-code rounded border px-3 py-2 hover:bg-gray-100" aria-hidden="true"></i>
<i class="fa fa-code rounded-md border px-3 py-2 hover:bg-gray-100" aria-hidden="true"></i>
</a>
{% endif %}
</td>
<td class="px-1 py-2">
<a
href="#"
class="inline-block rounded border text-blue-600 border-blue-500 px-4 py-2 text-xs font-medium hover:bg-blue-500 hover:text-white"
class="inline-block rounded-md border text-blue-600 border-blue-500 px-4 py-2 text-xs font-medium hover:bg-blue-500 hover:text-white"
>
<i class="fa fa-bookmark fa-fw" aria-hidden="true"></i>
Vote

View File

@ -0,0 +1,68 @@
{% extends "base.html" %}
{% block main %}
<div class="mt-5 text-center">
<h2 class="text-2xl font-bold text-gray-900">
Add an application to the wishlist
</h2>
</div>
<div class="overflow-x-auto max-w-md mx-auto pt-5">
{% if not user %}
<div role="alert" class="rounded-md border-s-4 border-orange-500 bg-orange-50 p-4 mb-5">
<p class="mt-2 text-sm text-orange-700 font-bold">
<i class="fa fa-exclamation-triangle fa-fw" aria-hidden="true"></i>
You must first login to be allowed to submit an app to the wishlist
</p>
</div>
{% endif %}
<div role="alert" class="rounded-md border-s-4 border-sky-500 bg-sky-50 p-4">
<p class="mt-2 text-sm text-sky-700 font-bold">
<i class="fa fa-info-circle fa-fw" aria-hidden="true"></i>
Please check the license of the app your are proposing
</p>
<p class="mt-2 text-sm text-sky-700">
The YunoHost project will only package free/open-source software (with possible case-by-case exceptions for apps which are not-totally-free)
</p>
</div>
{% if errormsg %}
<div role="alert" class="rounded-md border-s-4 border-red-500 bg-red-50 p-4 my-5">
<p class="mt-2 text-sm text-red-700 font-bold">
<i class="fa fa-exclamation-triangle fa-fw" aria-hidden="true"></i>
{{ errormsg }}
</p>
</div>
{% endif %}
<form method="POST" action="{{ url_for('add_to_wishlist') }}" class="mt-8 mb-8" >
<label for="name" class="mt-5 block font-bold text-gray-700">Name</label>
<input name="name" type="text" class="w-full mt-1 rounded-md border-gray-200 text-gray-700 shadow-sm" maxlength="30" required onkeyup="this.value = this.value.replace(/[^a-zA-Z0-9.-\\(\\)\\ ]/, '')" />
<label for="description" class="mt-5 block font-bold text-gray-700">Description</label>
<textarea name="description" type="text" class="w-full mt-1 rounded-md border-gray-200 text-gray-700 shadow-sm" required rows='3' maxlength='100'></textarea>
<span class="text-xs text-gray-600"><span class="font-bold">Please be concise and focus on what the app does.</span> No need to repeat "[App] is ...". No need to state that it is free/open-source or self-hosted (otherwise it wouldn't be packaged for YunoHost). Avoid marketing stuff like 'the most', or vague properties like 'easy', 'simple', 'lightweight'.</span>
<label for="upstream" class="mt-5 block font-bold text-gray-700">Project code repository</label>
<input name="upstream" type="url" class="w-full mt-1 rounded-md border-gray-200 text-gray-700 shadow-sm" maxlength="150" required />
<label for="website" class="mt-5 block font-bold text-gray-700">Project website</label>
<input name="website" type="url" class="w-full mt-1 rounded-md border-gray-200 text-gray-700 shadow-sm" maxlength="150" />
<span class="text-xs text-gray-600">Please <emph>do not</emph> just copy-paste the code repository URL. If the project has no proper website, then leave the field empty.</span>
<button
type="submit"
class="mx-auto block rounded-md border text-white bg-blue-500 px-4 mt-5 py-2 font-medium {% if user %}hover:bg-blue-700{% endif %}"
{% if not user %}disabled{% endif %}
>
Submit
</button>
</form>
</div>
{% endblock %}