-
+
+
Этапы работы
+
+
1 / Согласование условий
+
+ Обсуджение задания и условий выполнения работы. Подтверждение заказа исполнителем.
+
+
+
+
+
+
+ Какое кол-во этапов подразумевает работа?
+
+
-
+
-
+
+
@@ -241,23 +245,48 @@
var csrftoken = getCookie('csrftoken');
- $('#countStage').on('change', function(e){
- $(".stages_form").each(function(){
+ $("#addStagesForm").on('click',function(){
+ $(".new-stages-form").each(function(i,v){
+ $.ajax({
+ url: '/api/stages/',
+ type: 'POST',
+ beforeSend: function (xhr) {
+ xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'))
+ },
+ data:$(this).serialize(),
+ dataType: 'json',
+ success: function (json) {
+ console.log(json);
+ },
+ error: function(e){
+ console.log(e);
+ }
+ });
+
+ });
+ });
+
+ $('#countStage').on('change', function (e) {
+ $(".stages_form").each(function () {
$(this).remove();
});
var countStage = parseInt($(this).val());
var limitCount = countStage + 1;
- for(var i=2;i
' +
- '
'+ senderName +'
'+ v.created +' ' +
+ inbox.innerHTML += '' +
+ '
' + senderName + '
' + v.created + '' +
'
' + v.text + '
';
});
}
@@ -296,10 +325,22 @@
success: function (json) {
var htmlInbox = "";
$.each(json.results, function (i, v) {
- htmlInbox += '' +
- '
Этап '+ v.pos +''+ v.name +'
' +
- '
Результаты этапа:'+ v.result+'
' +
- '
до 16.03.2015
'+ v.cost +' ';
+ if (v.status == "not_agreed") {
+ htmlInbox += '';
+ } else {
+ htmlInbox += '' +
+ '
Этап ' + v.pos + '' + v.name + '
' +
+ '
Результаты этапа:' + v.result + '
' +
+ '
до 16.03.2015
' + v.cost + ' ';
+
+ }
});
$("#order-stages").html(htmlInbox);
}
diff --git a/chat/templates/test1.html b/chat/templates/test1.html
index 2531df0..97e9bd9 100644
--- a/chat/templates/test1.html
+++ b/chat/templates/test1.html
@@ -1,10 +1,33 @@
-Test page
+{% extends 'partials/base.html' %}
+{% block content %}
+ Test page
+{% endblock %}
+{% block js_block %}
+
+
+{% endblock %}
diff --git a/chat/views.py b/chat/views.py
index 1268f22..ed44c24 100644
--- a/chat/views.py
+++ b/chat/views.py
@@ -53,6 +53,4 @@ class ChatUserView(View):
def test(request):
- ArticleFormSet = formset_factory(ArticleForm, extra=2)
- formset = ArticleFormSet()
- return render(request, 'test1.html', {'formset': formset})
+ return render(request, 'test1.html')
diff --git a/projects/serializers.py b/projects/serializers.py
index 45cf44a..a9ac96c 100755
--- a/projects/serializers.py
+++ b/projects/serializers.py
@@ -80,6 +80,17 @@ class StageSerializer(ModelSerializer):
)
+ # def update(self, inst, validated_data):
+ # import code; code.interact(local=dict(globals(), **locals()))
+ # inst.id = validated_data.get('id',inst.id)
+ # inst.name = validated_data.get('name', inst.name)
+ # inst.cost = validated_data.get('cost', inst.cost)
+ # inst.order = validated_data.get('order', inst.order)
+ # inst.result = validated_data.get('result', inst.result)
+ # inst.save()
+ # return inst
+
+
class ProjectSerializer(ModelSerializer):
customer = UserSerializer()
specialization = SpecializationSerializer()
diff --git a/users/templates/contractor_profile.html b/users/templates/contractor_profile.html
index 0cdaa44..606a110 100644
--- a/users/templates/contractor_profile.html
+++ b/users/templates/contractor_profile.html
@@ -287,6 +287,7 @@
{{ contractor.contractor_resume.text }}
+