Initial commit
This commit is contained in:
commit
f073e69417
28 changed files with 2564 additions and 0 deletions
26
htdocs/views/auth.html
Normal file
26
htdocs/views/auth.html
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<div class="row">
|
||||
<form class="col" ng-submit="logmein()">
|
||||
<h2>Accès à votre compte</h2>
|
||||
<div class="form-group">
|
||||
<label for="login">CRI login</label>
|
||||
<input class="form-control" id="login" ng-model="auth.username" placeholder="Entrer votre login" autofocus>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password">Mot de passe</label>
|
||||
<input type="password" class="form-control" id="password" ng-model="auth.password" placeholder="Mot de passe">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true" ng-show="pleaseWait"></span>
|
||||
Me connecter
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<div class="col">
|
||||
<h2>OpenId Connect</h2>
|
||||
<div class="text-center">
|
||||
<a href="auth/CRI" class="btn btn-info" target="_self">
|
||||
Me connecter avec mon compte CRI
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
26
htdocs/views/home.html
Normal file
26
htdocs/views/home.html
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<div class="jumbotron mt-2">
|
||||
<img class="float-right" src="https://photos.cri.epita.fr/thumb/mercie_d" alt="avatar" style="max-height: 150px">
|
||||
<h1>
|
||||
Bienvenue {{ isLogged.login }} !
|
||||
</h1>
|
||||
<hr class="my-4">
|
||||
|
||||
<p class="lead">Voici la liste des questionnaires :</p>
|
||||
|
||||
<table class="table" ng-controller="SurveysController">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Intitulé</th>
|
||||
<th>État</th>
|
||||
<th>Date</th>
|
||||
<th>Score</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="survey in surveys">
|
||||
<td>{{ survey }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
89
htdocs/views/survey.html
Normal file
89
htdocs/views/survey.html
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
<button class="btn btn-primary ml-1 float-right" ng-click="editSurvey()" ng-if="user.is_admin && !survey.edit"><svg class="bi bi-pencil" width="1em" height="1em" viewBox="0 0 20 20" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M13.293 3.293a1 1 0 011.414 0l2 2a1 1 0 010 1.414l-9 9a1 1 0 01-.39.242l-3 1a1 1 0 01-1.266-1.265l1-3a1 1 0 01.242-.391l9-9zM14 4l2 2-9 9-3 1 1-3 9-9z" clip-rule="evenodd"></path><path fill-rule="evenodd" d="M14.146 8.354l-2.5-2.5.708-.708 2.5 2.5-.708.708zM5 12v.5a.5.5 0 00.5.5H6v.5a.5.5 0 00.5.5H7v.5a.5.5 0 00.5.5H8v-1.5a.5.5 0 00-.5-.5H7v-.5a.5.5 0 00-.5-.5H5z" clip-rule="evenodd"></path></svg></button>
|
||||
<h2>
|
||||
{{ survey.title }}
|
||||
<small>
|
||||
<span class="badge badge-danger" ng-if="survey.start_availability > now">Prévu</span>
|
||||
<span class="badge badge-warning" ng-if="survey.start_availability <= now && survey.end_availability >= now">En cours</span>
|
||||
<span class="badge badge-danger" ng-if="survey.end_availability < now">Clos</span>
|
||||
<span class="badge badge-success">Validé</span>
|
||||
<span class="badge badge-info">Corrigé</span>
|
||||
</small>
|
||||
</h2>
|
||||
|
||||
<form ng-submit="saveSurvey()" ng-if="user.is_admin && survey.edit">
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="title" class="col-2 col-form-label col-form-label-sm">Titre du questionnaire</label>
|
||||
<div class="col-10">
|
||||
<input type="text" class="form-control form-control-sm" id="title" ng-model="survey.title">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="start_availability" class="col-2 col-form-label col-form-label-sm">Date de début</label>
|
||||
<div class="col-10">
|
||||
<input type="text" class="form-control form-control-sm" id="start_availability" ng-model="survey.start_availability">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="end_availability" class="col-2 col-form-label col-form-label-sm">Date de fin</label>
|
||||
<div class="col-10">
|
||||
<input type="text" class="form-control form-control-sm" id="end_availability" ng-model="survey.end_availability">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="shown" ng-model="survey.shown">
|
||||
<label class="form-check-label" for="shown">
|
||||
Afficher le questionnaire
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-10">
|
||||
<button type="submit" class="btn btn-primary">Enregistrer</button>
|
||||
<button type="button" class="btn btn-danger" ng-click="deleteSurvey()">Supprimer</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<form class="mb-5" ng-submit="submitAnswers()" ng-controller="QuestionsController" ng-if="survey.id" ng-cloak>
|
||||
<div class="card mb-2" ng-repeat="(qid,question) in questions">
|
||||
<div class="card-body">
|
||||
<button class="btn btn-danger ml-1 float-right" ng-click="deleteQuestion()" ng-if="user.is_admin"><svg class="bi bi-trash-fill" width="1em" height="1em" viewBox="0 0 20 20" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M4.5 3a1 1 0 00-1 1v1a1 1 0 001 1H5v9a2 2 0 002 2h6a2 2 0 002-2V6h.5a1 1 0 001-1V4a1 1 0 00-1-1H12a1 1 0 00-1-1H9a1 1 0 00-1 1H4.5zm3 4a.5.5 0 01.5.5v7a.5.5 0 01-1 0v-7a.5.5 0 01.5-.5zM10 7a.5.5 0 01.5.5v7a.5.5 0 01-1 0v-7A.5.5 0 0110 7zm3 .5a.5.5 0 00-1 0v7a.5.5 0 001 0v-7z" clip-rule="evenodd"></path></svg></button>
|
||||
<button class="btn btn-success ml-1 float-right" ng-click="saveQuestion()" ng-if="user.is_admin && question.edit"><svg class="bi bi-check" width="1em" height="1em" viewBox="0 0 20 20" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M15.854 5.646a.5.5 0 010 .708l-7 7a.5.5 0 01-.708 0l-3.5-3.5a.5.5 0 11.708-.708L8.5 12.293l6.646-6.647a.5.5 0 01.708 0z" clip-rule="evenodd"></path></svg></button>
|
||||
<button class="btn btn-primary ml-1 float-right" ng-click="editQuestion()" ng-if="user.is_admin && !question.edit"><svg class="bi bi-pencil" width="1em" height="1em" viewBox="0 0 20 20" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M13.293 3.293a1 1 0 011.414 0l2 2a1 1 0 010 1.414l-9 9a1 1 0 01-.39.242l-3 1a1 1 0 01-1.266-1.265l1-3a1 1 0 01.242-.391l9-9zM14 4l2 2-9 9-3 1 1-3 9-9z" clip-rule="evenodd"></path><path fill-rule="evenodd" d="M14.146 8.354l-2.5-2.5.708-.708 2.5 2.5-.708.708zM5 12v.5a.5.5 0 00.5.5H6v.5a.5.5 0 00.5.5H7v.5a.5.5 0 00.5.5H8v-1.5a.5.5 0 00-.5-.5H7v-.5a.5.5 0 00-.5-.5H5z" clip-rule="evenodd"></path></svg></button>
|
||||
|
||||
<h4 class="card-title" ng-if="!question.edit">{{qid + 1}}. {{ question.title }}</h4>
|
||||
<div class="card-title form-group row" ng-if="question.edit"><label for="q{{qid}}title" class="col-auto col-form-label font-weight-bold">Titre :</label><div class="col"><input id="q{{qid}}title" class="form-control" ng-model="question.title"></div></div>
|
||||
|
||||
<p class="card-text" style="white-space: pre-line" ng-bind-html="question.description" ng-if="!question.edit"></p>
|
||||
<textarea class="form-control mb-2" ng-if="question.edit" ng-model="question.description" placeholder="Description de la question"></textarea>
|
||||
|
||||
<div class="form-group row" ng-if="question.edit">
|
||||
<label class="col-2 col-form-label" for="q{{qid}}kind">Type de réponse</label>
|
||||
<div class="col">
|
||||
<select class="custom-select" id="q{{qid}}kind" ng-model="question.kind">
|
||||
<option value="text">Texte</option>
|
||||
<option value="mcq">QCM</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<textarea class="form-control" ng-if="!question.edit && question.kind == 'text'" rows="6" ng-model="question.value" placeholder="{{ question.placeholder }}"></textarea>
|
||||
<div class="form-group row" ng-if="question.edit && question.kind == 'text'">
|
||||
<label class="col-2 col-form-label" for="q{{qid}}placeholder">Placeholder</label>
|
||||
<div class="col">
|
||||
<input class="form-control" id="q{{qid}}placeholder" ng-model="question.placeholder">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="card-text text-center text-danger" ng-if="question.kind == 'mcq'">QCM non implémentés</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary" ng-disabled="submitInProgress">Soumettre les réponses</button>
|
||||
<button type="button" class="btn btn-info" ng-click="addQuestion()" ng-if="user.is_admin">Ajouter une question</button>
|
||||
</form>
|
||||
28
htdocs/views/surveys.html
Normal file
28
htdocs/views/surveys.html
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<table class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Intitulé</th>
|
||||
<th>État</th>
|
||||
<th>Date</th>
|
||||
<th>Score</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody style="cursor: pointer;">
|
||||
<tr ng-repeat="survey in surveys" ng-if="survey.shown" ng-click="show(survey.id)">
|
||||
<td>{{ survey.title }}</td>
|
||||
<td class="bg-info" ng-if="survey.start_availability > now">Prévu</td>
|
||||
<td class="bg-warning" ng-if="survey.start_availability <= now && survey.end_availability >= now">En cours</td>
|
||||
<td class="bg-success" ng-if="survey.end_availability < now">Terminé</td>
|
||||
<td ng-if="survey.start_availability > now">{{ survey.start_availability | date: "medium" }}</td>
|
||||
<td ng-if="survey.start_availability <= now">{{ survey.end_availability | date: "medium" }}</td>
|
||||
<td>N/A</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot ng-if="user.is_admin">
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<a href="surveys/new" class="btn btn-sm btn-primary">Ajouter un questionnaire</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
Reference in a new issue