Skip to content

Commit

Permalink
labels for LIVE and UAT server, add MLI site, update site names
Browse files Browse the repository at this point in the history
  • Loading branch information
frdrckaman committed May 24, 2022
1 parent 0d40034 commit 815f1ca
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 26 deletions.
2 changes: 1 addition & 1 deletion edcs/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
DATABASE_SQLITE_ENABLED=(bool, False),
DJANGO_EMAIL_ENABLED=(bool, False),
DJANGO_AUTO_CREATE_KEYS=(bool, False),
EDCS_SITES_UAT_DOMAIN=(bool, True),
EDCS_SITES_UAT_DOMAIN=(bool, False),
EDCS_SITES_LIVE_DOMAIN=(bool, False),
)

Expand Down
9 changes: 5 additions & 4 deletions edcs_auth/templates/edcs_auth/bootstrap3/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
{% block title %} <title> EDCS | Login </title> {% endblock title %}
{% block body-content %}
<div class="loginBlock" id="login" style="display: block;">
{# {% if server_state == 'UAT' %}#}
{# <div class="alert alert-danger" style="font-size: medium"><strong>Note:</strong> This is a <strong>UAT Server</strong>, Please use it for practicing purpose only.</div>#}
{# {% endif %}#}
<h4>Welcome to <strong>{% site_name %}</strong>, Please Login</h4>
<div class="alert {% live_server %} alert-block">
<div class="col-md-offset-2"><h4 >U54 Lung Cancer EDC ({% server %})</h4></div>
<div class="col-md-offset-1"><h4 style="margin-top: 4%">{% site_name %}</h4></div>
{% login_uat_label %}
</div>
<div class="dr"><span></span></div>
<div class="loginForm">
<form class="form-horizontal" action="" method="post" id="validation">
Expand Down
14 changes: 7 additions & 7 deletions edcs_dashboard/static/css/login.css
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
.loginBox{width: 320px; position: absolute; left: 50%; top: 50%; margin-top: -212px; margin-left: -160px;}
.loginBox{width: 320px; position: absolute; left: 50%; top: 50%; margin-top: -212px; margin-left: -160px;}
.loginBox .row{margin-left: 0px; margin-right: 0px;}
.bLogo{width: 320px; height: 110px; background: url("../img/b_logo.png") top center no-repeat transparent; margin-bottom: 10px;}
.loginForm{background: #F9F9F9; border: 1px solid #CCC; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px;
-webkit-box-shadow: 0px 1px 6px rgba(67, 101, 139, 0.35); -moz-box-shadow: 0px 1px 6px rgba(67, 101, 139, 0.35); box-shadow: 0px 1px 6px rgba(67, 101, 139, 0.35);}
.loginForm .form-horizontal{padding: 20px 10px 0px;}

.loginForm label.checkbox{margin-left: 0px; padding: 0px; cursor: pointer; font-size: 11px;}
.loginForm label.checkbox .checker{margin-top: -3px;}
.loginForm label.checkbox .checker input[type="checkbox"]{margin-left: 0px;}
.loginForm input[type="text"], .loginBox input[type="password"]{width: 256px;}

.loginForm .white{background-color: #FFF; -moz-border-top-right-radius: 5px; -webkit-border-top-right-radius: 5px; border-top-right-radius: 5px; border-top: 1px solid #E8E8E8; border-right: 1px solid #E8E8E8;}
.loginForm .white p{margin: 0px 10px; line-height: 30px; font-size: 11px; color: #888;}

.loginForm .change{background-color: #FFF; -moz-border-top-left-radius: 5px; -webkit-border-top-left-radius: 5px; border-top-left-radius: 5px; border-top: 1px solid #E8E8E8; border-left: 1px solid #E8E8E8;}
.loginForm .change p{margin: 0px 10px; line-height: 30px; text-align: center;}
.loginForm .change p a{color: #888; font-weight: bold; text-decoration: none;}
.loginForm .change p a:hover{color: #444;}
.loginBlock{width: 320px; position: absolute; left: 50%; top: 100px; margin-left: -160px; border: 10px solid #FFF; display: none;

.loginBlock{width: 520px; position: absolute; left: 45%; top: 100px; margin-left: -160px; border: 10px solid #FFF; display: none;
-webkit-box-shadow: 2px 2px 4px rgba(0,0,0,0.1); -moz-box-shadow: 2px 2px 4px rgba(0,0,0,0.1); box-shadow: 2px 2px 4px rgba(0,0,0,0.1);
-moz-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px;}
.loginBlock p{color: #666;}
Expand All @@ -29,5 +29,5 @@
.loginBlock .control-group{margin-bottom: 10px;}
.loginBlock .loginForm{-moz-border-radius: 0px; -webkit-border-radius: 0px; border-radius: 0px;
-webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; border: 0px;}
.loginBlock .loginForm input[type="text"], .loginBlock .loginForm input[type="password"]{width: 238px;}
.loginBlock .loginForm input[type="text"], .loginBlock .loginForm input[type="password"]{width: 438px;}
.loginBlock .controls{padding: 0px 10px 0px;}
6 changes: 4 additions & 2 deletions edcs_dashboard/templates/edcs_dashboard/bootstrap3/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@
<!------------------------------- begin system logo ------------------------------------------->
<a class="logo" href="{% url 'edcs_dashboard:home' %}">
{# <img src="{% static 'img/logo.png' %}" alt="edcs-logo" title="edcs"/>#}
<p><span style="font-weight: bold;color: #cccccc; font-size: x-large">{% edcs_name %}</span> &nbsp;&nbsp;
<span style="color: firebrick;font-size: medium;font-weight: bold">{% server %} - {% site_name %}</span> </p>
<p>
<span style="font-weight: bold;color: #ffffff; font-size: x-large">{% edcs_name %} - {% site_name %}</span> &nbsp;&nbsp;
<span class="btn {% color_code %}" style="font-weight: bolder">{% server %}</span>
</p>
</a>
<!------------------------------- end system logo ------------------------------------------->
<!------------------------------- start template theme settings ------------------------------------------->
Expand Down
33 changes: 25 additions & 8 deletions edcs_dashboard/templatetags/edcs_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,20 @@ def summary_menu(context):
)


@register.inclusion_tag(
f"edcs_dashboard/bootstrap{settings.EDCS_BOOTSTRAP}/"
f"labels/login_uat_label.html",
)
def login_uat_label():
uat = False
if settings.EDCS_SITES_UAT_DOMAIN:
uat = True

return dict(
uat=uat,
)


def site_(context):
site_id = (
context.get("s_id")
Expand Down Expand Up @@ -117,17 +131,18 @@ def server():

@register.simple_tag
def color_code():
colour_code = "btn-danger"
if settings.EDCS_SITES_LIVE_DOMAIN:
return "#0ad00e"
else:
return "firebrick"
colour_code = "btn-success"

return colour_code


def server_state():
if settings.DEBUG:
state = "DEBUG"
elif settings.EDCS_SITES_UAT_DOMAIN:
state = "UAT"
if settings.EDCS_SITES_UAT_DOMAIN:
state = "TEST"
elif settings.EDCS_SITES_LIVE_DOMAIN:
state = "LIVE"
else:
Expand All @@ -137,6 +152,8 @@ def server_state():


@register.simple_tag
def uat_server():
if settings.EDCS_SITES_UAT_DOMAIN:
return
def live_server():
alert = "alert-danger"
if settings.EDCS_SITES_LIVE_DOMAIN:
alert = "alert-success"
return alert
16 changes: 12 additions & 4 deletions edcs_sites/sites.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@
"tanzania": (
SingleSite(
10,
"muhimbili",
"Muhimbili National Hospital (MNH)",
title="Muhimbili National hospital",
country_code="tz",
country="tanzania",
domain=f"mnh.tz.{edcs}{fqdn}",
),
SingleSite(
11,
"oceanroadcancerinstitute",
"Ocean Road Cancer Institute (ORCI)",
title="Ocean Road Cancer Institute",
country_code="tz",
country="tanzania",
Expand All @@ -56,19 +56,27 @@
"uganda": (
SingleSite(
20,
"mulago",
"Mulago National Referral Hospital (MNRH)",
title="Mulago National Referral Hospital",
country_code="ug",
country="uganda",
domain=f"mnrh.ug.{edcs}{fqdn}",
),
SingleSite(
21,
"ugandacancerinstitute",
"Uganda Cancer Institute (UCI)",
title="Uganda Cancer Institute",
country_code="ug",
country="uganda",
domain=f"uci.ug.{edcs}{fqdn}",
),
SingleSite(
22,
"Makerere Lung Institute (MLI)",
title="Makerere Lung Institute",
country_code="ug",
country="uganda",
domain=f"mli.ug.{edcs}{fqdn}",
),
),
}

0 comments on commit 815f1ca

Please sign in to comment.