Skip to content

Commit cee6d35

Browse files
committed
Allow to hide the version number on homepage
1 parent 4b00697 commit cee6d35

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

src/Settings/SystemSettings/CustomizationSettings.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,9 @@ class CustomizationSettings
7676
#[Assert\NotBlank()]
7777
#[Assert\Unique()]
7878
public array $homepageitems = [HomepageItems::SEARCH, HomepageItems::BANNER, HomepageItems::FIRST_STEPS, HomepageItems::LICENSE, HomepageItems::LAST_ACTIVITY];
79+
80+
#[SettingsParameter(
81+
label: new TM("settings.system.customization.showVersionOnHomepage")
82+
)]
83+
public bool $showVersionOnHomepage = true;
7984
}

templates/homepage.html.twig

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@
1313
{% block item_banner %}
1414
<div class="rounded p-4 bg-body-secondary">
1515
<h1 class="display-3">{{ vars.partdb_title() }}</h1>
16-
<h4>
17-
{% trans %}version.caption{% endtrans %}: {{ shivas_app_version }}
18-
{% if git_branch is not empty or git_commit is not empty %}
19-
({{ git_branch ?? '' }}/{{ git_commit ?? '' }})
20-
{% endif %}
21-
</h4>
16+
{% if settings_instance('customization').showVersionOnHomepage %}
17+
<h4>
18+
{% trans %}version.caption{% endtrans %}: {{ shivas_app_version }}
19+
{% if git_branch is not empty or git_commit is not empty %}
20+
({{ git_branch ?? '' }}/{{ git_commit ?? '' }})
21+
{% endif %}
22+
</h4>
23+
{% endif %}
2224
{% if banner is not empty %}
2325
<hr>
2426
<div class="latex" data-controller="common--latex">

translations/messages.en.xlf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13453,5 +13453,11 @@ Please note, that you can not impersonate a disabled user. If you try you will g
1345313453
<target><![CDATA[The items to show at the homepage. Order can be changed via drag & drop.]]></target>
1345413454
</segment>
1345513455
</unit>
13456+
<unit id="CYw3_pS" name="settings.system.customization.showVersionOnHomepage">
13457+
<segment>
13458+
<source>settings.system.customization.showVersionOnHomepage</source>
13459+
<target>Show Part-DB version on homepage</target>
13460+
</segment>
13461+
</unit>
1345613462
</file>
1345713463
</xliff>

0 commit comments

Comments
 (0)