Merge branch 'develop' of http://git.general-servers.com/expomap/expomap
commit
4147bd001b
57 changed files with 988 additions and 255 deletions
@ -0,0 +1 @@ |
||||
__author__ = 'dev' |
||||
@ -0,0 +1 @@ |
||||
__author__ = 'dev' |
||||
@ -0,0 +1,24 @@ |
||||
from django.core.management.base import BaseCommand |
||||
from django.utils.translation import activate |
||||
from service.models import Service,LinkedService |
||||
from country.models import Country |
||||
from exposition.models import Exposition |
||||
from conference.models import Conference |
||||
|
||||
|
||||
class Command(BaseCommand): |
||||
def handle(self, *args, **options): |
||||
activate('ru') |
||||
LinkedService.objects.all().delete() |
||||
services = Service.objects.all() |
||||
for service in services: |
||||
linked = LinkedService() |
||||
linked.service = service |
||||
linked.save() |
||||
if Country.objects.language().filter(services=getattr(Country.services, service.url)).count() > 180: |
||||
linked.exclude_countries = True |
||||
linked.countries = Country.objects.language().exclude(services=getattr(Country.services, service.url)) |
||||
else: |
||||
linked.countries = Country.objects.language().filter(services=getattr(Country.services, service.url)) |
||||
linked.save() |
||||
|
||||
@ -1,39 +0,0 @@ |
||||
{% extends 'admin_list.html' %} |
||||
|
||||
{% block body %} |
||||
<div class="box span8"> |
||||
<div class="box-header well"> |
||||
<h2><i class="icon-arrow-down"></i>Список услуг</h2> |
||||
</div> |
||||
<div class="box-content"> |
||||
|
||||
<table class="table table-hover"> |
||||
<thead> |
||||
<tr> |
||||
<th>id</th> |
||||
<th>Название</th> |
||||
<th> </th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
{% for item in object_list %} |
||||
|
||||
<tr> |
||||
<td>{{ item.id }}</td> |
||||
<td>{{ item.name }}</td> |
||||
|
||||
<td> |
||||
<a class="btn-small btn-info" href="/admin/service/control/{{ item.id }}/"> |
||||
Управлять |
||||
</a> |
||||
</td> |
||||
</tr> |
||||
|
||||
{% endfor %} |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
{# pagination #} |
||||
{% include 'admin/includes/admin_pagination.html' with page_obj=object_list %} |
||||
</div> |
||||
{% endblock %} |
||||
@ -0,0 +1,146 @@ |
||||
{% extends 'base.html' %} |
||||
{% load static %} |
||||
|
||||
{% block scripts %} |
||||
|
||||
{# selects #} |
||||
<link href="{% static 'js/select/select2.css' %}" rel="stylesheet"/> |
||||
<style> |
||||
ul { |
||||
list-style: none; |
||||
} |
||||
</style> |
||||
<script src="{% static 'js/select/select2.js' %}"></script> |
||||
|
||||
<script> |
||||
$(document).ready(function () { |
||||
console.log(1); |
||||
$("#id_countries").select2({width:'element'}); |
||||
$('#id_expositions').select2({ |
||||
placeholder: "Expositions", |
||||
width: 'element', |
||||
multiple: true, |
||||
ajax: { |
||||
|
||||
url: "/admin/exposition/search/", |
||||
dataType: "json", |
||||
quietMillis: 200, |
||||
multiple: true, |
||||
|
||||
data: function (term, page) { |
||||
return { |
||||
term: term, |
||||
page: page |
||||
}; |
||||
}, |
||||
|
||||
results: function (data) { |
||||
var results = []; |
||||
$.each(data, function (index, item) { |
||||
results.push({ |
||||
id: item.id, |
||||
text: item.label |
||||
}); |
||||
}); |
||||
return {results: results}; |
||||
} |
||||
}, |
||||
initSelection: function (element, callback) { |
||||
var data = []; |
||||
var values = element.val(); |
||||
element.val(""); |
||||
$(values.split(",")).each(function (i) { |
||||
var item = this.split(':'); |
||||
data.push({ |
||||
id: item[0], |
||||
text: item[1] |
||||
}); |
||||
}); |
||||
console.log("initselection data: "); |
||||
console.log(data); |
||||
callback(data); |
||||
|
||||
} |
||||
|
||||
}); |
||||
$('#id_conferences').select2({ |
||||
placeholder: "Conferences", |
||||
width: 'element', |
||||
multiple: true, |
||||
ajax: { |
||||
|
||||
url: "/admin/conference/search/", |
||||
dataType: "json", |
||||
quietMillis: 200, |
||||
multiple: true, |
||||
|
||||
data: function (term, page) { |
||||
return { |
||||
term: term, |
||||
page: page |
||||
}; |
||||
}, |
||||
|
||||
results: function (data) { |
||||
var results = []; |
||||
$.each(data, function (index, item) { |
||||
results.push({ |
||||
id: item.id, |
||||
text: item.label |
||||
}); |
||||
}); |
||||
return {results: results}; |
||||
} |
||||
}, |
||||
initSelection: function (element, callback) { |
||||
var data = []; |
||||
var values = element.val(); |
||||
element.val(""); |
||||
$(values.split(",")).each(function (i) { |
||||
var item = this.split(':'); |
||||
data.push({ |
||||
id: item[0], |
||||
text: item[1] |
||||
}); |
||||
}); |
||||
callback(data); |
||||
|
||||
} |
||||
|
||||
}); |
||||
|
||||
}); |
||||
|
||||
</script> |
||||
|
||||
{% endblock %} |
||||
|
||||
{% block body %} |
||||
|
||||
{# Uses multilang.html template for translated fields #} |
||||
<form class="form-horizontal" method="post" action="">{% csrf_token %} |
||||
<fieldset> |
||||
<div class="box span8"> |
||||
<div class="box-header well"> |
||||
<h2><i class="icon-pencil"></i> </h2> |
||||
</div> |
||||
<div class="box-content"> |
||||
{% for f in form %} |
||||
<div class="control-group {% if f.errors %}error{% endif %}"> |
||||
<label class="control-label"><b>{{ f.label }}:</b></label> |
||||
<div class="controls">{{ f }} |
||||
<span class="help-inline">{{ f.errors }}</span> |
||||
</div> |
||||
</div> |
||||
{% endfor %} |
||||
</div> |
||||
</div> |
||||
<div class="controls"> |
||||
<button type="submit" class="btn btn-large btn-primary">Submit</button> |
||||
<button type="reset" class="btn btn-large">Reset</button> |
||||
</div> |
||||
</fieldset> |
||||
</form> |
||||
|
||||
|
||||
{% endblock %} |
||||
@ -0,0 +1,11 @@ |
||||
{% extends 'base.html' %} |
||||
{% block sidebar %}{% endblock %} |
||||
{% block body %} |
||||
<form action="" method="post">{% csrf_token %} |
||||
<div class="controls"> |
||||
<p>Вы точно хотите удалить настройку для сервиса "{{ object.service.name }}" ?</p> |
||||
<input class="btn btn-large btn-danger delete" type="submit" value="Да" /> |
||||
<a class="btn btn-large btn-primary" href = {% url 'linked_service_all' %}>Нет</a> |
||||
</div> |
||||
</form> |
||||
{% endblock %} |
||||
@ -0,0 +1,46 @@ |
||||
{% extends 'base.html' %} |
||||
|
||||
{% block body %} |
||||
|
||||
<div class="box span10"> |
||||
<div class="box-header well"> |
||||
<h2><i class="icon-arrow-down"></i>Настройки услуг</h2> |
||||
</div> |
||||
<div class="box-content"> |
||||
<table class="table table-hover"> |
||||
<thead> |
||||
<tr> |
||||
<th>id</th> |
||||
<th>Название услуги</th> |
||||
<th>Тип</th> |
||||
<th>Стран</th> |
||||
<th>Виставок</th> |
||||
<th>Конференций</th> |
||||
<th> </th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
{{ object }} |
||||
{% for item in object_list %} |
||||
<tr> |
||||
<td>{{ item.id }}</td> |
||||
<td>{{ item.service.name }}</td> |
||||
<td>{% if item.service.type.mask == 1 %} выставки {% elif item.service.type.mask == 2%} конференции {% elif item.service.type.mask == 3 %} выставки и конференции{% endif %}</td> |
||||
<td>{{ item.countries_count }}</td> |
||||
<td>{{ item.expositions.count }}</td> |
||||
<td>{{ item.conferences.count }}</td> |
||||
<td class="center sorting_1"> |
||||
<a class="btn btn-info" href="{% url 'linked_service_update' item.service.url %}"> |
||||
<i class="icon-edit icon-white"></i> Управление |
||||
</a> |
||||
|
||||
</td> |
||||
</tr> |
||||
{% endfor %} |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
|
||||
</div> |
||||
|
||||
{% endblock %} |
||||
@ -0,0 +1,11 @@ |
||||
{% extends 'base.html' %} |
||||
{% block sidebar %}{% endblock %} |
||||
{% block body %} |
||||
<form action="" method="post">{% csrf_token %} |
||||
<div class="controls"> |
||||
<p>Вы точно хотите удалить "{{ object.name }}" ?</p> |
||||
<input class="btn btn-large btn-danger delete" type="submit" value="Да" /> |
||||
<a class="btn btn-large btn-primary" href = {% url 'theme_blog_all' %}>Нет</a> |
||||
</div> |
||||
</form> |
||||
{% endblock %} |
||||
@ -0,0 +1,65 @@ |
||||
{% extends 'admin_list.html' %} |
||||
|
||||
{% block body %} |
||||
|
||||
{#<div class="box span8">#} |
||||
{# <div class="box-header well">#} |
||||
{# <h2><i class="icon-arrow-down"></i>Фильтры</h2>#} |
||||
{# </div>#} |
||||
{# <div class="box-content">#} |
||||
{# <form>#} |
||||
{# {{ form }}#} |
||||
{##} |
||||
{# <button type="submit" class="btn">Найти</button>#} |
||||
{# </form>#} |
||||
{# </div>#} |
||||
{##} |
||||
{#</div>#} |
||||
|
||||
<div class="box span8"> |
||||
<div class="box-header well"> |
||||
<h2><i class="icon-arrow-down"></i>Список тем</h2> |
||||
</div> |
||||
<div class="box-content"> |
||||
<table class="table table-hover"> |
||||
<colgroup> |
||||
<col width="10%"> |
||||
<col width="70%"> |
||||
<col width="10%"> |
||||
<col width="10%"> |
||||
</colgroup> |
||||
<thead> |
||||
<tr> |
||||
<th>id</th> |
||||
<th>Название</th> |
||||
<th> </th> |
||||
<th> </th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
{% for item in object_list %} |
||||
|
||||
<tr> |
||||
<td>{{ item.id }}</td> |
||||
<td>{{ item.name }}</td> |
||||
<td class="center sorting_1"> |
||||
<a class="btn-small btn-info" href="{% url "theme_blog_change" item.id %}"> |
||||
Изменить |
||||
</a> |
||||
</td> |
||||
<td> |
||||
<a class="btn-small btn-danger delete" href="{% url "theme_blog_delete" item.id %}"> |
||||
Удалить |
||||
</a> |
||||
</td> |
||||
</tr> |
||||
|
||||
{% endfor %} |
||||
</tbody> |
||||
</table> |
||||
<a class="btn btn-success" href="{% url "theme_blog_new" %}"><i class="icon-plus-sign icon-white"></i> Добавить тематику</a> |
||||
</div> |
||||
{# pagination #} |
||||
{% include 'admin/includes/admin_pagination.html' with page_obj=object_list %} |
||||
</div> |
||||
{% endblock %} |
||||
@ -0,0 +1,50 @@ |
||||
{% extends 'base.html' %} |
||||
{% load static %} |
||||
|
||||
{% block scripts %} |
||||
|
||||
<script src="{% static 'ckeditor/ckeditor/ckeditor.js' %}"></script> |
||||
{# selects #} |
||||
<link href="{% static 'js/select/select2.css' %}" rel="stylesheet"/> |
||||
<script src="{% static 'js/select/select2.js' %}"></script> |
||||
|
||||
|
||||
|
||||
{% endblock %} |
||||
|
||||
{% block body %} |
||||
|
||||
<form method="post" class="form-horizontal" > {% csrf_token %} |
||||
<fieldset> |
||||
<legend><i class="icon-edit"></i>{% if theme_id %} Изменить {% else %} Добавить {% endif %}тему</legend> |
||||
<div class="box span8"> |
||||
<div class="box-header well"> |
||||
<h2><i class="icon-pencil"></i> Информация</h2> |
||||
</div> |
||||
<div class="box-content"> |
||||
{# name #} |
||||
{% with field='name' form=form languages=languages %} |
||||
{% include 'admin/forms/multilang.html' %} |
||||
{% endwith %} |
||||
|
||||
{# main_title #} |
||||
{% with field='main_title' form=form languages=languages %} |
||||
{% include 'admin/forms/multilang.html' %} |
||||
{% endwith %} |
||||
{# description #} |
||||
{% with field='description' form=form languages=languages %} |
||||
{% include 'admin/forms/multilang.html' %} |
||||
{% endwith %} |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
<div class="controls"> |
||||
<input class="btn btn-large btn-primary" type="submit" value="Добавить"> |
||||
<input class="btn btn-large" type="reset" value="Отмена"> |
||||
</div> |
||||
|
||||
</fieldset> |
||||
</form> |
||||
|
||||
{% endblock %} |
||||
@ -0,0 +1,30 @@ |
||||
{ |
||||
"name": "kotzilla", |
||||
"version": "0.0.0", |
||||
"description": "", |
||||
"main": "gulpfile.js", |
||||
"dependencies": { |
||||
"gulp": "~3.9.0" |
||||
}, |
||||
"devDependencies": { |
||||
"connect": "~3.4.0", |
||||
"gulp-concat": "~2.6.0", |
||||
"gulp-livereload": "~3.8.1", |
||||
"gulp": "~3.9.0", |
||||
"gulp-stylus": "~2.1.0", |
||||
"gulp-uglify": "~1.4.1", |
||||
"gulp-jade": "~1.1.0", |
||||
"gulp-imagemin": "~2.3.0", |
||||
"gulp-csso": "~1.0.0", |
||||
"gulp-myth": "~1.0.3", |
||||
"gulp-rename": "~1.2.2", |
||||
"gulp-autoprefixer": "~3.0.2", |
||||
"gulp-cssmin": "~0.1.7", |
||||
"gulp-newer": "~0.5.1" |
||||
}, |
||||
"scripts": { |
||||
"test": "echo \"Error: no test specified\" && exit 1" |
||||
}, |
||||
"author": "", |
||||
"license": "BSD-2-Clause" |
||||
} |
||||
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue