[TWIG] FAQ base template hierarchy fixes

Minor refactoring of routes for FAQ static pages
This commit is contained in:
rainydaysavings 2020-06-21 19:37:20 +01:00 committed by Hugo Sales
parent 02ddf96371
commit bf0e944aaa
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0
7 changed files with 12 additions and 71 deletions

View File

@ -30,31 +30,22 @@
namespace App\Routes;
<<<<<<< HEAD
use App\Controller as C;
use App\Core\Router\RouteLoader;
=======
use App\Controller\NetworkPublic;
use App\Core\RouteLoader;
use App\Core\Router\RouteLoader;
use Symfony\Bundle\FrameworkBundle\Controller\TemplateController;
>>>>>>> 5734468448... [UI] Better use of icons, fixing static pages routing.
abstract class Main
{
public static function load(RouteLoader $r): void
{
<<<<<<< HEAD
$r->connect('main_all', '/main/all', C\NetworkPublic::class);
$r->connect('config_admin', '/config/admin', C\AdminConfigController::class);
=======
$r->connect('main_all', '/main/all', NetworkPublic::class);
// FAQ pages, still need to make sure no path traversal attacks or sql and stuff
$r->connect('doc_faq', '/doc/faq', TemplateController::class, [], ['defaults' => ['template' => 'faq/home.html.twig']]);
$r->connect('doc_contact', '/doc/contact', TemplateController::class, [], ['defaults' => ['template' => 'faq/contact.html.twig']]);
$r->connect('doc_tags', '/doc/tags', TemplateController::class, [], ['defaults' => ['template' => 'faq/tags.html.twig']]);
$r->connect('doc_groups', '/doc/groups', TemplateController::class, [], ['defaults' => ['template' => 'faq/groups.html.twig']]);
$r->connect('doc_openid', '/doc/openid', TemplateController::class, [], ['defaults' => ['template' => 'faq/openid.html.twig']]);
>>>>>>> 5734468448... [UI] Better use of icons, fixing static pages routing.
// FAQ static pages
foreach (['faq', 'contact', 'tags', 'groups', 'openid'] as $s) {
$r->connect('doc_' . $s, 'doc/' . $s, TemplateController::class, [], ['defaults' => ['template' => 'faq/' . $s . '.html.twig']]);
}
$r->connect('settings_profile', '/settings/profile', C\UserAdminPanel::class);
}
}

View File

@ -1,4 +1,4 @@
{% extends 'faq/home.html.twig' %}
{% extends 'faq/faq.html.twig' %}
{% block title %}Help{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends 'faq/home.html.twig' %}
{% extends 'faq/faq.html.twig' %}
{% block title %}Help{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends 'faq/home.html.twig' %}
{% extends 'faq/faq.html.twig' %}
{% block title %}Help{% endblock %}

View File

@ -1,50 +0,0 @@
{% extends 'faq/base.html.twig' %}
{% block title %}FAQ{% endblock %}
{% block header %}{{ parent() }}{% endblock %}
{% block nav %}
<nav class='faq-nav'>
<ul>
<li>
<a href="{{ path('doc_faq') }}" class='hover-effect {% if app.request.attributes.get('_route') starts with 'doc_faq' %}active{% endif %}'>FAQ</a>
</li>
<li>
<a href="{{ path('doc_contact') }}" class='hover-effect {% if app.request.attributes.get('_route') starts with 'doc_contact' %}active{% endif %}'>Contact</a>
</li>
<li>
<a href="{{ path('doc_tags') }}" class='hover-effect {% if app.request.attributes.get('_route') starts with 'doc_tags' %}active{% endif %}'>Tags</a>
</li>
<li>
<a href="{{ path('doc_groups') }}" class='hover-effect {% if app.request.attributes.get('_route') starts with 'doc_groups' %}active{% endif %}'>Groups</a>
</li>
<li>
<a href="{{ path('doc_openid') }}" class='hover-effect {% if app.request.attributes.get('_route') starts with 'doc_openid' %}active{% endif %}'>OpenID</a>
</li>
</ul>
</nav>
{% endblock %}
{% block body %}
<div class="content">
{% block markdown %}
{% apply markdown_to_html %}
## What is this site?
This is a social network, running the GNU social software.
You can use it to make connections between friends, family and colleagues -- writing short notices about yourself, where you are, and what you're doing, and those notices will be sent to all your contacts.
In the future, we'll be adding support for photo, video and file sharing, as well as events, better contact management and mobile devices.
## Help
GNU social is a **social service**. Users can post short status messages which are shared to their friends and colleagues on the service and (optionally) onto the Web.
You can also share other types of data, like bookmarks, event invitations, polls, and questions.
If you'd like to try it out, first register a new account. Then, on the public timeline, enter your message into the textbox at the top of the page, and click "Send". It will go out on the public timeline and to anyone who is subscribed to your notices.
To subscribe to other people's notifications, go to their profile page and click the "subscribe" button. They'll get a notice that you're now subscribed to their notifications.
{% endapply %}
{% endblock %}
</div>
{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends 'faq/home.html.twig' %}
{% extends 'faq/faq.html.twig' %}
{% block title %}Help{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends 'faq/home.html.twig' %}
{% extends 'faq/faq.html.twig' %}
{% block title %}Help{% endblock %}