Browse Source

implement header links

main
ghost 6 months ago
parent
commit
13292efe29
  1. 5
      .env
  2. 1
      config/packages/twig.yaml
  3. 1
      config/services.yaml
  4. 13
      public/css/default.css
  5. 26
      templates/default/layout.html.twig

5
.env

@ -43,7 +43,7 @@ MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0
# HLState # HLState
# Application version, used for API and media cache # Application version, used for API and media cache
APP_VERSION="1.2.0" APP_VERSION="1.3.0"
# Application name # Application name
APP_NAME="HLState" APP_NAME="HLState"
@ -58,3 +58,6 @@ APP_THEME="default"
# Masters list, server:port comma separated # Masters list, server:port comma separated
APP_MASTERS="" APP_MASTERS=""
# Links, name|url comma separated
APP_LINKS="Game|https://store.steampowered.com/app/70/HalfLife,Xash3D|https://github.com/FWGS/xash3d-fwgs"

1
config/packages/twig.yaml

@ -6,6 +6,7 @@ twig:
name: '%app.name%' name: '%app.name%'
theme: '%app.theme%' theme: '%app.theme%'
masters: '%app.masters%' masters: '%app.masters%'
links: '%app.links%'
meta: meta:
title: '%env(APP_META_TITLE)%' title: '%env(APP_META_TITLE)%'
description: '%env(APP_META_DESCRIPTION)%' description: '%env(APP_META_DESCRIPTION)%'

1
config/services.yaml

@ -8,6 +8,7 @@ parameters:
app.name: '%env(APP_NAME)%' app.name: '%env(APP_NAME)%'
app.theme: '%env(APP_THEME)%' app.theme: '%env(APP_THEME)%'
app.masters: '%env(APP_MASTERS)%' app.masters: '%env(APP_MASTERS)%'
app.links: '%env(APP_LINKS)%'
app.meta.title: '%env(APP_META_TITLE)%' app.meta.title: '%env(APP_META_TITLE)%'
app.meta.description: '%env(APP_META_DESCRIPTION)%' app.meta.description: '%env(APP_META_DESCRIPTION)%'
app.meta.keywords: '%env(APP_META_KEYWORDS)%' app.meta.keywords: '%env(APP_META_KEYWORDS)%'

13
public/css/default.css

@ -75,21 +75,10 @@ header
display: block; display: block;
margin: 16px auto; margin: 16px auto;
max-width: var(--container-max-width); max-width: var(--container-max-width);
overflow: hidden;
position: relative; position: relative;
} }
header > h1
{
padding-right: 32px;
}
header > a:first-child
{
position: absolute;
top: -2px;
right: 4px;
}
main main
{ {
display: block; display: block;

26
templates/default/layout.html.twig

@ -18,15 +18,25 @@
{% block header_container %} {% block header_container %}
<header> <header>
{% block header_content %} {% block header_content %}
<a href="{{ path('main_index') }}"> <div class="float-left">
<svg version="1.1" width="20" height="20" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 364.707 364.707" enable-background="new 0 0 364.707 364.707" xml:space="preserve"> {% if 'main_index' == request.get('_route') %}
<path fill="currentColor" d="M223.864,272.729l-38.608-97.848l-56.603,89.184H93.166l79.052-127.654l-8.875-25.229h-30.781V81.12h52.691l60.521,153.899l26.608-8.668l8.867,29.813L223.864,272.729z"/> {{ 'Home' | trans }}
<path fill="none" stroke="currentColor" stroke-width="34" d="M337.623,182.198c0,85.579-69.363,154.934-154.934,154.934c-85.571,0-154.936-69.354-154.936-154.934c0-85.569,69.363-154.933,154.936-154.933C268.259,27.265,337.623,96.629,337.623,182.198z"/> {% else %}
</svg> <a href="{{ path('main_index') }}">{{ 'Home' | trans }}</a>
</a> {% endif %}
<h1 class="text-align-right padding-right-36-px"> {% for link in app.links | split(',') %}
{% set a = link | split('|') %}
{% if a.0 is defined and a.1 is defined %}
&bull;
<a href="{{ a.1 }}" target="_blank">{{ a.0 }}</a>
{% endif %}
{% endfor %}
</div>
<div class="float-right">
<strong>
{{ app.name }} {{ app.name }}
</h1> </strong>
</div>
{% endblock %} {% endblock %}
</header> </header>
{% endblock %} {% endblock %}

Loading…
Cancel
Save