1
0
forked from ScoDoc/ScoDoc

Cosmetic: dernières opérations, sidebar, ...

This commit is contained in:
Emmanuel Viennet 2024-08-23 08:39:53 +02:00
parent bdc6c90bfc
commit 478bf80c6b
10 changed files with 66 additions and 29 deletions

View File

@ -271,10 +271,10 @@ class ScolarNews(db.Model):
return ""
dept_news_url = url_for("scolar.dept_news", scodoc_dept=g.scodoc_dept)
H = [
f"""<div class="scobox news"><div class="scobox-title" desktop="true"><a href="{
f"""<div class="scobox news" desktop="true"><div class="scobox-title" desktop="true"><a href="{
dept_news_url
}">Dernières opérations</a>
</div><ul class="newslist" desktop="true">"""
</div><ul class="newslist">"""
]
for news in news_list:
@ -286,15 +286,12 @@ class ScolarNews(db.Model):
f"""<li class="newslist">
<span class="newstext"><a href="{dept_news_url}" class="stdlink">...</a>
</span>
</li>"""
)
H.append(
"""</ul>
<ul class="newslist" mobile="true" style="margin-bottom: 0px;">
<li><a href="{dept_news_url}" class="stdlink">Dernières opérations</a></li>
</ul>
</div>
</li>
</ul>
<ul class="newslist" mobile="true" style="margin-bottom: 0px;">
<li><a href="{dept_news_url}" class="stdlink">Dernières opérations</a></li>
</ul>
</div>
"""
)

View File

@ -657,7 +657,7 @@ def formation_list_table(detail: bool) -> GenTable:
"version": "Version",
"formation_code": "Code",
"sems_list_txt": "Semestres",
"referentiel": "Réf.",
"referentiel": "Réf. Comp.",
"date_fin_dernier_sem": "Fin dernier sem.",
"annee_dernier_sem": "Année dernier sem.",
"semestres_ues": "Semestres avec UEs",

View File

@ -54,7 +54,7 @@ def index_html(
all_depts = int(all_depts)
with_inactives = int(with_inactives)
H = ["<h2>Gestion des utilisateurs</h2>"]
H = ["<h1>Gestion des utilisateurs</h1>"]
if current_user.has_permission(Permission.UsersAdmin, g.scodoc_dept):
H.append(
@ -127,7 +127,7 @@ def index_html(
H.append(content)
return render_template(
"sco_page.j2", content="\n".join(H), title="Gestion des utilisateurs"
"sco_page_dept.j2", content="\n".join(H), title="Gestion des utilisateurs"
)

View File

@ -13,6 +13,7 @@
display: flex;
flex-direction: column;
justify-content: space-between;
padding-left: 4px;
}
.formsemestre-page-header {
@ -78,15 +79,25 @@
margin-right: 8px;
}
.app-corner .scodoc-index,
.app-corner .scodoc-index a {
.scodoc-index,
.scodoc-index a {
font-size: 14pt;
display: flex;
color: rgb(4, 16, 159);
justify-content: center;
width: 100%;
}
div.scodoc-index[mobile="true"] a {
justify-content: center;
}
.scodoc-index a:any-link {
text-decoration: none;
}
.scodoc-index.collapsed {
display: none;
}
.hamburger-menu {
display: none;
@ -210,20 +221,24 @@ print {
text-decoration: none;
}
#sidebar h2 {
#sidebar .sidebar-link-dept {
color: rgb(102, 102, 102);
font-weight: bold;
font-size: large;
margin-bottom: 0;
margin-top: 12px;
}
#sidebar .sidebar-link-dept a:any-link {
text-decoration: none;
}
#sidebar div.sidebar-item {
margin-left: 4px;
}
#sidebar div.sidebar-item a:link,
#sidebar div.sidebar-item a:link,
#sidebar div.sidebar-item a:visited {
#sidebar div.sidebar-item a:any-link {
color: rgb(4, 16, 159);
text-decoration: none;
}

View File

@ -1,4 +1,4 @@
{% extends "sco_page.j2" %}
{% extends "sco_page_dept.j2" %}
{% block styles %}
{{super()}}
<link rel="stylesheet" href="{{scu.STATIC_DIR}}/css/assiduites.css">

View File

@ -1,5 +1,5 @@
{# -*- mode: jinja-html -*- #}
{% extends "sco_page.j2" %}
{% extends "sco_page_dept.j2" %}
{% block styles %}
{{super()}}
{% endblock %}

View File

@ -100,6 +100,9 @@
document.getElementById('sidebar').classList.toggle('collapsed');
document.getElementById('app-content').classList.toggle('collapsed');
document.getElementById('toggle-sidebar-img').classList.toggle('collapsed');
document.querySelectorAll('.scodoc-index').forEach(element => {
element.classList.toggle('collapsed');
});
}
</script>

View File

@ -8,5 +8,21 @@
.formsemestre-page-header {
display: none;
}
div.scodoc-container > div#app-content {
grid-row-start: 1;
grid-row-end: span 2;
}
@media (min-width: 769px) {
/* On desktop, we need to adjust the margin to make room for the button << */
div.scodoc-container > div#app-content.collapsed {
margin-left: 16px;
}
div.scodoc-container > div#app-content {
margin-top: 8px;
}
}
</style>
{% endblock %}

View File

@ -2,9 +2,9 @@
{# -*- mode: jinja-html -*- #}
<!-- sidebar -->
{# sidebar_common #}
<h1 mobile="true">
<div class="scodoc-index" mobile="true">
<a href="{{url_for('scodoc.index', scodoc_dept=g.scodoc_dept)}}">ScoDoc</a>
</h1>
</div>
<div id="authuser"><a id="authuserlink" href="{{
url_for('users.user_info_page', scodoc_dept=g.scodoc_dept, user_name=current_user.user_name)
@ -13,8 +13,10 @@
</div>
{% block sidebar_dept %}
<h2><a href="{{ url_for('scolar.index_html', scodoc_dept=g.scodoc_dept) }}"
>Dépt. {{ sco.prefs["DeptName"] }}</a></h2>
<div class="sidebar-link-dept">
<a href="{{ url_for('scolar.index_html', scodoc_dept=g.scodoc_dept) }}"
>Dépt. {{ sco.prefs["DeptName"] }}</a>
</div>
{% if sco.prefs["DeptIntranetURL"] %}
<div class="sidebar-item">
@ -48,6 +50,10 @@
<a href="{{url_for('scolar.edit_preferences', scodoc_dept=g.scodoc_dept)}}">Paramétrage</a>
</div>
{% endif %}
<div class="sidebar-item" mobile="true">
<a href="{{url_for('scolar.dept_news', scodoc_dept=g.scodoc_dept)}}">Dernières Opérations</a>
</div>
{# /sidebar_common #}
<div class="box-chercheetud">Chercher étudiant:
@ -138,7 +144,7 @@
const sidebarExpanded = sidebar ? sidebar.getAttribute('aria-expanded') === 'true' : false;
const formSemestreMenuExpanded = formSemestreMenu ? formSemestreMenu.classList.contains("active") : false;
let isScrollToggled = document.body.classList.contains("no-scroll");
if (isScrollToggled && !sidebarExpanded && !formSemestreMenuExpanded) {

View File

@ -676,7 +676,7 @@ def index_html():
return table.make_page(fmt=fmt, filename=f"Formations-{g.scodoc_dept}")
H = [
f"""<h2>Formations (programmes pédagogiques)</h2>
f"""<h1>Formations (programmes pédagogiques)</h1>
<form>
<input type="checkbox" id="detailCheckbox" name="detail"
onchange="this.form.submit();"