Skip to content

Commit

Permalink
Add PUI info banner to CUI (#7097)
Browse files Browse the repository at this point in the history
* add intrestials to CUI

* Add intrestial to report settings

* add option to docs

* rename to banner
Fixes #6554

Co-authored-by: Oliver <[email protected]>

* change name

---------

Co-authored-by: Oliver <[email protected]>
  • Loading branch information
matmair and SchrodingersGat authored Apr 23, 2024
1 parent df36f90 commit 37956db
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/docs/start/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ The logo and custom messages can be changed/set:
| INVENTREE_CUSTOM_SPLASH | customize.splash | Path to custom splash screen in the static files directory | *Not specified* |
| INVENTREE_CUSTOMIZE | customize.login_message | Custom message for login page | *Not specified* |
| INVENTREE_CUSTOMIZE | customize.navbar_message | Custom message for navbar | *Not specified* |
| INVENTREE_CUSTOMIZE | customize.hide_pui_banner | Disable PUI banner | False |

If you want to remove the InvenTree branding as far as possible from your end-user also check the [global server settings](../settings/global.md#server-settings).

Expand Down
1 change: 1 addition & 0 deletions src/backend/InvenTree/config_template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ remote_login_header: HTTP_REMOTE_USER
# hide_password_reset: true
# logo: img/custom_logo.png
# splash: img/custom_splash.jpg
# hide_pui_banner: true

# Set enabled frontends
# Use the environment variable INVENTREE_CLASSIC_FRONTEND
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

{% block content %}

{% include "pui_banner.html" with mode='admin' %}

<table class='table table-striped table-condensed'>
<tbody>
{% include "InvenTree/settings/setting.html" with key="INVENTREE_COMPANY_NAME" icon="fa-building" %}
Expand Down
2 changes: 2 additions & 0 deletions src/backend/InvenTree/templates/InvenTree/settings/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
</div>
{% endif %}

{% include "pui_banner.html" with mode='admin' %}

<table class='table table-striped table-condensed'>
<tbody>
{% include "InvenTree/settings/setting.html" with key="LOGIN_ENABLE_PWD_FORGOT" icon="fa-user-lock" %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
{% trans "Changing the settings below require you to immediately restart the server. Do not change this while under active usage." %}
</div>

{% include "pui_banner.html" with mode='admin' %}

<div class='table-responsive'>
<table class='table table-striped table-condensed'>
<tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

{% block content %}

{% include "pui_banner.html" with mode='admin' %}

<table class='table table-striped table-condensed'>
<tbody>
{% include "InvenTree/settings/setting.html" with key="REPORT_ENABLE" icon="fa-file-pdf" %}
Expand Down
2 changes: 2 additions & 0 deletions src/backend/InvenTree/templates/account/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
{% inventree_customize 'login_message' as login_message %}
{% mail_configured as mail_conf %}

{% include "pui_banner.html" with mode='user' %}

<div class='d-flex flex-wrap'>
<h3>{% trans "Sign In" %}</h3>
{% include "spacer.html" %}
Expand Down
17 changes: 17 additions & 0 deletions src/backend/InvenTree/templates/pui_banner.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% load inventree_extras %}
{% load i18n %}

{% inventree_customize 'hide_pui_banner' as hidden %}

{% if not hidden %}
<div class='alert alert-block alert-warning'>
{% if mode == 'admin' %}
{% trans "Platform UI - the new UI for InvenTree - provides more modern administration options." %}
{% endif %}
{% if mode == 'user' %}
{% trans "Platform UI - the new UI for InvenTree - is ready to be tested." %}
{% endif %}
<br>
{% trans "Try it out now" %} <a href="{% url 'platform' %}"/>{% trans "here" %}</a>.
</div>
{% endif %}

0 comments on commit 37956db

Please sign in to comment.