-
+
-
- –
- {{ item.item_number }} {{ item.getTitle() }}
+
+
+
+
+ –
+ {{ item.getTitle() }}
+
+
{{ item.comment }}
-
+
+
{{ item.duration }}
h
-
-
+
+
+
+
+
diff --git a/openslides/core/static/css/app.css b/openslides/core/static/css/app.css
index 3e030c968..e1323a1f6 100644
--- a/openslides/core/static/css/app.css
+++ b/openslides/core/static/css/app.css
@@ -61,8 +61,8 @@ body {
.hiddenDiv {
visibility: hidden;
}
-/* override bootstraps's progress bar for poll results*/
-.progress {
+/* override bootstraps's progress bar for poll results */
+.pollresults .progress {
height: 12px;
margin-bottom: 0;
}
@@ -70,6 +70,31 @@ body {
.result_label {
margin-top: 5px;
}
+/* background colors for table rows */
+tr.offline td, li.offline {
+ background-color: #EAEAEA !important;
+}
+tr.hiddenrow td {
+ background-color: #e5e5e5;
+}
+tr.activeline td, li.activeline, .projected {
+ background-color: #bed4de;
+}
+tr.selected td {
+ background-color: #ff9999;
+}
+
+/* override ngdialog-theme-default */
+.ngdialog.ngdialog-theme-default {
+ padding-top: 50px;
+}
+.ngdialog.ngdialog-theme-default.wide-form .ngdialog-content {
+ width: 650px;
+}
+.ngdialog h2 {
+ margin-top: 5px;
+ margin-bottom: 20px;
+}
.inline {
display: inline;
@@ -253,15 +278,7 @@ div.import > div > input[type="text"] {
}
-tr.offline td, li.offline {
- background-color: #EAEAEA !important;
-}
-tr.activeline td, li.activeline, .projected {
- background-color: #bed4de;
-}
-tr.selected td {
- background-color: #ff9999;
-}
+
.nopadding {
padding: 0;
}
diff --git a/openslides/core/static/js/core/base.js b/openslides/core/static/js/core/base.js
index 9e86c1ca5..93513afd9 100644
--- a/openslides/core/static/js/core/base.js
+++ b/openslides/core/static/js/core/base.js
@@ -8,6 +8,7 @@ angular.module('OpenSlidesApp.core', [
'js-data',
'gettext',
'ngAnimate',
+ 'ngSanitize', // TODO: only use this in functions that need it.
'ui.bootstrap',
'ui.tree',
'uiSwitch',
diff --git a/openslides/core/static/js/core/site.js b/openslides/core/static/js/core/site.js
index 97c812706..c289bd1ac 100644
--- a/openslides/core/static/js/core/site.js
+++ b/openslides/core/static/js/core/site.js
@@ -9,9 +9,9 @@ angular.module('OpenSlidesApp.core.site', [
'formly',
'formlyBootstrap',
'ngBootbox',
+ 'ngDialog',
'ngMessages',
'ngCsvImport',
- 'ngSanitize', // TODO: only use this in functions that need it.
'ui.select',
'luegg.directives',
'xeditable',
@@ -220,14 +220,6 @@ angular.module('OpenSlidesApp.core.site', [
abstract: true,
template: " ",
})
- .state('core.customslide.list', {
- resolve: {
- customslides: function(Customslide) {
- return Customslide.findAll();
- }
- }
- })
- .state('core.customslide.create', {})
.state('core.customslide.detail', {
resolve: {
customslide: function(Customslide, $stateParams) {
@@ -235,11 +227,6 @@ angular.module('OpenSlidesApp.core.site', [
}
}
})
- .state('core.customslide.detail.update', {
- views: {
- '@core.customslide': {}
- }
- })
// tag
.state('core.tag', {
url: '/tag',
@@ -369,46 +356,6 @@ angular.module('OpenSlidesApp.core.site', [
};
})
-.controller("LoginFormCtrl", function ($scope, $modal) {
- $scope.open = function () {
- var modalInstance = $modal.open({
- animation: true,
- templateUrl: 'LoginForm.html',
- controller: 'LoginFormModalCtrl',
- size: 'sm',
- });
- };
-})
-
-.controller('LoginFormModalCtrl', [
- '$scope',
- '$modalInstance',
- '$http',
- 'operator',
- function ($scope, $modalInstance, $http, operator) {
- $scope.login = function () {
- $http.post(
- '/users/login/',
- {'username': $scope.username, 'password': $scope.password}
- ).success(function(data) {
- if (data.success) {
- operator.setUser(data.user_id);
- $scope.loginFailed = false;
- $modalInstance.close();
- } else {
- $scope.loginFailed = true;
- }
- });
- };
- $scope.guest = function () {
- $modalInstance.dismiss('cancel');
- };
- $scope.cancel = function () {
- $modalInstance.dismiss('cancel');
- };
- }
-])
-
// Version Controller
.controller('VersionCtrl', [
'$scope',
@@ -433,37 +380,33 @@ angular.module('OpenSlidesApp.core.site', [
};
})
-// Customslide Controller
-.controller('CustomslideListCtrl', [
- '$scope',
- '$http',
- 'Customslide',
- function($scope, $http, Customslide) {
- Customslide.bindAll({}, $scope, 'customslides');
- // setup table sorting
- $scope.sortColumn = 'title';
- $scope.reverse = false;
- // function to sort by clicked column
- $scope.toggleSort = function ( column ) {
- if ( $scope.sortColumn === column ) {
- $scope.reverse = !$scope.reverse;
+// Provide generic motion form fields for create and update view
+.factory('CustomslideFormFieldFactory', [
+ 'gettext',
+ 'CKEditorOptions',
+ function (gettext, CKEditorOptions) {
+ return {
+ getFormFields: function () {
+ return [
+ {
+ key: 'title',
+ type: 'input',
+ templateOptions: {
+ label: gettext('Title'),
+ required: true
+ }
+ },
+ {
+ key: 'text',
+ type: 'textarea',
+ templateOptions: {
+ label: gettext('Text')
+ },
+ ngModelElAttrs: {'ckeditor': 'CKEditorOptions'}
+ }];
}
- $scope.sortColumn = column;
- };
-
- // save changed customslide
- $scope.save = function (customslide) {
- Customslide.save(customslide);
- };
- $scope.delete = function (customslide) {
- //TODO: add confirm message
- Customslide.destroy(customslide.id).then(
- function(success) {
- //TODO: success message
- }
- );
- };
+ }
}
])
@@ -660,6 +603,7 @@ angular.module('OpenSlidesApp.core.site', [
}
])
+// Customslide Controllers
.controller('CustomslideDetailCtrl', function($scope, Customslide, customslide) {
Customslide.bindOne(customslide.id, $scope, 'customslide');
Customslide.loadRelations(customslide, 'agenda_item');
@@ -668,15 +612,18 @@ angular.module('OpenSlidesApp.core.site', [
.controller('CustomslideCreateCtrl', [
'$scope',
'$state',
- 'CKEditorOptions',
'Customslide',
- function($scope, $state, CKEditorOptions, Customslide) {
+ 'CustomslideFormFieldFactory',
+ function($scope, $state, Customslide, CustomslideFormFieldFactory) {
$scope.customslide = {};
- $scope.CKEditorOptions = CKEditorOptions;
+ // get all form fields
+ $scope.formFields = CustomslideFormFieldFactory.getFormFields();
+
+ // save form
$scope.save = function (customslide) {
Customslide.create(customslide).then(
function(success) {
- $state.go('core.customslide.list');
+ $scope.closeThisDialog();
}
);
};
@@ -686,16 +633,20 @@ angular.module('OpenSlidesApp.core.site', [
.controller('CustomslideUpdateCtrl', [
'$scope',
'$state',
- 'CKEditorOptions',
'Customslide',
+ 'CustomslideFormFieldFactory',
'customslide',
- function($scope, $state, CKEditorOptions, Customslide, customslide) {
- $scope.customslide = customslide;
- $scope.CKEditorOptions = CKEditorOptions;
+ function($scope, $state, Customslide, CustomslideFormFieldFactory, customslide) {
+ // set initial values for form model
+ $scope.model = customslide;
+ // get all form fields
+ $scope.formFields = CustomslideFormFieldFactory.getFormFields();
+
+ // save form
$scope.save = function (customslide) {
Customslide.save(customslide).then(
function(success) {
- $state.go('core.customslide.list');
+ $scope.closeThisDialog();
}
);
};
@@ -791,10 +742,12 @@ angular.module('OpenSlidesApp.core.site', [
// increment unread messages counter for each new message
$scope.$watch('chatmessages', function (newVal, oldVal) {
// add new message id if there is really a new message which is not yet tracked
- if ((oldVal[oldVal.length-1].id != newVal[newVal.length-1].id) &&
- ($.inArray(newVal[newVal.length-1].id, NewChatMessages) == -1)) {
- NewChatMessages.push(newVal[newVal.length-1].id);
- $scope.unreadMessages = NewChatMessages.length;
+ if (oldVal.length > 0) {
+ if ((oldVal[oldVal.length-1].id != newVal[newVal.length-1].id) &&
+ ($.inArray(newVal[newVal.length-1].id, NewChatMessages) == -1)) {
+ NewChatMessages.push(newVal[newVal.length-1].id);
+ $scope.unreadMessages = NewChatMessages.length;
+ }
}
})
}
diff --git a/openslides/core/static/templates/core/customslide-detail.html b/openslides/core/static/templates/core/customslide-detail.html
index 4c8e2f58a..250e51cfd 100644
--- a/openslides/core/static/templates/core/customslide-detail.html
+++ b/openslides/core/static/templates/core/customslide-detail.html
@@ -1,24 +1,23 @@
{{ customslide.title }}
-{{ customslide.agenda_item }}
-
-{{ customslide.text }}
+
diff --git a/openslides/core/static/templates/core/customslide-form.html b/openslides/core/static/templates/core/customslide-form.html
index 26dcfee16..16726d4a1 100644
--- a/openslides/core/static/templates/core/customslide-form.html
+++ b/openslides/core/static/templates/core/customslide-form.html
@@ -1,27 +1,13 @@
-Edit custom slide
-New custom slide
+Edit agenda item
+New agenda item
-
-
-
diff --git a/openslides/core/static/templates/core/login-form.html b/openslides/core/static/templates/core/login-form.html
new file mode 100644
index 000000000..a2e9f45c2
--- /dev/null
+++ b/openslides/core/static/templates/core/login-form.html
@@ -0,0 +1,28 @@
+
diff --git a/openslides/core/static/templates/core/slide_customslide.html b/openslides/core/static/templates/core/slide_customslide.html
index 4b6d20a8f..47237a810 100644
--- a/openslides/core/static/templates/core/slide_customslide.html
+++ b/openslides/core/static/templates/core/slide_customslide.html
@@ -1,4 +1,4 @@
{{ customslide.title }}
-
{{ customslide.text }}
+
diff --git a/openslides/core/static/templates/index.html b/openslides/core/static/templates/index.html
index ef34563a6..1f247198e 100644
--- a/openslides/core/static/templates/index.html
+++ b/openslides/core/static/templates/index.html
@@ -22,6 +22,7 @@
-
-
-
-
-
+
+
+
Login
@@ -173,13 +136,18 @@
-
diff --git a/openslides/motions/static/js/motions/site.js b/openslides/motions/static/js/motions/site.js
index 6d417d882..98a7ed730 100644
--- a/openslides/motions/static/js/motions/site.js
+++ b/openslides/motions/static/js/motions/site.js
@@ -180,14 +180,6 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions'])
});
});
- // hover edit actions
- $scope.hoverIn = function () {
- $scope.showEditActions = true;
- };
- $scope.hoverOut = function () {
- $scope.showEditActions = false;
- };
-
// save changed motion
$scope.update = function (motion) {
// get (unchanged) values from latest version for update method
diff --git a/openslides/motions/static/templates/motions/motion-detail.html b/openslides/motions/static/templates/motions/motion-detail.html
index 214ecc1d5..f62a6ee1e 100644
--- a/openslides/motions/static/templates/motions/motion-detail.html
+++ b/openslides/motions/static/templates/motions/motion-detail.html
@@ -17,6 +17,11 @@
PDF
+
+
+
+ List of speakers
+
-
+
diff --git a/openslides/users/static/js/users/site.js b/openslides/users/static/js/users/site.js
index 54feba1c6..4c6906db2 100644
--- a/openslides/users/static/js/users/site.js
+++ b/openslides/users/static/js/users/site.js
@@ -563,7 +563,8 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
'DS',
'User',
'operator',
- function($scope, $http, DS, User, operator) {
+ 'ngDialog',
+ function($scope, $http, DS, User, operator, ngDialog) {
$scope.logout = function() {
$http.post('/users/logout/').success(function(data) {
operator.setUser(null);
@@ -571,6 +572,59 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
// DS.flush();
});
};
+ $scope.openLoginForm = function () {
+ ngDialog.open({
+ template: 'static/templates/core/login-form.html',
+ controller: 'LoginFormCtrl',
+ });
+ };
+ }
+])
+
+.controller('LoginFormCtrl', [
+ '$scope',
+ '$http',
+ 'operator',
+ 'gettext',
+ 'Config',
+ function ($scope, $http, operator, gettext, Config) {
+ $scope.alerts = [];
+
+ // TODO: add welcome message only on first time (or if admin password not changed)
+ $scope.alerts.push({
+ type: 'success',
+ msg: gettext("Installation was successfully.") + "
" +
+ gettext("Use
admin and
admin for first login.") + "
" +
+ gettext("Important: Please change your password!")
+ });
+ // close alert function
+ $scope.closeAlert = function(index) {
+ $scope.alerts.splice(index, 1);
+ };
+ // check if guest login is allowed
+ $scope.guestAllowed = true; //TODO Config.get('general_system_enable_anonymous').value;
+ // login
+ $scope.login = function () {
+ $http.post(
+ '/users/login/',
+ {'username': $scope.username, 'password': $scope.password}
+ ).success(function(data) {
+ if (data.success) {
+ operator.setUser(data.user_id);
+ $scope.closeThisDialog();
+ } else {
+ $scope.alerts.push({
+ type: 'danger',
+ msg: gettext('Username or password was not correct.')
+ });
+ //Username or password is not correct.
+ }
+ });
+ };
+ // guest login
+ $scope.guestLogin = function () {
+ $scope.closeThisDialog();
+ };
}
]);