This repository has been archived by the owner on Jun 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
596 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
geocity/apps/core/static/js/submission_validations_edit.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Create a label to replace "readonly hidden select" readonly | ||
window.addEventListener('load', function () { | ||
var selects = document.querySelectorAll("select[readonly][hidden]"); | ||
for (select of selects) { | ||
let elem = document.createElement('label'); | ||
let text = select.querySelector("option[selected]").text | ||
let div = select.closest('.col-md-9'); | ||
|
||
elem.innerHTML = text; | ||
elem.classList.add('col-form-label', 'bold'); | ||
div.appendChild(elem); | ||
} | ||
}); |
22 changes: 22 additions & 0 deletions
22
geocity/apps/reports/migrations/0023_sectionhorizontalrule_padding_top.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Generated by Django 4.1.7 on 2023-03-23 12:19 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("reports", "0022_alter_sectionparagraph_content"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="sectionhorizontalrule", | ||
name="padding_top", | ||
field=models.PositiveIntegerField( | ||
default=0, | ||
help_text="Espace vide au dessus afin de placer le texte au bon endroit (en pixels). Augmenter la valeur fait descendre le texte", | ||
verbose_name="Espace vide au dessus", | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
geocity/apps/submissions/migrations/0016_historicalsubmissionvalidation_comment_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Generated by Django 4.1.7 on 2023-03-22 10:49 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
def migrate_comments(apps, schema_editor): | ||
""" | ||
Put comment_before, comment_during and comment_after in 1 comment | ||
""" | ||
SubmissionValidation = apps.get_model("submissions", "SubmissionValidation") | ||
|
||
validations = SubmissionValidation.objects.all().exclude( | ||
comment_before__exact="", comment_during__exact="", comment_after__exact="" | ||
) | ||
|
||
# For each SubmissionValidation, squash comment_before comment_during comment_after in 1 comment | ||
for validation in validations: | ||
comment = f"""{validation.comment_before} | ||
{validation.comment_during} | ||
{validation.comment_after}""" | ||
|
||
# save it in SubmissionValidation.comment | ||
validation.comment = comment | ||
validation.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("submissions", "0015_alter_submission_options"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="historicalsubmissionvalidation", | ||
name="comment", | ||
field=models.TextField( | ||
blank=True, | ||
help_text="Information supplémentaire facultative transmise au requérant", | ||
verbose_name="Commentaire", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="submissionvalidation", | ||
name="comment", | ||
field=models.TextField( | ||
blank=True, | ||
help_text="Information supplémentaire facultative transmise au requérant", | ||
verbose_name="Commentaire", | ||
), | ||
), | ||
migrations.RunPython(migrate_comments), | ||
] |
Oops, something went wrong.