Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Commit

Permalink
Merge branch 'release/3.1.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandreJunod committed Sep 13, 2023
2 parents 8035e20 + 51a820e commit 37ae46e
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 8 deletions.
5 changes: 5 additions & 0 deletions geocity/apps/core/static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -921,4 +921,9 @@ img.captcha {
height: calc(1.5em + .75rem + 2px) !important;
}

.select2-container .select2-selection--single .select2-selection__rendered {
padding-left: 12px !important;
padding-top: 4px !important;
}

/* END Django-Select2 tuning */
18 changes: 10 additions & 8 deletions geocity/apps/core/static/js/submission_contacts.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ let update_form_value = function(item, userprofile) {

// Create a label to replace .form-control without .extra-form in classes inside of forms-container
window.addEventListener('load', function () {
var forms_control = document.querySelectorAll("[id=forms-container] select[class=form-control]");
var forms_control = document.querySelectorAll("[id=forms-container] select[class*=form-control]");
for (form_control of forms_control) {
let elem = document.createElement('label');
let text = form_control.querySelector("option[selected]").text
Expand All @@ -36,11 +36,13 @@ window.addEventListener('load', function () {

// addEventListener for button .show-extra-form
var button = document.querySelector("button.show-extra-form");
button.addEventListener("click", (event) => {
var hidden_extra_forms = document.querySelector(".contact-form[hidden]")
if (hidden_extra_forms == null){
document.getElementById('contact-alert').style.display = "block"
}
hidden_extra_forms.removeAttribute("hidden")
});
if (button != null) {
button.addEventListener("click", (event) => {
var hidden_extra_forms = document.querySelector(".contact-form[hidden]")
if (hidden_extra_forms == null){
document.getElementById('contact-alert').style.display = "block"
}
hidden_extra_forms.removeAttribute("hidden")
});
};
});
35 changes: 35 additions & 0 deletions geocity/apps/forms/migrations/0025_alter_form_quick_access_slug.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Generated by Django 4.2.4 on 2023-09-12 08:48

import re
import uuid

import django.core.validators
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("forms", "0024_form_slug_and_contactformforadminsite"),
]

operations = [
migrations.AlterField(
model_name="form",
name="quick_access_slug",
field=models.UUIDField(
blank=True,
default=uuid.uuid4,
help_text="Permettant d'accéder directement au formulaire par l'url: https://geocity.ch/?form=URL_COURTE<br>\n Pour une demande anonyme https://geocity.ch/submissions/anonymous/?form=URL_COURTE",
unique=True,
validators=[
django.core.validators.RegexValidator(
re.compile("^[-a-zA-Z0-9_]+\\Z"),
"Enter a valid “slug” consisting of letters, numbers, underscores or hyphens.",
"invalid",
)
],
verbose_name="URL courte",
),
),
]
1 change: 1 addition & 0 deletions geocity/apps/submissions/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,7 @@ class SubmissionContactForm(forms.ModelForm):
contact_form = forms.ModelChoiceField(
queryset=models.ContactType.objects.all(),
empty_label="Sélectionner un contact...",
label=_("Type de contact"),
)

class Meta:
Expand Down

0 comments on commit 37ae46e

Please sign in to comment.