add group page
This commit is contained in:
@ -1,13 +0,0 @@
|
||||
{% extends 'components/inline_form.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block header %}
|
||||
{% trans "Create Group" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block form %}
|
||||
<form name="create-group" method="post" action="{% url 'groups' %}">
|
||||
{% include 'group/form.html' %}
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
6
bookwyrm/templates/groups/created_text.html
Normal file
6
bookwyrm/templates/groups/created_text.html
Normal file
@ -0,0 +1,6 @@
|
||||
{% load i18n %}
|
||||
{% spaceless %}
|
||||
|
||||
{% blocktrans with username=group.manager.display_name path=group.manager.local_path %}Managed by <a href="{{ path }}">{{ username }}</a>{% endblocktrans %}
|
||||
|
||||
{% endspaceless %}
|
21
bookwyrm/templates/groups/delete_group_modal.html
Normal file
21
bookwyrm/templates/groups/delete_group_modal.html
Normal file
@ -0,0 +1,21 @@
|
||||
{% extends 'components/modal.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block modal-title %}{% trans "Delete this group?" %}{% endblock %}
|
||||
|
||||
{% block modal-body %}
|
||||
{% trans "This action cannot be un-done" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block modal-footer %}
|
||||
<div >
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="id" value="{{ group.id }}">
|
||||
<button class="button is-danger" type="submit">
|
||||
{% trans "Delete" %}
|
||||
</button>
|
||||
{% trans "Cancel" as button_text %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with text=button_text controls_text="delete_list" controls_uid=list.id %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
13
bookwyrm/templates/groups/edit_form.html
Normal file
13
bookwyrm/templates/groups/edit_form.html
Normal file
@ -0,0 +1,13 @@
|
||||
{% extends 'components/inline_form.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block header %}
|
||||
{% trans "Edit Group" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block form %}
|
||||
<form name="edit-group" method="post" action="{% url 'group' group.id %}">
|
||||
{% include 'groups/form.html' %}
|
||||
</form>
|
||||
{% include "groups/delete_group_modal.html" with controls_text="delete_group" controls_uid=group.id %}
|
||||
{% endblock %}
|
@ -1,9 +1,12 @@
|
||||
{% load i18n %}
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="user" value="{{ request.user.id }}">
|
||||
|
||||
{{ group_form.non_field_errors }}
|
||||
<div class="columns">
|
||||
|
||||
<div class="column is-two-thirds">
|
||||
<input type="hidden" name="manager" value="{{ request.user.id }}" />
|
||||
<input type="hidden" name="privacy" value="public" />
|
||||
<div class="field">
|
||||
<label class="label" for="id_name">{% trans "Group Name:" %}</label>
|
||||
{{ group_form.name }}
|
||||
|
32
bookwyrm/templates/groups/layout.html
Normal file
32
bookwyrm/templates/groups/layout.html
Normal file
@ -0,0 +1,32 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}{{ group.name }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<header class="columns content is-mobile">
|
||||
<div class="column">
|
||||
<h1 class="title">{{ group.name }} <span class="subtitle">{% include 'snippets/privacy-icons.html' with item=group %}</span></h1>
|
||||
<p class="subtitle help">
|
||||
{% include 'groups/created_text.html' with group=group %}
|
||||
</p>
|
||||
</div>
|
||||
<div class="column is-narrow is-flex">
|
||||
{% if request.user == group.manager %}
|
||||
{% trans "Edit group" as button_text %}
|
||||
{% include 'snippets/toggle/open_button.html' with text=button_text icon_with_text="pencil" controls_text="edit_group" focus="edit_group_header" %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="block content">
|
||||
{% include 'snippets/trimmed_text.html' with full=group.description %}
|
||||
</div>
|
||||
|
||||
<div class="block">
|
||||
{% include 'groups/edit_form.html' with controls_text="edit_group" %}
|
||||
</div>
|
||||
|
||||
{% block panel %}{% endblock %}
|
||||
|
||||
{% endblock %}
|
Reference in New Issue
Block a user