fix: rename, set and use env variable

This commit is contained in:
david
2021-04-06 17:35:35 +02:00
committed by Mojib Wali
parent 8425d410f2
commit 88d7125acf
7 changed files with 29 additions and 27 deletions

View File

@@ -1,4 +1,5 @@
import $ from 'jquery';
import 'semantic-ui-css';
$(function() {
let scriptNode = document.createElement("hidden"); //needed for zammad script
@@ -17,6 +18,13 @@ $(function() {
});
});
$('.ui.sticky.test-instance')
.sticky({
context: 'body'
})
;
export function toggleVisibility(id) {
var element = document.getElementById(id);
var isHided = element.style.display === "none";

View File

@@ -248,23 +248,9 @@ span.home-inline{
white-space: nowrap;
}
.test-instance-side-sticky{
.test-instance{
text-align: center;
position: fixed;
width: 10%;
left: 5%;
top: 20%;
background-color: @outlineColor;
border: solid @tugrazRed;
z-index: 100000;
}
.test-instance-top-sticky{
text-align: center;
position: sticky;
width: 100%;
top: 0%;
background-color: @outlineColor;
border: solid @tugrazRed;
background-color: @notificationBackground;
border: solid @notificationBorder 1px;
z-index: 100000;
}

View File

@@ -51,7 +51,7 @@
//account (signin, signup) specific
// account (signin, signup) specific
@primaryFormAccounts : #fff;
@formAccountsInputPlaceholder : silver;
@fieldInputSelectionBackground: #50a2ce;
@@ -67,3 +67,7 @@
// input
@outlineColor: #85B7D9;
// notification
@notificationBackground: #fffaf3;
@notificationBorder: #e2d5c2;

View File

@@ -31,8 +31,12 @@ INVENIO_THEME_TUGRAZ_LOGIN_IMG = "images/login_logo.png"
INVENIO_THEME_TUGRAZ_CONTACT_FORM = False
"""Enable/Disable Contact form."""
INVENIO_THEME_TUGRAZ_PRODUCTION = False
"""Production environment."""
THEME_TUGRAZ_PRODUCTION = False
"""Production environment.
Can also be set as an environment variable in a .env file. Then the name
has to be 'INVENIO_THEME_TUGRAZ_PRODUCTION'.
"""
# Invenio-theme
# ============

View File

@@ -34,5 +34,5 @@ class InvenioThemeTugraz(object):
def init_config(self, app):
"""Initialize configuration."""
for k in dir(config):
if k.startswith("INVENIO_THEME_TUGRAZ_"):
if k.startswith("INVENIO_THEME_TUGRAZ_") or k.startswith("THEME_TUGRAZ_"):
app.config.setdefault(k, getattr(config, k))

View File

@@ -56,10 +56,10 @@
{%- endblock head %}
</head>
<body ng-csp {% if body_css_classes %} class="{{ body_css_classes|join(' ') }}"{% endif %}{% if g.ln %} lang="{{ g.ln.split('_', 1)[0]|safe }}"{% if rtl_direction %} {{ rtl_direction|safe }}{% endif %}{% endif %} itemscope itemtype="http://schema.org/WebPage" data-spy="scroll" data-target=".scrollspy-target">
{% if not config.INVENIO_THEME_TUGRAZ_PRODUCTION %}
<div class="test-instance-top-sticky">
{% if not config.THEME_TUGRAZ_PRODUCTION %}
<div class="ui sticky test-instance">
<h4>Test Instance</h4>
<p>This is the test instance of the TU Graz Repository. Feel free to test everything and make changes as you wish.</p>
<p>{{_ ("This is the test instance of the TU Graz Repository. Feel free to test everything and make changes as you wish.")}}</p>
</div>
{% endif %}
{%- block body %}

View File

@@ -6,10 +6,10 @@
details.
#}
{% if not config.INVENIO_THEME_TUGRAZ_PRODUCTION %}
<div class="test-instance-top-sticky">
{% if not config.THEME_TUGRAZ_PRODUCTION %}
<div class="ui sticky test-instance">
<h4>Test Instance</h4>
<p>This is the test instance of the TU Graz Repository. Feel free to test everything and make changes as you wish.</p>
<p>{{_ ("This is the test instance of the TU Graz Repository. Feel free to test everything and make changes as you wish.")}}</p>
</div>
{% endif %}