#ARC-15 jquery-sortable add

remotes/origin/setup
Mukhtar 10 years ago
parent d4da6dd7c9
commit 8005a56625
  1. 19
      projects/migrations/0005_auto_20160812_1931.py
  2. 3
      projects/models.py
  3. 103
      projects/templates/comparison.html
  4. 1
      projects/views.py
  5. 3
      users/templates/contractor_profile.html
  6. 5
      work_sell/templates/worksell_edit.html

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-08-12 16:31
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('projects', '0004_merge'),
]
operations = [
migrations.AlterModelOptions(
name='candidate',
options={'ordering': ('position',), 'verbose_name': 'Кандидат', 'verbose_name_plural': 'Кандидаты'},
),
]

@ -206,9 +206,10 @@ class Candidate(models.Model):
position = models.PositiveIntegerField(default=0)
def __str__(self):
return self.answer.user.get_full_name()
return str(self.answer.pk)
class Meta:
ordering = ('position',)
verbose_name = 'Кандидат'
verbose_name_plural = 'Кандидаты'

@ -4,44 +4,47 @@
{% block content %}
{% include 'partials/header.html' %}
<div class="container mainScore">
<div class="row">
<div class="col-lg-12">
<p class="titleScore">Сравнение кандидатов по проекту</p>
</div>
<div class="titleBlockComparison disTab">
<div class="triangle1"></div>
<p>{{ object }}</p>
<table class="compTable">
<tr>
<th></th>
<th>Кандидат</th>
<th>Цена</th>
<th>Срок</th>
<th>Описание</th>
<th>Рейтинги/отзывы</th>
<th>Безопасные сделки</th>
<th>Решение</th>
</tr>
<div class="container mainScore">
<div class="row">
<div class="col-lg-12">
<p class="titleScore">Сравнение кандидатов по проекту</p>
</div>
<div class="titleBlockComparison disTab">
<div class="triangle1"></div>
<p>{{ object }}</p>
<table class="compTable" id="compTable">
<thead>
<tr>
<th></th>
<th>Кандидат</th>
<th>Цена</th>
<th>Срок</th>
<th>Описание</th>
<th>Рейтинги/отзывы</th>
<th>Безопасные сделки</th>
<th>Решение</th>
</tr>
</thead>
<tbody>
{% for cand in object.candidates.all %}
<tr>
<tr style="cursor:pointer" class="items[]_{{ cand.pk }}" data-class="items[]_{{ cand.pk }}">
<td>{{ forloop.counter }}</td>
<td>
{{ cand.answer.contractor.get_full_name }}
{{ cand.answer.contractor.get_full_name }} {{ cand.answer.contractor.username }}
</td>
<td>{{ cand.answer.budget }} <i class="fa fa-rub"></i></td>
<td>
{{ cand.answer.term }}<br> <span>{{ cand.answer.term_type }}</span>
</td>
<td>
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
</td>
<td>
<ul>
<li><span>0</span></li>
@ -51,18 +54,18 @@
<small> - 0</small>
</li>
{% if cand.answer.contractor.cro %}
<li>
СРО
</li>
<li>
СРО
</li>
{% endif %}
</ul>
</td>
<td>
<span>0</span><br>
Готов работать по безопасной сделке
</td>
<td>
<div class="tableButtons disTab">
<div class="btnTab btnTab1"></div>
@ -73,10 +76,36 @@
</td>
</tr>
{% endfor %}
</table>
</div>
</tbody>
</table>
</div>
{% include 'partials/footer.html' %}
</div>
</div>
</div>
</div>
{% endblock %}
{% block js_block %}
<script src="https://code.jquery.com/ui/1.12.0/jquery-ui.min.js"
integrity="sha256-eGE6blurk5sHj+rmkfsGYeKyZx3M4bG+ZlFyA7Kns7E=" crossorigin="anonymous"></script>
<script type="text/javascript">
$(function () {
var fixHelper = function(e,ui) {
ui.children().each(function(){
$(this).width($(this).width());
});
return ui;
};
$("#compTable tbody").sortable({
forcePlaceholderSize:true,
forceHelperSize: true,
items: 'tr',
update: function(){
var serial = $('#compTable tbody').sortable('serialize',{key:'items[]', attribute:'data-class'});
console.log(serial);
},
helper: fixHelper,
}).disableSelection();;
});
</script>
{% endblock %}

@ -411,6 +411,7 @@ class ContractorPortfolioTrashView(View):
redirect_to = request.POST.get('next')
return redirect(redirect_to)
class CustomerProjectTrashView(View):
form_class = CustomerProjectTrashForm

@ -201,13 +201,14 @@
{% for ws in user.work_sell.all %}
<div class="col-lg-4">
<div class="insetCol box-sizing disTab">
<a href="{% url 'work_sell:detail' ws.pk %}">
{% thumbnail ws.get_cover "224x224" crop="center" as im %}
<div class="imgGal"
style="background:rgba(0, 0, 0, 0) url('{{ im.url }}') no-repeat scroll center center / cover ;">
<div class="imgFigure"></div>
</div>
{% endthumbnail %}
</a>
<div class="cenaImg box-sizing">
<div class="cenaImgInset">

@ -83,9 +83,10 @@
{{ form.building_classification}}
</div>
<div class="textAreaBlock2 text-nn box-sizing disTab">
<input type="file" name="{{ form.img.html_name }}" >
<div class="polsF1 polsF2 disTab">
{% form.ins %}
</div>
<div class="searchF1 polsF1 polsFF links-filter">
<input class="btn-submit-link" type="submit" value="Сохранить проект">
</div>

Loading…
Cancel
Save