Merge pull request #1799 from emanuelschuetze/loginText

Show info text in login form (Fixes #1754)
This commit is contained in:
Norman Jäckel 2016-01-09 16:07:55 +01:00
commit 68ec516e6f
8 changed files with 52 additions and 48 deletions

View File

@ -38,7 +38,7 @@ Other:
for generic Django REST Framework views in OpenSlides apps.
- Removed most of the Django views and templates.
- Removed Django error pages.
- Added page for legal notes.
- Added page for legal notice.
- Refactored projector API using metaclasses now.
- Renamed SignalConnectMetaClass classmethod get_all_objects to get_all
(private API).

View File

@ -64,13 +64,36 @@ def setup_general_config(sender, **kwargs):
subgroup=ugettext_lazy('Event'))
yield ConfigVariable(
name='general_event_legal_notes',
default_value='',
name='general_event_legal_notice',
default_value=_(
'<a href="http://www.openslides.org">OpenSlides</a> is a free web based '
'presentation and assembly system for visualizing and controlling agenda, '
'motions and elections of an assembly.'),
input_type='text',
label=ugettext_lazy('Legal notes'),
label=ugettext_lazy('Legal notice'),
weight=132,
group=ugettext_lazy('General'),
subgroup=ugettext_lazy('Event'))
subgroup=ugettext_lazy('Event'),
translatable=True)
yield ConfigVariable(
name='general_event_welcome_title',
default_value=_('Welcome to OpenSlides'),
label=ugettext_lazy('Front page title'),
weight=134,
group=ugettext_lazy('General'),
subgroup=ugettext_lazy('Event'),
translatable=True)
yield ConfigVariable(
name='general_event_welcome_text',
default_value=_('[Space for your welcome text.]'),
input_type='text',
label=ugettext_lazy('Front page text'),
weight=136,
group=ugettext_lazy('General'),
subgroup=ugettext_lazy('Event'),
translatable=True)
# General System
@ -79,7 +102,7 @@ def setup_general_config(sender, **kwargs):
default_value=False,
input_type='boolean',
label=ugettext_lazy('Allow access for anonymous guest users'),
weight=135,
weight=138,
group=ugettext_lazy('General'),
subgroup=ugettext_lazy('System'))
@ -136,23 +159,6 @@ def setup_general_config(sender, **kwargs):
weight=170,
group=ugettext_lazy('Projector'))
yield ConfigVariable(
name='projector_welcome_title',
default_value=_('Welcome to OpenSlides'),
label=ugettext_lazy('Title'),
help_text=ugettext_lazy('Also used for the default welcome slide.'),
weight=175,
group=ugettext_lazy('Projector'),
translatable=True)
yield ConfigVariable(
name='projector_welcome_text',
default_value=_('[Space for your welcome text.]'),
label=ugettext_lazy('Welcome text'),
weight=180,
group=ugettext_lazy('Projector'),
translatable=True)
yield ConfigVariable(
name='projector_default_countdown',
default_value=60,

View File

@ -205,10 +205,10 @@ angular.module('OpenSlidesApp.core.site', [
abstract: true,
template: "<ui-view/>",
})
// version
.state('version', {
url: '/version',
controller: 'VersionCtrl',
// legal notice and version
.state('legalnotice', {
url: '/legalnotice',
controller: 'LegalNoticeCtrl',
})
//config
.state('config', {
@ -425,8 +425,8 @@ angular.module('OpenSlidesApp.core.site', [
}
])
// Version Controller
.controller('VersionCtrl', [
// Legal Notice Controller
.controller('LegalNoticeCtrl', [
'$scope',
'$http',
function ($scope, $http) {

View File

@ -6,6 +6,7 @@
type="{{ type }}" class="form-control">
<textarea ng-if="type == 'textarea'" ng-model="value" ng-change="save(configOption.key, value)" id="{{ key }}" class="form-control">
</textarea>
<select ng-if="type == 'choice'" ng-model="value" ng-change="save(configOption.key, value)" id="{{ key }}"
class="form-control" ng-options="option.value as option.display_name for option in choices">

View File

@ -1,9 +1,7 @@
<div class="header">
<div class="title">
<h1>{{ config('projector_welcome_title') }}</h1>
<h1>{{ config('general_event_welcome_title') }}</h1>
</div>
</div>
<div class="details">
{{ config('projector_welcome_text') }}
</div>
<div class="details" ng-bind-html="config('general_event_welcome_text')"></div>

View File

@ -143,7 +143,7 @@
<!-- footer -->
<div id="footer">
&copy; Copyright by <a href="http://www.openslides.org" target="_blank">OpenSlides</a> |
<a ui-sref="version">Version</a>
<a ui-sref="legalnotice" translate>Legal notice</a>
</div><!--end footer-->
</div>
<div class="col2" os-perms="core.can_see_projector"

View File

@ -1,16 +1,13 @@
<div class="header">
<div class="title">
<h1 translate>Legal Notes and Version</h1>
<h1 translate>Legal Notice</h1>
</div>
</div>
<div class="details">
<p class="lead" translate>Legal Notes</p>
{{ config('general_event_legal_notes') }}
</div>
<div class="details">
<p class="lead">OpenSlides {{ core_version }}
<div ng-bind-html="config('general_event_legal_notice')"></div>
<hr>
<p>OpenSlides {{ core_version }}
<div ng-show="plugins.length">
<p translate>Installed plugins:</p>
<ol>

View File

@ -829,13 +829,15 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
function ($scope, $http, $stateParams, operator, gettextCatalog, Config) {
$scope.alerts = [];
// TODO: add welcome message only on first time (or if admin password not changed)
// get login info-text from server
$http.get('/users/login/').success(function(data) {
if(data.info_text) {
$scope.alerts.push({
type: 'success',
msg: gettextCatalog.getString("Installation was successfully.") + "<br>" +
gettextCatalog.getString("Use <strong>admin</strong> and <strong>admin</strong> for first login.") + "<br>" +
gettextCatalog.getString("Important: Please change your password!")
msg: data.info_text
});
}
})
// close alert function
$scope.closeAlert = function(index) {
$scope.alerts.splice(index, 1);