aboutsummaryrefslogtreecommitdiffstats
path: root/97suifangqa/apps/indicator
diff options
context:
space:
mode:
Diffstat (limited to '97suifangqa/apps/indicator')
-rw-r--r--97suifangqa/apps/indicator/fixtures_bak/initial_data.json (renamed from 97suifangqa/apps/indicator/fixtures/initial_data.json)0
-rw-r--r--97suifangqa/apps/indicator/static/javascripts/card_chart.js20
-rw-r--r--97suifangqa/apps/indicator/static/javascripts/delete_card_tip.js60
-rw-r--r--97suifangqa/apps/indicator/templates/indicator/SheetDefault.html18
4 files changed, 59 insertions, 39 deletions
diff --git a/97suifangqa/apps/indicator/fixtures/initial_data.json b/97suifangqa/apps/indicator/fixtures_bak/initial_data.json
index d26f8b9..d26f8b9 100644
--- a/97suifangqa/apps/indicator/fixtures/initial_data.json
+++ b/97suifangqa/apps/indicator/fixtures_bak/initial_data.json
diff --git a/97suifangqa/apps/indicator/static/javascripts/card_chart.js b/97suifangqa/apps/indicator/static/javascripts/card_chart.js
index 92a91c0..ef2eb24 100644
--- a/97suifangqa/apps/indicator/static/javascripts/card_chart.js
+++ b/97suifangqa/apps/indicator/static/javascripts/card_chart.js
@@ -92,6 +92,22 @@ $(document).ready(function(){
// update 'detail_card_id'
detail_card_id = $(this).closest(".index_card").attr("id").replace('index_card_', '');
var card = $("#index_card_"+detail_card_id);
+ // determine the position to show the 'detail_card'
+ var pos_to_insertafter = null;
+ if (card.hasClass("index_card_sec")) {
+ // this card in on the right
+ pos_to_insertafter = card;
+ }
+ else if (card.nextAll(".index_card_sec").length) {
+ // this card is on the left
+ pos_to_insertafter = card.nextAll(".index_card_sec").first();
+ }
+ else {
+ // this card is the last card
+ pos_to_insertafter = card.nextAll(".act_card_container");
+ }
+ // move 'detail_card_info' div
+ $(".detail_card_info").insertAfter(pos_to_insertafter);
// check if this card has data (class "record_empty")
if (card.hasClass("record_empty")) {
$(".detail_card_info").hide();
@@ -142,7 +158,7 @@ $(document).ready(function(){
getdata_type, getdata_num,
begin_date_str, end_date_str
);
- $(".act_card_container").addClass("move_div_2_left");
+ //$(".act_card_container").addClass("move_div_2_left");
return false;
});
@@ -215,7 +231,7 @@ $(document).ready(function(){
//初始化详细卡片id
detail_card_id = "-1";
//添加删除div位置初始化
- $(".act_card_container").removeClass("move_div_2_left");
+ //$(".act_card_container").removeClass("move_div_2_left");
return false;
});
});
diff --git a/97suifangqa/apps/indicator/static/javascripts/delete_card_tip.js b/97suifangqa/apps/indicator/static/javascripts/delete_card_tip.js
index 9365d46..da5c896 100644
--- a/97suifangqa/apps/indicator/static/javascripts/delete_card_tip.js
+++ b/97suifangqa/apps/indicator/static/javascripts/delete_card_tip.js
@@ -1,32 +1,36 @@
// global js var: card_2_delete_id (type: string)
$(document).ready(function(){
-// console.log(parent.card_2_delete_id); //要取消关注的 卡片id 的获取方法
- //点大叉、继续关注按钮,关闭弹层页面
- $(".delete_card_tip_close, .action_confirm_ignore").bind("click", function(){
- parent.TB_remove();
- return false;
- });
-
- //取消关注,关闭弹层页面
- $(".action_confirm_cancel").bind("click", function(){
- // ajax process to unfollow the indicator
- // indicator_id -> parseInt(parent.card_2_delete_id)
- // 底层数据层取消关注(ajax)
- var date = new Date();
- var time = date.getTime();
- $.ajax({
- type: 'get',
- url: parent.indicator_url + 'ajax/unfollow_indicator',
- data: 'indicator_id='+parent.card_2_delete_id+'&time='+time,
- success: function(data) {
- if (data == 'success') {
- parent.delete_card();
- parent.TB_remove();
- }
- },
- });
-
- return false;
- });
+ // console.log(parent.card_2_delete_id); //要取消关注的 卡片id 的获取方法
+ //点大叉、继续关注按钮,关闭弹层页面
+ $(".delete_card_tip_close, .action_confirm_ignore").bind("click", function(){
+ parent.TB_remove();
+ return false;
+ });
+
+ //取消关注,关闭弹层页面
+ $(".action_confirm_cancel").bind("click", function(){
+ // ajax process to unfollow the indicator
+ // indicator_id -> parseInt(parent.card_2_delete_id)
+ // 底层数据层取消关注(ajax)
+ var date = new Date();
+ var time = date.getTime();
+ $.ajax({
+ type: 'get',
+ url: parent.indicator_url + 'ajax/unfollow_indicator',
+ data: 'indicator_id='+parent.card_2_delete_id+'&time='+time,
+ success: function(data) {
+ if (data == 'success') {
+ // destroy the 'qtip' if exist
+ //$('#index_card_'+parent.card_2_delete_id, window.parent.document).qtip('destroy', true);
+ // remove card
+ parent.delete_card();
+ parent.TB_remove();
+ }
+ },
+ });
+
+ return false;
+ });
});
+// vim: set ts=4 sw=4 tw=0 fenc=utf-8 ft=javascript: //
diff --git a/97suifangqa/apps/indicator/templates/indicator/SheetDefault.html b/97suifangqa/apps/indicator/templates/indicator/SheetDefault.html
index 07cf2f0..5a6659f 100644
--- a/97suifangqa/apps/indicator/templates/indicator/SheetDefault.html
+++ b/97suifangqa/apps/indicator/templates/indicator/SheetDefault.html
@@ -284,12 +284,12 @@
{% block page %}
{% csrf_token %}
- <iframe align="left" width="420" height="1020" src="{% url indicator_sidebar %}" style="position:fixed;left:0;top:0;z-index:99;" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
+ <iframe align="left" width="420" height="1020" src="{% url indicator_sidebar %}" style="position:fixed;left:0;top:0;z-index:99;" frameborder="no" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<!-- TODO -->
<div id="login_container">
<div class="logged-in" id="login">
- <img class="user-photo" alt="" src="{% static "images/userPhoto.jpg" %}" />
+ <img class="user-photo" alt="user_photo" src="{% static "images/userPhoto.jpg" %}" />
<span class="number-block green-block user-level">6</span>
<span class="drop-down-area">
<span class="user-name">username</span>
@@ -344,14 +344,14 @@
<span class="data_value">{{ ind|dict_get:"last_record"|dict_get:"value_html"|safe }}</span>
<span class="data_unit">{% if ind|dict_get:"std_unit_symbol" %}({{ ind|dict_get:"std_unit_symbol" }}){% endif %}</span>
</div>
- <img class="small_edit_icon" src="{% static "images/pen.png" %}" />
+ <img class="small_edit_icon" alt="edit_icon" src="{% static "images/pen.png" %}" />
<!-- explain_icon -->
{% if ind|dict_get:"record_empty" %}
- <img class="explain_icon nodata_icon" src="{% static "images/nodata.png" %}" style="display: block;" />
- <img class="explain_icon lastdata_icon" src="{% static "images/last_edit_data.png" %}" style="display: none;" />
+ <img class="explain_icon nodata_icon" alt="nodata_icon" src="{% static "images/nodata.png" %}" style="display: block;" />
+ <img class="explain_icon lastdata_icon" alt="lastdata_icon" src="{% static "images/last_edit_data.png" %}" style="display: none;" />
{% else %}
- <img class="explain_icon nodata_icon" src="{% static "images/nodata.png" %}" style="display: none;" />
- <img class="explain_icon lastdata_icon" src="{% static "images/last_edit_data.png" %}" style="display: block;" />
+ <img class="explain_icon nodata_icon" alt="nodata_icon" src="{% static "images/nodata.png" %}" style="display: none;" />
+ <img class="explain_icon lastdata_icon" alt="lastdata_icon" src="{% static "images/last_edit_data.png" %}" style="display: block;" />
{% endif %}
<div style="clear:both;"></div>
<!-- last edit date -->
@@ -433,7 +433,7 @@
{% endif %}
<div class="card_bottom">
- <div class="understand_index"><a class="thickbox" href="{% url indicator_indexdesc %}?card_id={{ ind|dict_get:"id" }}&url_type=html&no_title=true&TB_iframe=true&height=367&width=630">了解该指标</a></div>
+ <div class="understand_index"><a class="thickbox" href="{% url indicator_indexdesc %}?card_id={{ ind|dict_get:"id" }}&amp;url_type=html&amp;no_title=true&amp;TB_iframe=true&amp;height=367&amp;width=630">了解该指标</a></div>
<!-- TODO -->
<div class="simulation_sheet"><a href="{% static "images/demo_sheet.png" %}" class="thickbox">仿真化验单</a></div>
<div class="detail_history">
@@ -450,7 +450,7 @@
width参数为弹出层页面宽度+2,
card_id参数为 "卡片id"
{% endcomment %}
- <a class="card_delete_icon card_delete thickbox" href="{% url indicator_deletecardtip %}?card_id={{ ind|dict_get:"id" }}&url_type=html&no_title=true&TB_iframe=true&height=166&width=630"></a>
+ <a class="card_delete_icon card_delete thickbox" href="{% url indicator_deletecardtip %}?card_id={{ ind|dict_get:"id" }}&amp;url_type=html&amp;no_title=true&amp;TB_iframe=true&amp;height=166&amp;width=630"></a>
</div> <!-- end: index_card -->
{% endfor %} {# end: indicators #}