socialforge/public/assets/wechat/activities.html

276 lines
16 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html>
<head>
<title>最新动态</title>
<meta charset='utf-8' />
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="apple-mobile-web-app-capable" content="no">
<meta content='True' name='HandheldFriendly' />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<link type="text/css" rel="stylesheet" href="/stylesheets/weui/weixin.css" />
</head>
<body>
<div id="container"></div>
<!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 -->
<script id="t:result-list" type="text/html">
<! for(var i =0; i < activities.length; ++i){ !>
<! var container_type = activities[i].container_type; var act_type = activities[i].act_type; !>
<! if (container_type == "Course") { !>
<! if (act_type == "HomeworkCommon") { !>
<!--homework -->
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl"><img src="<!=activities[i].author.img_url!>" width="45" height="45" class="border-radius" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb"><!=activities[i].subject!></span></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10"><!=activities[i].author.nickname!></a>to<a herf="javascript:void(0);" class="ml10"><!=activities[i].course_project_name!>&nbsp;&nbsp;|&nbsp;&nbsp;<!=activities[i].activity_type_name!></a></div>
<div class="cl"></div>
<div class="post-content c-grey2 mt10">
<div class="post-all-content"><!:=activities[i].description!><br />
<span class="mr15">迟交扣分<!:=activities[i].homework_common_detail.late_penalty!></span> 匿评开启时间:<!:=activities[i].homework_common_detail.evaluation_start!><br />
<span class="mr15">缺评扣分<!:=activities[i].homework_common_detail.absence_penalty!>/作品</span> <!:=activities[i].homework_common_detail.evaluation_end!></div>
</div>
<a herf="javascript:void(0);" class="link-blue f13 fl mt5 post-more undis" style="text-decoration:underline">点击展开</a>
<div class="cl"></div>
<span class="c-grey f13 mt10 fl"><!=activities[i].latest_update!></span>
<div class="cl"></div>
</div>
<div class="post-interactive">
<div class="post-interactive-column c-grey2"><a href="javascript:void(0);" onclick="window.open('homework_detail.html?id=<!=activities[i].act_id!>');" class="c-grey">回复 (<!=activities[i].reply_count!>)</a></div>
<div class="post-interactive-column c-grey2"> (<!=activities[i].activity_praise_count!>)</div>
</div>
</div>
</div>
<! } else if (act_type == "News") { !>
<!-- course news -->
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl"><img src="<!=activities[i].author.img_url!>" width="45" height="45" class="border-radius" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb"><!=activities[i].subject!></span></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10"><!=activities[i].author.nickname!></a>to<a herf="javascript:void(0);" class="ml10"><!=activities[i].course_project_name!>&nbsp;&nbsp;|&nbsp;&nbsp;<!=activities[i].activity_type_name!></a></div>
<div class="cl"></div>
<div class="post-content c-grey2 mt10">
<div class="post-all-content"><!:=activities[i].description!></div>
</div>
<a herf="javascript:void(0);" class="link-blue f13 fl mt5 post-more undis" style="text-decoration:underline">点击展开</a>
<div class="cl"></div>
<span class="c-grey f13 mt10 fl"><!=activities[i].latest_update!></span>
<div class="cl"></div>
</div>
<div class="post-interactive">
<div class="post-interactive-column c-grey2"><a href="javascript:void(0);" <!--onclick="window.open('course_notice.html?id=<!=activities[i].act_id!>');"--> class="c-grey">回复 (<!=activities[i].reply_count!>)</a></div>
<div class="post-interactive-column c-grey2"> (<!=activities[i].activity_praise_count!>)</div>
</div>
</div>
</div>
<! } else if (act_type == "Message") { !>
<!--course message -->
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl"><img src="images/post-avatar.jpg" width="45" height="45" class="border-radius" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb"><!=activities[i].subject!></span></div>
<div class="post-title fl mb10 hidden"><a herf="javascript:void(0);" class="mr10"><!=activities[i].author.nickname!></a>to<a herf="javascript:void(0);" class="ml10"><!=activities[i].course_project_name!>&nbsp;&nbsp;|&nbsp;&nbsp;<!=activities[i].activity_type_name!></a></div>
<div class="cl"></div>
<div class="post-content c-grey2 mt10">
<p class="post-all-content"><!:=activities[i].description!></p>
</div>
<a herf="javascript:void(0);" class="link-blue f13 fl mt5 post-more undis" style="text-decoration:underline;">点击展开</a>
<span class="c-grey f13 mt10 fl"><!=activities[i].latest_update!></span>
<div class="cl"></div>
</div>
<div class="post-interactive">
<div class="post-interactive-column c-grey2"><a href="javascript:void(0);" <!--onclick="window.open('course_discussion.html?id=<!=activities[i].act_id!>');"--> class="c-grey">回复 (<!=activities[i].reply_count!>)</a></div>
<div class="post-interactive-column c-grey2"> (<!=activities[i].activity_praise_count!>)</div>
</div>
</div>
</div>
<! } else if (act_type == "Course") { !>
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl"><img src="<!=activities[i].author.img_url!>" width="45" height="45" class="border-radius" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f13 fb mr10"><!=activities[i].author.nickname!></span><span class="c-grey3 f13 fb ml10"><!=activities[i].course_project_name!></span></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10"><!=activities[i].latest_update!></a></div>
<div class="cl"></div>
</div>
</div>
</div>
<! } !>
<! } else if (container_type == "Project") { !>
<! if (act_type == "Issue") { !>
<!-- activities -->
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl"><img src="<!=activities[i].author.img_url!>" width="45" height="45" class="border-radius" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb"><!=activities[i].subject!></span></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10"><!=activities[i].author.nickname!></a>to<a herf="javascript:void(0);" class="ml10"><!=activities[i].course_project_name!>&nbsp;&nbsp;|&nbsp;&nbsp;<!=activities[i].activity_type_name!></a></div>
<div class="cl"></div>
<div class="post-content c-grey2 mt10">
<div class="post-all-content"><!:=activities[i].description!><br />
<span class="mr15">状态<!:=activities[i].issue_detail.issue_status!></span> <span class="mr15"><!:=activities[i].issue_detail.issue_priority!></span> <br /> <span class="mr15"><!:=activities[i].issue_detail.issue_assigned_to!></span> <span class="mr15"><!:=activities[i].issue_detail.done_ratio!>%</span></div>
</div>
<a herf="javascript:void(0);" class="link-blue f13 fl mt5 post-more undis" style="text-decoration:underline">点击展开</a>
<div class="cl"></div>
<span class="c-grey f13 mt10 fl"><!=activities[i].latest_update!></span>
<div class="cl"></div>
</div>
<div class="post-interactive">
<div class="post-interactive-column c-grey2"><a href="javascript:void(0);" onclick="window.open('issue_detail.html?id=<!=activities[i].act_id!>');" class="c-grey"> 回复 (<!=activities[i].reply_count!>)</a></div>
<div class="post-interactive-column c-grey2"> (<!=activities[i].activity_praise_count!>)</div>
</div>
</div>
</div>
<! } else if (act_type == "Message") { !>
<!-- project news -->
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl"><img src="<!=activities[i].author.img_url!>" width="45" height="45" class="border-radius" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb"><!=activities[i].subject!></span></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10"><!=activities[i].author.nickname!></a>to<a herf="javascript:void(0);" class="ml10"><!=activities[i].course_project_name!>&nbsp;&nbsp;|&nbsp;&nbsp;<!=activities[i].activity_type_name!></a></div>
<div class="cl"></div>
<div class="post-content c-grey2 mt10">
<div class="post-all-content"><!:=activities[i].description!></div>
</div>
<a herf="javascript:void(0);" class="link-blue f13 fl mt5 post-more undis" style="text-decoration:underline">点击展开</a>
<div class="cl"></div>
<span class="c-grey f13 mt10 fl"><!=activities[i].latest_update!></span>
<div class="cl"></div>
</div>
<div class="post-interactive">
<div class="post-interactive-column c-grey2"><a href="javascript:void(0);" <!--onclick="window.open('project_discussion.html?id=<!=activities[i].act_id!>');"--> class="c-grey"> 回复 (<!=activities[i].reply_count!>) </a></div>
<div class="post-interactive-column c-grey2"> (<!=activities[i].activity_praise_count!>)</div>
</div>
</div>
</div>
<! } else if (act_type == "ProjectCreateInfo") { !>
<!-- project created -->
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl"><img src="<!=activities[i].author.img_url!>" width="45" height="45" class="border-radius" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb"><!=activities[i].author.nickname!></span><span class="c-grey3 f15 fb"><!=activities[i].course_project_name!></span></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10"><!=activities[i].latest_update!></a></div>
<div class="cl"></div>
</div>
</div>
</div>
<! } !>
<! } else if (container_type == "Principal") { !>
<!--留言 -->
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl"><img src="images/post-avatar.jpg" width="45" height="45" class="border-radius" /></div>
<div class="post-title mb5 hidden"><a herf="javascript:void(0);" class="mr10"><!=activities[i].author.nickname!></a> <span style="vertical-align:top;"></span></div>
<div class="post-title hidden"><!=activities[i].latest_update!></div>
<div class="cl"></div>
<div class="post-content c-grey2 mt10">
<p class="post-all-content"><!:=activities[i].description!></p>
</div>
<a herf="javascript:void(0);" class="link-blue f13 fl mt5 post-more undis" style="text-decoration:underline;">点击展开</a>
<div class="cl"></div>
</div>
<div class="post-interactive">
<div class="post-interactive-column c-grey2"><a href="javascript:void(0);" <!--onclick="window.open('message_detail.html?id=<!=activities[i].act_id!>');"--> class="c-grey"> 回复 (<!=activities[i].reply_count!>)</a></div>
<div class="post-interactive-column c-grey2"> (<!=activities[i].activity_praise_count!>)</div>
</div>
</div>
</div>
<! } else if (container_type == "Blog") { !>
<!--blog -->
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl"><img src="<!=activities[i].author.img_url!>" width="45" height="45" class="border-radius" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb"><!=activities[i].subject!></span></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10"><!=activities[i].author.nickname!></a></div>
<div class="cl"></div>
<div class="post-content c-grey2 mt10">
<div class="post-all-content"><!:=activities[i].description!></div>
</div>
<a herf="javascript:void(0);" class="link-blue f13 fl mt5 post-more undis" style="text-decoration:underline">点击展开</a>
<div class="cl"></div>
<span class="c-grey f13 mt10 fl"><!=activities[i].latest_update!></span>
<div class="cl"></div>
</div>
<div class="post-interactive">
<div class="post-interactive-column c-grey2"><a href="javascript:void(0);" <!--onclick="window.open('blog_detail.html?id=<!=activities[i].act_id!>');"--> class="c-grey"> 回复 (<!=activities[i].reply_count!>)</a></div>
<div class="post-interactive-column c-grey2"> (<!=activities[i].activity_praise_count!>)</div>
</div>
</div>
</div>
<! } !>
<! } !>
<! if ((count + page * 10) < all_count) {!>
<div id="more_activities" class="more-events mt10" onclick="loadDataFromServer(868, <!= page+1 !>);">更多</div>
<! } !>
</script>
<script src="/javascripts/jquery-1.3.2.js"></script>
<script src="/javascripts/baiduTemplate.js"></script>
<script src="/javascripts/wechat/wechat_dev.js"></script>
<script src="/javascripts/wechat/auth.js"></script>
<script type="text/javascript">
var bt=baidu.template;
bt.LEFT_DELIMITER='<!';
bt.RIGHT_DELIMITER='!>';
var apiUrl = '/api/v1/';
var loadDataFromServer = function(id, page){
//getOpenId(function(openid){
$.ajax({
url: apiUrl + 'activities/' + id +"?page=" + parseInt(page),
dataType: 'json',
success: function(data){
setTemplate(data.data, data.all_count, data.count, data.page);
},
error: function(xhr,status,err){
console.log(err);
}
});
//})
};
var setTemplate = function(data, all_count, count, page){
console.log(data);
var html=bt('t:result-list',{activities: data, all_count: all_count, count: count, page: page});
if (page == 0) {
$('#container').prepend(html);
} else {
$("#more_activities").remove();
$('#container').append(html);
}
descToggle();
};
//内容全部显示与部分隐藏
var descToggle = function(){
$(".post-all-content").each(function(){
var postHeight = $(this).height();
if (postHeight > 90){
$(this).parent().next().css("display","block");
$(this).parent().next().toggle(function(){
$(this).text("点击隐藏");
$(this).prev().css("height",postHeight);
},function(){
$(this).text("点击展开");
$(this).prev().css("height",90);
});
}
});
}
</script>
</body>
</html>