1
0
forked from ScoDoc/ScoDoc

suite upgrade bootstrap

This commit is contained in:
Iziram 2024-07-31 13:40:30 +02:00
parent d77bf8f700
commit 7f08f84934
19 changed files with 45 additions and 63 deletions

View File

@ -47,9 +47,9 @@ from app.scodoc.sco_exceptions import ScoValueError
from app.scodoc.sco_logos import find_logo
JAVASCRIPTS = html_sco_header.BOOTSTRAP_MULTISELECT_JS + []
JAVASCRIPTS = html_sco_header.BOOTSTRAP_JS + []
CSSSTYLES = html_sco_header.BOOTSTRAP_MULTISELECT_CSS
CSSSTYLES = html_sco_header.BOOTSTRAP_CSS
# class ItemForm(FlaskForm):
# """Unused Generic class to document common behavior for classes

View File

@ -37,19 +37,8 @@ import sco_version
# Some constants:
# Multiselect menus are used on a few pages and not loaded by default
BOOTSTRAP_MULTISELECT_JS = [
"libjs/bootstrap/js/bootstrap.min.js",
"libjs/bootstrap-multiselect-1.1.2/bootstrap-multiselect.min.js",
"libjs/purl.js",
]
BOOTSTRAP_MULTISELECT_CSS = [
"libjs/bootstrap/css/bootstrap.min.css",
"libjs/bootstrap/css/bootstrap-theme.min.css",
"libjs/bootstrap-multiselect-1.1.2/bootstrap-multiselect.min.css",
]
BOOTSTRAP_JS = ["libjs/bootstrap/js/bootstrap.min.js", "libjs/purl.js"]
BOOTSTRAP_CSS = ["libjs/bootstrap/css/bootstrap.min.css"]
def standard_html_header():

View File

@ -28,6 +28,7 @@
"""Ajout/Modification/Suppression UE
"""
import re
import sqlalchemy as sa
@ -765,9 +766,9 @@ def ue_table(formation_id=None, semestre_idx=1, msg=""): # was ue_list
)
H = [
html_sco_header.sco_header(
cssstyles=html_sco_header.BOOTSTRAP_MULTISELECT_CSS
cssstyles=html_sco_header.BOOTSTRAP_CSS
+ ["libjs/jQuery-tagEditor/jquery.tag-editor.css", "css/ue_table.css"],
javascripts=html_sco_header.BOOTSTRAP_MULTISELECT_JS
javascripts=html_sco_header.BOOTSTRAP_JS
+ [
"libjs/jinplace-1.2.1.min.js",
"js/ue_list.js",
@ -1129,9 +1130,7 @@ def _ue_table_ues(
scodoc_dept=g.scodoc_dept,
ue_id=ue["ue_id"],
)
ue[
"code_apogee_str"
] = f""", Apo: <span
ue["code_apogee_str"] = f""", Apo: <span
class="{klass}" data-url="{edit_url}" id="{ue['ue_id']}"
data-placeholder="{scu.APO_MISSING_CODE_STR}">{
ue["code_apogee"] or ""

View File

@ -73,9 +73,7 @@ def _build_results_table(start_date=None, end_date=None, types_parcours=[]):
formsemestre_ids_parcours = [sem["formsemestre_id"] for sem in semlist_parcours]
# Ensemble des étudiants
etuds_infos = (
{}
) # etudid : { formsemestre_id d'inscription le plus recent dans les dates considérées, etud }
etuds_infos = {} # etudid : { formsemestre_id d'inscription le plus recent dans les dates considérées, etud }
for formsemestre_id in formsemestre_ids_parcours:
formsemestre = FormSemestre.get_formsemestre(formsemestre_id)
nt: NotesTableCompat = res_sem.load_formsemestre_results(formsemestre)
@ -287,9 +285,9 @@ def scodoc_table_results(
H = [
html_sco_header.sco_header(
page_title="Export résultats",
javascripts=html_sco_header.BOOTSTRAP_MULTISELECT_JS
javascripts=html_sco_header.BOOTSTRAP_JS
+ ["js/etud_info.js", "js/export_results.js"],
cssstyles=html_sco_header.BOOTSTRAP_MULTISELECT_CSS,
cssstyles=html_sco_header.BOOTSTRAP_CSS,
),
# XXX
"""
@ -326,9 +324,9 @@ _DATE_FORM = """
</div>
<div>
<b>Types de parcours :</b>
<select name="types_parcours" id="parcours_sel" class="multiselect" multiple="multiple">
<multi-select name="types_parcours" id="parcours_sel" label="Choisir le(s) parcours...">
{menu_options}
</select>
</multi-select>
<input type="submit" name="" value=" charger " width=100/>
</form>

View File

@ -33,7 +33,7 @@ div.small_form {
{% endif %}
<div class="row {{ 'small_form' if is_cas_enabled else ''}}">
<div class="col-md-4">
{{ wtf.quick_form(form) }}
{{ wtf.quick_form(form, button_map={'submit':'secondary'}) }}
</div>
</div>

View File

@ -6,7 +6,7 @@
<h1>Création utilisateur</h1>
<div class="row">
<div class="col-md-4">
{{ wtf.quick_form(form) }}
{{ wtf.quick_form(form, button_map={'submit':'secondary'}) }}
</div>
</div>
{% endblock %}

View File

@ -11,7 +11,7 @@
<div class="row" style="margin-top: 30px;">
<div class="col-md-4">
{{ wtf.quick_form(form) }}
{{ wtf.quick_form(form, button_map={'submit':'secondary'}) }}
</div>
</div>
{% endblock %}

View File

@ -6,7 +6,7 @@
<h1>Demande d'un nouveau mot de passe</h1>
<div class="row">
<div class="col-md-4">
{{ wtf.quick_form(form) }}
{{ wtf.quick_form(form, button_map={'submit':'secondary'}) }}
</div>
</div>
{% if is_cas_enabled %}

View File

@ -12,7 +12,7 @@
</div>
<div class="row">
<div class="col-md-4">
{{ wtf.quick_form(form) }}
{{ wtf.quick_form(form, button_map={'submit':'secondary'}) }}
</div>
</div>
{% endblock %}

View File

@ -50,7 +50,7 @@
{% if current_user.has_permission(current_user.Permission.RelationsEntrepEdit, None) %}
<td>
<div class="btn-group">
<a class="btn btn-default dropdown-toggle" data-toggle="dropdown" href="#">Action
<a class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" href="#">Action
<span class="caret"></span>
</a>
<ul class="dropdown-menu pull-left">

View File

@ -25,13 +25,13 @@
<div class="container boutons">
{% if current_user.has_permission(current_user.Permission.RelationsEntrepEdit, None) %}
<a class="btn btn-default" href="{{ url_for('entreprises.add_entreprise') }}">Ajouter une entreprise</a>
<a class="btn btn-secondary" href="{{ url_for('entreprises.add_entreprise') }}">Ajouter une entreprise</a>
{% endif %}
{% if current_user.has_permission(current_user.Permission.RelationsEntrepExport, None) %}
<a class="btn btn-default" href="{{ url_for('entreprises.import_donnees') }}">Importer des données</a>
<a class="btn btn-secondary" href="{{ url_for('entreprises.import_donnees') }}">Importer des données</a>
{% endif %}
{% if current_user.has_permission(current_user.Permission.RelationsEntrepExport, None) and entreprises %}
<a class="btn btn-default" href="{{ url_for('entreprises.export_donnees') }}">Exporter des données</a>
<a class="btn btn-secondary" href="{{ url_for('entreprises.export_donnees') }}">Exporter des données</a>
{% endif %}
</div>
@ -76,7 +76,7 @@
{% if current_user.has_permission(current_user.Permission.RelationsEntrepEdit, None) %}
<td>
<div class="btn-group">
<a class="btn btn-default dropdown-toggle" data-toggle="dropdown" href="#">Action
<a class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" href="#">Action
<span class="caret"></span>
</a>
<ul class="dropdown-menu pull-left">

View File

@ -48,7 +48,7 @@
<th>{{ entreprise.ville }}</th>
<th>{{ entreprise.pays }}</th>
<th>
<a class="btn btn-default"
<a class="btn btn-secondary"
href="{{ url_for('entreprises.fiche_entreprise_validation', entreprise_id=entreprise.id) }}">Voir</a>
</th>
</tr>

View File

@ -190,7 +190,7 @@
{% if current_user.has_permission(current_user.Permission.RelationsEntrepEdit, None) %}
<td>
<div class="btn-group">
<a class="btn btn-default dropdown-toggle" data-toggle="dropdown" href="#">Action
<a class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" href="#">Action
<span class="caret"></span>
</a>
<ul class="dropdown-menu pull-left">

View File

@ -31,9 +31,9 @@
{% endfor %}
{{ form.correspondants }}
<div style="margin-bottom: 10px;">
<button class="btn btn-default" id="add-correspondant-field">Ajouter un correspondant</button>
{{ form.submit(class_="btn btn-default") }}
{{ form.cancel(class_="btn btn-default") }}
<button class="btn btn-secondary" id="add-correspondant-field">Ajouter un correspondant</button>
{{ form.submit(class_="btn btn-secondary") }}
{{ form.cancel(class_="btn btn-secondary") }}
</div>
</form>
</div>
@ -45,7 +45,7 @@
for (let i = 0; i < allCorrepondantsForm.length; i++) {
let form_id = allCorrepondantsForm[i].getElementsByTagName('table')[0].id
if (form_id.split('-')[1] != 0)
allCorrepondantsForm[i].insertAdjacentHTML('beforeend', `<div class="btn btn-default btn-remove" onclick="deleteForm('${form_id}')">Retirer ce correspondant</div>`)
allCorrepondantsForm[i].insertAdjacentHTML('beforeend', `<div class="btn btn-secondary btn-remove" onclick="deleteForm('${form_id}')">Retirer ce correspondant</div>`)
}
window.onload = function (e) {
@ -75,7 +75,7 @@
<tr><th><label for="${newFieldName}-notes">Notes</label></th><td><input class="form-control" id="${newFieldName}-notes" name="${newFieldName}-notes" type="text" value=""></td></tr>
</table>
<input id="${newFieldName}-csrf_token" name="${newFieldName}-csrf_token" type="hidden" value=${csrf_token}>
<div class="btn btn-default btn-remove" onclick="deleteForm('${newFieldName}')">Retirer ce correspondant</div>
<div class="btn btn-secondary btn-remove" onclick="deleteForm('${newFieldName}')">Retirer ce correspondant</div>
</li>
`);
});

View File

@ -24,9 +24,9 @@
{% endfor %}
{{ form.responsables }}
<div style="margin-bottom: 10px;">
<button class="btn btn-default" id="add-responsable-field">Ajouter un responsable</button>
{{ form.submit(class_="btn btn-default") }}
{{ form.cancel(class_="btn btn-default") }}
<button class="btn btn-secondary" id="add-responsable-field">Ajouter un responsable</button>
{{ form.submit(class_="btn btn-secondary") }}
{{ form.cancel(class_="btn btn-secondary") }}
</div>
</form>
</div>
@ -38,7 +38,7 @@
for (let i = 0; i < allResponsablesField.length; i++) {
let form_id = allResponsablesField[i].getElementsByTagName('input')[0].id
if (form_id.split('-')[1] != 0)
allResponsablesField[i].insertAdjacentHTML('beforeend', `<div class="btn btn-default btn-remove" onclick="deleteForm('${form_id}')">Retirer</div>`)
allResponsablesField[i].insertAdjacentHTML('beforeend', `<div class="btn btn-secondary btn-remove" onclick="deleteForm('${form_id}')">Retirer</div>`)
}
window.onload = function (e) {
@ -71,7 +71,7 @@
<li>
<label for="${newFieldName}">Responsable (*)</label>
<input class="form-control" id="${newFieldName}" name="${newFieldName}" type="text" value="" placeholder="Tapez le nom du responsable de formation">
<div class="btn btn-default btn-remove" onclick="deleteForm('${newFieldName}')">Retirer</div>
<div class="btn btn-secondary btn-remove" onclick="deleteForm('${newFieldName}')">Retirer</div>
</li>
`);
var as_r = new bsn.AutoSuggest(newFieldName, responsables_options);

View File

@ -25,7 +25,7 @@
<div class="text-center">
<a href="{{ url_for('entreprises.logs', page=logs.prev_num) }}"
class="btn btn-default {% if logs.page == 1 %}disabled{% endif %}">
class="btn btn-secondary {% if logs.page == 1 %}disabled{% endif %}">
&laquo;
</a>
{% for page_num in logs.iter_pages(left_edge=1, right_edge=1, left_current=1, right_current=2) %}
@ -33,14 +33,14 @@
{% if logs.page == page_num %}
<a href="{{ url_for('entreprises.logs', page=page_num) }}" class="btn btn-inverse">{{ page_num }}</a>
{% else %}
<a href="{{ url_for('entreprises.logs', page=page_num) }}" class="btn btn-default">{{ page_num }}</a>
<a href="{{ url_for('entreprises.logs', page=page_num) }}" class="btn btn-secondary">{{ page_num }}</a>
{% endif %}
{% else %}
...
{% endif %}
{% endfor %}
<a href="{{ url_for('entreprises.logs', page=logs.next_num) }}"
class="btn btn-default {% if logs.page == logs.pages %}disabled{% endif %}">
class="btn btn-secondary {% if logs.page == logs.pages %}disabled{% endif %}">
&raquo;
</a>
</div>

View File

@ -29,7 +29,7 @@
<div class="text-center">
<a href="{{ url_for('entreprises.logs_entreprise', entreprise_id=entreprise.id, page=logs.prev_num) }}"
class="btn btn-default {% if logs.page == 1 %}disabled{% endif %}">
class="btn btn-secondary {% if logs.page == 1 %}disabled{% endif %}">
&laquo;
</a>
{% for page_num in logs.iter_pages(left_edge=1, right_edge=1, left_current=1, right_current=2) %}
@ -39,14 +39,14 @@
class="btn btn-inverse">{{ page_num }}</a>
{% else %}
<a href="{{ url_for('entreprises.logs_entreprise', entreprise_id=entreprise.id, page=page_num) }}"
class="btn btn-default">{{ page_num }}</a>
class="btn btn-secondary">{{ page_num }}</a>
{% endif %}
{% else %}
...
{% endif %}
{% endfor %}
<a href="{{ url_for('entreprises.logs_entreprise', entreprise_id=entreprise.id, page=logs.next_num) }}"
class="btn btn-default {% if logs.page == logs.pages %}disabled{% endif %}">
class="btn btn-secondary {% if logs.page == logs.pages %}disabled{% endif %}">
&raquo;
</a>
</div>

View File

@ -4,7 +4,6 @@
{% block styles %}
{{super()}}
<link rel="stylesheet" href="{{scu.STATIC_DIR}}/libjs/tui.calendar/toastui-calendar.min.css"/>
<link rel="stylesheet" href="{{scu.STATIC_DIR}}/libjs/bootstrap-multiselect-1.1.2/bootstrap-multiselect.min.css"/>
<link rel="stylesheet" href="{{scu.STATIC_DIR}}/css/edt.css">
{% endblock %}
@ -42,12 +41,12 @@
<div>
<span id="menu-navi">
<button type="button" class="btn btn-default btn-sm move-today"
<button type="button" class="btn btn-secondary btn-sm move-today"
data-action="move-today">Aujourd'hui</button>
<button type="button" class="btn btn-default btn-sm move-day" data-action="move-prev">
<button type="button" class="btn btn-secondary btn-sm move-day" data-action="move-prev">
<i class="calendar-icon ic-arrow-line-left" data-action="move-prev">&lt;</i>
</button>
<button type="button" class="btn btn-default btn-sm move-day" data-action="move-next">
<button type="button" class="btn btn-secondary btn-sm move-day" data-action="move-next">
<i class="calendar-icon ic-arrow-line-right" data-action="move-next">&gt;</i>
</button>
</span>
@ -77,7 +76,6 @@
{% block scripts %}
{{ super() }}
<script src="{{scu.STATIC_DIR}}/libjs/bootstrap-multiselect-1.1.2/bootstrap-multiselect.min.js"></script>
<script src="{{scu.STATIC_DIR}}/libjs/purl.js"></script>
<script src="{{scu.STATIC_DIR}}/libjs/tui.calendar/toastui-calendar.min.js"></script>
<script src="{{scu.STATIC_DIR}}/js/groups_view.js"></script>

View File

@ -4,8 +4,7 @@
{% block styles %}
{{super()}}
<link rel="stylesheet" href="{{scu.STATIC_DIR}}/libjs/bootstrap/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="{{scu.STATIC_DIR}}/libjs/bootstrap-multiselect-1.1.2/bootstrap-multiselect.min.css">
<link rel="stylesheet" href="{{scu.STATIC_DIR}}/libjs/bootstrap/css/bootstrap.min.css">
<style>
div{
@ -50,6 +49,5 @@
{{super()}}
{% include "sco_timepicker.j2" %}
<script src="{{scu.STATIC_DIR}}/js/groups_view.js"></script>
<script src="{{scu.STATIC_DIR}}/libjs/bootstrap-multiselect-1.1.2/bootstrap-multiselect.min.js"></script>
<script src="{{scu.STATIC_DIR}}/libjs/purl.js"></script>
{% endblock scripts %}