Skip to content

Commit

Permalink
Templates and theme overrides improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
gagnieray committed Jan 14, 2024
1 parent fedff9b commit 1f42393
Show file tree
Hide file tree
Showing 19 changed files with 546 additions and 1,057 deletions.
363 changes: 179 additions & 184 deletions app/Templates/default/reference.html.twig

Large diffs are not rendered by default.

257 changes: 133 additions & 124 deletions app/Templates/default/telemetry.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -11,145 +11,154 @@

{% set myheader = {
'title': 'Telemetry',
'icon': 'database',
'icon': 'chart bar outline',
'text': '<strong>Anonymous data</strong> collected from voluntary users instances.'
} %}
{{ parent() }}
{% endblock %}

{% block content %}

<form>
<div class="ui form basic segment right aligned">
<div class="inline field">
<label for="years">Data since</label>
<select name="years" id="years" >
<option value='-1'>always</option>
{% for i in 1..20 %}
<option value="{{ i }}"{% if form.years == i %} selected="selected"{% endif %}>
{{ i }} {% if i < 2 %}year{% else %}years{% endif %}
</option>
{% endfor %}
</select>
<input type="submit" value="Filter" class="ui button primary" />
<main class="ui very wide container">
<div class="ui basic segment">
<form class="ui unstackable form">
<div class="ui horizontally fitted basic segment">
<div class="inline unstackable fields">
<div class="field">
<label for="years">Data since</label>
<select name="years" id="years" class="ui selection dropdown">
<option value='-1'>always</option>
{% for i in 1..20 %}
<option value="{{ i }}"{% if form.years == i %} selected="selected"{% endif %}>
{{ i }} {% if i < 2 %}year{% else %}years{% endif %}
</option>
{% endfor %}
</select>
</div>
<div class="field">
<button type="submit" class="ui primary button"><i class="filter icon"></i> Filter</button>
</div>
</div>
</div>
</form>
<div class="dashboard">

<div class="chart-sizer"></div>

{% if nb_telemetry_entries %}
<div class="chart">
{% set vars = {'chart': {
'id': 'nb_telemetry_entries',
'title': 'Telemetry: data sent',
'data': nb_telemetry_entries
}} %}
{% include 'partials/chart.html.twig' with vars %}
</div>
</div>
</form>

<div class="dashboard">

{% if nb_telemetry_entries %}
<div class="chart">
{% set vars = {'chart': {
'id': 'nb_telemetry_entries',
'title': '# Telemetry: data sent',
'data': nb_telemetry_entries
}} %}
{% include 'partials/chart.html.twig' with vars %}
</div>
{% endif %}

{% if nb_reference_entries %}
<div class="chart">
{% set vars = {'chart': {
'id': 'nb_reference_entries',
'title': '# References added',
'data': nb_reference_entries,
}} %}
{% include 'partials/chart.html.twig' with vars %}
</div>
{% endif %}

<div class="chart chart-2 chart-2h">
{% set vars = {'chart': {
'id': 'references_countries',
'title': 'Countries of references',
'data': references_countries
}} %}
{% include 'partials/chart.html.twig' with vars %}
</div>
{% endif %}

{% if galette_versions %}
<div class="chart chart-2 chart-2h">
{% set vars = {'chart': {
'id': 'galette_versions',
'title': 'Galette versions',
'data': galette_versions
}} %}
{% include 'partials/chart.html.twig' with vars %}
</div>
{% endif %}

{% if top_plugins %}
<script type="text/javascript">
var _allPluginsURL = '{{ url_for('allPlugins') }}';
</script>
<div class="chart" data-expand-callback="pluginsExpanded">
{% set vars = {'chart': {
'id': 'top_plugins',
'title': 'Top plugins',
'data': top_plugins,
'expandable': true
}} %}
{% include 'partials/chart.html.twig' with vars %}
</div>
{% endif %}

{% if php_versions %}
<div class="chart chart-2">
{% set vars = {'chart': {
'id': 'php_versions',
'title': 'PHP versions',
'data': php_versions
}} %}
{% include 'partials/chart.html.twig' with vars %}
{% if nb_reference_entries %}
<div class="chart">
{% set vars = {'chart': {
'id': 'nb_reference_entries',
'title': 'References added',
'data': nb_reference_entries,
}} %}
{% include 'partials/chart.html.twig' with vars %}
</div>
{% endif %}

<div class="chart chart-2 chart-2h">
{% set vars = {'chart': {
'id': 'references_countries',
'title': 'Countries of references',
'data': references_countries
}} %}
{% include 'partials/chart.html.twig' with vars %}
</div>
{% endif %}

{% if default_languages %}
{% if galette_versions %}
<div class="chart chart-2 chart-3 chart-2h">
{% set vars = {'chart': {
'id': 'galette_versions',
'title': 'Galette versions',
'data': galette_versions
}} %}
{% include 'partials/chart.html.twig' with vars %}
</div>
{% endif %}

{% if top_plugins %}
<script type="text/javascript">
var _allPluginsURL = '{{ url_for('allPlugins') }}';
</script>
<div class="chart" data-expand-callback="pluginsExpanded">
{% set vars = {'chart': {
'id': 'top_plugins',
'title': 'Top plugins',
'data': top_plugins,
'expandable': true
}} %}
{% include 'partials/chart.html.twig' with vars %}
</div>
{% endif %}

{% if php_versions %}
<div class="chart chart-2">
{% set vars = {'chart': {
'id': 'php_versions',
'title': 'PHP versions',
'data': php_versions
}} %}
{% include 'partials/chart.html.twig' with vars %}
</div>
{% endif %}

{% if default_languages %}
<div class="chart">
{% set vars = {'chart': {
'id': 'default_languages',
'title': 'Default languages',
'data': default_languages
}} %}
{% include 'partials/chart.html.twig' with vars %}
</div>
{% endif %}

{% if os_family %}
<div class="chart">
{% set vars = {'chart': {
'id': 'default_languages',
'title': 'Default languages',
'data': default_languages
}} %}
{% include 'partials/chart.html.twig' with vars %}
{% set vars = {'chart': {
'id': 'os_family',
'title': 'Operating systems',
'data': os_family
}} %}
{% include 'partials/chart.html.twig' with vars %}
</div>
{% endif %}

{% if os_family %}
<div class="chart">
{% set vars = {'chart': {
'id': 'os_family',
'title': 'Operating systems',
'data': os_family
}} %}
{% include 'partials/chart.html.twig' with vars %}
</div>
{% endif %}

{% if web_engines %}
<div class="chart">
{% set vars = {'chart': {
'id': 'web_engines',
'title': 'Web engines',
'data': web_engines
}} %}
{% include 'partials/chart.html.twig' with vars %}
</div>
{% endif %}

{% if db_engines %}
<div class="chart">
{% set vars = {'chart': {
'id': 'db_engines',
'title': 'DB engines',
'data': db_engines
}} %}
{% include 'partials/chart.html.twig' with vars %}
{% endif %}

{% if web_engines %}
<div class="chart">
{% set vars = {'chart': {
'id': 'web_engines',
'title': 'Web engines',
'data': web_engines
}} %}
{% include 'partials/chart.html.twig' with vars %}
</div>
{% endif %}

{% if db_engines %}
<div class="chart">
{% set vars = {'chart': {
'id': 'db_engines',
'title': 'DB engines',
'data': db_engines
}} %}
{% include 'partials/chart.html.twig' with vars %}
</div>
{% endif %}
</div>
{% endif %}
</div>
</main>
{% endblock %}

{% block userscripts %}
Expand Down
86 changes: 42 additions & 44 deletions app/Templates/partials/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<meta http-equiv="Cache-control" content="no-cache" />

<link rel="stylesheet" type="text/css" href="{{ base_path() }}/ui/semantic.min.css" />
<link rel="stylesheet" href="{{ base_path() }}/css/base.css" />

{% if darkcss_created and darkcss_enabled %}
<link rel="stylesheet" type="text/css" href="{{ url_for('getDarkCSS') }}">
Expand All @@ -19,10 +18,15 @@
{% endblock %}
</head>
<body class="{{ class }}">
<div class="ui centered top secondary menu">
<div class="ui text container">
<nav class="top-nav">
<div class="ui centered secondary large menu">
<div class="header item">
<span>
<img src="pics/logo.png" alt="Galette"/>
<span>
</div>
<a href="{{ url_for("telemetry") }}" class="item">
<i class="database icon"></i>
<i class="chart bar outline icon"></i>
Telemetry
</a>
<a href="{{ url_for('reference') }}" class="item">
Expand All @@ -33,59 +37,53 @@
href="#"
class="item{% if darkcss_created and darkcss_enabled %} black{% endif %} tooltip darkmode"
title="{% if darkcss_created and darkcss_enabled %}Disable dark mode{% else %}Enable dark mode{% endif %}"
data-position="bottom center"
>
<i class="icon adjust"></i>
<span class="displaynone">{% if darkcss_created and darkcss_enabled %}Disable dark mode{% else %}Enable dark mode{% endif %}</span>
<span class="visually-hidden">{% if darkcss_created and darkcss_enabled %}Disable dark mode{% else %}Enable dark mode{% endif %}</span>
</a>
</div>
</div>
</nav>

<!-- Page Contents -->
<div class="ui">
{% block header %}
<div class="ui vertical masthead center aligned segment page-header">
<div class="ui text container">
<h1 class="ui header">
<i class="{{ myheader.icon }} icon"></i>
{{ myheader.title }}
</h1>
<p>{{ myheader.text|raw }}</p>
</div>
{% block header %}
<header class="ui vertical masthead center aligned segment page-header">
<div class="ui text container">
<h1 class="ui header">
<i class="{{ myheader.icon }} icon"></i>
{{ myheader.title }}
</h1>
<p>{{ myheader.text|raw }}</p>
</div>
{% endblock %}
</header>
{% endblock %}

{% block content %}{% endblock %}
{% block content %}{% endblock %}

<div class="ui inverted basic segment">
<div class="ui grid">
<div class="two column row">
<div class="left floated column">
<a href="https://galette.eu">
<img src="pics/logo.png" alt="Galette"/>
</a>
</div>
<div class="right aligned column">
<div class="ui inverted link horizontal list">
{% for text, link in footer_links %}
<a href="{{ link.url }}" class="item" target="_blank">
<i class="icon {{ link.icon }}"></i>
{{- text -}}
</a>
{% endfor %}
</div><br/>
<div class="ui inverted link horizontal list">
{% for text, link in social_links %}
<a href="{{ link.url }}" class="item tooltip" title="{{ text }}" target="_blank">
<i class="ui icon {{ link.icon }}"></i>
<span class="displaynone">{{- text -}}</span>
</a>
{% endfor %}
</div>
<footer class="ui secondary inverted basic segment">
<div class="ui grid wide container">
<div class="row">
<div class="center aligned column">
<div class="ui inverted link horizontal list">
{% for text, link in footer_links %}
<a href="{{ link.url }}" class="item" target="_blank">
<i class="icon {{ link.icon }}"></i>
{{- text -}}
</a>
{% endfor %}
</div><br/>
<div class="ui inverted link horizontal list">
{% for text, link in social_links %}
<a href="{{ link.url }}" class="item tooltip" title="{{ text }}" data-position="top center" target="_blank">
<i class="ui icon {{ link.icon }}"></i>
<span class="visually-hidden">{{- text -}}</span>
</a>
{% endfor %}
</div>
</div>
</div>
</div>
</div>
</footer>

{% include "partials/alerts.html.twig" %}

Expand Down
Loading

0 comments on commit 1f42393

Please sign in to comment.