diff --git a/src/backoffice/templates/backoffice/base.html b/src/backoffice/templates/backoffice/base.html index 20517eae6134b4aba2e45363d99adb33c7f69c65..6d8d7f318273e08f3be184c1188bb449f99f1490 100644 --- a/src/backoffice/templates/backoffice/base.html +++ b/src/backoffice/templates/backoffice/base.html @@ -262,5 +262,9 @@ </div> </div> </div> + <div class="d-none" id="templates"> + {% block templates %} + {% endblock templates %} + </div> </body> </html> diff --git a/src/backoffice/templates/backoffice/link/components/form_line.html b/src/backoffice/templates/backoffice/link/components/form_line.html new file mode 100644 index 0000000000000000000000000000000000000000..e927debde9da82eb98c9893746ce47e9f065983d --- /dev/null +++ b/src/backoffice/templates/backoffice/link/components/form_line.html @@ -0,0 +1,2 @@ +{% load django_bootstrap5 %} +<div class="row row-cols-lg-auto g-3 align-items-center">{% bootstrap_form link_form layout='inline' %}</div> diff --git a/src/backoffice/templates/backoffice/link/link_display.html b/src/backoffice/templates/backoffice/link/link_display.html index d461270e702fc573c1d68ae28c2b3f8b2a6ea07b..375cedb7d53293fc8dc567895a59b316c25c91e5 100644 --- a/src/backoffice/templates/backoffice/link/link_display.html +++ b/src/backoffice/templates/backoffice/link/link_display.html @@ -1,7 +1,6 @@ {% load django_bootstrap5 %} {% load i18n %} - <div class="card-header bg-default">{% trans 'Links' %}</div> <ul class="list-group list-group-flush"> {% csrf_token %} @@ -10,7 +9,7 @@ {% bootstrap_formset_errors link_forms layout='inline' %} {% for link_form in link_forms %} <li class="list-group-item"> - <div class="row row-cols-lg-auto g-3 align-items-center">{% bootstrap_form link_form layout='inline' %}</div> + {% include 'backoffice/link/components/form_line.html' %} </li> {% endfor %} </ul> diff --git a/src/backoffice/templates/backoffice/project/create_edit.html b/src/backoffice/templates/backoffice/project/create_edit.html index 39599160ea1ffb38cbeaf0669d7616e2398e0548..5d60767dd15ec0b1264f600575807f2795f64059 100644 --- a/src/backoffice/templates/backoffice/project/create_edit.html +++ b/src/backoffice/templates/backoffice/project/create_edit.html @@ -167,3 +167,11 @@ </div> {% endif %} {% endblock content %} + +{% block templates %} +<div id="link_form_template"> + {% with link_form=template_link_form %} + {% include 'backoffice/link/components/form_line.html' %} + {% endwith %} +</div> +{% endblock templates %} \ No newline at end of file diff --git a/src/backoffice/views/projects.py b/src/backoffice/views/projects.py index f445c4b81cc2cb291148d123da5a4b4e95cf187c..e5e85fd5bb1df63f715376db2cf5bdd2b389e0dc 100644 --- a/src/backoffice/views/projects.py +++ b/src/backoffice/views/projects.py @@ -123,6 +123,7 @@ class ProjectFormMixin(ConferenceRequiredMixin, FormView): def get_context_data(self, *args, **kwargs): ctx = super().get_context_data(*args, **kwargs) + ctx['template_link_form'] = LinkForm(prefix='template') if 'form' not in kwargs: ctx['form'] = self.get_form() if 'link_forms' not in kwargs: