mirror of
https://github.com/dkmstr/openuds.git
synced 2024-12-22 13:34:04 +03:00
* Added modal to gui
* Advanced a bit with edition of components
This commit is contained in:
parent
127c36f364
commit
004e060aaf
@ -16,7 +16,7 @@ encoding//src/uds/REST/methods/networks.py=utf-8
|
||||
encoding//src/uds/REST/methods/osmanagers.py=utf-8
|
||||
encoding//src/uds/REST/methods/providers.py=utf-8
|
||||
encoding//src/uds/REST/methods/transports.py=utf-8
|
||||
encoding//src/uds/REST/methods/users.py=utf-8
|
||||
encoding//src/uds/REST/methods/users_groups.py=utf-8
|
||||
encoding//src/uds/REST/mixins.py=utf-8
|
||||
encoding//src/uds/REST/processors.py=utf-8
|
||||
encoding//src/uds/__init__.py=utf-8
|
||||
|
@ -37,7 +37,7 @@ from uds.models import Authenticator
|
||||
from uds.core import auths
|
||||
|
||||
|
||||
from users import Users
|
||||
from users_groups import Users, Groups
|
||||
from uds.REST import Handler, NotFound
|
||||
from uds.REST.mixins import ModelHandlerMixin, ModelTypeHandlerMixin, ModelTableHandlerMixin
|
||||
|
||||
@ -49,7 +49,7 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
class Authenticators(ModelHandlerMixin, Handler):
|
||||
model = Authenticator
|
||||
detail = { 'users': Users }
|
||||
detail = { 'users': Users, 'groups':Groups }
|
||||
|
||||
def item_as_dict(self, auth):
|
||||
type_ = auth.getType()
|
||||
@ -75,7 +75,7 @@ class Types(ModelTypeHandlerMixin, Handler):
|
||||
|
||||
class TableInfo(ModelTableHandlerMixin, Handler):
|
||||
path = 'authenticators'
|
||||
detail = { 'users': Users }
|
||||
detail = { 'users': Users, 'groups':Groups }
|
||||
|
||||
title = _('Current authenticators')
|
||||
fields = [
|
||||
|
@ -1,5 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#
|
||||
# Copyright (c) 2014 Virtual Cable S.L.
|
||||
# All rights reserved.
|
||||
@ -38,6 +37,7 @@ from uds.core.util.State import State
|
||||
|
||||
from uds.models import Authenticator
|
||||
|
||||
from uds.REST.handlers import HandlerError
|
||||
from uds.REST.mixins import DetailHandler
|
||||
|
||||
import logging
|
||||
@ -49,9 +49,6 @@ logger = logging.getLogger(__name__)
|
||||
class Users(DetailHandler):
|
||||
|
||||
def get(self):
|
||||
logger.debug(self._parent)
|
||||
logger.debug(self._kwargs)
|
||||
|
||||
# Extract authenticator
|
||||
auth = self._kwargs['parent']
|
||||
|
||||
@ -79,4 +76,30 @@ class Users(DetailHandler):
|
||||
{ 'last_access': { 'title': _('Last access'), 'type': 'datetime' } },
|
||||
]
|
||||
|
||||
|
||||
class Groups(DetailHandler):
|
||||
def get(self):
|
||||
# Extract authenticator
|
||||
auth = self._kwargs['parent']
|
||||
|
||||
try:
|
||||
if len(self._args) == 0:
|
||||
return list(auth.groups.all().values('id','name', 'comments','state','is_meta'))
|
||||
else:
|
||||
return auth.get(pk=self._args[0]).values('id','name', 'comments','state','is_meta')
|
||||
except:
|
||||
logger.exception('REST groups')
|
||||
raise HandlerError('exception')
|
||||
|
||||
def getTitle(self):
|
||||
try:
|
||||
return _('Groups of {0}').format(Authenticator.objects.get(pk=self._kwargs['parent_id']).name)
|
||||
except:
|
||||
return _('Current groups')
|
||||
|
||||
def getFields(self):
|
||||
return [
|
||||
{ 'name': {'title': _('User Id'), 'visible': True, 'type': 'icon', 'icon': 'fa fa-group text-success' } },
|
||||
{ 'comments': { 'title': _('Comments') } },
|
||||
{ 'state': { 'title': _('state'), 'type': 'dict', 'dict': State.dictionary() } },
|
||||
]
|
||||
|
@ -146,7 +146,7 @@ class ModelTypeHandlerMixin(object):
|
||||
if self._args[1] == 'gui':
|
||||
gui = self.getGui(self._args[0])
|
||||
# Add name default description, at top of form
|
||||
gui.insert(0, {
|
||||
gui.append({
|
||||
'name': 'name',
|
||||
'value':'',
|
||||
'gui': {
|
||||
@ -159,11 +159,11 @@ class ModelTypeHandlerMixin(object):
|
||||
'tooltip': _('Name of this element'),
|
||||
'rdonly': False,
|
||||
'type': 'text',
|
||||
'order': 1
|
||||
'order': -2
|
||||
}
|
||||
})
|
||||
# And comments
|
||||
gui.insert(1, {
|
||||
gui.append({
|
||||
'name': 'comments',
|
||||
'value':'',
|
||||
'gui': {
|
||||
@ -176,12 +176,14 @@ class ModelTypeHandlerMixin(object):
|
||||
'tooltip': _('Comments for this element'),
|
||||
'rdonly': False,
|
||||
'type': 'text',
|
||||
'order': 1
|
||||
'order': -1
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
logger.debug("GUI: {0}".format(gui))
|
||||
return gui
|
||||
return sorted(gui, key=lambda f: f['gui']['order']);
|
||||
|
||||
|
||||
class ModelTableHandlerMixin(object):
|
||||
|
@ -36,7 +36,7 @@ body {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* chevrons for collapsable pannels */
|
||||
/* collapsable && closeable pannels */
|
||||
.chevron:before {
|
||||
content: "\f139";
|
||||
}
|
||||
@ -48,6 +48,10 @@ body {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#minimized {
|
||||
margin-top: 0.6em;
|
||||
margin-bottom: 0.3em;
|
||||
}
|
||||
|
||||
/* Edit Below to Customize Widths > 768px */
|
||||
@media (min-width:768px) {
|
||||
|
@ -19,6 +19,7 @@
|
||||
return;
|
||||
// Let's check if a "preloaded template" exists
|
||||
} else if( document.getElementById('tmpl_' + name) ) {
|
||||
$this.cache.put(name, 'tmpl_' + name); // In fact, this is not neccesary...
|
||||
success_fnc('tmpl_' + name);
|
||||
return;
|
||||
}
|
||||
@ -28,7 +29,7 @@
|
||||
type : "GET",
|
||||
dataType : "text",
|
||||
success : function(data) {
|
||||
var cachedId = name;
|
||||
var cachedId = 'tmpl_' + name;
|
||||
$this.cache.put('_' + cachedId, $this.evaluate(data));
|
||||
$this.cache.put(name, cachedId);
|
||||
api.doLog('Success getting template "' + name + '".');
|
||||
|
@ -37,7 +37,13 @@ gui.providers.link = function(event) {
|
||||
onEdit: function(value, event, table) {
|
||||
gui.providers.rest.gui(value.type, {
|
||||
success: function(data){
|
||||
gui.fields(data);
|
||||
var form = gui.fields(data);
|
||||
gui.appendToWorkspace(gui.modal('edit_modal', gettext('Edit service provider'), form));
|
||||
$('#edit_modal').modal()
|
||||
.on('hidden.bs.modal', function () {
|
||||
$('#edit_modal').remove();
|
||||
})
|
||||
;
|
||||
},
|
||||
});
|
||||
},
|
||||
@ -59,7 +65,8 @@ gui.authenticators.link = function(event) {
|
||||
gui.clearWorkspace();
|
||||
gui.appendToWorkspace(api.templates.evaluate(tmpl, {
|
||||
auths : 'auths-placeholder',
|
||||
users : 'users-placeholder'
|
||||
users : 'users-placeholder',
|
||||
groups: 'groups-placeholder',
|
||||
}));
|
||||
gui.setLinksEvents();
|
||||
|
||||
@ -71,6 +78,15 @@ gui.authenticators.link = function(event) {
|
||||
api.tools.blockUI();
|
||||
var id = selected[0].id;
|
||||
var user = new GuiElement(api.authenticators.detail(id, 'users'), 'users');
|
||||
var group = new GuiElement(api.authenticators.detail(id, 'groups'), 'groups');
|
||||
group.table({
|
||||
container : 'groups-placeholder',
|
||||
rowSelect : 'multi',
|
||||
buttons : [ 'edit', 'delete', 'xls' ],
|
||||
onLoad: function(k) {
|
||||
api.tools.unblockUI();
|
||||
},
|
||||
});
|
||||
user.table({
|
||||
container : 'users-placeholder',
|
||||
rowSelect : 'multi',
|
||||
@ -85,6 +101,19 @@ gui.authenticators.link = function(event) {
|
||||
onRefresh : function() {
|
||||
$('#users-placeholder').empty(); // Remove detail on parent refresh
|
||||
},
|
||||
onEdit: function(value, event, table) {
|
||||
gui.authenticators.rest.gui(value.type, {
|
||||
success: function(data){
|
||||
var form = gui.fields(data);
|
||||
gui.appendToWorkspace(gui.modal('edit_modal', gettext('Edit authenticator'), form));
|
||||
$('#edit_modal').modal()
|
||||
.on('hidden.bs.modal', function () {
|
||||
$('#edit_modal').remove();
|
||||
})
|
||||
;
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -4,41 +4,28 @@
|
||||
|
||||
// Returns a form that will manage a gui description (new or edit)
|
||||
gui.fields = function(item_description) {
|
||||
$.each(item_description, function(index, field){
|
||||
gui.doLog(field);
|
||||
var form = '<form class="form-horizontal" role="form">';
|
||||
// item_description is expected to have fields sorted by .gui.order (REST api returns them sorted)
|
||||
$.each(item_description, function(index, f){
|
||||
|
||||
gui.doLog(f);
|
||||
var editing = false; // Locate real Editing
|
||||
form += api.templates.evaluate('tmpl_fld_'+f.gui.type, {
|
||||
value: f.value || f.gui.value || f.gui.defvalue, // If no value present, use default value
|
||||
values: f.gui.values,
|
||||
label: f.gui.label,
|
||||
length: f.gui.length,
|
||||
multiline: f.gui.multiline,
|
||||
rdonly: editing ? f.gui.rdonly : false, // rdonly applies just to editing
|
||||
required: f.gui.required,
|
||||
tooltip: f.gui.tooltip,
|
||||
type: f.gui.type,
|
||||
name: f.name,
|
||||
});
|
||||
});
|
||||
form += '</form>';
|
||||
return form;
|
||||
};
|
||||
|
||||
gui.fields.config = {
|
||||
text: {
|
||||
css: 'form-control'
|
||||
|
||||
},
|
||||
textbox: {
|
||||
css: 'form-control'
|
||||
},
|
||||
numeric: {
|
||||
css: 'form-control'
|
||||
},
|
||||
password: {
|
||||
css: 'form-control'
|
||||
},
|
||||
hidden: {
|
||||
css: ''
|
||||
},
|
||||
choice: {
|
||||
css: ''
|
||||
},
|
||||
multichoice: {
|
||||
css: ''
|
||||
},
|
||||
editlist: {
|
||||
css: ''
|
||||
},
|
||||
checkbox: {
|
||||
css: 'form-control'
|
||||
},
|
||||
};
|
||||
|
||||
}(window.gui = window.gui || {}, jQuery));
|
||||
|
||||
|
@ -84,13 +84,34 @@
|
||||
|
||||
return '<div class="row"><div class="col-lg-12"><ol class="breadcrumb">' + list + "</ol></div></div>";
|
||||
};
|
||||
|
||||
gui.minimizePanel = function(panelId) {
|
||||
var title = $(panelId).attr('data-minimized');
|
||||
$(panelId).hide('slow', function(){
|
||||
$('<span class="label label-primary panel-icon"><b class="fa fa-plus-square-o"></b> ' + title + '</span>')
|
||||
.appendTo('#minimized')
|
||||
.click(function(){
|
||||
this.remove();
|
||||
$(panelId).show('slow');
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
gui.modal = function(id, title, content) {
|
||||
return api.templates.evaluate('tmpl_modal', {
|
||||
id: id,
|
||||
title: title,
|
||||
content: content
|
||||
});
|
||||
};
|
||||
|
||||
gui.clearWorkspace = function() {
|
||||
$('#page-wrapper').empty();
|
||||
$('#content').empty();
|
||||
$('#minimized').empty();
|
||||
};
|
||||
|
||||
gui.appendToWorkspace = function(data) {
|
||||
$(data).appendTo('#page-wrapper');
|
||||
$(data).appendTo('#content');
|
||||
};
|
||||
|
||||
// Links methods
|
||||
@ -333,6 +354,7 @@ GuiElement.prototype = {
|
||||
|
||||
$this.rest.get({
|
||||
success : function(data) {
|
||||
var refreshFnc;
|
||||
var table = gui.table(title, tableId);
|
||||
if (options.container === undefined) {
|
||||
gui.appendToWorkspace('<div class="row"><div class="col-lg-12">' + table.text + '</div></div>');
|
||||
@ -376,7 +398,7 @@ GuiElement.prototype = {
|
||||
// What execute on refresh button push
|
||||
var onRefresh = options.onRefresh || function(){};
|
||||
|
||||
var refreshFnc = function() {
|
||||
refreshFnc = function() {
|
||||
// Refreshes table content
|
||||
var tbl = $('#' + tableId).dataTable();
|
||||
// Clears selection first
|
||||
|
68
server/src/uds/static/css/font-awesome.css
vendored
68
server/src/uds/static/css/font-awesome.css
vendored
@ -1,34 +1,13 @@
|
||||
/*!
|
||||
* Font Awesome 4.0.0
|
||||
* the iconic font designed for Bootstrap
|
||||
* ------------------------------------------------------------------------------
|
||||
* The full suite of pictographic icons, examples, and documentation can be
|
||||
* found at http://fontawesome.io. Stay up to date on Twitter at
|
||||
* http://twitter.com/fontawesome.
|
||||
*
|
||||
* License
|
||||
* ------------------------------------------------------------------------------
|
||||
* - The Font Awesome font is licensed under SIL OFL 1.1 -
|
||||
* http://scripts.sil.org/OFL
|
||||
* - Font Awesome CSS, LESS, and SASS files are licensed under MIT License -
|
||||
* http://opensource.org/licenses/mit-license.html
|
||||
* - Font Awesome documentation licensed under CC BY 3.0 -
|
||||
* http://creativecommons.org/licenses/by/3.0/
|
||||
* - Attribution is no longer required in Font Awesome 3.0, but much appreciated:
|
||||
* "Font Awesome by Dave Gandy - http://fontawesome.io"
|
||||
*
|
||||
* Author - Dave Gandy
|
||||
* ------------------------------------------------------------------------------
|
||||
* Email: dave@fontawesome.io
|
||||
* Twitter: http://twitter.com/davegandy
|
||||
* Work: Lead Product Designer @ Kyruus - http://kyruus.com
|
||||
* Font Awesome 4.0.3 by @davegandy - http://fontawesome.io - @fontawesome
|
||||
* License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
|
||||
*/
|
||||
/* FONT PATH
|
||||
* -------------------------- */
|
||||
@font-face {
|
||||
font-family: 'FontAwesome';
|
||||
src: url('../fonts/fontawesome-webfont.eot?v=4.0.0');
|
||||
src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.0.0') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff?v=4.0.0') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.0.0') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.0.0#fontawesomeregular') format('svg');
|
||||
src: url('../fonts/fontawesome-webfont.eot?v=4.0.3');
|
||||
src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.0.3') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff?v=4.0.3') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.0.3') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.0.3#fontawesomeregular') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
@ -195,6 +174,7 @@
|
||||
.fa-stack-1x,
|
||||
.fa-stack-2x {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
@ -414,7 +394,7 @@
|
||||
.fa-check-square-o:before {
|
||||
content: "\f046";
|
||||
}
|
||||
.fa-move:before {
|
||||
.fa-arrows:before {
|
||||
content: "\f047";
|
||||
}
|
||||
.fa-step-backward:before {
|
||||
@ -499,10 +479,10 @@
|
||||
.fa-share:before {
|
||||
content: "\f064";
|
||||
}
|
||||
.fa-resize-full:before {
|
||||
.fa-expand:before {
|
||||
content: "\f065";
|
||||
}
|
||||
.fa-resize-small:before {
|
||||
.fa-compress:before {
|
||||
content: "\f066";
|
||||
}
|
||||
.fa-plus:before {
|
||||
@ -569,10 +549,10 @@
|
||||
.fa-folder-open:before {
|
||||
content: "\f07c";
|
||||
}
|
||||
.fa-resize-vertical:before {
|
||||
.fa-arrows-v:before {
|
||||
content: "\f07d";
|
||||
}
|
||||
.fa-resize-horizontal:before {
|
||||
.fa-arrows-h:before {
|
||||
content: "\f07e";
|
||||
}
|
||||
.fa-bar-chart-o:before {
|
||||
@ -666,7 +646,7 @@
|
||||
.fa-rss:before {
|
||||
content: "\f09e";
|
||||
}
|
||||
.fa-hdd:before {
|
||||
.fa-hdd-o:before {
|
||||
content: "\f0a0";
|
||||
}
|
||||
.fa-bullhorn:before {
|
||||
@ -717,10 +697,11 @@
|
||||
.fa-briefcase:before {
|
||||
content: "\f0b1";
|
||||
}
|
||||
.fa-fullscreen:before {
|
||||
.fa-arrows-alt:before {
|
||||
content: "\f0b2";
|
||||
}
|
||||
.fa-group:before {
|
||||
.fa-group:before,
|
||||
.fa-users:before {
|
||||
content: "\f0c0";
|
||||
}
|
||||
.fa-chain:before,
|
||||
@ -751,7 +732,7 @@
|
||||
.fa-square:before {
|
||||
content: "\f0c8";
|
||||
}
|
||||
.fa-reorder:before {
|
||||
.fa-bars:before {
|
||||
content: "\f0c9";
|
||||
}
|
||||
.fa-list-ul:before {
|
||||
@ -888,10 +869,10 @@
|
||||
.fa-file-text-o:before {
|
||||
content: "\f0f6";
|
||||
}
|
||||
.fa-building:before {
|
||||
.fa-building-o:before {
|
||||
content: "\f0f7";
|
||||
}
|
||||
.fa-hospital:before {
|
||||
.fa-hospital-o:before {
|
||||
content: "\f0f8";
|
||||
}
|
||||
.fa-ambulance:before {
|
||||
@ -977,12 +958,6 @@
|
||||
.fa-folder-open-o:before {
|
||||
content: "\f115";
|
||||
}
|
||||
.fa-expand-o:before {
|
||||
content: "\f116";
|
||||
}
|
||||
.fa-collapse-o:before {
|
||||
content: "\f117";
|
||||
}
|
||||
.fa-smile-o:before {
|
||||
content: "\f118";
|
||||
}
|
||||
@ -1097,16 +1072,16 @@
|
||||
.fa-anchor:before {
|
||||
content: "\f13d";
|
||||
}
|
||||
.fa-unlock-o:before {
|
||||
.fa-unlock-alt:before {
|
||||
content: "\f13e";
|
||||
}
|
||||
.fa-bullseye:before {
|
||||
content: "\f140";
|
||||
}
|
||||
.fa-ellipsis-horizontal:before {
|
||||
.fa-ellipsis-h:before {
|
||||
content: "\f141";
|
||||
}
|
||||
.fa-ellipsis-vertical:before {
|
||||
.fa-ellipsis-v:before {
|
||||
content: "\f142";
|
||||
}
|
||||
.fa-rss-square:before {
|
||||
@ -1358,3 +1333,6 @@
|
||||
.fa-try:before {
|
||||
content: "\f195";
|
||||
}
|
||||
.fa-plus-square-o:before {
|
||||
content: "\f196";
|
||||
}
|
||||
|
399
server/src/uds/static/css/font-awesome.min.css
vendored
399
server/src/uds/static/css/font-awesome.min.css
vendored
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
@ -280,8 +280,8 @@
|
||||
<glyph unicode="" horiz-adv-x="1664" d="M640 320q0 -40 -12.5 -82t-43 -76t-72.5 -34t-72.5 34t-43 76t-12.5 82t12.5 82t43 76t72.5 34t72.5 -34t43 -76t12.5 -82zM1280 320q0 -40 -12.5 -82t-43 -76t-72.5 -34t-72.5 34t-43 76t-12.5 82t12.5 82t43 76t72.5 34t72.5 -34t43 -76t12.5 -82zM1440 320 q0 120 -69 204t-187 84q-41 0 -195 -21q-71 -11 -157 -11t-157 11q-152 21 -195 21q-118 0 -187 -84t-69 -204q0 -88 32 -153.5t81 -103t122 -60t140 -29.5t149 -7h168q82 0 149 7t140 29.5t122 60t81 103t32 153.5zM1664 496q0 -207 -61 -331q-38 -77 -105.5 -133t-141 -86 t-170 -47.5t-171.5 -22t-167 -4.5q-78 0 -142 3t-147.5 12.5t-152.5 30t-137 51.5t-121 81t-86 115q-62 123 -62 331q0 237 136 396q-27 82 -27 170q0 116 51 218q108 0 190 -39.5t189 -123.5q147 35 309 35q148 0 280 -32q105 82 187 121t189 39q51 -102 51 -218 q0 -87 -27 -168q136 -160 136 -398z" />
|
||||
<glyph unicode="" horiz-adv-x="1664" d="M1536 224v704q0 40 -28 68t-68 28h-704q-40 0 -68 28t-28 68v64q0 40 -28 68t-68 28h-320q-40 0 -68 -28t-28 -68v-960q0 -40 28 -68t68 -28h1216q40 0 68 28t28 68zM1664 928v-704q0 -92 -66 -158t-158 -66h-1216q-92 0 -158 66t-66 158v960q0 92 66 158t158 66h320 q92 0 158 -66t66 -158v-32h672q92 0 158 -66t66 -158z" />
|
||||
<glyph unicode="" horiz-adv-x="1920" d="M1781 605q0 35 -53 35h-1088q-40 0 -85.5 -21.5t-71.5 -52.5l-294 -363q-18 -24 -18 -40q0 -35 53 -35h1088q40 0 86 22t71 53l294 363q18 22 18 39zM640 768h768v160q0 40 -28 68t-68 28h-576q-40 0 -68 28t-28 68v64q0 40 -28 68t-68 28h-320q-40 0 -68 -28t-28 -68 v-853l256 315q44 53 116 87.5t140 34.5zM1909 605q0 -62 -46 -120l-295 -363q-43 -53 -116 -87.5t-140 -34.5h-1088q-92 0 -158 66t-66 158v960q0 92 66 158t158 66h320q92 0 158 -66t66 -158v-32h544q92 0 158 -66t66 -158v-160h192q54 0 99 -24.5t67 -70.5q15 -32 15 -68z " />
|
||||
<glyph unicode="" horiz-adv-x="1152" d="M896 608v-64q0 -14 -9 -23t-23 -9h-224v-224q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v224h-224q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h224v224q0 14 9 23t23 9h64q14 0 23 -9t9 -23v-224h224q14 0 23 -9t9 -23zM1024 224v704q0 40 -28 68t-68 28h-704q-40 0 -68 -28 t-28 -68v-704q0 -40 28 -68t68 -28h704q40 0 68 28t28 68zM1152 928v-704q0 -92 -65.5 -158t-158.5 -66h-704q-93 0 -158.5 66t-65.5 158v704q0 93 65.5 158.5t158.5 65.5h704q93 0 158.5 -65.5t65.5 -158.5z" />
|
||||
<glyph unicode="" horiz-adv-x="1152" d="M928 1152q93 0 158.5 -65.5t65.5 -158.5v-704q0 -92 -65.5 -158t-158.5 -66h-704q-93 0 -158.5 66t-65.5 158v704q0 93 65.5 158.5t158.5 65.5h704zM1024 224v704q0 40 -28 68t-68 28h-704q-40 0 -68 -28t-28 -68v-704q0 -40 28 -68t68 -28h704q40 0 68 28t28 68z M864 640q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-576q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h576z" />
|
||||
<glyph unicode="" horiz-adv-x="1792" />
|
||||
<glyph unicode="" horiz-adv-x="1792" />
|
||||
<glyph unicode="" d="M1134 461q-37 -121 -138 -195t-228 -74t-228 74t-138 195q-8 25 4 48.5t38 31.5q25 8 48.5 -4t31.5 -38q25 -80 92.5 -129.5t151.5 -49.5t151.5 49.5t92.5 129.5q8 26 32 38t49 4t37 -31.5t4 -48.5zM640 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5 t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1152 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1408 640q0 130 -51 248.5t-136.5 204t-204 136.5t-248.5 51t-248.5 -51t-204 -136.5t-136.5 -204t-51 -248.5 t51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
|
||||
<glyph unicode="" d="M1134 307q8 -25 -4 -48.5t-37 -31.5t-49 4t-32 38q-25 80 -92.5 129.5t-151.5 49.5t-151.5 -49.5t-92.5 -129.5q-8 -26 -31.5 -38t-48.5 -4q-26 8 -38 31.5t-4 48.5q37 121 138 195t228 74t228 -74t138 -195zM640 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5 t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1152 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1408 640q0 130 -51 248.5t-136.5 204t-204 136.5t-248.5 51t-248.5 -51t-204 -136.5t-136.5 -204 t-51 -248.5t51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
|
||||
<glyph unicode="" d="M1152 448q0 -26 -19 -45t-45 -19h-640q-26 0 -45 19t-19 45t19 45t45 19h640q26 0 45 -19t19 -45zM640 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1152 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5 t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1408 640q0 130 -51 248.5t-136.5 204t-204 136.5t-248.5 51t-248.5 -51t-204 -136.5t-136.5 -204t-51 -248.5t51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
|
||||
@ -400,7 +400,7 @@
|
||||
<glyph unicode="" horiz-adv-x="1664" d="M1023 349l102 -204q-58 -179 -210 -290t-339 -111q-156 0 -288.5 77.5t-210 210t-77.5 288.5q0 181 104.5 330t274.5 211l17 -131q-122 -54 -195 -165.5t-73 -244.5q0 -185 131.5 -316.5t316.5 -131.5q126 0 232.5 65t165 175.5t49.5 236.5zM1571 249l58 -114l-256 -128 q-13 -7 -29 -7q-40 0 -57 35l-239 477h-472q-24 0 -42.5 16.5t-21.5 40.5l-96 779q-2 16 6 42q14 51 57 82.5t97 31.5q66 0 113 -47t47 -113q0 -69 -52 -117.5t-120 -41.5l37 -289h423v-128h-407l16 -128h455q40 0 57 -35l228 -455z" />
|
||||
<glyph unicode="" d="M1254 899q16 85 -21 132q-52 65 -187 45q-17 -3 -41 -12.5t-57.5 -30.5t-64.5 -48.5t-59.5 -70t-44.5 -91.5q80 7 113.5 -16t26.5 -99q-5 -52 -52 -143q-43 -78 -71 -99q-44 -32 -87 14q-23 24 -37.5 64.5t-19 73t-10 84t-8.5 71.5q-23 129 -34 164q-12 37 -35.5 69 t-50.5 40q-57 16 -127 -25q-54 -32 -136.5 -106t-122.5 -102v-7q16 -8 25.5 -26t21.5 -20q21 -3 54.5 8.5t58 10.5t41.5 -30q11 -18 18.5 -38.5t15 -48t12.5 -40.5q17 -46 53 -187q36 -146 57 -197q42 -99 103 -125q43 -12 85 -1.5t76 31.5q131 77 250 237 q104 139 172.5 292.5t82.5 226.5zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
|
||||
<glyph unicode="" horiz-adv-x="1152" d="M1152 704q0 -191 -94.5 -353t-256.5 -256.5t-353 -94.5h-160q-14 0 -23 9t-9 23v611l-215 -66q-3 -1 -9 -1q-10 0 -19 6q-13 10 -13 26v128q0 23 23 31l233 71v93l-215 -66q-3 -1 -9 -1q-10 0 -19 6q-13 10 -13 26v128q0 23 23 31l233 71v250q0 14 9 23t23 9h160 q14 0 23 -9t9 -23v-181l375 116q15 5 28 -5t13 -26v-128q0 -23 -23 -31l-393 -121v-93l375 116q15 5 28 -5t13 -26v-128q0 -23 -23 -31l-393 -121v-487q188 13 318 151t130 328q0 14 9 23t23 9h160q14 0 23 -9t9 -23z" />
|
||||
<glyph unicode="" horiz-adv-x="1792" />
|
||||
<glyph unicode="" horiz-adv-x="1408" d="M1152 736v-64q0 -14 -9 -23t-23 -9h-352v-352q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v352h-352q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h352v352q0 14 9 23t23 9h64q14 0 23 -9t9 -23v-352h352q14 0 23 -9t9 -23zM1280 288v832q0 66 -47 113t-113 47h-832 q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113zM1408 1120v-832q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832q119 0 203.5 -84.5t84.5 -203.5z" />
|
||||
<glyph unicode="" horiz-adv-x="1792" />
|
||||
<glyph unicode="" horiz-adv-x="1792" />
|
||||
<glyph unicode="" horiz-adv-x="1792" />
|
||||
|
Before Width: | Height: | Size: 198 KiB After Width: | Height: | Size: 197 KiB |
Binary file not shown.
Binary file not shown.
@ -35,7 +35,13 @@
|
||||
<!-- End of menu -->
|
||||
<!-- Content -->
|
||||
<div id="page-wrapper">
|
||||
<div id="content">
|
||||
{% block body %}{% endblock %}
|
||||
</div>
|
||||
<div class="row">
|
||||
<div id="minimized" class="col-lg-12">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End of content -->
|
||||
</div>
|
||||
@ -101,10 +107,24 @@
|
||||
});
|
||||
</script>
|
||||
{% block js %}{% endblock %}
|
||||
<!-- templates -->
|
||||
{% js_template_path 'uds/admin/tmpl' %}
|
||||
<!-- preloading of templates -->
|
||||
<!-- page contents -->
|
||||
{% js_template 'dashboard' %}
|
||||
{% js_template 'authenticators' %}
|
||||
<!-- components -->
|
||||
{% js_template 'table' %}
|
||||
{% js_template 'modal' %}
|
||||
<!-- fields -->
|
||||
{% js_template 'fld/checkbox' %}
|
||||
{% js_template 'fld/choice' %}
|
||||
{% js_template 'fld/editlist' %}
|
||||
{% js_template 'fld/hidden' %}
|
||||
{% js_template 'fld/multichoice' %}
|
||||
{% js_template 'fld/numeric' %}
|
||||
{% js_template 'fld/password' %}
|
||||
{% js_template 'fld/text' %}
|
||||
{% js_template 'fld/textbox' %}
|
||||
|
||||
</body>
|
||||
</html>
|
@ -9,10 +9,11 @@
|
||||
</div>
|
||||
</div><!-- /.row -->
|
||||
<div class="row">
|
||||
<div id="<%= auths %>" class="col-xs-12">
|
||||
</div>
|
||||
<div id="<%= auths %>" class="col-xs-12"></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div id="<%= users %>" class="col-xs-12">
|
||||
</div>
|
||||
<div id="<%= groups %>" class="col-xs-12"></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div id="<%= users %>" class="col-xs-12"></div>
|
||||
</div>
|
||||
|
6
server/src/uds/templates/uds/admin/tmpl/fld/numeric.html
Normal file
6
server/src/uds/templates/uds/admin/tmpl/fld/numeric.html
Normal file
@ -0,0 +1,6 @@
|
||||
<div class="form-group">
|
||||
<label for="<%= name %>_field" class="col-sm-3 control-label"><%= label %></label>
|
||||
<div class="col-sm-9">
|
||||
<input type="numeric" class="form-control" id="<%= name %>_field" placeholder="<%= tooltip %>">
|
||||
</div>
|
||||
</div>
|
6
server/src/uds/templates/uds/admin/tmpl/fld/text.html
Normal file
6
server/src/uds/templates/uds/admin/tmpl/fld/text.html
Normal file
@ -0,0 +1,6 @@
|
||||
<div class="form-group">
|
||||
<label for="<%= name %>_field" class="col-sm-3 control-label"><%= label %></label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" id="<%= name %>_field" placeholder="<%= tooltip %>">
|
||||
</div>
|
||||
</div>
|
17
server/src/uds/templates/uds/admin/tmpl/modal.html
Normal file
17
server/src/uds/templates/uds/admin/tmpl/modal.html
Normal file
@ -0,0 +1,17 @@
|
||||
{% load i18n %}
|
||||
<div id="<%= id %>" class="modal fade">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title"><%= title %></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<%= content %>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{% trans 'Close' %}</button>
|
||||
<button type="button" class="btn btn-primary">{% trans 'Save' %}</button>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
|
@ -1,16 +1,15 @@
|
||||
<div class="panel panel-primary" id="<%= panelId %>">
|
||||
<div class="panel panel-primary" id="<%= panelId %>" data-minimized="<%= title %>">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><span class="fa fa-<%= icon %>"></span> <%= title %>
|
||||
<span class="panel-icon fa fa-dot-circle-o pull-right"
|
||||
onclick="$('#<%= panelId %>').remove();"> </span>
|
||||
onclick="gui.minimizePanel('#<%= panelId %>');"> </span>
|
||||
<span class="panel-icon fa chevron pull-right" data-toggle="collapse"
|
||||
data-target="#<%= panelId %> div.panel-body"> </span>
|
||||
data-target="#<%= panelId %> > div.panel-body"> </span>
|
||||
<span class="panel-icon fa fa-refresh pull-right"> </span>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="panel-body collapse in">
|
||||
<table class="table table-striped table-bordered table-hover" id="<%= table_id %>"
|
||||
border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<table class="table table-striped table-bordered table-hover" id="<%= table_id %>">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -60,6 +60,6 @@ def js_template_path(context, path):
|
||||
|
||||
@register.simple_tag(name='js_template', takes_context=True)
|
||||
def js_template(context, template_name, template_id = None):
|
||||
template_id = template_id or 'tmpl_' + template_name
|
||||
template_id = (template_id or 'tmpl_' + template_name).replace('/', '_')
|
||||
tmpl = template.loader.get_template(context['template_path'] + '/' + template_name + '.html')
|
||||
return '<script id="{0}" type="text/html">\n'.format(template_id) + tmpl.render(context) + '\n</script>'
|
||||
|
Loading…
Reference in New Issue
Block a user