2015-11-29 22:25:01 +01:00
|
|
|
<div class="header">
|
|
|
|
<div class="title">
|
|
|
|
<div class="submenu">
|
|
|
|
<a ui-sref="users.user.list" class="btn btn-sm btn-default">
|
|
|
|
<i class="fa fa-angle-double-left fa-lg"></i>
|
|
|
|
<translate>Back to overview</translate>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<h1 translate>Import participants</h1>
|
|
|
|
</div>
|
2015-06-24 15:04:40 +02:00
|
|
|
</div>
|
|
|
|
|
2015-11-29 22:25:01 +01:00
|
|
|
<div class="details">
|
2015-12-11 21:36:09 +01:00
|
|
|
<h2 translate>Import by copy/paste</h2>
|
2015-11-29 22:25:01 +01:00
|
|
|
<p translate>Copy and paste your participant names in this textbox.
|
|
|
|
Keep each person in a single line.</p>
|
2015-06-24 15:04:40 +02:00
|
|
|
|
2015-11-29 22:25:01 +01:00
|
|
|
<div class="row">
|
|
|
|
<div class="form-group col-sm-6">
|
|
|
|
<textarea ng-model="userlist" rows="5" class="form-control" ng-list="/\n/"></textarea>
|
|
|
|
</div>
|
2015-06-24 15:04:40 +02:00
|
|
|
</div>
|
|
|
|
|
2015-11-29 22:25:01 +01:00
|
|
|
<div class="clearfix">
|
|
|
|
<button ng-click="importByLine()" class="btn btn-primary pull-left" translate>Import</button>
|
2015-12-11 21:36:09 +01:00
|
|
|
<div class="col-xs-5" ng-if="usernames">
|
|
|
|
<progressbar animate="false" type="success" max="usernames.length" value="importcounter">
|
|
|
|
<i>{{ importcounter }} / {{ usernames.length }} {{ "imported" | translate }}</i>
|
2015-11-29 22:25:01 +01:00
|
|
|
</progressbar>
|
|
|
|
</div>
|
2015-06-24 15:04:40 +02:00
|
|
|
</div>
|
2015-12-11 21:36:09 +01:00
|
|
|
<div class="spacer">
|
|
|
|
<a ng-if="importcounter > 0 && importcounter == usernames.length" ui-sref="users.user.list"
|
|
|
|
class="btn btn-default">
|
|
|
|
<i class="fa fa-angle-double-left fa-lg"></i>
|
|
|
|
<translate>Back to users overview</translate>
|
|
|
|
</a>
|
|
|
|
</div>
|
2015-06-24 15:04:40 +02:00
|
|
|
|
2015-11-29 22:25:01 +01:00
|
|
|
<hr>
|
2015-06-24 15:04:40 +02:00
|
|
|
|
2015-12-11 21:36:09 +01:00
|
|
|
<h2 translate>Import by CSV file</h2>
|
2015-06-24 15:04:40 +02:00
|
|
|
|
2015-12-11 21:36:09 +01:00
|
|
|
<div class="block row">
|
|
|
|
<div class="title">
|
|
|
|
<h3 translate>Select a CSV file
|
|
|
|
</div>
|
|
|
|
<div class="block right import">
|
|
|
|
<label class="label" for="inputSeparator" translate>Separator</label>
|
|
|
|
<input type="text" ng-model="separator" ng-change="setSeparator()" ng-init="separator=separator" id="inputSeparator">
|
|
|
|
<br>
|
|
|
|
<label class="label" for="selectEncoding" translate>Encoding</label>
|
|
|
|
<select ng-model="encoding" ng-options="enc as enc for enc in encodingOptions"
|
|
|
|
ng-selected="setEncoding()" ng-init="encoding=encoding" id="selectEncoding"></select>
|
|
|
|
<ng-csv-import
|
|
|
|
content="csv.content"
|
|
|
|
header="csv.header"
|
|
|
|
header-visible="csv.headerVisible"
|
|
|
|
separator="csv.separator"
|
|
|
|
separator-visible="csv.separatorVisible"
|
|
|
|
result="csv.result"
|
|
|
|
encoding="csv.encoding"
|
|
|
|
encoding-visible="csv.encodingVisible"></ng-csv-import>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<h4 translate>Please note:</h4>
|
2015-11-29 22:25:01 +01:00
|
|
|
<ul>
|
2015-12-11 21:36:09 +01:00
|
|
|
<li><translate>Required comma or semicolon separated values with these column header names in the first row</translate>:<br>
|
2016-01-29 14:52:25 +01:00
|
|
|
<code>title, first_name, last_name, structure level, groups, comment, is active</code>
|
2015-11-29 22:25:01 +01:00
|
|
|
<li><translate>Default groups</translate>:
|
2016-01-29 14:52:25 +01:00
|
|
|
<translate>Delegates</translate> <code>3</code>,
|
2015-11-29 22:25:01 +01:00
|
|
|
<translate>Staff</translate> <code>4</code>
|
2015-11-30 14:55:41 +01:00
|
|
|
<li translate>At least first name or last name have to be filled in. All
|
2015-11-29 22:25:01 +01:00
|
|
|
other fields are optional and may be empty.
|
2015-12-11 21:36:09 +01:00
|
|
|
<li translate>Only double quotes are accepted as text delimiter (no single quotes).
|
2015-12-30 21:56:03 +01:00
|
|
|
<li><a id="downloadLink" href="" ng-click="downloadCSVExample()" translate>Download CSV example file</a>
|
2015-11-29 22:25:01 +01:00
|
|
|
</ul>
|
2015-06-24 15:04:40 +02:00
|
|
|
|
2015-12-11 21:36:09 +01:00
|
|
|
<div ng-if="csv.result">
|
2015-11-29 22:25:01 +01:00
|
|
|
<h3 translate>Preview</h3>
|
|
|
|
<table class="table table-striped table-bordered table-condensed">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2015-12-11 21:36:09 +01:00
|
|
|
<th>
|
2015-11-29 22:25:01 +01:00
|
|
|
<th>#
|
|
|
|
<th translate>Title
|
|
|
|
<th translate>First name
|
|
|
|
<th translate>Last name
|
|
|
|
<th translate>Structure level
|
|
|
|
<th translate>Groups
|
2015-12-11 21:36:09 +01:00
|
|
|
<th translate>Comment
|
|
|
|
<th translate>Is active</th>
|
|
|
|
<tbody ng-repeat="user in users">
|
2015-11-29 22:25:01 +01:00
|
|
|
<tr>
|
2015-12-11 21:36:09 +01:00
|
|
|
<td class="minimum"
|
|
|
|
ng-class="{ 'text-danger': user.importerror, 'text-success': user.imported }">
|
|
|
|
<span ng-if="user.importerror">
|
|
|
|
<i class="fa fa-exclamation-triangle fa-lg"></i>
|
|
|
|
</span>
|
|
|
|
<span ng-if="!user.importerror && !user.imported">
|
|
|
|
<i class="fa fa-check-circle-o fa-lg"></i>
|
|
|
|
</span>
|
|
|
|
<span ng-if="user.imported">
|
|
|
|
<i class="fa fa-check-circle fa-lg"></i>
|
|
|
|
</span>
|
|
|
|
<td>
|
|
|
|
{{ $index + 1 }}
|
|
|
|
<td>
|
|
|
|
{{ user.title }}
|
|
|
|
<td ng-class="{ 'text-danger': user.name_error }">
|
|
|
|
<span ng-if="!user.first_name && user.name_error" title="{{ user.name_error | translate }}">
|
|
|
|
<i class="fa fa-exclamation-triangle"></i>
|
|
|
|
</span>
|
|
|
|
{{ user.first_name }}
|
|
|
|
<td ng-class="{ 'text-danger': user.name_error }">
|
|
|
|
<span ng-if="!user.last_name && user.name_error" title="{{ user.name_error | translate }}">
|
|
|
|
<i class="fa fa-exclamation-triangle"></i>
|
|
|
|
</span>
|
|
|
|
{{ user.last_name }}
|
|
|
|
<td>
|
|
|
|
{{ user.structure_level }}
|
|
|
|
<td>
|
|
|
|
<div ng-repeat="groupname in user.groupnames">
|
|
|
|
<translate>{{ groupname }}</translate>
|
|
|
|
</div>
|
|
|
|
<td>
|
|
|
|
{{ user.comment }}
|
|
|
|
<td>
|
|
|
|
<i ng-if="user.is_active" class="fa fa-check-square-o"></i>
|
2015-11-29 22:25:01 +01:00
|
|
|
</table>
|
2015-06-24 15:04:40 +02:00
|
|
|
|
2015-12-11 21:36:09 +01:00
|
|
|
<div class="text-danger">
|
|
|
|
<div ng-repeat="user in usersFailed = (users | filter:{importerror:true})"></div>
|
|
|
|
<i class="fa fa-exclamation-triangle"></i>
|
|
|
|
{{ usersFailed.length }}
|
|
|
|
<translate>participants will be not imported.</translate>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<div ng-repeat="user in usersPassed = (users | filter:{importerror:false})"></div>
|
|
|
|
<i class="fa fa-check-circle-o fa-lg"></i>
|
|
|
|
{{ users.length - usersFailed.length }}
|
|
|
|
<translate>participants will be imported.</translate>
|
|
|
|
</div>
|
|
|
|
<div ng-repeat="user in usersImported = (users | filter:{imported:true})"></div>
|
|
|
|
<div ng-if="usersImported.length > 0" class="text-success">
|
|
|
|
<hr class="smallhr">
|
|
|
|
<i class="fa fa-check-circle fa-lg"></i>
|
|
|
|
{{ usersImported.length }}
|
|
|
|
<translate>participants were successfully imported.</translate>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="spacer">
|
|
|
|
<button ng-click="clear()" class="btn btn-default" translate>
|
|
|
|
Clear preview
|
|
|
|
</button>
|
|
|
|
<button ng-if="!csvImporting" ng-click="import()" class="btn btn-primary" translate>
|
|
|
|
Import {{ users.length - usersFailed.length }} participants
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
<div class="spacer">
|
|
|
|
<a ng-if="csvimported" ui-sref="users.user.list" class="btn btn-default">
|
|
|
|
<i class="fa fa-angle-double-left fa-lg"></i>
|
|
|
|
<translate>Back to users overview</translate>
|
|
|
|
</a>
|
2015-06-24 15:04:40 +02:00
|
|
|
</div>
|
2015-11-29 22:25:01 +01:00
|
|
|
</div>
|
2015-06-24 15:04:40 +02:00
|
|
|
</div>
|