mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 04:10:06 -05:00
space create initial name and markup
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">{% trans 'Join an existing space.' %}</h5>
|
||||
<p class="card-text">{% trans 'To join an existing space either enter your invite token or click on the invite link the space owner send you.' %}</p>
|
||||
<p class="card-text" style="height: 64px">{% trans 'To join an existing space either enter your invite token or click on the invite link the space owner send you.' %}</p>
|
||||
|
||||
<form method="POST" action="{% url 'view_no_space' %}">
|
||||
{% csrf_token %}
|
||||
@@ -49,7 +49,7 @@
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">{% trans 'Create your own recipe space.' %}</h5>
|
||||
<p class="card-text">{% trans 'Start your own recipe space and invite other users to it.' %}</p>
|
||||
<p class="card-text" style="height: 64px">{% trans 'Start your own recipe space and invite other users to it.' %}</p>
|
||||
<form method="POST" action="{% url 'view_no_space' %}">
|
||||
{% csrf_token %}
|
||||
{{ create_form | crispy }}
|
||||
|
||||
@@ -120,6 +120,7 @@ def no_space(request):
|
||||
max_users=settings.SPACE_DEFAULT_MAX_USERS,
|
||||
allow_sharing=settings.SPACE_DEFAULT_ALLOW_SHARING,
|
||||
)
|
||||
|
||||
request.user.userpreference.space = created_space
|
||||
request.user.userpreference.save()
|
||||
request.user.groups.add(Group.objects.filter(name='admin').get())
|
||||
@@ -139,7 +140,7 @@ def no_space(request):
|
||||
if 'signup_token' in request.session:
|
||||
return HttpResponseRedirect(reverse('view_invite', args=[request.session.pop('signup_token', '')]))
|
||||
|
||||
create_form = SpaceCreateForm()
|
||||
create_form = SpaceCreateForm(initial={'name': f'{request.user.username}\'s Space'})
|
||||
join_form = SpaceJoinForm()
|
||||
|
||||
return render(request, 'no_space_info.html', {'create_form': create_form, 'join_form': join_form})
|
||||
|
||||
Reference in New Issue
Block a user