Merge branch 'setup' of https://bitbucket.org/PekopT/archilance into setup
commit
a0fe73f49a
31 changed files with 872 additions and 643 deletions
@ -1,9 +0,0 @@ |
|||||||
from django.shortcuts import _get_queryset |
|
||||||
|
|
||||||
def get_or_none(klass, *args, **kwargs): |
|
||||||
queryset = _get_queryset(klass) |
|
||||||
|
|
||||||
try: |
|
||||||
return queryset.get(*args, **kwargs) |
|
||||||
except queryset.model.DoesNotExist: |
|
||||||
return None |
|
||||||
@ -0,0 +1,26 @@ |
|||||||
|
# -*- coding: utf-8 -*- |
||||||
|
# Generated by Django 1.9.7 on 2016-07-26 16:31 |
||||||
|
from __future__ import unicode_literals |
||||||
|
|
||||||
|
import datetime |
||||||
|
from django.db import migrations, models |
||||||
|
from django.utils.timezone import utc |
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration): |
||||||
|
|
||||||
|
dependencies = [ |
||||||
|
('projects', '0003_auto_20160725_1606'), |
||||||
|
] |
||||||
|
|
||||||
|
operations = [ |
||||||
|
migrations.AlterModelOptions( |
||||||
|
name='stage', |
||||||
|
options={'ordering': ['pos'], 'verbose_name': 'Этап', 'verbose_name_plural': 'Этапы'}, |
||||||
|
), |
||||||
|
migrations.AlterField( |
||||||
|
model_name='stage', |
||||||
|
name='created', |
||||||
|
field=models.DateTimeField(default=datetime.datetime(2016, 7, 26, 16, 31, 5, 738741, tzinfo=utc)), |
||||||
|
), |
||||||
|
] |
||||||
@ -1,29 +1,51 @@ |
|||||||
{% if is_paginated %} |
{% if is_paginated %} |
||||||
<nav> |
<nav> |
||||||
<ul class="pagination"> |
<ul class="pagination"> |
||||||
{% if page_obj.has_previous %} |
<li> |
||||||
<li> |
<a |
||||||
<button type="submit" name="page" value="{{ page_obj.previous_page_number }}">Previous</button> |
href="#" |
||||||
</li> |
aria-label="Previous" |
||||||
{% endif %} |
|
||||||
|
{% if page_obj.has_previous %} |
||||||
|
onclick="paginateTo({{ page_obj.previous_page_number }}); return false" |
||||||
|
{% else %} |
||||||
|
onclick="return false" |
||||||
|
style="cursor: not-allowed" |
||||||
|
{% endif %}> |
||||||
|
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span> |
||||||
|
</a> |
||||||
|
</li> |
||||||
|
|
||||||
{% for n in page_obj.paginator.page_range %} |
{% for n in page_obj.paginator.page_range %} |
||||||
{% if n == page_obj.number %} |
{% if n == page_obj.number %} |
||||||
<li class="i active"> |
<li class="active"><a href="#" onclick="return false">{{ n }}</a></li> |
||||||
<button type="submit" name="page" value="{{ n }}" class="i" disabled>{{ n }}</button> |
|
||||||
</li> |
|
||||||
{% else %} |
{% else %} |
||||||
<li> |
<li><a href="#" onclick="paginateTo({{ n }}); return false">{{ n }}</a></li> |
||||||
<button type="submit" name="page" value="{{ n }}">{{ n }}</button> |
|
||||||
</li> |
|
||||||
{% endif %} |
{% endif %} |
||||||
{% endfor %} |
{% endfor %} |
||||||
|
|
||||||
{% if page_obj.has_next %} |
<li> |
||||||
<li> |
<a |
||||||
<button type="submit" name="page" value="{{ page_obj.next_page_number }}">Next</button> |
href="#" |
||||||
</li> |
aria-label="Next" |
||||||
{% endif %} |
|
||||||
|
{% if page_obj.has_next %} |
||||||
|
onclick="paginateTo({{ page_obj.next_page_number }}); return false" |
||||||
|
{% else %} |
||||||
|
onclick="return false" |
||||||
|
style="cursor: not-allowed" |
||||||
|
{% endif %}> |
||||||
|
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span> |
||||||
|
</a> |
||||||
|
</li> |
||||||
</ul> |
</ul> |
||||||
</nav> |
</nav> |
||||||
|
|
||||||
|
<script> |
||||||
|
function paginateTo(pageNum) { |
||||||
|
var urlObj = new URI(location.href) |
||||||
|
urlObj.setQuery('page', pageNum) |
||||||
|
location.href = urlObj.href() |
||||||
|
} |
||||||
|
</script> |
||||||
{% endif %} |
{% endif %} |
||||||
|
|||||||
@ -0,0 +1,29 @@ |
|||||||
|
# -*- coding: utf-8 -*- |
||||||
|
# Generated by Django 1.9.7 on 2016-07-26 16:31 |
||||||
|
from __future__ import unicode_literals |
||||||
|
|
||||||
|
from django.db import migrations, models |
||||||
|
import django.db.models.deletion |
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration): |
||||||
|
|
||||||
|
dependencies = [ |
||||||
|
('users', '0002_auto_20160725_1605'), |
||||||
|
] |
||||||
|
|
||||||
|
operations = [ |
||||||
|
migrations.RenameModel( |
||||||
|
old_name='ContractorFinancialInfo', |
||||||
|
new_name='UserFinancialInfo', |
||||||
|
), |
||||||
|
migrations.RemoveField( |
||||||
|
model_name='user', |
||||||
|
name='contractor_financial_info', |
||||||
|
), |
||||||
|
migrations.AddField( |
||||||
|
model_name='user', |
||||||
|
name='financial_info', |
||||||
|
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='user', to='users.UserFinancialInfo'), |
||||||
|
), |
||||||
|
] |
||||||
Loading…
Reference in new issue