+
\ No newline at end of file
diff --git a/src/application/templates/old/components/alert_success.twig b/src/application/templates/old/components/alert_success.twig
new file mode 100644
index 0000000..2192358
--- /dev/null
+++ b/src/application/templates/old/components/alert_success.twig
@@ -0,0 +1,11 @@
+
+
diff --git a/src/application/templates/old/components/post.twig b/src/application/templates/old/components/post.twig
new file mode 100644
index 0000000..6b04bca
--- /dev/null
+++ b/src/application/templates/old/components/post.twig
@@ -0,0 +1,169 @@
+{%- set fileAttachments = attachments|filter(a => not (a.mimeType starts with "image/" or a.mimeType starts with "video/")) -%}
+{%- set imageAttachments = attachments|filter(a => a.mimeType starts with "image/" or a.mimeType starts with "video/") -%}
+
+{%- set canReply =
+ not post.deleted
+ and not topic.isLocked
+ and currentUser is not null
+ and currentUser.hasPermission(permission("CREATE_OWN_POST"))
+-%}
+
+{%- set canEdit =
+ not post.deleted
+ and not topic.isLocked
+ and currentUser is not null
+ and (
+ (
+ postAuthor is not null
+ and postAuthor.id == currentUser.id
+ and postAuthor.hasPermission(permission("EDIT_OWN_POST"))
+ )
+ or currentUser.hasPermission(permission("EDIT_OTHER_POST"))
+ ) -%}
+
+{%- set canDelete =
+ not post.deleted
+ and currentUser is not null
+ and (
+ (
+ postAuthor is not null
+ and postAuthor.id == currentUser.id
+ and postAuthor.hasPermission(permission("DELETE_OWN_POST"))
+ )
+ or currentUser.hasPermission(permission("DELETE_OTHER_POST"))
+ ) -%}
+
+{%- set canViewAttachments = currentUser is not null -%}
+
+{%- set your_are_the_author =
+ currentUser is not null
+ and postAuthor is not null
+ and currentUser.id == postAuthor.id
+-%}
+
+{%- set is_op =
+ topicAuthor is not null
+ and postAuthor is not null
+ and postAuthor.id == topicAuthor.id
+-%}
+
+{%- set hasOtherAttachments = (fileAttachments|length > 0) -%}
+
+{% if post.deleted %}
+
+ {{ __("Are you sure you want to delete the topic %topic% including all posts and attachments?", {
+ "topic": ctx.topic.title|e("html"),
+ }) }}
+
+
+
+
+
+
+
+
+
+
+{% endblock %}
diff --git a/src/application/templates/old/error_page.twig b/src/application/templates/old/error_page.twig
new file mode 100644
index 0000000..dde4057
--- /dev/null
+++ b/src/application/templates/old/error_page.twig
@@ -0,0 +1,12 @@
+{% set title = __("Error") %}
+{% extends "base.twig" %}
+
+{% block navbar %}
+ {% if not ctx.skipLoginCheck %}
+ {{ parent() }}
+ {% endif %}
+{% endblock %}
+
+{% block content %}
+ {% include "components/alert_error.twig" with { message: ctx.message } %}
+{% endblock %}
diff --git a/src/application/templates/old/info_page.twig b/src/application/templates/old/info_page.twig
new file mode 100644
index 0000000..e243b36
--- /dev/null
+++ b/src/application/templates/old/info_page.twig
@@ -0,0 +1,12 @@
+{% set title = __("Information") %}
+{% extends "base.twig" %}
+
+{% block navbar %}
+ {% if not ctx.skipLoginCheck %}
+ {{ parent() }}
+ {% endif %}
+{% endblock %}
+
+{% block content %}
+ {% include "components/alert_info.twig" with { message: ctx.message } %}
+{% endblock %}
diff --git a/src/application/templates/old/login.twig b/src/application/templates/old/login.twig
new file mode 100644
index 0000000..cbbb929
--- /dev/null
+++ b/src/application/templates/old/login.twig
@@ -0,0 +1,51 @@
+{% set title = __("Log in") %}
+{% set formId = "login" %}
+{% set formError = getAndClearFormError(formId) %}
+
+{% extends "base.twig" %}
+
+{% block content %}
+
+
+
{{ __("Log in") }}
+
+{% if formError %}
+ {% include "components/alert_error.twig" with { message: formError } %}
+{% endif %}
+
+
+{% endblock %}
+
+{% block scripts %}
+{{ parent() }}
+
+{% endblock %}
diff --git a/src/application/templates/old/new_password.twig b/src/application/templates/old/new_password.twig
new file mode 100644
index 0000000..02d6037
--- /dev/null
+++ b/src/application/templates/old/new_password.twig
@@ -0,0 +1,40 @@
+{% set title = __("Reset password") %}
+{% set formId = "pwnew" %}
+{% set formError = getAndClearFormError(formId) %}
+
+{% extends "base.twig" %}
+
+{% block content %}
+
+
+
{{ __("Reset password") }}
+
+{% if formError %}
+ {% include "components/alert_error.twig" with { message: formError } %}
+{% endif %}
+
+
+{% endblock %}
+
+{% block scripts %}
+{{ parent() }}
+
+{% endblock %}
diff --git a/src/application/templates/old/new_topic.twig b/src/application/templates/old/new_topic.twig
new file mode 100644
index 0000000..5063db1
--- /dev/null
+++ b/src/application/templates/old/new_topic.twig
@@ -0,0 +1,32 @@
+{% set title = __("New topic") %}
+{% set formId = "newtopic" %}
+{% set formError = getAndClearFormError(formId) %}
+
+{% extends "base.twig" %}
+
+{% block content %}
+
+
+
{{ __("New topic") }}
+
+{% if formError %}
+ {% include "components/alert_error.twig" with { message: formError } %}
+{% endif %}
+
+
+{% endblock %}
diff --git a/src/application/templates/old/password_reset.twig b/src/application/templates/old/password_reset.twig
new file mode 100644
index 0000000..c6e98c2
--- /dev/null
+++ b/src/application/templates/old/password_reset.twig
@@ -0,0 +1,45 @@
+{% set title = __("Reset password") %}
+{% set formId = "pwreset" %}
+{% set formError = getAndClearFormError(formId) %}
+
+{% extends "base.twig" %}
+
+{% block content %}
+
+
+
{{ __("Reset password") }}
+
+{% if formError %}
+ {% include "components/alert_error.twig" with { message: formError } %}
+{% endif %}
+
+
+{% endblock %}
+
+{% block scripts %}
+{{ parent() }}
+
+{% endblock %}
+
diff --git a/src/application/templates/old/register.twig b/src/application/templates/old/register.twig
new file mode 100644
index 0000000..02e2bd0
--- /dev/null
+++ b/src/application/templates/old/register.twig
@@ -0,0 +1,77 @@
+{% set title = __("Register") %}
+{% set formId = "register" %}
+{% set formError = getAndClearFormError(formId) %}
+
+{% extends "base.twig" %}
+
+{% block content %}
+
+
+
{{ __("Register") }}
+
+
+ {% if formError %}
+ {% include "components/alert_error.twig" with { message: formError } %}
+ {% endif %}
+
+{% endblock %}
+
+{% block scripts %}
+{{ parent() }}
+
+
+{% endblock %}
+
diff --git a/src/application/templates/old/search.twig b/src/application/templates/old/search.twig
new file mode 100644
index 0000000..0bdd497
--- /dev/null
+++ b/src/application/templates/old/search.twig
@@ -0,0 +1,77 @@
+{% set title = __("Search") %}
+{% set formId = "search" %}
+{% set formError = getAndClearFormError(formId) %}
+
+{% extends "base.twig" %}
+
+{% block content %}
+
+
+
{{ __("Search") }}
+
+{% if formError %}
+ {% include "components/alert_error.twig" with { message: formError } %}
+{% endif %}
+
+
+
+{% if g.get.query is defined and g.get.query is not null and g.get.query != "" %}
+ {% if ctx.posts|length > 0 %}
+
+
+ {% for post in ctx.posts|filter(p => not p.deleted) %}
+ {% set hasAttachments = ctx.attachments[post.id]|length > 0 %}
+ {% set postAuthor = ctx.users[post.authorId] %}
+ {{ renderPostSummary(post.content) }}
+ {{ __("posted by %author% on %post_date% in %topic%", {
+ "author": '' ~ (postAuthor ? postAuthor.displayName : __("unknown"))|e("html") ~ '',
+ "post_date": ' ' ~ post.postDate.format("c")|e("html") ~ '',
+ "topic": ' '
+ ~ (ctx.topics[post.topicId].isLocked ? (' ') : '')
+ ~ (ctx.topics[post.topicId] ? ctx.topics[post.topicId].title : null)|default(__("unknown"))|e("html") ~ '',
+ }) }}
+
+ {% endfor %}
+ {% else %}
+
+
+
+ {#
+ #}{{ __("No results for this search") }}
+
+
+
+ {% endif %}
+{% endif %}
+
+{% endblock %}
+
+
+{% block scripts %}
+{{ parent() }}
+{% if not (g.get.query is defined and g.get.query is not null and g.get.query != "") %}
+
+{% endif %}
+{% endblock %}
diff --git a/src/application/templates/old/view_topic.twig b/src/application/templates/old/view_topic.twig
new file mode 100644
index 0000000..613de49
--- /dev/null
+++ b/src/application/templates/old/view_topic.twig
@@ -0,0 +1,237 @@
+{% set canReply =
+ not ctx.topic.isLocked
+ and currentUser is not null
+ and currentUser.hasPermission(permission("CREATE_OWN_POST")) %}
+
+{% set canEdit =
+ currentUser is not null and (
+ (
+ ctx.topicAuthor is not null
+ and currentUser.id == ctx.topicAuthor.id
+ and ctx.topicAuthor.hasPermission(permission("EDIT_OWN_TOPIC"))
+ )
+ or currentUser.hasPermission(permission("EDIT_OTHER_TOPIC"))
+ ) %}
+
+{% set couldEditPost =
+ currentUser is not null
+ and (
+ currentUser.hasPermission(permission("EDIT_OWN_POST"))
+ or currentUser.hasPermission(permission("EDIT_OTHER_POST"))
+ ) %}
+
+{% set canDelete =
+ currentUser is not null and (
+ (
+ ctx.topicAuthor is not null
+ and currentUser.id == ctx.topicAuthor.id
+ and ctx.topicAuthor.hasPermission(permission("DELETE_OWN_TOPIC"))
+ )
+ or currentUser.hasPermission(permission("DELETE_OTHER_TOPIC"))
+ ) %}
+
+{% set title = ctx.topic.title %}
+{% extends "base.twig" %}
+
+{% block content %}
+
+{% set formError = getAndClearFormError("updateTopic") %}
+{% if formError %}
+ {% include "components/alert_error.twig" with { message: formError } %}
+{% endif %}
+{% set formError = getAndClearFormError("lockTopic") %}
+{% if formError %}
+ {% include "components/alert_error.twig" with { message: formError } %}
+{% endif %}
+{% set formError = null %}
+
+
+
+
+ {% set hasAttachments = ctx.attachments[post.id] is defined and ctx.attachments[post.id]|length > 0 %}
+ {% if hasAttachments %}
+
+ {% endif %}
+ {{ renderPostSummary(post.content) }}
+
+ {{ __("posted on %post_date% in %topic%", {
+ "post_date": '' ~ post.postDate.format("c")|e("html") ~ '',
+ "topic": ' '
+ ~ (ctx.topics[post.topicId].isLocked ? (' ') : '')
+ ~ (ctx.topics[post.topicId] ? ctx.topics[post.topicId].title : null)|default(__("unknown"))|e("html") ~ '',
+ }) }}
+
+
+ {% endfor %}
+
+{% else %}
+ {% include "components/alert_info.twig" with { message: __("This user has not posted anything yet") } %}
+{% endif %}
+
+{% if canEdit %}
+
+
+
{{ __("Edit profile") }}
+ {% set formId = "update_profile" %}
+ {% set formError = getAndClearFormError(formId) %}
+ {% if formError %}
+ {% include "components/alert_error.twig" with { message: formError } %}
+ {% endif %}
+
+ {% if isOwnProfile %}
+
+
{{ __("Change password") }}
+ {% set formId = "update_password" %}
+ {% set formError = getAndClearFormError(formId) %}
+ {% if formError %}
+ {% include "components/alert_error.twig" with { message: formError } %}
+ {% endif %}
+
+ {% endif %}
+