Skip to content

Commit 0030ffb

Browse files
committed
feat: Added yc_demo mode
1 parent 78b8fcd commit 0030ffb

File tree

5 files changed

+24
-5
lines changed

5 files changed

+24
-5
lines changed

upsonic_on_prem/dash/app/templates/libraries/control_element_header.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ <h1 class="uk-h2 uk-margin text-foreground">
3838
<div class="uk-navbar-right ">
3939
<ul class="uk-navbar-nav uk-margin-medium-right" style="gap: 0.5rem;">
4040

41-
41+
{% yc_demo as yc_demo %}
42+
{% if not yc_demo %}
4243

4344
<a href="#" onclick="page_load('{% url 'control_element' id=control_library_with_version %}');event.preventDefault();" class="uk-button uk-button{% if sub_page_title == 'Home' %}-primary{% else %}-default{% endif %}"><span uk-icon="home" class="uk-margin-small-right"></span>Home</a>
4445

@@ -55,7 +56,7 @@ <h1 class="uk-h2 uk-margin text-foreground">
5556

5657
<a href="#" onclick="page_load('{% url 'control_element_settings' id=control_library_with_version %}');event.preventDefault();" class="uk-button uk-button{% if sub_page_title == 'Settings' %}-primary{% else %}-default{% endif %}"><span uk-icon="settings" class="uk-margin-small-right"></span>Settings</a>
5758

58-
59+
{% endif %}
5960

6061
</ul>
6162
</div>

upsonic_on_prem/dash/app/templates/libraries/control_library.html

+11-1
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,29 @@
5353
<div class="uk-navbar-right">
5454
<ul class="uk-navbar-nav uk-margin-medium-right" style="gap: 0.5rem;">
5555

56-
{% if value == False %}
56+
{% if value == False %}
5757

5858
<a href="#" onclick="page_load('{% url 'control_element' id=key %}');event.preventDefault();" class="uk-button uk-button-default" style="width: 1px;" uk-tooltip="Home"><span uk-icon="home"></span></a>
5959

6060

61+
62+
{% yc_demo as yc_demo %}
63+
{% if not yc_demo %}
6164
<a href="#" onclick="page_load('{% url 'control_element_commits' id=key %}');event.preventDefault();" class="uk-button uk-button-default" style="width: 1px;" uk-tooltip="Commits"><span uk-icon="push"></span></a>
6265
<a href="#" onclick="page_load('{% url 'control_element_runs' id=key %}');event.preventDefault();" class="uk-button uk-button-default" style="width: 1px;" uk-tooltip="Run History"><span uk-icon="server"></span></a>
6366
<a href="#" onclick="page_load('{% url 'control_element_dependency' id=key %}');event.preventDefault();" class="uk-button uk-button-default" style="width: 1px;" uk-tooltip="Dependency"><span uk-icon="thumbnails"></span></a>
6467
<a href="#" onclick="page_load('{% url 'control_element_settings' id=key %}');event.preventDefault();" class="uk-button uk-button-default" style="width: 1px;" uk-tooltip="Settings"><span uk-icon="settings"></span></a>
68+
{% endif %}
69+
6570
{% else %}
6671
<a href="#" onclick="page_load('{% url 'control_library' id=key %}');event.preventDefault();" class="uk-button uk-button-default" style="width: 1px;" uk-tooltip="Home"><span uk-icon="home"></span></a>
72+
73+
{% yc_demo as yc_demo %}
74+
{% if not yc_demo %}
6775
<a href="#" onclick="page_load('{% url 'control_library_settings' id=key %}');event.preventDefault();" class="uk-button uk-button-default" style="width: 1px;" uk-tooltip="Settings"><span uk-icon="settings"></span></a>
6876
{% endif %}
77+
78+
{% endif %}
6979

7080

7181
</ul>

upsonic_on_prem/dash/app/templates/libraries/control_library_header.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ <h1 class="uk-h2 uk-margin text-foreground">
3030
<div class="uk-navbar-right">
3131
<ul class="uk-navbar-nav uk-margin-medium-right" style="gap: 0.5rem;">
3232

33+
{% yc_demo as yc_demo %}
34+
{% if not yc_demo %}
35+
36+
3337
<a href="#" onclick="page_load('{% url 'control_library' id=control_library_with_version %}');event.preventDefault();" class="uk-button uk-button{% if sub_page_title == 'Home' %}-primary{% else %}-default{% endif %}"><span uk-icon="home" class="uk-margin-small-right"></span>home</a>
3438

3539

@@ -40,7 +44,7 @@ <h1 class="uk-h2 uk-margin text-foreground">
4044
<a href="#" onclick="page_load('{% url 'control_library_settings' id=control_library_with_version %}');event.preventDefault();" class="uk-button uk-button{% if sub_page_title == 'Settings' %}-primary{% else %}-default{% endif %}"><span uk-icon="settings" class="uk-margin-small-right"></span>Settings</a>
4145

4246

43-
47+
{%endif%}
4448

4549

4650
</ul>

upsonic_on_prem/dash/app/templatetags/tags.py

+4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ def debug_mode():
1919
def demo_mode():
2020
return settings.DEMO_MODE
2121

22+
@register.simple_tag(name="yc_mode")
23+
def yc_mode():
24+
return settings.YC_MODE
25+
2226

2327
@register.simple_tag(name="sentry")
2428
def sentry():

upsonic_on_prem/dash/dash/settings.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@
229229
DEBUG = debug_mode
230230

231231
DEMO_MODE = os.environ.get("demo_mode", "false").lower() == "true"
232-
232+
YC_MODE = os.environ.get("YC_MODE", "false").lower() == "true"
233233

234234
# TODO: Adding csrf protection
235235

0 commit comments

Comments
 (0)