Skip to content

Commit

Permalink
use new template settings and replace django interval field
Browse files Browse the repository at this point in the history
  • Loading branch information
bdzim committed Oct 10, 2017
1 parent d3f192b commit 49fecb5
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 152 deletions.
191 changes: 95 additions & 96 deletions django/apps/blue_management/blue_mgnt/templates/base.html
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>{% block title %}{% endblock title %}</title>
<meta name="description" content="{% block meta_description %}{% endblock meta_description %}" />
<meta name="keywords" content="{% block meta_keywords %}{% endblock meta_keywords %}" />
<meta name="robots" content="{% block meta_bots %}noindex, nofollow{% endblock meta_bots %}" />
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>{% block title %}{% endblock title %}</title>
<meta name="description" content="{% block meta_description %}{% endblock meta_description %}" />
<meta name="keywords" content="{% block meta_keywords %}{% endblock meta_keywords %}" />
<meta name="robots" content="{% block meta_bots %}noindex, nofollow{% endblock meta_bots %}" />
<meta http-equiv="refresh" content="905" />

{% block base_styles %}
{% endblock base_styles %}
{% block base_styles %}
{% endblock base_styles %}

{% with dev=False %}
{% block styles %}
<link rel="stylesheet" href="/static/blue_mgnt/css/ss-standard.css" />

{% if dev %}
<link rel="stylesheet/less" href="/static/blue_mgnt/less/style.less" type="text/css" />
<script type="text/javascript" src="/static/blue_mgnt/vendor/less-1.5.0.min.js"></script>
<script type="text/javascript">
less.env = "development";
</script>
{% else %}
<link rel="stylesheet" href="/static/blue_mgnt/css/console-min.css?v=20170215.0" />
{% endif %}
{% if dev %}
<link rel="stylesheet/less" href="/static/blue_mgnt/less/style.less" type="text/css" />
<script type="text/javascript" src="/static/blue_mgnt/vendor/less-1.5.0.min.js"></script>
<script type="text/javascript">
less.env = "development";
</script>
{% else %}
<link rel="stylesheet" href="/static/blue_mgnt/css/console-min.css?v=20170215.0" />
{% endif %}

{% endblock styles %}
{% endwith %}
Expand All @@ -32,89 +32,88 @@
<script src="/static/blue_mgnt/vendor/jquery-1.10.2.min.js" type="text/javascript"></script>
<script src="/static/blue_mgnt/js/jquery.cookie-1.4.1.js" type="text/javascript"></script>
<script src="/static/blue_mgnt/js/console.js" type="text/javascript"></script>
{% endblock jquery %}
<!--[if lt IE 9]>
<script src="/static/blue_common/scripts/html5shiv.js"></script>
<![endif]-->
</head>
<body class="{% block body_classes %}{% endblock body_classes %}">
{% endblock jquery %}
<!--[if lt IE 9]>
<script src="/static/blue_common/scripts/html5shiv.js"></script>
<![endif]-->
</head>
<body class="{% block body_classes %}{% endblock body_classes %}">
<div class="shield">
<img src="/static/blue_mgnt/img/loading.gif" class="loader" />
<img src="/static/blue_mgnt/img/loading.gif" class="loader" />
</div>
{% if not request_login %}
{% if not request_login %}
{% block modal_options %}{% endblock modal_options %}
<div id="bg-gradient">
<div><!--ZKP--></div>
</div>
<div id="bg-gradient">
<div><!--ZKP--></div>
</div>

<header>
<div>
<h1>
<a href="/">
<img src="/static/blue_mgnt/img/spideroak-logo-white.png" alt="logo" />
</a>
</h1>
<ul>
<li>{{ account_info.info.company_name }}</li>
<li>{{ username }}</li>
<li class="line"><a target="_blank" href="https://spideroak.com/mcuserman/">
<i class="ss-icon">&#x2753;</i>Help
</a></li>
<li class="line"><a href="{% url "blue_mgnt:logout" %}"><i class="ss-icon">&#x1F512;</i>Logout</a></li>
</ul>
</div>
</header>
<header>
<div>
<h1>
<a href="/">
<img src="/static/blue_mgnt/img/spideroak-logo-white.png" alt="logo" />
</a>
</h1>
<ul>
<li>{{ account_info.info.company_name }}</li>
<li>{{ username }}</li>
<li class="line"><a target="_blank" href="https://spideroak.com/mcuserman/">
<i class="ss-icon">&#x2753;</i>Help
</a></li>
<li class="line"><a href="{% url "blue_mgnt:logout" %}"><i class="ss-icon">&#x1F512;</i>Logout</a></li>
</ul>
</div>
</header>

<div class="overlord">
{% block navtab %}{% include "partials/navtab-widget.html" %}{% endblock navtab %}
<div class="account-overview">
<ul>
<li>
<i class="ss-icon">&#x1F464;</i>
<strong>Total Users:</strong>
{{account_info.total_users}}
</li>
<li>
<i class="ss-icon">&#x1F465;</i>
<strong>Total Groups:</strong>
{{account_info.total_groups}}
</li>
<li>
<i class="ss-icon">&#xEE00;</i>
<strong>Total Shares:</strong>
{{account_info.share_count }}
</li>
</ul>
</div>
<div class="spacer"><!--ZKP--></div>
<div class="breadcrumb">{% block breadcrumb %}{% endblock breadcrumb%}</div>
<div class="spacer"><!--ZKP--></div>
{% endif %}
{% if request_login %}
<div class="overlord">
{% endif %}
<div class="content">{% block content %}{% endblock content %}</div>
<div class="overlord">
{% block navtab %}{% include "partials/navtab-widget.html" %}{% endblock navtab %}
<div class="account-overview">
<ul>
<li>
<i class="ss-icon">&#x1F464;</i>
<strong>Total Users:</strong>
{{account_info.total_users}}
</li>
<li>
<i class="ss-icon">&#x1F465;</i>
<strong>Total Groups:</strong>
{{account_info.total_groups}}
</li>
<li>
<i class="ss-icon">&#xEE00;</i>
<strong>Total Shares:</strong>
{{account_info.share_count }}
</li>
</ul>
</div>
<div class="spacer"><!--ZKP--></div>
<div class="breadcrumb">{% block breadcrumb %}{% endblock breadcrumb%}</div>
<div class="spacer"><!--ZKP--></div>
{% endif %}
{% if request_login %}
<div class="overlord">
{% endif %}
<div class="content">{% block content %}{% endblock content %}</div>
<div class="spacer"><!--ZKP--></div>
<div class="footer">
<p>Copyright &copy; {% now "Y" %} Spideroak. All Rights Reserved.</p>
<ul>
<li><a href="https://spideroak.com/about/">About</a></li>
<li><a href="https://spideroak.com/privacy_policy">Privacy Policy</a></li>
<li><a href="https://spideroak.com/terms_of_use">Terms of Use</a></li>
<li>{{ account_info.version }}</li>
</ul>
<div class="spacer"><!--ZKP--></div>
</div>
</div>

<noscript>
<div class="javascript-required">
<h3>Error: Scripting Disabled</h3>
<p>This page requires JavaScript to operate properly.</p>
<p>Please use a compatible browser or enable JavaScript.</p>
</div>
</noscript>
{% block js_templates %}{% endblock js_templates %}
{% block js_main %}{% endblock js_main %}
</body>
<div class="footer">
<p>Copyright &copy; {% now "Y" %} Spideroak. All Rights Reserved.</p>
<ul>
<li><a href="https://spideroak.com/about/">About</a></li>
<li><a href="https://spideroak.com/privacy_policy">Privacy Policy</a></li>
<li><a href="https://spideroak.com/terms_of_use">Terms of Use</a></li>
<li>{{ account_info.version }}</li>
</ul>
<div class="spacer"><!--ZKP--></div>
</div>
</div>
<noscript>
<div class="javascript-required">
<h3>Error: Scripting Disabled</h3>
<p>This page requires JavaScript to operate properly.</p>
<p>Please use a compatible browser or enable JavaScript.</p>
</div>
</noscript>
{% block js_templates %}{% endblock js_templates %}
{% block js_main %}{% endblock js_main %}
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -18,36 +18,16 @@ <h2 class="page-header"><i class="ss-icon">&#x1F511;</i>Create New Setup Code
{% if field.errors %}
{% for error in field.errors %}
<span class="error-highlight">
{{ field }}
{{ field }} {{ field.help_text }}
<span class="error-tag">{{ error }}</span>
</span>
{% endfor %}
{% else %}
{{ field }}
{{ field }} {{ field.help_text }}
{% endif %}
</td>
</tr>
{% endfor %}
{% comment %}
<!-- MOCKUP -->
<tr>
<td>
<label>Actions</label>
</td>
<td>
<input type="radio" class="radio-submit"name="action-select" id=""> Global
<input type="radio" class="radio-submit" name="action-select" id=""> By Group:
<select>
<option>Select Group</option>
<option value="a">a</option>
<option value="b">b</option>
<option value="c">c</option>
<option value="d">d</option>
</select>
</td>
</tr>
<!-- END MOCKUP -->
{% endcomment %}
</table>
<div class="widget-actions">
<input type='submit' value="Create Auth Code" class="rhs button button-primary-basic">
Expand Down
6 changes: 3 additions & 3 deletions django/apps/blue_management/blue_mgnt/views/managementvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ def escrow_login(request, api, account_info, config, username,


class CodeForm(forms.Form):
expiry_interval = forms.IntegerField(
expiry_days = forms.IntegerField(
min_value=0,
label='Expiry',
help_text='days',
initial=1
)
no_devices_only = forms.BooleanField(
required=False,
initial=True,
label='No Devices Only?',
help_text='testing it out'
)
single_use_only = forms.BooleanField(
required=False,
Expand Down Expand Up @@ -93,7 +93,7 @@ def auth_codes(request, api, account_info, config, username, saved=False):
token=setup_token.new_token(),
expiry=(
datetime.datetime.now() +
datetime.timedelta(days=new_code.cleaned_data['expiry_interval'])
datetime.timedelta(days=new_code.cleaned_data['expiry_days'])
),
no_devices_only=new_code.cleaned_data['no_devices_only'],
single_use_only=new_code.cleaned_data['single_use_only']
Expand Down
5 changes: 4 additions & 1 deletion django/apps/blue_management/blue_mgnt/views/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,22 @@ class OpenmanageOptsForm(forms.Form):
autopurge_interval = forms.IntegerField(
min_value=0,
label='Deleted Items Automatic Purge',
help_text='days',
initial=opts['autopurge_interval'],
required=False,
)
versionpurge_interval = forms.IntegerField(
min_value=0,
label='Historical Version Automatic Purge',
help_text='days',
initial=opts['versionpurge_interval'],
required=False,
)
purgehold_duration = forms.IntegerField(
min_value=0,
label='Purgehold Duration',
initial=opts['purgehold_duration'] * 86400,
help_text='days',
initial=opts['purgehold_duration'] / 86400,
required=False,
)
support_email = forms.EmailField(initial=opts['support_email'])
Expand Down
2 changes: 1 addition & 1 deletion django/apps/blue_management/blue_mgnt/views/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ def manage(request, api, account_info, config, username):
billing_info = None
if not features['ldap']:
billing_info = get_billing_info(config)
return render('manage.html', dict(
return render(request, 'manage.html', dict(
user=request.user,
username=username,
account_info=account_info,
Expand Down
42 changes: 13 additions & 29 deletions django/omva/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
sys.path += ['/opt/openmanage/django/apps']

DEBUG = False
TEMPLATE_DEBUG = DEBUG

ADMINS = ()

Expand All @@ -26,13 +25,6 @@
}
}

DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = 'openmanage'
DATABASE_USER = 'admin_console'
DATABASE_PASSWORD = 'iexyjtso'
DATABASE_HOST = 'localhost'
DATABASE_PORT = ''

SESSION_SAVE_EVERY_REQUEST = True
SESSION_COOKIE_AGE = 60 * 15

Expand All @@ -46,12 +38,7 @@

LOGIN_URL = '/login/'

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = None
TIME_ZONE = 'America/Chicago'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
Expand Down Expand Up @@ -82,12 +69,6 @@
# Make this unique, and don't share it with anybody.
SECRET_KEY = os.environ['DJANGO_SECRET_KEY']

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader'
)

MIDDLEWARE = [
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
Expand All @@ -101,18 +82,21 @@
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.contrib.auth.context_processors.auth',
'django.template.context_processors.debug',
'django.template.context_processors.i18n',
'django.template.context_processors.media',
'django.template.context_processors.request',
'django.template.context_processors.tz',
'django.contrib.messages.context_processors.messages',
'blue_mgnt.context_processors.blue_common',
]
}
},
]

TEMPLATE_CONTEXT_PROCESSORS = (
'django.contrib.auth.context_processors.auth',
'django.core.context_processors.debug',
'django.core.context_processors.i18n',
'django.core.context_processors.media',
'django.core.context_processors.request',
'blue_mgnt.context_processors.blue_common',
)

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
Expand Down

0 comments on commit 49fecb5

Please sign in to comment.