Skip to content

Commit

Permalink
Add disclaimer_notes to edit_note
Browse files Browse the repository at this point in the history
  • Loading branch information
kiblik committed Oct 18, 2024
1 parent a726115 commit 69acad5
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
21 changes: 21 additions & 0 deletions dojo/db_migrations/0217_system_settings_disclaimer_notif.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 5.0.8 on 2024-09-12 18:22

from django.db import migrations


def copy_notif_field(apps, schema_editor):
system_settings_model = apps.get_model('dojo', 'System_Settings')
if system_settings_model.disclaimer_notifications:
system_settings_model.disclaimer_reports = system_settings_model.disclaimer_notifications
system_settings_model.save()


class Migration(migrations.Migration):

dependencies = [
('dojo', '0216_system_settings_disclaimer_notif'),
]

operations = [
migrations.RunPython(copy_notif_field),
]
2 changes: 1 addition & 1 deletion dojo/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -2293,7 +2293,7 @@ def __init__(self, *args, **kwargs):
if get_system_setting("disclaimer_reports_forced"):
self.fields["include_disclaimer"].disabled = True
self.fields["include_disclaimer"].initial = "1" # represents yes
self.fields["include_disclaimer"].help_text="Administrator of the system enforced placement of disclaimer in all reports. You are not able exclude disclaimer from this report."
self.fields["include_disclaimer"].help_text = "Administrator of the system enforced placement of disclaimer in all reports. You are not able exclude disclaimer from this report."


class CustomReportOptionsForm(forms.Form):
Expand Down
6 changes: 6 additions & 0 deletions dojo/templates/dojo/edit_note.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
{% block content %}
{{ block.super }}
<h3>{% trans "Edit Note" %}</h3><br />
{% if system_settings.disclaimer_notes %}
<div style="background-color:#DADCE2; border:1px #003333; padding:.8em; margin: 1em">
<span style="font-size:16pt; font-family: 'Cambria','times new roman','garamond',serif; color:#ff0000;">Disclaimer</span><br/>
<p style="font-size:11pt; line-height:10pt; font-family: 'Cambria','times roman',serif;">{{ system_settings.disclaimer_notes }}</p>
</div>
{% endif %}
<form class="form-horizontal" action="{% url 'edit_note' note.id page objid %}" method="post">{% csrf_token %}
{% include "dojo/form_fields.html" with form=form %}
<div class="form-group">
Expand Down

0 comments on commit 69acad5

Please sign in to comment.