list sharing implemented w. passing UTs & FTs; changes to apps.dashboard.urls, .models, .views & .tests.test_views to accomodate; functional_tests.test_sharing also ensures sharing visible in UX; templates/apps/dashboard/list.html & /my_lists.html updated with django templating & for loops
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
|
||||
{% block content %}
|
||||
<div class="row justify-content-center">
|
||||
<small>List created by: <span id="id_list_owner">{{ list.owner.email }}</span></small>
|
||||
<div class="col-lg-6">
|
||||
<table id="id_list_table" class="table">
|
||||
{% for item in list.item_set.all %}
|
||||
@@ -19,6 +20,35 @@
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-6">
|
||||
|
||||
<form method="POST" action="{% url "share_list" list.id %}">
|
||||
{% csrf_token %}
|
||||
<input
|
||||
id="id_recipient"
|
||||
name="recipient"
|
||||
class="form-control form-control-lg{% if form.errors %} is-invalid{% endif %}"
|
||||
placeholder="friend@example.com"
|
||||
aria-describedby="id_recipient_feedback"
|
||||
required
|
||||
/>
|
||||
{% if form.errors %}
|
||||
<div id="id_recipient_feedback" class="invalid-feedback">
|
||||
{{ form.errors.recipient.0 }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<button type="submit" class="btn btn-primary">Share</button>
|
||||
</form>
|
||||
<small>List shared with:
|
||||
{% for user in list.shared_with.all %}
|
||||
<span class="list-recipient">{{ user.email }}</span>
|
||||
{% endfor %}
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
||||
{% block scripts %}
|
||||
|
||||
Reference in New Issue
Block a user