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. for generic Django REST Framework views in OpenSlides apps.
- Removed most of the Django views and templates. - Removed most of the Django views and templates.
- Removed Django error pages. - Removed Django error pages.
- Added page for legal notes. - Added page for legal notice.
- Refactored projector API using metaclasses now. - Refactored projector API using metaclasses now.
- Renamed SignalConnectMetaClass classmethod get_all_objects to get_all - Renamed SignalConnectMetaClass classmethod get_all_objects to get_all
(private API). (private API).

View File

@ -64,13 +64,36 @@ def setup_general_config(sender, **kwargs):
subgroup=ugettext_lazy('Event')) subgroup=ugettext_lazy('Event'))
yield ConfigVariable( yield ConfigVariable(
name='general_event_legal_notes', name='general_event_legal_notice',
default_value='', 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', input_type='text',
label=ugettext_lazy('Legal notes'), label=ugettext_lazy('Legal notice'),
weight=132, weight=132,
group=ugettext_lazy('General'), 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 # General System
@ -79,7 +102,7 @@ def setup_general_config(sender, **kwargs):
default_value=False, default_value=False,
input_type='boolean', input_type='boolean',
label=ugettext_lazy('Allow access for anonymous guest users'), label=ugettext_lazy('Allow access for anonymous guest users'),
weight=135, weight=138,
group=ugettext_lazy('General'), group=ugettext_lazy('General'),
subgroup=ugettext_lazy('System')) subgroup=ugettext_lazy('System'))
@ -136,23 +159,6 @@ def setup_general_config(sender, **kwargs):
weight=170, weight=170,
group=ugettext_lazy('Projector')) 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( yield ConfigVariable(
name='projector_default_countdown', name='projector_default_countdown',
default_value=60, default_value=60,

View File

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

View File

@ -6,6 +6,7 @@
type="{{ type }}" class="form-control"> 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 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 }}" <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"> 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="header">
<div class="title"> <div class="title">
<h1>{{ config('projector_welcome_title') }}</h1> <h1>{{ config('general_event_welcome_title') }}</h1>
</div> </div>
</div> </div>
<div class="details"> <div class="details" ng-bind-html="config('general_event_welcome_text')"></div>
{{ config('projector_welcome_text') }}
</div>

View File

@ -143,7 +143,7 @@
<!-- footer --> <!-- footer -->
<div id="footer"> <div id="footer">
&copy; Copyright by <a href="http://www.openslides.org" target="_blank">OpenSlides</a> | &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><!--end footer-->
</div> </div>
<div class="col2" os-perms="core.can_see_projector" <div class="col2" os-perms="core.can_see_projector"

View File

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

View File

@ -829,13 +829,15 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
function ($scope, $http, $stateParams, operator, gettextCatalog, Config) { function ($scope, $http, $stateParams, operator, gettextCatalog, Config) {
$scope.alerts = []; $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({ $scope.alerts.push({
type: 'success', type: 'success',
msg: gettextCatalog.getString("Installation was successfully.") + "<br>" + msg: data.info_text
gettextCatalog.getString("Use <strong>admin</strong> and <strong>admin</strong> for first login.") + "<br>" +
gettextCatalog.getString("Important: Please change your password!")
}); });
}
})
// close alert function // close alert function
$scope.closeAlert = function(index) { $scope.closeAlert = function(index) {
$scope.alerts.splice(index, 1); $scope.alerts.splice(index, 1);