merge st_button
This commit is contained in:
commit
ecf32a0ae7
@ -23,6 +23,12 @@
|
|||||||
class="btn btn-secondary"
|
class="btn btn-secondary"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
href="{% url 'control' %}">Управление</a>
|
href="{% url 'control' %}">Управление</a>
|
||||||
|
<a {% if stats_lit %}
|
||||||
|
class="btn btn-primary"
|
||||||
|
{% else %}
|
||||||
|
class="btn btn-secondary"
|
||||||
|
{% endif %}
|
||||||
|
href="{% url 'statistic' %}">Статистика</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a {% if work_lit %}
|
<a {% if work_lit %}
|
||||||
class="btn btn-primary"
|
class="btn btn-primary"
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
{% for radio in form.interval%}
|
{% for radio in form.interval%}
|
||||||
{{ radio.tag }}
|
{{ radio.tag }}
|
||||||
<label class="btn btn-secondary text-primary bg-white" for="{{ radio.id_for_label }}">
|
<label class="btn btn-outline-secondary" for="{{ radio.id_for_label }}">
|
||||||
{{ radio.choice_label }}
|
{{ radio.choice_label }}
|
||||||
</label>
|
</label>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@ -39,7 +39,7 @@
|
|||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
{% for radio in form.display_format%}
|
{% for radio in form.display_format%}
|
||||||
{{ radio.tag }}
|
{{ radio.tag }}
|
||||||
<label class="btn btn-secondary text-primary bg-white" for="{{ radio.id_for_label }}">
|
<label class="btn btn-outline-secondary" for="{{ radio.id_for_label }}">
|
||||||
{{ radio.choice_label }}
|
{{ radio.choice_label }}
|
||||||
</label>
|
</label>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@ -67,7 +67,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-row text-center">
|
<div class="form-row text-center">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<button type="submit" class="btn btn-primary bg-white text-primary">Посмотреть статистику</button>
|
<button type="submit" class="btn btn-outline-primary">Посмотреть статистику</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -30,13 +30,17 @@ from .models import UserProfile
|
|||||||
|
|
||||||
|
|
||||||
def setup_context(profile_lit: bool = False, control_lit: bool = False, work_lit: bool = False,
|
def setup_context(profile_lit: bool = False, control_lit: bool = False, work_lit: bool = False,
|
||||||
registration_lit: bool = False, login_lit: bool = False):
|
registration_lit: bool = False, login_lit: bool = False, stats_lit: bool = False):
|
||||||
|
|
||||||
|
print(profile_lit, control_lit, work_lit, registration_lit, login_lit)
|
||||||
|
|
||||||
context = {
|
context = {
|
||||||
'profile_lit': profile_lit,
|
'profile_lit': profile_lit,
|
||||||
'control_lit': control_lit,
|
'control_lit': control_lit,
|
||||||
'work_lit': work_lit,
|
'work_lit': work_lit,
|
||||||
'registration_lit': registration_lit,
|
'registration_lit': registration_lit,
|
||||||
'login_lit': login_lit,
|
'login_lit': login_lit,
|
||||||
|
'stats_lit': stats_lit,
|
||||||
}
|
}
|
||||||
return context
|
return context
|
||||||
|
|
||||||
@ -363,7 +367,7 @@ def statistic_page(request: WSGIRequest) -> HttpResponse:
|
|||||||
|
|
||||||
if not request.user.is_superuser:
|
if not request.user.is_superuser:
|
||||||
return redirect('index')
|
return redirect('index')
|
||||||
context = setup_context()
|
context = setup_context(stats_lit=True)
|
||||||
context.update({
|
context.update({
|
||||||
'pagename': 'страница статистики',
|
'pagename': 'страница статистики',
|
||||||
'errors': list(),
|
'errors': list(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user