add actions and templates folder

This commit is contained in:
Florian Schmitt 2023-12-21 19:34:13 +03:00
parent 8c772864b3
commit 934de3ad61
10 changed files with 792 additions and 0 deletions

View file

@ -0,0 +1,3 @@
{% extends "@bazar/layouts/field.twig" %}
{% block value %}{{ value|raw }}{% endblock %}

View file

@ -0,0 +1,9 @@
{% extends "@bazar/layouts/field.twig" %}
{% block label %}{{ _t('BAZ_GIVEN_ID') }}{% endblock %}
{% block value %}
{{ value }}
{% if isLoggedUser %}
{% endif %}
{% endblock %}

View file

@ -0,0 +1,15 @@
{% extends "@bazar/layouts/input.twig" %}
{% block input %}
<div class="input-group">
<input
type="text"
value="{{ value }}"
id="{{ field.name }}"
name="{{ field.name }}"
class="form-control yeswiki-input-pagetag"
size="{{ field.maxChars }}"
{% if field.required %}required{% endif %}
/>
</div>
{% endblock %}

View file

@ -0,0 +1,62 @@
<?php if ($connected) : ?>
<a href="#LoginModal" role="button" class="<?php if (empty($nobtn)) { echo 'btn btn-default '.$btnclass.' '; } ?>" data-toggle="modal">
<i class="glyphicon glyphicon-user"></i> <?php echo $user; ?>
</a>
<div class="modal fade" id="LoginModal" tabindex="-1" role="dialog" aria-labelledby="LoginModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3 id="LoginModalLabel"><?php echo _t('LOGIN_CONNECTED_AS').' '.$user; ?></h3>
</div>
<div class="modal-body">
<ul class="login-actions">
<?php echo $PageMenuUser; ?>
<li><a href="<?php echo $profileurl; ?>" title="<?php echo _t('LOGIN_MODIFY_USER'); ?>"><?php echo _t('LOGIN_MODIFY_USER'); ?></a></li>
</ul>
</div>
<div class="modal-footer">
<a href="<?php echo $incomingurl; ?>&amp;action=logout" class="btn btn-default" title="<?php echo _t('LOGIN_LOGOUT'); ?>"><?php echo _t('LOGIN_LOGOUT'); ?></a>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div> <!-- /#LoginModal-->
<?php else : ?>
<a href="#LoginModal" role="button" class="<?php if (empty($nobtn)) { echo 'btn btn-default '.$btnclass.' '; } ?>" data-toggle="modal">
<i class="glyphicon glyphicon-user"></i> <?php echo _t('LOGIN_LOGIN'); ?>
</a>
<div class="modal fade" id="LoginModal" tabindex="-1" role="dialog" aria-labelledby="LoginModalLabel" aria-hidden="true">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3 id="LoginModalLabel"><?php echo _t('LOGIN_LOGIN'); ?></h3>
</div>
<div class="modal-body">
<form action="<?php echo $incomingurl; ?>" method="post">
<div class="form-group">
<input type="text" name="name" class="form-control" value="<?php echo ($user ? htmlspecialchars($user, ENT_COMPAT, YW_CHARSET) : ''); ?>" required placeholder="<?php echo _t('LDAP_USERNAME'); ?>">
</div>
<div class="form-group">
<input type="password" class="form-control" name="password" required placeholder="<?php echo _t('LOGIN_PASSWORD'); ?>">
</div>
<?php if (!empty($lostpasswordurl)) { ?>
<small><a href="<?php echo $lostpasswordurl ?>"><?php echo _t('LOGIN_LOST_PASSWORD'); ?></a></small>
<?php } ?>
<div class="checkbox">
<label for="remember-modal">
<input type="checkbox" id="remember-modal" name="remember" value="1" /> <?php echo _t('LOGIN_REMEMBER_ME'); ?>
</label>
</div>
<input type="submit" name="login" class="btn btn-block <?php echo $btnclass; ?> btn-primary" value="<?php echo _t('LOGIN_LOGIN'); ?>">
<input type="hidden" name="action" value="ldaplogin" />
<input type="hidden" name="incomingurl" value="<?php echo $userpage; ?>" />
<input type="hidden" name="remember" value="0" />
</form>
<hr>
<a class="btn btn-block <?php echo $btnclass; ?>" href="<?php echo 'https://reseau.s-mart.fr/?InscriptionSmart' ?>"><?php echo _t('LOGIN_SIGNUP'); ?></a>
</div>
</div>
</div><!-- /.modal-dialog -->
</div> <!-- /#LoginModal-->
<?php endif; ?>

View file

@ -0,0 +1,81 @@
{{ include_javascript('javascripts/vendor/datatables-full/jquery.dataTables.min.js') }}
{{ include_css('styles/vendor/datatables-full/dataTables.bootstrap.min.css') }}
<h2>{{ _t('Tableau de bord') }}</h2>
<form id="date-filters" method="get" class="no-dblclick form-inline">
<div class="form-group">
<label for="datedeb" class="control-label">Date de début</label>
<input class="form-control" id="datedeb" name="datedeb" type="date" value="{{ selecteddatedeb }}" min="{{ period.deb }}" max="{{ period.end }}" />
</div>
<div class="form-group">
<label for="datefin" class="control-label">Date de fin</label>
<input class="form-control" id="datefin" name="datefin" type="date" value="{{ selecteddatefin }}" min="{{ period.deb }}" max="{{ period.end }}" />
</div>
<button class="btn btn-primary" type="submit" style="top: 15px;">Actualiser</button>
<input type="hidden" name="wiki" value="{{ wiki }}">
</form>
<div class="table-responsive">
{% for k, com in communities %}
<hr />
<h3>Indicateurs pour la communauté {{ com.title}}</h3>
<table id="stats-table-{{k}}" class="bazar-table table table-condensed table-striped">
<thead>
<tr>
<th>Indicateur</th>
<th>sur la période du {{ selecteddatedeb }} au {{ selecteddatefin }}</th>
<th>depuis la création du site</th>
</tr>
</thead>
<tbody>
{% for key, indic in com.indicators %}
<tr>
<td>{{ indic.title }}</td>
<td>{{ indic.periodvalue }}</td>
<td>{{ indic.totalvalue }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<hr />
{% endfor %}
</div> <!-- /.table-responsive -->
{% if total|length != 0 %}
<hr /><hr /><hr />
<div class="table-responsive">
<h3>Indicateurs pour toutes les communautés</h3>
<table id="stats-table-{{k}}" class="bazar-table table table-condensed table-striped">
<thead>
<tr>
<th>Indicateur</th>
<th>sur la période du {{ selecteddatedeb }} au {{ selecteddatefin }}</th>
<th>Ecart type mensuel sur la période</th>
<th>Moyenne mensuelle sur la période</th>
<th>depuis la création du site</th>
<th>Ecart type mensuel</th>
<th>Moyenne mensuelle</th>
</tr>
</thead>
<tbody>
{% for key, indic in total %}
<tr>
<td>{{ indic.title }}</td>
<td>{{ indic.periodvalue }}</td>
<td>{{ indic.ecarttype }}</td>
<td>{{ indic.moyenne }}</td>
<td>{{ indic.totalvalue }}</td>
<td>{{ indic.totalecarttype }}</td>
<td>{{ indic.totalmoyenne }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div> <!-- /.table-responsive -->
{% endif %}
<style>
#date-filters .control-label {
margin-right: 10px;
max-width: 100% !important;
left: 10px !important;
}
</style>