forked from mirrors/bookwyrm
Cleans up add server form
This commit is contained in:
parent
74549956c2
commit
d383e8a61e
3 changed files with 41 additions and 4 deletions
|
@ -286,4 +286,4 @@ class ReportForm(CustomForm):
|
|||
class ServerForm(CustomForm):
|
||||
class Meta:
|
||||
model = models.FederatedServer
|
||||
exclude = []
|
||||
exclude = ["remote_id"]
|
||||
|
|
|
@ -7,9 +7,7 @@
|
|||
|
||||
{% block form %}
|
||||
<form>
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button type="submit" class="button is-primary">{% trans "Save" %}</button>
|
||||
{% include 'settings/server_form.html' %}
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
|
|
39
bookwyrm/templates/settings/server_form.html
Normal file
39
bookwyrm/templates/settings/server_form.html
Normal file
|
@ -0,0 +1,39 @@
|
|||
{% load i18n %}
|
||||
|
||||
{% csrf_token %}
|
||||
|
||||
<div class="columns">
|
||||
<div class="column is-half">
|
||||
<p>
|
||||
<label class="label" for="id_server_name">{% trans "Instance:" %}</label>
|
||||
<input type="text" name="server_name" maxlength="255" class="input" required="" id="id_server_name" value="{{ form.server_name.value|default:'' }}" placeholder="domain.com">
|
||||
</p>
|
||||
<p>
|
||||
<label class="label" for="id_status">{% trans "Status:" %}</label>
|
||||
<div class="select">
|
||||
<select name="status" class="" id="id_status">
|
||||
<option value="federated" {% if form.status.value == "federated" or not form.status.value %}selected=""{% endif %}>Federated</option>
|
||||
<option value="blocked" {% if form.status.value == "blocked" %}selected{% endif %}>Blocked</option>
|
||||
</select>
|
||||
</div>
|
||||
</p>
|
||||
</div>
|
||||
<div class="column is-half">
|
||||
<p>
|
||||
<label class="label" for="id_application_type">{% trans "Software:" %}</label>
|
||||
<input type="text" name="application_type" maxlength="255" class="input" id="id_application_type" value="{{ form.application_type.value|default:'' }}">
|
||||
</p>
|
||||
<p>
|
||||
<label class="label" for="id_application_version">{% trans "Version:" %}</label>
|
||||
<input type="text" name="application_version" maxlength="255" class="input" id="id_application_version" value="{{ form.application_version.value|default:'' }}">
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<p>
|
||||
<label class="label" for="id_notes">{% trans "Notes:" %}</label>
|
||||
<textarea name="notes" cols="None" rows="None" class="textarea" id="id_notes">
|
||||
{{ form.notes.value|default:'' }}
|
||||
</textarea>
|
||||
</p>
|
||||
|
||||
<button type="submit" class="button is-primary">{% trans "Save" %}</button>
|
Loading…
Reference in a new issue