unserver-unify
Version:
240 lines (237 loc) • 10.2 kB
HTML
<div class="mbl_survey" ng-controller="showResultCtrl 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" 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" ui-sref="^.detail({ id : item._id,answered:item.answered,take:true })">
{{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 aria-hidden="true" class="fa fa-user">
</i>
({{item.counter}})
</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 href="javascript:;" ng-if="item.answered && !item.public " ui-sref=".({id:item._id})">
{{'View Result' | translate}}
<i class="fa fa-angle-right">
</i>
</a>
<a href="javascript:;" ng-if="item.public " ui-sref=".({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="">
Most answered
</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" 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" ui-sref="^.detail({ id : item._id,answered:item.answered,take:true })">
{{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 aria-hidden="true" class="fa fa-user">
</i>
({{item.counter}})
</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 href="javascript:;" ng-if="item.answered && !item.public " ui-sref=".({id:item._id})">
{{'View Result' | translate}}
<i class="fa fa-angle-right">
</i>
</a>
<a href="javascript:;" ng-if="item.public " ui-sref=".({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="news-v3 bg-color-white ">
<div class="news-v3-in survey_container">
<h3>
{{ ctrl.item.name }}
</h3>
<p style="font-size: 18px; border-bottom: solid 3px #72c02c; padding-bottom: 10px;">
{{ ctrl.item.description }}
</p>
<div ng-if="(ctrl.item.public&&!ctrl.forceResult)|| (!ctrl.resultFlag&&!ctrl.item.public)">
<h2 ng-if="ctrl.item.public" style="font-size: 15px;margin-bottom:25px;">
{{'User Name'|translate}}
<input class="item item-input" ng-model="ctrl.item.username" placeholder="Name" type="text"/>
</h2>
<div ng-repeat="q in ctrl.item.questions">
<div class="headline" ng-if="q.type=='heading'">
<h4 translate="">
{{q.content}}
</h4>
</div>
<div ng-if="q.type!='heading'">
<div class="tag-box tag-box-v2 adjust">
<div class="pull-left">
<b>
Q{{ q.index }}.
</b>
</div>
<div ng-bind-html="q.content">
</div>
</div>
</div>
<!-- SCQ -->
<table class="margin-bottom-20 survey_ans" ng-if="!q.type||q.type=='single'">
<!-- radio SCQ-->
<tr ng-repeat="opt in q.options">
<td align="center" width="30">
{{ numToLetters($index ) }}.
</td>
<td for="opt{{ $index }}">
<input id="opt{{ $index }}" ng-model="q.selection" type="radio" value="{{ opt.text }}"/>
{{ opt.text }}
</td>
</tr>
</table>
<!-- MCQ -->
<table ng-if="q.type=='multiple'">
<!-- checkbox MCQ-->
<tr ng-repeat="opt in q.options">
<td align="center" width="30">
{{ numToLetters($index ) }}.
</td>
<td for="opt{{ $index }}">
<input ng-model="opt.selection" type="checkbox" value="{{ opt.text }}"/>
{{ opt.text }}
</td>
</tr>
</table>
<!-- FILL -->
<div class="col-md-6" ng-if="q.type=='fill'">
<input class="form-control" ng-model="q.selection" style="margin-top:15px;" type="text"/>
</div>
<div class="clearfix margin-bottom-20">
</div>
</div>
<div class="clearfix">
</div>
<button class="btn btn-u" ng-click="ctrl.submit()" style="padding:5px 20px" translate="">
Submit
</button>
<button class="btn btn-u" ng-click="ctrl.showresult()" ng-if="ctrl.item.public" style="padding:5px 20px" translate="">
Result
</button>
<div class="clearfix">
</div>
</div>
<!-- result -->
<div class="survey_result" ng-if="ctrl.forceResult||(ctrl.resultFlag&&ctrl.item.result&& !ctrl.item.public)">
<!--div class="survey_result" ng-if="(ctrl.answered )"-->
<div class="row" ng-repeat="q in ctrl.item.questions">
<div class="col-md-12 col-xs-12 margin-bottom-30">
<h2>
Q{{ $index+1 }}
</h2>
<p ng-bind-html="q.content"></p>
<p class="totalresult" style="margin-bottom:30px">
{{ ctrl.summary[q.index]._total }}
<span translate="">
People Answered
</span>
</p>
<div class="col-md-4 col-xs-12">
<canvas chart-data="ctrl.summary[q.index].data" chart-legend="legend" chart-options="options" tc-chartjs-doughnut="">
</canvas>
</div>
<div chart-legend="legend" style="margin-top:20px; float:left;" tc-chartjs-legend="">
</div>
</div>
</div>
<div class="no_record" translate="" ng-if="!ctrl.summary">
No Record
</div>
<div ng-if="!ctrl.summary">
<div class="alert alert-success">
<strong translate="">Success</strong> {{'Please wait for the result !'| translate}}
</div>
</div>
<div class="clearfix">
</div>
</div>
<div class="survey_result" ng-if="ctrl.resultFlag&&!ctrl.item.result">
<div class="alert alert-info">
<strong translate="">Info</strong> {{'Survey result submited!'| translate}}
</div>
<div class="clearfix"></div>
</div>
<div class="clearfix">
</div>
</div>
</div>
<div class="margin-bottom-30"></div>
</div>
</div>