改为angularjs实现

This commit is contained in:
guange 2016-04-04 22:24:13 +08:00
parent 58c1b27600
commit 36f3e3a46c
13 changed files with 370 additions and 40980 deletions

View File

@ -1,225 +1,217 @@
<!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" />
<div id="container">
<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>
<!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 -->
<div ng-repeat="act in activities">
<div ng-if="act.container_type=='Course'">
<div ng-if="act.act_type=='HomeworkCommon'">
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="45" height="45" class="border-radius" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb">{{act.subject|safeHtml}}</span></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10">{{act.author.nickname}}</a>to<a herf="javascript:void(0);" class="ml10">{{act.course_project_name}}&nbsp;&nbsp;|&nbsp;&nbsp;{{act.activity_type_name}}</a></div>
<div class="cl"></div>
<div class="post-content c-grey2 mt10">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"><br />
<span class="mr15">迟交扣分:{{act.homework_common_detail.late_penalty}}分</span> 匿评开启时间:{{act.homework_common_detail.evaluation_start}}<br />
<span class="mr15">缺评扣分:{{act.homework_common_detail.absence_penalty}}分/作品</span> 匿评关闭时间:{{act.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">{{act.latest_update}}</span>
<div class="cl"></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 class="post-interactive">
<div class="post-interactive-column c-grey2"><a href="javascript:void(0);" ng-click="window.open('homework_detail.html?id={{act.act_id}}');" class="c-grey">回复 ({{act.reply_count}})</a></div>
<div class="post-interactive-column c-grey2">赞 ({{act.activity_praise_count}})</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 ng-if="act.act_type=='News'">
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="45" height="45" class="border-radius" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb">{{act.subject|safeHtml}}</span></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10">{{act.author.nickname}}</a>to<a herf="javascript:void(0);" class="ml10">{{act.course_project_name}}&nbsp;&nbsp;|&nbsp;&nbsp;{{act.activity_type_name}}</a></div>
<div class="cl"></div>
<div class="post-content c-grey2 mt10">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></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">{{act.latest_update}}</span>
<div class="cl"></div>
</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 class="post-interactive">
<div class="post-interactive-column c-grey2"><a href="javascript:void(0);" ng-click="window.open('course_notice.html?id={{act.act_id}}');" class="c-grey">回复 ({{act.reply_count}})</a></div>
<div class="post-interactive-column c-grey2">赞 ({{act.activity_praise_count}})</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 ng-if="act.act_type=='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">{{act.subject|safeHtml}}</span></div>
<div class="post-title fl mb10 hidden"><a herf="javascript:void(0);" class="mr10">{{act.author.nickname}}</a>to<a herf="javascript:void(0);" class="ml10">{{act.course_project_name}}&nbsp;&nbsp;|&nbsp;&nbsp;{{act.activity_type_name}}</a></div>
<div class="cl"></div>
<div class="post-content c-grey2 mt10">
<p class="post-all-content" ng-bind-html="act.description|safeHtml"></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">{{act.latest_update}}</span>
<div class="cl"></div>
</div>
<div class="post-interactive">
<div class="post-interactive-column c-grey2"><a href="javascript:void(0);" class="c-grey">回复 ({{act.reply_count}})</a></div>
<div class="post-interactive-column c-grey2">赞 ({{act.activity_praise_count}})</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 ng-if="act.act_type=='Course'">
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="45" height="45" class="border-radius" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f13 fb mr10">{{act.author.nickname}}</span>创建了<span class="c-grey3 f13 fb ml10">{{act.course_project_name}}</span></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10">{{act.latest_update}}</a></div>
<div class="cl"></div>
</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 ng-if="act.container_type=='Project'">
<div ng-if="act.act_type=='Issue'">
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="45" height="45" class="border-radius" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb">{{act.subject|safeHtml}}</span></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10">{{act.author.nickname}}</a>to<a herf="javascript:void(0);" class="ml10">{{act.course_project_name}}&nbsp;&nbsp;|&nbsp;&nbsp;{{act.activity_type_name}}</a></div>
<div class="cl"></div>
<div class="post-content c-grey2 mt10">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"><br />
<span class="mr15">状态:{{act.issue_detail.issue_status}}</span> <span class="mr15">优先级:{{act.issue_detail.issue_priority}}</span> <br /> <span class="mr15">指派给:{{act.issue_detail.issue_assigned_to}}</span> <span class="mr15">完成度:{{act.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">{{act.latest_update}}</span>
<div class="cl"></div>
</div>
<div class="post-interactive">
<div class="post-interactive-column c-grey2"><a href="javascript:void(0);" ng-href="#/issues/{{act.act_id}}" class="c-grey"> 回复 ({{act.reply_count}})</a></div>
<div class="post-interactive-column c-grey2">赞 ({{act.activity_praise_count}})</div>
</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(8686, <!= page+1 !>);">更多</div>
<! } !>
</script>
<script src="/javascripts/jquery-1.3.2.js"></script>
<script src="/javascripts/baiduTemplate.js"></script>
<script src="/javascripts/wechat/auth.js"></script>
<script src="/javascripts/wechat/wechat_dev.js"></script>
</body>
</html>
<div ng-if="act.act_type=='Message'">
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="45" height="45" class="border-radius" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb">{{act.subject|safeHtml}}</span></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10">{{act.author.nickname}}</a>to<a herf="javascript:void(0);" class="ml10">{{act.course_project_name}}&nbsp;&nbsp;|&nbsp;&nbsp;{{act.activity_type_name}}</a></div>
<div class="cl"></div>
<div class="post-content c-grey2 mt10">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></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">{{act.latest_update}}</span>
<div class="cl"></div>
</div>
<div class="post-interactive">
<div class="post-interactive-column c-grey2"><a href="javascript:void(0);" class="c-grey"> 回复 ({{act.reply_count}}) </a></div>
<div class="post-interactive-column c-grey2">赞 ({{act.activity_praise_count}})</div>
</div>
</div>
</div>
</div>
<div ng-if="act.act_type=='ProjectCreateInfo'">
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="45" height="45" class="border-radius" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb">{{act.author.nickname}}</span>创建了<span class="c-grey3 f15 fb">{{act.course_project_name}}</span></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10">{{act.latest_update}}</a></div>
<div class="cl"></div>
</div>
</div>
</div>
</div>
<div ng-if="act.act_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">{{act.author.nickname}}</a> <span style="vertical-align:top;">给您留言了</span></div>
<div class="post-title hidden">{{act.latest_update}}</div>
<div class="cl"></div>
<div class="post-content c-grey2 mt10">
<p class="post-all-content" ng-bind-html="act.description|safeHtml"></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);" class="c-grey"> 回复 ({{act.reply_count}})</a></div>
<div class="post-interactive-column c-grey2">赞 ({{act.activity_praise_count}})</div>
</div>
</div>
</div>
</div>
<div ng-if="act.act_type=='Blog'">
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="45" height="45" class="border-radius" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb">{{act.subject|safeHtml}}</span></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10">{{act.author.nickname}}</a>发表博客</div>
<div class="cl"></div>
<div class="post-content c-grey2 mt10">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></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">{{act.latest_update}}</span>
<div class="cl"></div>
</div>
<div class="post-interactive">
<div class="post-interactive-column c-grey2"><a href="javascript:void(0);" class="c-grey"> 回复 ({{act.reply_count}})</a></div>
<div class="post-interactive-column c-grey2">赞 ({{act.activity_praise_count}})</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="more_activities" class="more-events mt10" ng-click="loadActData(page+1);">更多</div>
</div>

View File

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html ng-app="wechat">
<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 ng-view></div>
<script src="http://apps.bdimg.com/libs/angular.js/1.4.6/angular.js"></script>
<script src="http://apps.bdimg.com/libs/angular.js/1.4.6/angular-route.js"></script>
<script src="http://apps.bdimg.com/libs/angular.js/1.4.6/angular-sanitize.min.js"></script>
<script src="/javascripts/wechat/app.js"></script>
</body>
</html>

View File

@ -1,89 +1,60 @@
<!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="issue-container"></div>
<!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 -->
<script id="t:issue-detail" type="text/html">
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl"><img src="<!=issues.author.img_url!>" width="45" height="45" class="border-radius" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb"><!=issues.subject!></span></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10"><!=issues.author.nickname!></a>to<span class="ml10"><!=issues.project_name!>&nbsp;&nbsp;|&nbsp;&nbsp;项目缺陷</span></div>
<div class="post-avatar fl"><img ng-src="{{issue.author.img_url}}" width="45" height="45" class="border-radius" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb">{{issue.subject}}</span></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10">{{issue.author.nickname}}</a>to<span class="ml10">{{issue.project_name}}&nbsp;&nbsp;|&nbsp;&nbsp;项目缺陷</span></div>
<div class="cl"></div>
<div class="post-content" style="height:auto;">
<div class="post-all-content c-grey2 mt10"><!:=issues.description!><br />
<span class="mr15">状态:<!:=issues.issue_status!></span> <span class="mr15">优先级:<!:=issues.issue_priority!></span> <br /> <span class="mr15">指派给:<!:=issues.issue_assigned_to!></span> <span class="mr15">完成度:<!:=issues.done_ratio!>%</span></div>
<div class="post-all-content c-grey2 mt10"><!:=issue.description}}<br />
<span class="mr15">状态:<!:=issue.issue_status}}</span> <span class="mr15">优先级:<!:=issue.issue_priority}}</span> <br /> <span class="mr15">指派给:<!:=issue.issue_assigned_to}}</span> <span class="mr15">完成度:<!:=issue.done_ratio}}%</span></div>
</div>
<div class="cl"></div>
<span class="c-grey f13 mt10 fl"><!=issues.created_on!></span>
<span class="c-grey f13 mt10 fl">{{issue.created_on}}</span>
<div class="cl"></div>
</div>
<div class="post-interactive border-bottom">
<div class="post-interactive-reply c-grey2">回复 <span class="reply-num">(<!=issues.journals_count!>)</span></div>
<div class="post-interactive-praise c-grey2"><span class="paise-text"></span> <span class="praise-num">(<!=issues.issue_praise_count!>)</span></div>
<div class="post-interactive-reply c-grey2">回复 <span class="reply-num">({{issue.journals_count}})</span></div>
<div class="post-interactive-praise c-grey2"><span class="paise-text"></span> <span class="praise-num">({{issue.issue_praise_count}})</span></div>
</div>
<div id="all_issue_reply">
<! for(var j = (issues.issue_journals.length -1); j >= 0; --j){ !>
<div class="post-reply-wrap border-bottom">
<div class="post-reply-wrap border-bottom" ng-repeat="journal in issue.issue_journals">
<div class="post-reply-row">
<div class="post-reply-avatar fl"><img src="<!=issues.issue_journals[j].user.img_url!>" width="45" height="45" class="border-radius" /></div>
<div class="post-reply-avatar fl"><img ng-src="{{journal.user.img_url}}" width="45" height="45" class="border-radius" /></div>
<div class="ml55">
<div class="post-reply-user hidden"><!=issues.issue_journals[j].user.realname!></div>
<div class="post-reply-content c-grey2 mb10"><!:=issues.issue_journals[j].notes!></div>
<div class="post-reply-date fl"><!=issues.issue_journals[j].created_on!></div>
<div class="post-reply-user hidden">{{journal.user.realname}}</div>
<div class="post-reply-content c-grey2 mb10" ng-bind-html="journal.notes|safeHtml"></div>
<div class="post-reply-date fl">{{journal.created_on}}</div>
<div class="post-reply-trigger fr undis">回复</div>
</div>
<div class="cl"></div>
</div>
</div>
<! } !>
</div>
<div class="post-input-wrap">
<div class="post-reply-row">
<!--<div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
<input type="text" class="post-reply-input" id="postInput" />
<input type="submit" value="回复" class="post-reply-submit fr mt10" />
<input type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" />
<button ng-click="addIssueReply(formData)" class="post-reply-submit fr mt10">回复</button>
<div class="cl"></div>
</div>
</div>
</div>
</div>
</script>
<script id="t:issue-detail-reply" type="text/html">
<div class="post-reply-wrap border-bottom">
<div class="post-reply-row">
<div class="post-reply-avatar fl"><img src="<!=issue_reply.user.img_url!>" width="45" height="45" class="border-radius" /></div>
<div class="post-reply-avatar fl"><img src="{{issue_reply.user.img_url}}" width="45" height="45" class="border-radius" /></div>
<div class="ml55">
<div class="post-reply-user hidden"><!=issue_reply.user.realname!></div>
<div class="post-reply-content c-grey2 mb10"><!:=issue_reply.notes!></div>
<div class="post-reply-date fl"><!=issue_reply.created_on!></div>
<div class="post-reply-user hidden">{{issue_reply.user.realname}}</div>
<div class="post-reply-content c-grey2 mb10"><!:=issue_reply.notes}}</div>
<div class="post-reply-date fl">{{issue_reply.created_on}}</div>
</div>
<div class="cl"></div>
</div>
</div>
</script>
<script src="/javascripts/jquery-1.3.2.js"></script>
<script src="/javascripts/baiduTemplate.js"></script>
<script src="/javascripts/wechat/auth.js"></script>
<script src="/javascripts/wechat/issue_detail.js"></script>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,131 @@
var app = angular.module('wechat', ['ngRoute']);
var apiUrl = 'http://wechat.trustie.net/api/v1/';
//var openid= "oCnvgvz8R7QheXE-R9Kkr39j8Ndg";
var openid = '';
app.factory('auth', function($http,$routeParams){
var _openid = '';
var getOpenId = function(cb) {
if (_openid.length > 0) {
cb(_openid);
}
var code = $routeParams.code;
$http({
url: '/wechat/get_open_id',
data: {code: code},
method: 'POST'
}).then(function successCallback(response) {
_openid = data.openid;
cb(_openid);
}, function errorCallback(response) {
cb(null);
});
};
var setOpenId = function(id){
_openid = id;
}
return {getOpenId: getOpenId, setOpenId: setOpenId};
});
app.controller('ActivityController',function($scope, $http, auth){
$scope.repaceUrl = function(url){
return "http://www.trustie.net/" + url;
}
$scope.activities = [];
$scope.page = 1;
auth.getOpenId(function(openid){
if(!openid){
alert("获取openid出错");
} else {
openid = openid;
$scope.loadActData($scope.page);
}
});
$scope.loadActData = function(page){
$scope.page = page;
$http({
method: 'POST',
url: apiUrl+ "activities",
data: {openid: openid, page: page},
}).then(function successCallback(response) {
$scope.activities = $scope.activities.concat(response.data.data);
}, function errorCallback(response) {
});
}
});
app.controller('IssueController', function($scope, $http, $routeParams, auth){
$scope.formData = {comment: ''};
var loadData = function(id){
$http({
method: 'GET',
url: apiUrl+ "issues/"+id,
}).then(function successCallback(response) {
console.log(response.data);
$scope.issue = response.data.data;
}, function errorCallback(response) {
});
}
loadData($routeParams.id);
$scope.addIssueReply = function(data){
console.log(data.comment);
if(!data.comment || data.comment.length<=0){
return;
}
var userInfo = {
type: "Issue",
content: data.comment,
openid: openid,
};
$http({
method: 'POST',
url: apiUrl+ "new_comment/"+$routeParams.id,
data: userInfo,
}).then(function successCallback(response) {
alert("提交成功");
$scope.formData = {comment: ''};
loadData($routeParams.id);
}, function errorCallback(response) {
});
}
console.log(auth.getOpenId());
});
app.filter('safeHtml', function ($sce) {
return function (input) {
return $sce.trustAsHtml(input);
}
});
app.config(['$routeProvider',function ($routeProvider) {
$routeProvider
.when('/activities', {
templateUrl: 'activities.html',
controller: 'ActivityController'
})
.when('/issues/:id', {
templateUrl: 'issue_detail.html',
controller: 'IssueController'
})
.otherwise({
redirectTo: '/activities'
});
}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,42 +0,0 @@
/**
* ReactDOM v0.14.0
*
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
// Based off https://github.com/ForbesLindesay/umd/blob/master/template.js
;(function(f) {
// CommonJS
if (typeof exports === "object" && typeof module !== "undefined") {
module.exports = f(require('react'));
// RequireJS
} else if (typeof define === "function" && define.amd) {
define(['react'], f);
// <script>
} else {
var g
if (typeof window !== "undefined") {
g = window;
} else if (typeof global !== "undefined") {
g = global;
} else if (typeof self !== "undefined") {
g = self;
} else {
// works providing we're not in "use strict";
// needed for Java 8 Nashorn
// see https://github.com/facebook/react/issues/3037
g = this;
}
g.ReactDOM = f(g.React);
}
})(function(React) {
return React.__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
});

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,97 +0,0 @@
/**
* Created by guange on 16/3/21.
*//*
var Index = React.createClass({
render: function(){
return (<div>index page</div>);
}
});
var apiUrl = '/api/v1/';
var PostContainer = React.createClass({
loadDataFromServer: function(){
$.ajax({
url: apiUrl + 'issues/' + this.props.params.id,
dataType: 'json',
success: function(data){
this.setState({data: data.data});
}.bind(this),
error: function(xhr,status,err){
console.log(err);
}.bind(this)
})
},
componentDidMount: function(){
this.loadDataFromServer();
},
getInitialState: function(){
return {data: null};
},
render: function(){
return (
<PostView data={this.state.data}/>
)
}
});
var PostView = React.createClass({
testClick: function(){
console.log("123123");
},
render: function(){
if(!this.props.data){
return <div></div>
}
var issueEach = this.props.data.map(function(issue){
var descMarkup = converter.makeHtml(issue.description.toString());
return (
<div className="post-container">
<div className="post-wrapper">
<div className="post-main">
<div className="post-avatar fl"><img src={issue.author.img_url} width="45" height="45" className="border-radius" /></div>
<div className="post-title hidden mb5"><span className="c-grey3 f15 fb">{issue.subject}</span></div>
<div className="post-title hidden"><a herf="javascript:void(0);" className="mr10">{issue.author.nickname}</a>项目问题</div>
<div className="cl"></div>
<div className="post-content c-grey2 mt10">
<div className="post-all-content" dangerouslySetInnerHTML={{__html: descMarkup}}></div>
</div>
<a herf="javascript:void(0);" className="link-blue f13 fl mt5 post-more " style={{textDecoration: 'underline'}}>点击展开</a>
<div className="cl"></div>
<span onClick={this.testClick} className="c-grey f13 mt10 fl">{issue.created_on}</span>
<div className="cl"></div>
</div>
</div>
</div>
)
});
return(
<div>{issueEach}</div>
);
}
});
var Route = ReactRouter.Route;
var Router = ReactRouter.Router;
var routes = (
<Router>
<Route path="/" component={Index}/>
<Route path="issue/:id" component={PostContainer} />
</Router>
);
React.render(routes, document.getElementById("container"));
*/