registration redirect. Note button

remotes/origin/1203
Назар Котюк 11 years ago
parent 5a1def04ec
commit fed13751f1
  1. 3
      registration/backends/default/views.py
  2. 2
      service/views.py
  3. 2
      templates/client/includes/exposition/exposition_list.html
  4. 12
      templates/client/includes/exposition/exposition_object.html
  5. 2
      templates/client/static_client/js/_modules/block.registration.completion.js

@ -254,8 +254,9 @@ def complete_registration(request):
response = {'success': False}
form = RegistrationCompleteForm(request.POST, instance=request.user)
if form.is_valid():
form.save()
user = form.save()
response['success']=True
response['redirect'] = user.get_permanent_url()
else:
response['errors'] = form.errors
return HttpResponse(json.dumps(response), content_type='application/json')

@ -43,7 +43,7 @@ def advertise(request):
form.save()
response['success'] = True
else:
response['erros'] = form.errors
response['errors'] = form.errors
return HttpResponse(json.dumps(response), content_type='application/json')

@ -68,7 +68,7 @@
<div class="cli-m-buttons">
{% include 'client/includes/exposition/services.html' with obj=obj %}
{% include 'client/includes/calendar_button.html' with event=obj user=user %}
{% include 'client/includes/calendar_button.html' with obj=obj%}
<div class="{% if request.user.is_authenticated%}note-wrap{% else %}note-wrap-disabled{% endif %}">
{% with note=obj|note_by_user:request.user %}
<a class="button green icon-note {% if note %}active{% endif %} note-button" href="/expo/add-note/{{ obj.url }}/">{% trans 'заметка' %}</a>

@ -73,20 +73,18 @@
{% with event=exposition user=user %}
{% include 'client/includes/visit_button.html' %}
{% endwith %}
{% with event=exposition user=user %}
{% include 'client/includes/calendar_button.html' %}
{% endwith %}
{% include 'client/includes/calendar_button.html' with obj=object %}
<div class="{% if request.user.is_authenticated%}note-wrap{% else %}note-wrap-disabled{% endif %}">
<a class="button green icon-note {% if note %}active{% endif %} note-button" href="/expo/add-note/{{ object.url }}/">{% trans 'заметка' %}</a>
{% with note=object|note_by_user:request.user %}
<a class="button green icon-note {% if note %}active{% endif %} note-button" href="/expo/add-note/{{ obj.url }}/">{% trans 'заметка' %}</a>
<div class="note-overlay">
<form action="">
<textarea name="note_text" class="note-text"> {{ note }}</textarea>
</form>
</div>
{% endwith %}
</div>
{% if request.user.is_admin %}
<a class="button green " href="/admin/exposition/{{ object.url }}/">{% trans 'изменить' %}</a>
{% endif %}

@ -25,7 +25,7 @@ if (EXPO.registration.completion) {
errClass = EXPO.common.opt.errMessageClass;
$('.'+errClass,$popup).removeClass(activeClass);
if (data.success) {
location.reload();
location = data.redirect;
}
else {
console.log(data);

Loading…
Cancel
Save