init symfony framework #14

This commit is contained in:
ghost 2023-10-02 16:13:55 +03:00
parent 3c233fcfad
commit 380377b27c
114 changed files with 11525 additions and 10998 deletions

16
templates/base.html.twig Normal file
View file

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>{% block title %}Welcome!{% endblock %}</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text></svg>">
{% block stylesheets %}
{% endblock %}
{% block javascripts %}
{% endblock %}
</head>
<body>
{% block body %}{% endblock %}
</body>
</html>

View file

@ -0,0 +1,2 @@
{% extends 'default/layout.html.twig' %}
{% block title %}{{ 'Home'|trans }} - {{ name }}{% endblock %}

View file

@ -0,0 +1,60 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>{% block title %}{{ name }}{% endblock %}</title>
{% block stylesheets %}
<link href="{{ asset('asset/default/css/framework.css') }}" rel="stylesheet" />
<link href="{{ asset('asset/default/css/common.css') }}" rel="stylesheet" />
{% endblock %}
</head>
<body>
{% block header %}
<header>
<div class="container">
<div class="row margin-t-8-px text-center">
<a class="logo" href="{{ path('home_index') }}">
<span>YGG</span>tracker
</a>
{% block header_search %}
{{ render(controller(
'App\\Controller\\SearchController::module'
)) }}
{% endblock %}
</div>
</div>
</header>
{% endblock %}
{% block main %}
<main>
<div class="container">
<div class="row">
<div class="column width-100">
{% block main_profile %}
{{ render(controller(
'App\\Controller\\ProfileController::module',
{route : app.request.get('_route')}
)) }}
{% endblock %}
<div class="padding-16-px margin-y-8-px border-radius-3-px background-color-night text-center">
{% block main_content %}{% endblock %}
</div>
</div>
</div>
</div>
</main>
{% endblock %}
{% block footer %}
<footer>
<div class="container">
<div class="row">
<div class="column width-100 text-center margin-y-8-px">
{% block footer_trackers %}{% endblock %}
<a href="https://github.com/YGGverse/YGGtracker">GitHub</a>
</div>
</div>
</div>
</footer>
{% endblock %}
</body>
</html>

View file

@ -0,0 +1,129 @@
{% extends 'default/layout.html.twig' %}
{% block title %}{{'Submit'|trans }} - {{ name }}{% endblock %}
{% block main_content %}
<div class="margin-b-24-px padding-b-16-px border-bottom-default">
<h1>{{'Submit'|trans }}</h1>
</div>
<form class="margin-t-8-px" name="submit" method="post" enctype="multipart/form-data" action="submit">
<input type="hidden" name="pageId" value="<?php echo $form->pageId->attribute->value ?>" />
<div class="margin-b-16">
<label for="locale">
{{'Content language'|trans }}
</label>
<sub class="opacity-0 parent-hover-opacity-09" title="{{ form.locale.placeholder }}">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-info-circle-fill" viewBox="0 0 16 16">
<path d="M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"/>
</svg>
</sub>
<select class="width-100 margin-t-8" type="text" name="locale" id="locale">
{% for locale in form.locale.options %}
{% if locale.active %}
<option value="{{ locale.code }}" selected="selected">
{{ locale.value }}
</option>
{% else %}
<option value="{{ locale.code }}">
{{ locale.value }}
</option>
{% endif %}
{% endfor %}
</select>
</div>
<div class="margin-b-16">
<label for="title">
{{'Title'|trans }}
</label>
<sub class="opacity-0 parent-hover-opacity-09" title="{{ form.title.attribute.placeholder }}">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-info-circle-fill" viewBox="0 0 16 16">
<path d="M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"/>
</svg>
</sub>
{% for errors in form.title.error %}
{% for error in errors %}
<div class="text-color-red margin-y-8-px">
{{ error }}
</div>
{% endfor %}
{% endfor %}
<input class="width-100 margin-t-8-px"
type="text"
name="title"
id="title"
{% if form.title.attribute.required %}required="required"{% endif %}
value="{{ form.title.attribute.value }}"
placeholder="{{ form.title.attribute.placeholder }}"
minlength="{{ form.title.attribute.minlength }}"
maxlength="{{ form.title.attribute.maxlength }}" />
</div>
<div class="margin-y-8-px padding-t-4-px">
<label for="description">
{{'Description'|trans }}
</label>
<sub class="opacity-0 parent-hover-opacity-09" title="{{ form.description.attribute.placeholder }}">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-info-circle-fill" viewBox="0 0 16 16">
<path d="M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"/>
</svg>
</sub>
{% for errors in form.description.error %}
{% for error in errors %}
<div class="text-color-red margin-y-8-px">
{{ error }}
</div>
{% endfor %}
{% endfor %}
<textarea class="width-100 margin-t-8-px"
name="description"
id="description"
{% if form.description.attribute.required %}required="required"{% endif %}
value="{{ form.description.attribute.value }}"
placeholder="{{ form.description.attribute.placeholder }}"
minlength="{{ form.description.attribute.minlength }}"
maxlength="{{ form.description.attribute.maxlength }}">{{ form.description.attribute.value }}</textarea>
</div>
<div class="margin-y-8 padding-t-4">
<label for="keywords">
{{'Keywords'|trans }}
</label>
<sub class="opacity-0 parent-hover-opacity-09"
title="<?php echo $form->keywords->attribute->placeholder ?>">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-info-circle-fill" viewBox="0 0 16 16">
<path d="M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"/>
</svg>
</sub>
{% for errors in form.keywords.error %}
{% for error in errors %}
<div class="text-color-red margin-y-8-px">
{{ error }}
</div>
{% endfor %}
{% endfor %}
<textarea class="width-100 margin-t-8-px"
name="keywords"
id="keywords"
{% if form.keywords.attribute.required %}required="required"{% endif %}
value="{{ form.keywords.attribute.value }}"
placeholder="{{ form.keywords.attribute.placeholder }}"
minlength="{{ form.keywords.attribute.minlength }}"
maxlength="{{ form.keywords.attribute.maxlength }}">{{ form.keywords.attribute.value }}</textarea>
</div>
<div class="margin-y-16-px">
<input type="checkbox"
name="sensitive"
id="sensitive"
value="true"
{% form.sensitive.attribute.value %}checked="checked"{% endif %} />
<label for="sensitive">
{{'Sensitive'|trans }}
</label>
<sub class="opacity-0 parent-hover-opacity-09" title="{{ form.sensitive.attribute.placeholder }}">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-info-circle-fill" viewBox="0 0 16 16">
<path d="M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"/>
</svg>
</sub>
</div>
<div class="text-right">
<input class="button-green" type="submit" value="{{'Submit'|trans }}" />
</div>
</form>
{% endblock %}

View file

@ -0,0 +1,2 @@
{% extends 'default/layout.html.twig' %}
{% block title %}{{ 'Profile - Settings'|trans }} - {{ name }}{% endblock %}

View file

@ -0,0 +1,178 @@
<div class="margin-y-8-px position-fixed width-180-px margin-l--196-px background-color-night border-radius-3-px">
<div class="padding-x-16-px padding-y-12-px border-bottom-default">
<a href="{{ path('profile_index') }}">
<img class="border-radius-50 vertical-align-middle" src="{{ identicon }}" alt="identicon" />
anon
</a>
<a class="text-color-default float-right" href="{{ path('profile_setting') }}" title="{{ 'Setting'|trans }}">
<svg class="vertical-align-middle" xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-gear-fill" viewBox="0 0 16 16">
<path d="M9.405 1.05c-.413-1.4-2.397-1.4-2.81 0l-.1.34a1.464 1.464 0 0 1-2.105.872l-.31-.17c-1.283-.698-2.686.705-1.987 1.987l.169.311c.446.82.023 1.841-.872 2.105l-.34.1c-1.4.413-1.4 2.397 0 2.81l.34.1a1.464 1.464 0 0 1 .872 2.105l-.17.31c-.698 1.283.705 2.686 1.987 1.987l.311-.169a1.464 1.464 0 0 1 2.105.872l.1.34c.413 1.4 2.397 1.4 2.81 0l.1-.34a1.464 1.464 0 0 1 2.105-.872l.31.17c1.283.698 2.686-.705 1.987-1.987l-.169-.311a1.464 1.464 0 0 1 .872-2.105l.34-.1c1.4-.413 1.4-2.397 0-2.81l-.34-.1a1.464 1.464 0 0 1-.872-2.105l.17-.31c.698-1.283-.705-2.686-1.987-1.987l-.311.169a1.464 1.464 0 0 1-2.105-.872l-.1-.34zM8 10.93a2.929 2.929 0 1 1 0-5.86 2.929 2.929 0 0 1 0 5.858z"/>
</svg>
</a>
</div>
<div class="padding-y-8-px">
{% if route == 'home_index' %}
<span class="padding-x-16-px padding-y-8-px display-block background-color-green cursor-default text-color-white">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-house-door-fill" viewBox="0 0 16 16">
<path d="M6.5 14.5v-3.505c0-.245.25-.495.5-.495h2c.25 0 .5.25.5.5v3.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5Z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Home'|trans }}
</span>
</span>
{% else %}
<a class="padding-x-16-px padding-y-8-px display-block background-color-hover-night-light text-color-default" href="{{ path('home_index') }}">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-house-door-fill" viewBox="0 0 16 16">
<path d="M6.5 14.5v-3.505c0-.245.25-.495.5-.495h2c.25 0 .5.25.5.5v3.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5Z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Home'|trans }}
</span>
</a>
{% endif %}
{% if route == 'page_stars' %}
<span class="padding-x-16-px padding-y-8-px display-block background-color-green cursor-default text-color-white">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-star-fill" viewBox="0 0 16 16">
<path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Stars'|trans }}
</span>
<span class="float-right">
{{ stars }}
</span>
</span>
{% else %}
<a class="padding-x-16-px padding-y-8-px display-block background-color-hover-night-light text-color-default" href="{{ path('page_stars') }}">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-star-fill" viewBox="0 0 16 16">
<path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Stars'|trans }}
</span>
<span class="float-right">
{{ stars }}
</span>
</a>
{% endif %}
{% if route == 'page_views' %}
<span class="padding-x-16-px padding-y-8-px display-block background-color-green cursor-default text-color-white">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-clock-fill" viewBox="0 0 16 16">
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8 3.5a.5.5 0 0 0-1 0V9a.5.5 0 0 0 .252.434l3.5 2a.5.5 0 0 0 .496-.868L8 8.71V3.5z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Views'|trans }}
</span>
<span class="float-right">
{{ views }}
</span>
</span>
{% else %}
<a class="padding-x-16-px padding-y-8-px display-block background-color-hover-night-light text-color-default" href="{{ path('page_views') }}">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-clock-fill" viewBox="0 0 16 16">
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8 3.5a.5.5 0 0 0-1 0V9a.5.5 0 0 0 .252.434l3.5 2a.5.5 0 0 0 .496-.868L8 8.71V3.5z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Views'|trans }}
</span>
<span class="float-right">
{{ views }}
</span>
</a>
{% endif %}
{% if route == 'page_comments' %}
<span class="padding-x-16-px padding-y-8-px display-block background-color-green cursor-default text-color-white">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-chat-fill" viewBox="0 0 16 16">
<path d="M8 15c4.418 0 8-3.134 8-7s-3.582-7-8-7-8 3.134-8 7c0 1.76.743 3.37 1.97 4.6-.097 1.016-.417 2.13-.771 2.966-.079.186.074.394.273.362 2.256-.37 3.597-.938 4.18-1.234A9.06 9.06 0 0 0 8 15z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Comments'|trans }}
</span>
<span class="float-right">
{{ comments }}
</span>
</span>
{% else %}
<a class="padding-x-16-px padding-y-8-px display-block background-color-hover-night-light text-color-default" href="{{ path('page_comments') }}">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-chat-fill" viewBox="0 0 16 16">
<path d="M8 15c4.418 0 8-3.134 8-7s-3.582-7-8-7-8 3.134-8 7c0 1.76.743 3.37 1.97 4.6-.097 1.016-.417 2.13-.771 2.966-.079.186.074.394.273.362 2.256-.37 3.597-.938 4.18-1.234A9.06 9.06 0 0 0 8 15z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Comments'|trans }}
</span>
<span class="float-right">
{{ comments }}
</span>
</a>
{% endif %}
{% if route == 'page_downloads' %}
<span class="padding-x-16-px padding-y-8-px display-block background-color-green cursor-default text-color-white">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-arrow-down-circle-fill" viewBox="0 0 16 16">
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8.5 4.5a.5.5 0 0 0-1 0v5.793L5.354 8.146a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V4.5z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Downloads'|trans }}
</span>
<span class="float-right">
{{ downloads }}
</span>
</span>
{% else %}
<a class="padding-x-16-px padding-y-8-px display-block background-color-hover-night-light text-color-default" href="{{ path('page_downloads') }}">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-arrow-down-circle-fill" viewBox="0 0 16 16">
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8.5 4.5a.5.5 0 0 0-1 0v5.793L5.354 8.146a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V4.5z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Downloads'|trans }}
</span>
<span class="float-right">
{{ downloads }}
</span>
</a>
{% endif %}
{% if route == 'page_editions' %}
<span class="padding-x-16-px padding-y-8-px display-block background-color-green cursor-default text-color-white">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-file-diff-fill" viewBox="0 0 16 16">
<path d="M12 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zM8.5 4.5V6H10a.5.5 0 0 1 0 1H8.5v1.5a.5.5 0 0 1-1 0V7H6a.5.5 0 0 1 0-1h1.5V4.5a.5.5 0 0 1 1 0zM6 10h4a.5.5 0 0 1 0 1H6a.5.5 0 0 1 0-1z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Editions'|trans }}
</span>
<span class="float-right">
{{ editions }}
</span>
</span>
{% else %}
<a class="padding-x-16-px padding-y-8-px display-block background-color-hover-night-light text-color-default" href="{{ path('page_editions') }}">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-file-diff-fill" viewBox="0 0 16 16">
<path d="M12 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zM8.5 4.5V6H10a.5.5 0 0 1 0 1H8.5v1.5a.5.5 0 0 1-1 0V7H6a.5.5 0 0 1 0-1h1.5V4.5a.5.5 0 0 1 1 0zM6 10h4a.5.5 0 0 1 0 1H6a.5.5 0 0 1 0-1z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Editions'|trans }}
</span>
<span class="float-right">
{{ editions }}
</span>
</a>
{% endif %}
{% if route == '/page/submit' %}
<span class="padding-x-16-px padding-y-8-px display-block background-color-green cursor-default text-color-white">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-plus-circle-fill" viewBox="0 0 16 16">
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8.5 4.5a.5.5 0 0 0-1 0v3h-3a.5.5 0 0 0 0 1h3v3a.5.5 0 0 0 1 0v-3h3a.5.5 0 0 0 0-1h-3v-3z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Submit'|trans }}
</span>
</span>
{% else %}
<a class="padding-x-16-px padding-y-8-px display-block background-color-hover-night-light text-color-default" href="{{ path('page_submit') }}">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-plus-circle-fill" viewBox="0 0 16 16">
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8.5 4.5a.5.5 0 0 0-1 0v3h-3a.5.5 0 0 0 0 1h3v3a.5.5 0 0 0 1 0v-3h3a.5.5 0 0 0 0-1h-3v-3z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Submit'|trans }}
</span>
</a>
{% endif %}
</div>
</div>

View file

@ -0,0 +1,2 @@
{% extends 'default/layout.html.twig' %}
{% block title %}{{ 'Profile - Settings'|trans }} - {{ name }}{% endblock %}

View file

@ -0,0 +1,10 @@
{% extends 'default/layout.html.twig' %}
{% block title %}{{ query }} - {{'Search'|trans }} - {{ name }}{% endblock %}
{% block header_search %}
{{ render(controller(
'App\\Controller\\SearchController::module',
{
query : query
}
)) }}
{% endblock %}

View file

@ -0,0 +1,4 @@
<form class="margin-t-8-px" name="search" method="get" action="{{ path('search_index') }}">
<input class="min-width-200-px" type="text" name="query" value="{{ query }}" placeholder="{{'Keyword, file, extension, hash...'|trans }}" />
<input type="submit" value="{{'Search'|trans }}" />
</form>