+ + {% if active_announcements %} +
+ {% for announcement in active_announcements %} +
+
+ {{ announcement.title }} + {% if announcement.is_urgent %} + URGENT + {% endif %} +
+
+ {{ announcement.content|safe }} +
+ {% if announcement.created_at %} + + Posted: {{ announcement.created_at.strftime('%Y-%m-%d %H:%M') }} + + {% endif %} +
+ {% endfor %} +
+ {% endif %} + {% with messages = get_flashed_messages(with_categories=true) %} {% if messages %}
@@ -107,5 +132,10 @@ + + + {% if tracking_script_enabled and tracking_script_code %} + {{ tracking_script_code|safe }} + {% endif %} \ No newline at end of file diff --git a/templates/system_admin_announcement_form.html b/templates/system_admin_announcement_form.html new file mode 100644 index 0000000..fefaa8e --- /dev/null +++ b/templates/system_admin_announcement_form.html @@ -0,0 +1,369 @@ +{% extends "layout.html" %} + +{% block content %} +
+
+

{{ "Edit" if announcement else "Create" }} Announcement

+

{{ "Update" if announcement else "Create new" }} system announcement for users

+ + โ† Back to Announcements + +
+ +
+
+
+ + +
+ +
+ + + You can use HTML formatting in the content. +
+ +
+
+ + +
+ +
+ +
+ +
+ +
+
+ +
+

Scheduling

+
+
+ + + Leave empty to show immediately +
+ +
+ + + Leave empty for no expiry +
+
+
+ +
+

Targeting

+
+
+ +
+
+ +
+
+
+ +
+ {% set selected_roles = [] %} + {% if announcement and announcement.target_roles %} + {% set selected_roles = announcement.target_roles|from_json %} + {% endif %} + {% for role in roles %} + + {% endfor %} +
+
+ +
+ +
+ {% set selected_companies = [] %} + {% if announcement and announcement.target_companies %} + {% set selected_companies = announcement.target_companies|from_json %} + {% endif %} + {% for company in companies %} + + {% endfor %} +
+
+
+
+
+ +
+ + Cancel +
+
+
+
+ + + + +{% endblock %} \ No newline at end of file diff --git a/templates/system_admin_announcements.html b/templates/system_admin_announcements.html new file mode 100644 index 0000000..53ebd40 --- /dev/null +++ b/templates/system_admin_announcements.html @@ -0,0 +1,165 @@ +{% extends "layout.html" %} + +{% block content %} +
+
+

System Announcements

+ + โž• New Announcement + +
+
+ +
+ {% if announcements.items %} +
+ + + + + + + + + + + + + + + {% for announcement in announcements.items %} + + + + + + + + + + + {% endfor %} + +
TitleTypeStatusStart DateEnd DateTargetCreatedActions
+ {{ announcement.title }} + {% if announcement.is_urgent %} + URGENT + {% endif %} + + + {{ announcement.announcement_type.title() }} + + + {% if announcement.is_active %} + {% if announcement.is_visible_now() %} + Active + {% else %} + Scheduled + {% endif %} + {% else %} + Inactive + {% endif %} + + {% if announcement.start_date %} + {{ announcement.start_date.strftime('%Y-%m-%d %H:%M') }} + {% else %} + Immediate + {% endif %} + + {% if announcement.end_date %} + {{ announcement.end_date.strftime('%Y-%m-%d %H:%M') }} + {% else %} + No expiry + {% endif %} + + {% if announcement.target_all_users %} + All Users + {% else %} + Targeted + {% endif %} + {{ announcement.created_at.strftime('%Y-%m-%d') }} +
+ + โœ๏ธ + +
+ +
+
+
+
+ + + {% if announcements.pages > 1 %} +
+ +
+ {% endif %} + + {% else %} +
+

No announcements found

+

Create your first announcement to communicate with users.

+ + Create Announcement + +
+ {% endif %} +
+ + +{% endblock %} \ No newline at end of file diff --git a/templates/system_admin_settings.html b/templates/system_admin_settings.html index 58aec56..c9658a0 100644 --- a/templates/system_admin_settings.html +++ b/templates/system_admin_settings.html @@ -69,6 +69,43 @@
+
+
+

Tracking Script

+

Enable custom tracking script (e.g., Google Analytics)

+
+
+ + + When enabled, the custom tracking script will be included on all pages. + Use this for analytics tracking, monitoring, or other custom JavaScript. + +
+
+ +
+
+

Tracking Script Code

+

Enter your tracking script code (HTML/JavaScript)

+
+
+ + + This code will be inserted at the bottom of every page before the closing </body> tag. + Common use cases: Google Analytics, Facebook Pixel, custom JavaScript, monitoring scripts. + +
+
+
Cancel @@ -235,6 +272,27 @@ border-radius: 8px; } +.setting-group.full-width { + grid-template-columns: 1fr; +} + +.code-textarea { + font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace; + font-size: 0.875rem; + line-height: 1.4; + background: #f8f9fa; + border: 1px solid #ced4da; + border-radius: 4px; + padding: 0.75rem; + resize: vertical; + min-height: 120px; +} + +.form-control { + width: 100%; + box-sizing: border-box; +} + .setting-header h4 { margin: 0 0 0.5rem 0; color: #495057;