1
0
forked from ScoDoc/ScoDoc

Ajout champ commentaire dans les formations (=> migration)

This commit is contained in:
Emmanuel Viennet 2023-01-30 14:08:40 -03:00
parent b19cf6f98e
commit 026946d3b9
6 changed files with 67 additions and 16 deletions

View File

@ -36,6 +36,7 @@ class Formation(db.Model):
titre = db.Column(db.Text(), nullable=False)
titre_officiel = db.Column(db.Text(), nullable=False)
version = db.Column(db.Integer, default=1, server_default="1")
commentaire = db.Column(db.Text())
formation_code = db.Column(
db.String(SHORT_STR_LEN),
server_default=db.text("notes_newid_fcod()"),

View File

@ -234,6 +234,16 @@ def formation_edit(formation_id=None, create=False):
"explanation": "optionel: code utilisé pour échanger avec d'autres logiciels et identifiant la filière ou spécialité (exemple: ASUR). N'est utilisé que s'il n'y a pas de numéro de semestre.",
},
),
(
"commentaire",
{
"input_type": "textarea",
"rows": 3,
"cols": 77,
"title": "Commentaire",
"explanation": "commentaire libre.",
},
),
),
initvalues=initvalues,
submitlabel=submitlabel,

View File

@ -75,6 +75,7 @@ _formationEditor = ndb.EditableTable(
"type_parcours",
"code_specialite",
"referentiel_competence_id",
"commentaire",
),
filter_dept=True,
sortkey="acronyme",

View File

@ -4,6 +4,7 @@
:root {
--sco-content-min-width: 600px;
--sco-content-max-width: 1024px;
--sco-color-explication: rgb(10, 58, 140);
}
html,
@ -2115,6 +2116,11 @@ div.formation_descr span.fd_n {
margin-left: 6em;
}
span.explication {
font-style: italic;
color: var(--sco-color-explication);
}
div.formation_ue_list {
border: 1px solid black;
margin-top: 5px;

View File

@ -4,21 +4,24 @@
<div class="formation_descr">
<div class="fd_d"><span class="fd_t">Titre:
</span><span class="fd_v">{{formation.titre}}</span>
</div>
<div class="fd_d"><span class="fd_t">Titre officiel:</span>
</div>
<div class="fd_d"><span class="fd_t">Titre officiel:</span>
<span class="fd_v">{{formation.titre_officiel}}</span>
</div>
<div class="fd_d"><span class="fd_t">Acronyme:</span>
</div>
<div class="fd_d"><span class="fd_t">Acronyme:</span>
<span class="fd_v">{{formation.acronyme}}</span>
</div>
<div class="fd_d"><span class="fd_t">Code:</span>
</div>
<div class="fd_d"><span class="fd_t">Code:</span>
<span class="fd_v">{{formation.formation_code}}</span>
</div>
<div class="fd_d"><span class="fd_t">Version:</span>
</div>
<div class="fd_d"><span class="fd_t">Version:</span>
<span class="fd_v">{{formation.version}}</span>
</div>
<div class="fd_d"><span class="fd_t">Type parcours:</span>
<span class="fd_v">{{parcours.__doc__}}</span>
</div>
<div class="fd_d"><span class="fd_t">Type parcours:</span>
<span class="fd_v">{{parcours.__doc__|e}}</span>
</div>
<div class="fd_d"><span class="fd_t">Commentaire:</span>
<span class="fd_v explication">{{formation.commentaire|e}}</span>
</div>
{% if parcours.UE_IS_MODULE %}

View File

@ -0,0 +1,30 @@
"""commentaire formation
Revision ID: 5c7b208355df
Revises: 25e3ca6cc063
Create Date: 2023-01-30 11:45:20.156713
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "5c7b208355df"
down_revision = "25e3ca6cc063"
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column(
"notes_formations", sa.Column("commentaire", sa.Text(), nullable=True)
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column("notes_formations", "commentaire")
# ### end Alembic commands ###