diff options
author | Alvin Li <liweitianux@gmail.com> | 2013-10-09 15:52:53 +0800 |
---|---|---|
committer | Alvin Li <liweitianux@gmail.com> | 2013-10-09 15:52:53 +0800 |
commit | 02afd8a32edb13ea7fc2266ac80092ea15c0930c (patch) | |
tree | c7a2a3f50378c017b425da47e04a71c6beaae56c /97suifangqa/apps/recommend/templates | |
parent | fafce2cfc72f4e1cd14ff6cb693c8ec7854159c5 (diff) | |
download | 97dev-02afd8a32edb13ea7fc2266ac80092ea15c0930c.tar.bz2 |
* treat 'apps/utils' as regular django app; which used to store
general tools for used in other apps
* moved 'templatetags' from 'apps/indicator' to 'apps/utils'
* '.gitignore' to ignore 'fixtures_bak'
* moved js plugins from 'apps/indicator/static/plugins' to
'staticfiles/plugins'
apps/recommend:
* updated 'recommend.models';
o commented 'recommend.models.ResearchCombination' (not used)
* implemented views 'add_edit_blog_info' and 'ajax_add_edit_configs';
* added pages 'templates/recommend/add_edit_blog_info.html',
'add_edit_blog_info_error.html';
o related css and javascripts files
* added 'tools.py';
* added 'utils/tools.py' for placing generic functions;
* deleted 'initial_data.json' (mv 'fixtures' to 'fixtures_bak');
* small fixes to 'indicator.models', 'sciblog.models' and
'sfaccount.views'
* fixed automatically show 'proper_nouns' annotation in blog:
recovered the line 'import signals' in 'sciblog.models'
* added 'is_ok()' method for 'recommend.models.ResearchConfig';
Diffstat (limited to '97suifangqa/apps/recommend/templates')
3 files changed, 180 insertions, 0 deletions
diff --git a/97suifangqa/apps/recommend/templates/recommend/add_edit_blog_info.html b/97suifangqa/apps/recommend/templates/recommend/add_edit_blog_info.html new file mode 100644 index 0000000..e646abf --- /dev/null +++ b/97suifangqa/apps/recommend/templates/recommend/add_edit_blog_info.html @@ -0,0 +1,87 @@ +{% extends "base.html" %} +{% load static from staticfiles %} +{% load dict_get %} + +{% block title %} +添加文章信息 | admin | 97 随访 +{% endblock %} + +{% block css %} + <link rel="stylesheet" type="text/css" href="{% static "css/add_edit_blog_info.css" %}"/> +{% endblock %} + +{% block scripts %} + <script type="text/javascript" src="{% static "plugins/moment/moment.min.js" %}"></script> + <script type="text/javascript" src="{% static "plugins/moment/lang/zh-cn.js" %}"></script> + <script type="text/javascript" src="{% static "javascripts/add_edit_blog_info.js" %}"></script> + + <script type="text/javascript"> + // urls + var static_url = "{{ STATIC_URL }}"; + var recommend_url = "/recommend/"; + + // moment.js: default the language to English + moment.lang('en'); + // default date format + var mm_date_fmt = "YYYY-MM-DD"; + + // index + var recommend_index_url = '{% url recommend_index %}'; + // blog id + var blog_id = {{ blog.id }}; + // number of research indicators + var rind_num = {{ rind_num }}; + // all combinations of research indicators + var rind_combs = $.parseJSON('{{ rind_combs_json|safe }}'); + // research indicator categories (by number) + var rind_categories = $.parseJSON('{{ rind_categories_json|safe }}'); + // research indicator objs dump + var rind_objs = $.parseJSON('{{ rind_objs_json|safe }}'); + // research configs + var research_configs = $.parseJSON('{{ research_configs_json|safe }}'); + // treat response data + var treat_responses_list = $.parseJSON('{{ treat_responses_list_json|safe }}'); + var treat_responses_objs = $.parseJSON('{{ treat_responses_objs_json|safe }}'); + + </script> +{% endblock %} + +{% block page %} + {% csrf_token %} + + <h2>添加文章信息</h2> + + <section class="blog"> + id: {{ blog.id }} + <br /> + title: {{ blog.title }} + </section> + + <section class="buttons"> + <input type="button" id="submit_info" value="提交信息" /> +   |   + <input type="button" id="back_to_list" value="返回文章列表" /> + </section> + + <section class="categories"> + <!-- buttons --> + <div id="cate_btns"></div> + </section> + + <section class="combinations"> + <!-- div's & buttons --> + <div id="comb_divs"></div> + </section> + + <section class="configs"> + <!-- div's & info input --> + <div id="conf_divs"></div> + </section> + + <section class="notes"> + <h4>说明</h4> + <p>权重: 浮点数,范围 0-10</p> + </section> +{% endblock page %} + +{# vim: set ts=2 sw=2 tw=0 fenc=utf-8 ft=htmldjango.html: #} diff --git a/97suifangqa/apps/recommend/templates/recommend/add_edit_blog_info_error.html b/97suifangqa/apps/recommend/templates/recommend/add_edit_blog_info_error.html new file mode 100644 index 0000000..e1a6434 --- /dev/null +++ b/97suifangqa/apps/recommend/templates/recommend/add_edit_blog_info_error.html @@ -0,0 +1,66 @@ +{% extends "base.html" %} +{% load static from staticfiles %} +{% load dict_get %} + +{% block title %} +添加文章信息 | admin | 97 随访 +{% endblock %} + +{% block css %} + <link rel="stylesheet" type="text/css" href="{% static "css/add_edit_blog_info.css" %}"/> +{% endblock %} + +{% block scripts %} + <script type="text/javascript"> + // index + var recommend_index_url = '{% url recommend_index %}'; + // back_to_list button + $("#back_to_list").bind("click", function() { + window.location.href = recommend_index_url; + }); + </script> +{% endblock %} + +{% block page %} + <h2>错误 | 添加文章信息</h2> + + <section class="blog"> + id: {{ blog.id }} + <br /> + title: {{ blog.title }} + </section> + + <section class="no_indicator" style="display: {% if no_indicator %}block{% else %}none{% endif %};"> + <span class="error"> + 该文章未添加关联的研究指标"ResearchIndicator" + ({{ ResearchIndicatorName }}) + </span> + </section> + + <section class="error no_indicator_atom" style="display: {% if no_indicator_atom %}block{% else %}none{% endif %};"> + <span class="error"> + 该文章关联的以下研究指标"ResearchIndicator" + 没有添加原子分类"ResearchAtom"({{ ResearchAtomName }}) + </span> + {% if no_indicator_atom %} + <ul class="research_indicator"> + {% for ri in no_atom_ri %} + <li>{{ ri|dict_get:"display" }} (id={{ ri|dict_get:"id" }})</li> + {% endfor %} + </ul> + {% endif %} + </section> + + <section class="error no_treat_response" style="display: {% if no_treat_response %}block{% else %}none{% endif %};"> + <span class="error"> + 未添加全局的治疗反应"TreatResponse"({{ TreatResponseName }}) + </span> + </section> + + <section class="button"> + <input type="button" id="back_to_list" value="返回文章列表" /> + </section> + +{% endblock page %} + +{# vim: set ts=2 sw=2 tw=0 fenc=utf-8 ft=htmldjango.html: #} diff --git a/97suifangqa/apps/recommend/templates/recommend/recommend_index.html b/97suifangqa/apps/recommend/templates/recommend/recommend_index.html new file mode 100644 index 0000000..fd05bf3 --- /dev/null +++ b/97suifangqa/apps/recommend/templates/recommend/recommend_index.html @@ -0,0 +1,27 @@ +{% extends "base.html" %} +{% load static from staticfiles %} +{% load dict_get %} + +{% block title %} +文章列表 | admin | 97 随访 +{% endblock %} + +{% block css %} + <link rel="stylesheet" type="text/css" href="{% static "css/recommend_index.css" %}"/> +{% endblock %} + +{% block page %} + <h2>文章列表 | 添加文章信息</h2> + + <p>图例:<span class="has_info">已添加信息</span></p> + + <ul class="blogs"> + {% for blog in blog_list %} + <li class="{% if blog|dict_get:"has_info" %}has_info{% endif %}"> + <a href="{% url add_edit_blog_info blog|dict_get:"id" %}">{{ blog|dict_get:"title" }}</a> + </li> + {% endfor %} + </ul> +{% endblock page %} + +{# vim: set ts=2 sw=2 tw=0 fenc=utf-8 ft=htmldjango.html: #} |