parent
d64e2f854c
commit
ce6e3b451e
18 changed files with 170 additions and 151 deletions
@ -0,0 +1,19 @@ |
|||||||
|
from django.contrib.sites.models import Site |
||||||
|
from django.views.generic.base import ContextMixin |
||||||
|
|
||||||
|
|
||||||
|
class BaseMixin(ContextMixin): |
||||||
|
def get_context_data(self, **kwargs): |
||||||
|
context = super().get_context_data(**kwargs) |
||||||
|
|
||||||
|
pk = self.kwargs.get('pk') |
||||||
|
|
||||||
|
if pk: |
||||||
|
context['pk'] = pk |
||||||
|
|
||||||
|
context['domain'] = Site.objects.get_current().domain |
||||||
|
|
||||||
|
return context |
||||||
|
|
||||||
|
|
||||||
|
# import code; code.interact(local=dict(globals(), **locals())) |
||||||
@ -1,9 +1,9 @@ |
|||||||
{{ user }} |
{{ request.user }} |
||||||
|
|
||||||
|
|
||||||
<h2>Мои проекты</h2> |
<h2>Мои проекты</h2> |
||||||
|
|
||||||
{% for proj in user.projects.all %} |
{% for proj in request.user.projects.all %} |
||||||
<h3>{{ proj }}</h3> |
<h3>{{ proj }}</h3> |
||||||
<h5>{{ proj.order }}</h5> |
<h5>{{ proj.order }}</h5> |
||||||
{% endfor %} |
{% endfor %} |
||||||
|
|||||||
@ -1,11 +1,6 @@ |
|||||||
{% extends '_layout.html' %} |
{% extends 'partials/base.html' %} |
||||||
|
|
||||||
{% load staticfiles %} |
|
||||||
|
|
||||||
{% block content %} |
{% block content %} |
||||||
<div ng-controller='TestCtrl as test'> |
<h1>project: {{ project }}</h1> |
||||||
<ul ng-repeat='user in test.users'> |
<h1>object: {{ object }}</h1> |
||||||
<li>{( user.first_name )}</li> |
|
||||||
</ul> |
|
||||||
</div> |
|
||||||
{% endblock %} |
{% endblock %} |
||||||
|
|||||||
@ -1,36 +0,0 @@ |
|||||||
{% extends 'partials/base.html' %} |
|
||||||
{% block content %} |
|
||||||
|
|
||||||
<div class="container container_1200""> |
|
||||||
<hr> |
|
||||||
</div> |
|
||||||
|
|
||||||
<!-- block_registr --> |
|
||||||
<div class="container container_1200" id="registration"> |
|
||||||
<div class="block_registr"> |
|
||||||
<div class="text-center registr">Вход</div> |
|
||||||
<form method="post" action="{% url 'django.contrib.auth.views.login' %}"> |
|
||||||
{% csrf_token %} |
|
||||||
|
|
||||||
<div class="form-group"> |
|
||||||
<input type="email" name="{{ form.username.name }}" class="col-xs-10 form-control" id="inputEmail" placeholder="Электронная почта"> |
|
||||||
<p>{{ form.email.errors.as_text }}</p> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="form-group"> |
|
||||||
<input type="password" name="{{ form.password.name }}" class="col-xs-10 form-control" id="inputPassword" placeholder="Пароль"> |
|
||||||
<p>{{ form.password1.errors.as_text }}</p> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div> |
|
||||||
<button type="submit" class="btn registr_button"> |
|
||||||
Вход |
|
||||||
</button> |
|
||||||
</div> |
|
||||||
|
|
||||||
|
|
||||||
</form> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
<!-- block_registr end --> |
|
||||||
{% endblock %} |
|
||||||
Loading…
Reference in new issue