Skip to content

Commit

Permalink
refactor: migrated setup and update to Twig
Browse files Browse the repository at this point in the history
  • Loading branch information
thorsten committed Jun 1, 2024
1 parent bdd7550 commit 655bfc6
Show file tree
Hide file tree
Showing 13 changed files with 758 additions and 473 deletions.
3 changes: 3 additions & 0 deletions phpmyfaq/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ Header set Access-Control-Allow-Headers "Content-Type, Authorization"
# User pages
RewriteRule ^user/(ucp|bookmarks|request-removal|logout|register) index.php?action=$1 [L,QSA]

# Setup and update pages
RewriteRule ^setup/(.*) setup/index.php [L,QSA]

# Administration API
RewriteRule ^admin/api/(.*) admin/api/index.php [L,QSA]

Expand Down
48 changes: 48 additions & 0 deletions phpmyfaq/assets/templates/setup/base.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>phpMyFAQ {{ newVersion }} {{ setupType }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="application-name" content="phpMyFAQ {{ newVersion }}">
<meta name="copyright" content="(c) 2001-{{ currentYear }} phpMyFAQ Team">
<link rel="stylesheet" href="../assets/dist/styles.css">
<link rel="shortcut icon" href="../assets/themes/default/img/favicon.ico">
</head>
<body>

<nav class="p-3 text-bg-dark border-bottom">
<div class="container">
<div class="d-flex flex-wrap align-items-center justify-content-center justify-content-lg-start">
<ul class="nav col-12 col-lg-auto me-lg-auto mb-2 justify-content-center mb-md-0">
<li class="pmf-nav-link">
<a href="{{ documentationUrl }}" class="pmf-nav-link" target="_blank">
Documentation
</a>
</li>
<li class="pmf-nav-link">
<a href="https://www.phpmyfaq.de/support" class="pmf-nav-link" target="_blank">
Support
</a>
</li>
<li class="pmf-nav-link">
<a href="https://forum.phpmyfaq.de/" class="pmf-nav-link" target="_blank">
Forums
</a>
</li>
</ul>
</div>
</div>
</nav>

{% block content %}{% endblock %}

<footer class="setup-footer container mt-1">
<p class="text-end">
&copy; 2001-{{ currentYear }} <a target="_blank" href="https://www.phpmyfaq.de/">phpMyFAQ Team</a>
</p>
</footer>

<script src="../assets/dist/update.js"></script>
</body>
</html>
41 changes: 41 additions & 0 deletions phpmyfaq/assets/templates/setup/index.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{% extends 'setup/base.twig' %}

{% block content %}
<main role="main">
<section id="content">

<div class="container shadow-lg p-5 mt-5 bg-light-subtle">
<form action="./index.php" method="post" id="phpmyfaq-setup-form" name="phpmyfaq-setup-form"
class="needs-validation" novalidate>

<div class="px-4 pt-2 my-2 text-center border-bottom">
<h1 class="display-4 fw-bold">phpMyFAQ {{ newVersion }}</h1>
<div class="col-lg-6 mx-auto">
<p class="lead mb-4">
Did you already read our
<a target="_blank" href="{{ documentationUrl }}">documentation</a>
carefully before starting the phpMyFAQ setup?
</p>
</div>
</div>

<div class="form-header d-flex mb-4">
<span class="stepIndicator">Database Setup</span>
<span class="stepIndicator">LDAP Setup</span>
<span class="stepIndicator">Elasticsearch Setup</span>
<span class="stepIndicator">Admin user account</span>
</div>

{% if checkBasicError %}
<div class="alert alert-danger" role="alert">
{{ checkBasicError | raw }}
</div>
{% else %}

{% endif %}

</form>
</div>
</section>
</main>
{% endblock %}
41 changes: 41 additions & 0 deletions phpmyfaq/assets/templates/setup/install.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{% extends 'setup/base.twig' %}

{% block content %}
<main role="main">
<section id="content">

<div class="container shadow-lg p-5 mt-5 bg-light-subtle">
<form action="./index.php" method="post" id="phpmyfaq-setup-form" name="phpmyfaq-setup-form"
class="needs-validation" novalidate>

<div class="px-4 pt-2 my-2 text-center border-bottom">
<h1 class="display-4 fw-bold">phpMyFAQ {{ newVersion }}</h1>
<div class="col-lg-6 mx-auto">
<p class="lead mb-4">
Did you already read our
<a target="_blank" href="{{ documentationUrl }}">documentation</a>
carefully before starting the phpMyFAQ setup?
</p>
</div>
</div>

<div class="form-header d-flex mb-4">
<span class="stepIndicator">Database Setup</span>
<span class="stepIndicator">LDAP Setup</span>
<span class="stepIndicator">Elasticsearch Setup</span>
<span class="stepIndicator">Admin user account</span>
</div>

{% if checkBasicError %}
<div class="alert alert-danger" role="alert">
{{ checkBasicError | raw }}
</div>
{% else %}

{% endif %}

</form>
</div>
</section>
</main>
{% endblock %}
Loading

0 comments on commit 655bfc6

Please sign in to comment.