<ng-include src="'/intranet/quiz/html/includes/infoboxes/survey_preview_mode.html'"></ng-include>

<div class="row row-fluid">
	<div class="col-md-4 mb-10" ng-hide="!content.survey.image_url">
		<img class="img-fluid" ng-src="{{ content.survey.image_url }}">
	</div>

	<div ng-class="!content.survey.image_url ? 'col-md-8' : 'col-md-8'">
<div class="row mt-2 mt-md-0">
	<div class="col-sm-6 col-md-7 col-lg-8">
		<h3 class="text-break mb-0 mt-0">
			<span class="va-middle" ng-bind="content.survey.title">[Title]</span>
			<span ng-if="content.permissions.can_view_status">

				<!-- Survey is completed -->
				<cla-badge styleclass="badge badge-success" ng-show="isCompleted()" lmsg="quiz.status.completed">[Completed]</cla-badge>

				<!-- Survey is a draft -->
				<cla-badge styleclass="badge badge-warning" ng-if="content.survey.is_draft" lmsg="quiz.status.draft">[Draft]</cla-badge>

				<!-- Survey is Archived -->
				<cla-badge styleclass="badge badge-secondary"  ng-if="content.survey.is_archived" lmsg="quiz.status.archived">[Archived]</cla-badge>

				<!-- Survey is Ended -->
				<cla-badge styleclass="badge badge-secondary" ng-show="isEnded() && !content.survey.is_draft" lmsg="quiz.status.ended">[Ended]</cla-badge>

				<!-- Survey end date/time -->
				<cla-badge styleclass="badge badge-warning" ng-if="!isEnded() && hasEnd() && !content.survey.is_archived">
					<span ng-bind="end_date_lmsg"></span>
				</cla-badge>
			</span>
		</h3>
	</div>
	<div class="col-sm-6 col-md-5 col-lg-4 title-buttons text-left text-sm-right mt-2 mt-sm-0">
		<cla-share canonical_url="{{canonicalUrl}}"></cla-share>

		<div class="btn-group">
			<a href="/polls-surveys/survey/{{content.survey.id}}/edit" name="link_edit" class="btn btn-secondary js-link-edit" ng-if="content.permissions.can_manage" rel="tooltip" data-original-title="{{ edit_survey_lmsg}}">
				<ion-icon name="create-outline"></ion-icon>
			</a>
			<a href="/polls-surveys/survey/{{ survey_id }}/results" name="link_stats" class="btn btn-secondary" ng-if="content.permissions.can_manage || content.permissions.can_view_statistics" rel="tooltip" data-original-title="{{view_results_lmsg}}">
				<ion-icon name="stats-chart-outline"></ion-icon>
			</a>
		</div>
	</div>
</div>

		<p class="mt-5" name="intro-description" ng-bind-html="content.survey.description">[Description]</p>

		<p>
			<strong lmsg="quiz.info.author">[Author]</strong>:
			<a target="_blank" href="{{content.survey.created_by.url}}?from_list=true" ng-bind="content.survey.created_by.name">[Username]</a>
		</p>

		<p>
			<strong lmsg="quiz.surveys.info.questions">[Questions]</strong>: <span ng-bind="content.questions_number">[0]</span>
		</p>

		<p>
			<strong lmsg="quiz.survey.info.sections">[Sections]</strong>: <span ng-bind="content.sections_number">[0]</span>
		</p>

		<h5 class="ng-scope" ng-show="content.survey.anonymous === 1">
			<ion-icon class="mr-1 align-middle" name="eye-off-outline"></ion-icon>
			<txt lmsg="quiz.survey.info.anonymous">[You're answering this survey anonymously]</txt>
		</h5>

		<div ng-if="showPreview()">
			<a href="#/start" class="btn btn-primary btn-intro-poll" lmsg="quiz.survey.preview">[Preview survey]</a>
		</div>
		<div ng-if="content.permissions.can_attempt && !isEnded() && !isCompleted() && !isCompletedAnonymous()">
			<a href="#/start" class="btn btn-primary btn-intro-poll" ng-show="!content.attempt || content.attempt.completed_date">
				<txt lmsg="quiz.survey.start">[Start survey]</txt>
			</a>
			<a href="#/continue" class="btn btn-primary btn-intro-poll" lmsg="quiz.survey.continue" ng-show="isContinue()">[Continue survey]</a>
		</div>
		<div ng-show="data_ready" ng-if="(isCompleted() || isCompletedAnonymous()) && !showPreview() && !isEnded()">
			<h4 lmsg="quiz.survey.info.taken">[You've already taken this survey]</h4>
			<div class="page-actions">
				<a href="#/start" ng-if="can_retake" class="btn btn-primary"><txt lmsg="quiz.survey.info.start_again">Start Again</txt></a>
				<a href="/polls-surveys/survey/{{ survey_id }}/results" ng-if="content.permissions.can_manage || content.permissions.can_view_statistics" class="btn btn-next-question btn-primary mt-3 mb-3" lmsg="quiz.survey.info.view_results">View results</a>
			</div>
		</div>
	</div>
</div>
