Let users create shelves
This commit is contained in:
@ -12,32 +12,61 @@
|
||||
shelves
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% include 'snippets/user_header.html' with user=user %}
|
||||
|
||||
<div class="block columns">
|
||||
<div class="column">
|
||||
<div class="tabs" aria-role="tablist">
|
||||
<ul>
|
||||
{% for shelf_tab in shelves %}
|
||||
<li class="{% if shelf_tab.identifier == shelf.identifier %}is-active{% endif %}">
|
||||
<a href="/user/{{ user | username }}/shelf/{{ shelf_tab.identifier }}" role="tab" aria-selected="{% if shelf_tab.identifier == shelf.identifier %}true{% else %}false{% endif %}">{{ shelf_tab.name }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if is_self %}
|
||||
<div class="column is-narrow">
|
||||
<a href="/create-shelf/">
|
||||
<span class="icon icon-plus">
|
||||
<span class="is-sr-only">Create new shelf</span>
|
||||
</span>
|
||||
<label for="create-shelf-form">
|
||||
<div role="button" tabindex="0">
|
||||
<span class="icon icon-plus">
|
||||
<span class="is-sr-only">Create new shelf</span>
|
||||
</span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% include 'snippets/user_header.html' with user=user %}
|
||||
<input type="checkbox" id="create-shelf-form" class="toggle-control">
|
||||
<div class="toggle-content hidden">
|
||||
<div class="box mb-5">
|
||||
<h2 class="title is-4">Create new shelf</h2>
|
||||
<form name="create-shelf" action="/create-shelf/" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="user" value="{{ request.user.id }}">
|
||||
<div class="field">
|
||||
<label class="label" for="id_name">Name:</label>
|
||||
<input type="text" name="name" maxlength="100" class="input" required="" id="id_name">
|
||||
</div>
|
||||
|
||||
<div class="block">
|
||||
<div class="tabs" aria-role="tablist">
|
||||
<ul>
|
||||
{% for shelf_tab in shelves %}
|
||||
<li class="{% if shelf_tab.identifier == shelf.identifier %}is-active{% endif %}">
|
||||
<a href="/user/{{ user | username }}/shelf/{{ shelf_tab.identifier }}" role="tab" aria-selected="{% if shelf_tab.identifier == shelf.identifier %}true{% else %}false{% endif %}">{{ shelf_tab.name }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<label class="label">
|
||||
<p>Shelf privacy:</p>
|
||||
{% include 'snippets/privacy_select.html' with no_label=True%}
|
||||
</label>
|
||||
<div class="field is-grouped">
|
||||
<button class="button is-primary" type="submit">Create shelf</button>
|
||||
<label role="button" class="button" for="create-shelf-form" tabindex="0">Cancel<label>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="columns">
|
||||
<div class="block columns">
|
||||
<div class="column">
|
||||
<h2 class="title is-3">{{ shelf.name }}</h2>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user