aboutsummaryrefslogtreecommitdiffstats
path: root/97suifangqa/apps/indicator/templates
diff options
context:
space:
mode:
authorAlvin Li <liweitianux@gmail.com>2013-08-25 01:25:27 +0800
committerAlvin Li <liweitianux@gmail.com>2013-08-25 01:25:27 +0800
commit58b77885308c944a029caf5c2d8b5d3263b6f64d (patch)
tree428a2672d18f63a439f44f34a9f52059ea5e0af8 /97suifangqa/apps/indicator/templates
parent3f1d09f3b5b86157ccf9f47eef69a065be6153a4 (diff)
download97dev-58b77885308c944a029caf5c2d8b5d3263b6f64d.tar.bz2
* improved the popup page 'EditHistoryData.html':
o improvd page styles; o updated related view: 'indicator.views.indicator_edithistorydata()'; o updated related css styles; o added styles 'valid' and 'invalid'; o added 'jquery-ui: datepicker' to select date; o added 'reason_input' field to get the reason for modification; o implemented validation for 'date' and 'reason' field; * added testing record data for testing 'detail_card'; * added 'cursor: pointer' for 'ui-datepicker-trigger'; * small style change to the 'see_more_button' of SheetDefault.html; * added umcompressed 'jquery-1.9.1.js' for backup; * added param 'type' for 'indicator.tools.format_data()'; TODO: EditHistoryData.html: o to show original record data properly; o to add validation for data field o to implement ajax POST data and related view
Diffstat (limited to '97suifangqa/apps/indicator/templates')
-rw-r--r--97suifangqa/apps/indicator/templates/indicator/SheetDefault.html2
-rw-r--r--97suifangqa/apps/indicator/templates/indicator/popup/EditHistoryData.html147
-rw-r--r--97suifangqa/apps/indicator/templates/indicator/test.html9
3 files changed, 123 insertions, 35 deletions
diff --git a/97suifangqa/apps/indicator/templates/indicator/SheetDefault.html b/97suifangqa/apps/indicator/templates/indicator/SheetDefault.html
index 6b127d3..97f2d62 100644
--- a/97suifangqa/apps/indicator/templates/indicator/SheetDefault.html
+++ b/97suifangqa/apps/indicator/templates/indicator/SheetDefault.html
@@ -52,7 +52,7 @@
<!-- Highcharts related, draw records chart -->
<script type="text/javascript">
// default the language to English
- moment.lang('en')
+ moment.lang('en');
// default date format
var mm_date_fmt = "YYYY-MM-DD";
// default to show 30 days' data
diff --git a/97suifangqa/apps/indicator/templates/indicator/popup/EditHistoryData.html b/97suifangqa/apps/indicator/templates/indicator/popup/EditHistoryData.html
index cc82336..172aeb9 100644
--- a/97suifangqa/apps/indicator/templates/indicator/popup/EditHistoryData.html
+++ b/97suifangqa/apps/indicator/templates/indicator/popup/EditHistoryData.html
@@ -1,56 +1,135 @@
{% extends "base.html" %}
{% load static from staticfiles %}
+{% load dict_get %}
{% block title %}
编辑历史数据 | 随访工具 | 97 随访
{% endblock %}
{% block css %}
- <link rel="stylesheet" type="text/css" href="{% static "css/normalize.css" %}"/>
- <link rel="stylesheet" type="text/css" href="{% static "css/edit_history_data.css" %}"/>
+ <link rel="stylesheet" type="text/css" href="{% static "css/normalize.css" %}" />
+ <link rel="stylesheet" type="text/css" href="{% static "plugins/jquery-ui/themes/smoothness/jquery-ui.min.css" %}"/>
+ <link rel="stylesheet" type="text/css" href="{% static "css/edit_history_data.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 "plugins/jquery-ui/ui/minified/jquery.ui.core.min.js" %}"></script>
+ <script type="text/javascript" src="{% static "plugins/jquery-ui/ui/minified/jquery.ui.datepicker.min.js" %}"></script>
+ <script type="text/javascript" src="{% static "plugins/jquery-ui/ui/minified/i18n/jquery.ui.datepicker-zh-CN.min.js" %}"></script>
<script type="text/javascript" src="{% static "javascripts/edit_history_data.js" %}"></script>
- <!-- set variables
- 'static_url': used in js to load staticfiles
- 'indicator_url': root url of 'apps/indicator'
- -->
- <script>
+ <script type="text/javascript">
+ // 'static_url': used in js to load staticfiles
+ // 'indicator_url': root url of 'apps/indicator'
var static_url = "{{ STATIC_URL }}";
var indicator_url = "/indicator/";
+
+ // default the language to English
+ moment.lang('en');
+ // default date format
+ var mm_date_fmt = "YYYY-MM-DD";
+
+ // indicator DATA_TYPES
+ var DATA_TYPES = {
+ 'INTEGER_TYPE': '{{ indicator_obj.INTEGER_TYPE }}',
+ 'FLOAT_TYPE': '{{ indicator_obj.FLOAT_TYPE }}',
+ 'RANGE_TYPE': '{{ indicator_obj.RANGE_TYPE }}',
+ 'FLOAT_RANGE_TYPE': '{{ indicator_obj.FLOAT_RANGE_TYPE }}',
+ 'PM_TYPE': '{{ indicator_obj.PM_TYPE }}'
+ };
</script>
{% endblock %}
{% block page %}
- <div id="edit_history_data_container">
- <div class="edit_history_data_title_line">
- <div class="edit_history_data_title">乙肝病毒核算定量(PCR)</div>
- <div class="edit_history_data_close"></div>
- </div>
- <div class="edit_history_data_content">
- <div class="date_time">
- <span>日期:2013-07-16</span>
- <span class="time">时间:11:20</span>
- </div>
- <div class="refer_range">参考范围:100 x 10^4 拷贝 /mL</div>
- <div class="edit_data">您的记录:<span class="data_fir">100</span> x 10^<span class="data_sec">4</span> 拷贝 /mL<input type="button" id="edit_btn" value="修改记录" /></div>
- <div class="editing_data">
- <div class="input_container">
- <label>修改记录:</label>
- <input class="edit_input_main" type="text" value="" autocomplete="off" /> x 10^
- <input class="edit_input_sub" type="text" value="" autocomplete="off" />
- </div>
- <div class="add_minus_icon">
- <div class="add_icon"></div>
- <div class="minus_icon"></div>
- </div>
- 拷贝 /mL
- <input type="button" id="save_btn" value="保存新记录" />
- </div>
- </div>
- </div>
+ <div id="edit_history_data_container">
+ <div class="edit_history_data_title_line">
+ <div class="edit_history_data_title">{{ indicator_obj.name }}</div>
+ <div class="edit_history_data_close"></div>
+ </div>
+ <div class="edit_history_data_content">
+ <div class="refer_range">
+ <span class="refer_text">{{ indicator_dict|dict_get:"ref_text" }}</span>
+ <span class="refer_value">{{ indicator_dict|dict_get:"ref_value"|safe }}</span>
+ <span class="data_unit">{% if indicator_dict|dict_get:"std_unit_symbol" %}({{ indicator_dict|dict_get:"std_unit_symbol" }}){% endif %}</span>
+ </div>
+ <div class="edit_data">
+ <div class="date">
+ <span class="date_text">化验日期</span>
+ <span class="date_value">{{ record_dict|dict_get:"date" }}</span>
+ </div>
+ <div class="data">
+ <span class="prompt">结果</span>
+ <span class="data_value">{{ record_dict|dict_get:"value_html"|safe }}</span>
+ <span class="data_unit">{% if record_dict|dict_get:"unit_symbol" %}({{ record_dict|dict_get:"unit_symbol" }}){% endif %}</span>
+ </div>
+ <div class="state">
+ <span class="prompt">状态</span>
+ {% if record_dict|dict_get:"is_normal" == None %}
+ {# 'is_normal': None #}
+ <span class="text unknown">未知</span>
+ {% elif not record_dict|dict_get:"is_normal" %}
+ {# 'is_normal': False #}
+ <span class="text abnormal">异常</span>
+ {% else %}
+ {# 'is_normal': True #}
+ <span class="text normal">正常</span>
+ {% endif %}
+ </div>
+ <input type="button" id="edit_btn" value="修改记录" />
+ </div>
+ <div class="editing_data">
+ <div class="date">
+ <div class="date_text">化验日期</div>
+ <div class="datepicker_container">
+ <!-- jquery-ui: datepicker -->
+ <input class="datepicker date_input" id="editing_date_picker" type="text" value="{{ record_dict|dict_get:"date" }}" />
+ </div>
+ </div>
+ <!--
+ <div class="input_container">
+ <div class="prompt">修改记录</div>
+ <input class="edit_input_main" type="text" value="" autocomplete="off" />
+ x10^
+ <input class="edit_input_sub" type="text" value="" autocomplete="off" />
+ </div>
+ <div class="add_minus_icon">
+ <div class="add_icon"></div>
+ <div class="minus_icon"></div>
+ </div>
+ -->
+ <div class="data data_type_{{ indicator_obj.dataType }}">
+ <div class="prompt">修改记录</div>
+ {% if indicator_obj.dataType == indicator_obj.INTEGER_TYPE %}
+ {# INTEGER_TYPE #}
+ TODO
+ {% elif indicator_obj.dataType == indicator_obj.FLOAT_TYPE %}
+ {# FLOAT_TYPE #}
+ <input class="data_input" type="text" value="" autocomplete="off" />
+ {% elif indicator_obj.dataType == indicator_obj.RANGE_TYPE %}
+ {# RANGE_TYPE #}
+ <input class="data_input" type="text" value="" autocomplete="off" />
+ {% elif indicator_obj.dataType == indicator_obj.FLOAT_RANGE_TYPE %}
+ {# FLOAT_RANGE_TYPE #}
+ <input class="data_input" type="text" value="" autocomplete="off" />
+ {% elif indicator_obj.dataType == indicator_obj.PM_TYPE %}
+ {# PM_TYPE #}
+ TODO
+ {% else %}
+ {# UNKNOWN TYPE #}
+ ERROR: unknown data type
+ {% endif %}
+ </div>
+ <div class="data_unit">{% if record_dict|dict_get:"unit_symbol" %}({{ record_dict|dict_get:"unit_symbol" }}){% endif %}</div>
+ <div class="reason">
+ <div class="prompt">修改原因</div>
+ <input class="reason_input" type="text" value="" />
+ </div>
+ <input type="button" id="save_btn" value="提交修改" />
+ </div> <!-- end: edting_data -->
+ </div> <!-- end: edit_history_data_content -->
+ </div>
{% endblock page %}
{# vim: set ts=2 sw=2 tw=0 fenc=utf-8 ft=htmldjango.html: #}
diff --git a/97suifangqa/apps/indicator/templates/indicator/test.html b/97suifangqa/apps/indicator/templates/indicator/test.html
index d7b349f..412eb17 100644
--- a/97suifangqa/apps/indicator/templates/indicator/test.html
+++ b/97suifangqa/apps/indicator/templates/indicator/test.html
@@ -39,6 +39,15 @@
<li>i</li>
{% endfor %}
</ul>
+
+ <h3>templates 'if' statement</h3>
+ {% if boolvar == None %}
+ None
+ {% elif not boolvar %}
+ False
+ {% else %}
+ True
+ {% endif %}
</body>
</html>