diff --git a/server/src/uds/core/managers/UserPrefsManager.py b/server/src/uds/core/managers/UserPrefsManager.py index ee77b473a..98c22dc2e 100644 --- a/server/src/uds/core/managers/UserPrefsManager.py +++ b/server/src/uds/core/managers/UserPrefsManager.py @@ -151,6 +151,7 @@ class UserPreference(object): self._name = kwargs['name'] self._label = kwargs['label'] self._defValue = kwargs['defvalue'] if kwargs.has_key('defvalue') else None + self._css = 'form-control' def getName(self): return self._name @@ -177,7 +178,7 @@ class UserTextPreference(UserPreference): self._length = kwargs['length'] if kwargs.has_key('length') else None def formField(self, value): - return forms.CharField(label = _(self._label), initial = value) + return forms.CharField(label = _(self._label), initial = value, attrs = {'class': self._css}) class UserNumericPreference(UserPreference): @@ -188,7 +189,8 @@ class UserNumericPreference(UserPreference): self._max = kwargs['maxvalue'] if kwargs.has_key('maxvalue') else None def formField(self, value): - return forms.IntegerField(label = _(self._label), initial = value, min_value = self._min, max_value = self._max) + return forms.IntegerField(label = _(self._label), initial = value, min_value = self._min, max_value = self._max, + widget = forms.TextInput(attrs = {'class': self._css})) class UserChoicePreference(UserPreference): TYPE = 'choice' @@ -200,7 +202,8 @@ class UserChoicePreference(UserPreference): self._values = kwargs['values'] def formField(self, value): - return forms.ChoiceField(label = _(self._label), initial = value, choices = self._values) + return forms.ChoiceField(label = _(self._label), initial = value, choices = self._values, + widget = forms.Select(attrs = {'class': self._css})) def guiField(self, value): vals = [] diff --git a/server/src/uds/static/css/uds-html5.css b/server/src/uds/static/css/uds-html5.css index 64e6440d0..c2fe2401f 100644 --- a/server/src/uds/static/css/uds-html5.css +++ b/server/src/uds/static/css/uds-html5.css @@ -95,3 +95,30 @@ footer { display: block; } +/* Preferences form */ +.form-preferences { + margin-bottom: 10px; + max-width: 640px; + margin: 0 auto; +} + +.form-preferences legend { + margin-top: 20px; + padding-left: 16px; + background-color: #f7f7f7; + -moz-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3); + -webkit-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3); + box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3); + } + +.form-preferences .prefset { + padding: 10px; + background-color: #f7f7f7; + -moz-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3); + -webkit-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3); + box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3); +} + +.form-preferences .btn { + margin-top: 16px; +} \ No newline at end of file diff --git a/server/src/uds/web/views.py b/server/src/uds/web/views.py index a56403448..4faec71ef 100644 --- a/server/src/uds/web/views.py +++ b/server/src/uds/web/views.py @@ -195,7 +195,7 @@ def index(request): logger.debug('Services: {0}'.format(services)) - services = sorted(services, key=lambda s: s['name']) + services = sorted(services, key=lambda s: s['name'].upper()) if len(services) == 1 and GlobalConfig.AUTORUN_SERVICE.get(True) == '1' and len(services[0]['transports']) > 0: if request.session.get('autorunDone', '0') == '0': @@ -220,7 +220,7 @@ def prefs(request): UserPrefsManager.manager().processRequestForUserPreferences(request.user, request.POST) return HttpResponseRedirect(reverse('uds.web.views.index')) prefs_form = UserPrefsManager().manager().getHtmlForUserPreferences(request.user) - return render_to_response('uds/prefs.html', {'prefs_form' : prefs_form }, context_instance=RequestContext(request)) + return render_to_response(theme.template('prefs.html'), {'prefs_form' : prefs_form }, context_instance=RequestContext(request)) @webLoginRequired