unserver-unify
Version:
145 lines (142 loc) • 7.63 kB
HTML
<div class="mbl_survey" ng-controller="surveyListCtrl as ctrl">
<div class="col-md-3 hidden-xs">
<div class="profile sidebar no-wrap">
<div class="panel no-bg ongoing margin-bottom-20">
<div class="panel-heading overflow-h">
<h2 class="panel-title heading-sm pull-left">
<i class="fa fa-clock-o" style="color:#0ece1a">
</i>
<span translate>
Latest
</span>
</h2>
</div>
<ul>
<!-- <li class="profile-event" ui-sref=".detail({ id : item._id ,answered:item.answered,take:true})" ng-repeat="item in ctrl.displaySurveys | orderBy: -created |limitTo: 30 "> -->
<li class="profile-event text-center" style="color:#e67e22; padding-bottom: 10px;" ng-if="!ctrl.displaySurveys||ctrl.displaySurveys.length<1" translate>
No Latest Survey to show
</li>
<li class="profile-event" ng-repeat="item in ctrl.displaySurveys | orderBy: '-created' |limitTo: 3 ">
<div class="overflow-h">
<h3 class="heading-xs">
<a ng-if="!item.public && !item.answered">
{{item.name}}
</a>
<a ng-if="!item.public && item.answered" ui-sref=".detail({ id : item._id ,answered:item.answered})">
{{item.name}}
</a>
<a ng-if="item.public" ui-sref=".detail({ id : item._id,answered:item.answered,take:true })">
{{item.name}}
</a>
<i class="fa fa-user" aria-hidden="true"></i>({{item.counter || 0}})
</h3>
<div class="item-date font-12">
<span>
{{item.created|date:shortDate}}
</span>
</div>
<p style="max-height:36px; overflow: hidden;">
{{item.description}}
</p>
<a ng-if="!item.answered || item.public" href="javascript:;" ui-sref=".detail({id: item._id,answered:item.answered,take:true})" class="color-orange">{{'Take Survey' | translate}} <i class="fa fa-angle-right"></i></a>
<a ng-if="item.answered && !item.public " href="javascript:;" ui-sref=".result({id: item._id})">{{'View result' | translate}} <i class="fa fa-angle-right"></i></a>
<a ng-if="item.public" href="javascript:;" ui-sref=".result({id: item._id,force:true})"> {{'View result' | translate}} <i class="fa fa-angle-right"></i></a>
</div>
</li>
</ul>
<div class="clearfix"></div>
</div>
</div>
<div class="profile sidebar no-wrap">
<div class="panel no-bg ongoing margin-bottom-20">
<div class="panel-heading overflow-h">
<h2 class="panel-title heading-sm pull-left">
<i class="fa fa-list">
</i>
<span translate>
Hot
</span>
</h2>
</div>
<!--div class="profile-event text-center" ng-if="!ctrl.latest||ctrl.latest.length<1" style="color:#e67e22">
No survey to show
</div-->
<ul>
<li class="profile-event text-center" style="color:#e67e22; padding-bottom: 10px;" ng-if="!ctrl.displaySurveys||ctrl.displaySurveys.length<1" translate>
No Upcoming Survey to show
</li>
<li class="profile-event" ng-repeat="item in ctrl.displaySurveys | orderBy: '-counter' |limitTo: 3 ">
<div class="overflow-h">
<h3 class="heading-xs">
<a ng-if="!item.public && !item.answered">
{{item.name}}
</a>
<a ng-if="!item.public && item.answered" ui-sref=".detail({ id : item._id ,answered:item.answered})">
{{item.name}}
</a>
<a ng-if="item.public" ui-sref=".detail({ id : item._id,answered:item.answered,take:true })">
{{item.name}}
</a>
<i class="fa fa-user" aria-hidden="true"></i>({{item.counter || 0}})
</h3>
<div class="item-date font-12">
<span>
{{item.created|date:shortDate}}
</span>
</div>
<p style="max-height:36px; overflow: hidden;">
{{item.description}}
</p>
<a ng-if="!item.answered || item.public" href="javascript:;" ui-sref=".detail({id: item._id,answered:item.answered,take:true})" class="color-orange">{{'Take Survey' | translate}} <i class="fa fa-angle-right"></i></a>
<a ng-if="item.answered && !item.public " href="javascript:;" ui-sref=".result({id: item._id})">{{'View result' | translate}} <i class="fa fa-angle-right"></i></a>
<a ng-if="item.public" href="javascript:;" ui-sref=".result({id: item._id,force:true})"> {{'View result' | translate}} <i class="fa fa-angle-right"></i></a>
</div>
</li>
</ul>
<div class="clearfix"></div>
</div>
</div>
</div>
<div class="col-md-9 col-xs-12">
<div class="panel panel-body">
<div class="table-responsive margin-bottom-20">
<table class="table table-striped table-hover white-bg">
<tr class="info">
<th width="20%">{{ {eng:'Name', chn:'问卷名称'} | trans}}</th>
<th width="15%" translate>Posted on</th>
<th width="15%" translate>{{ {eng:'Taken Times', chn:'参与次数'} | trans}}</th>
<th width="25%">{{ {eng:'Description', chn:'问卷详情'} | trans}}</th>
<th width="10%" translate>Action</th>
</tr>
<tbody>
<tr ng-if="ctrl.displaySurveys | isEmpty">
<td colspan="5">
<div class="no_record" translate="">
No record
</div>
</td>
</tr>
<tr ng-repeat="survey in ctrl.displaySurveys | orderBy: '-created' ">
<td class="v-middle">
<!-- <a ui-sref=".detail({id: survey._id})" ng-if="!(survey.answered&&survey.result&& !survey.public)">{{survey.name}}</a> -->
<!-- <a ui-sref=".detail({id: survey._id,answered:survey.answered})" ng-if="survey.answered&&survey.result&& !survey.public">{{survey.name}}
</a> -->
<a ui-sref=".detail({id: survey._id,answered:survey.answered})" ng-if="!survey.public">{{survey.name}}
</a>
<a ui-sref=".detail({id: survey._id,answered:true})" ng-if="survey.public">{{survey.name}}
</a>
</td>
<td class="v-middle">{{survey.created | date : mediumDate}}</td>
<td class="v-middle text_indent10">{{survey.counter}}</td>
<td class="v-middle"><a ui-sref=".detail({id: survey._id,answered:survey.answered})">{{survey.description}}</a></td>
<td class="v-middle">
<button class="btn-u btn-xs" ng-if="!survey.answered || survey.public" ui-sref=".detail({id: survey._id,answered:survey.answered,take:true})" translate>Take survey </button>
<button class="btn-info btn-xs" style="border: none;" ui-sref=".result({id: survey._id})" ng-if="survey.answered&&survey.result&& !survey.public" translate>View Result</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>