Several important fixes for beta4

- Fix socket error in autoupdate (Check if socket exists)
- Add missing translation string for core permission
- Fix KeyError in extract_default_password function in users/views.py
- Improve Pagination. Fix users list for users without can_see_extra_data permissions.
- Limit the number of users in ui-select field
- Fix csv header names in users import help text.
- Use config options (enable logo/title) on projector.
- Nicer font style for main and sub items on agenda slide.
- Fix JS error if this.groups is undefined for anonymous.
This commit is contained in:
Emanuel Schuetze 2016-02-17 13:46:20 +01:00
parent 956bba9a13
commit 84ea0bf1f5
17 changed files with 65 additions and 27 deletions

View File

@ -216,6 +216,10 @@ angular.module('OpenSlidesApp.agenda.site', ['OpenSlidesApp.agenda'])
$scope.speakerSelectBox = {};
$scope.alert = {};
$scope.speakers = $filter('orderBy')(item.speakers, 'weight');
// limit the number of users in ui-select field
$scope.limitUsers = 50;
$scope.$watch(function () {
return Agenda.lastModified();
}, function () {

View File

@ -135,7 +135,7 @@
<ui-select-match placeholder="{{ 'Select or search a participant ...' | translate }}">
{{ $select.selected.get_full_name() }}
</ui-select-match>
<ui-select-choices repeat="user in users | filter: $select.search">
<ui-select-choices repeat="user in users | filter: $select.search | limitTo: limitUsers">
<div ng-bind-html="user.get_full_name() | highlight: $select.search"></div>
</ui-select-choices>
</ui-select>

View File

@ -203,5 +203,8 @@
<a href="" ng-click="editDialog(item)" class="pull-right"><translate>Edit ...</translate></a>
</div>
</table>
<uib-pagination total-items="itemsFiltered.length" items-per-page="itemsPerPage" ng-model="currentPage" ng-change="pageChanged()"></uib-pagination>
<uib-pagination ng-if="itemsFiltered.length > itemsPerPage" total-items="itemsFiltered.length" items-per-page="itemsPerPage" ng-model="currentPage"
ng-change="pageChanged()"
class="pagination-sm" direction-links="false" boundary-links="true" first-text="&laquo;" last-text="&raquo;">
</uib-pagination>
</div>

View File

@ -18,12 +18,14 @@
<li ng-repeat="item in items" ui-tree-node ng-include="'nodes_renderer.html'">
</ol>
</div>
<p class="spacer">* <translate>Internal item</translate</p>
</div>
<!-- Nested node template -->
<script type="text/ng-template" id="nodes_renderer.html">
<div ui-tree-handle>
<span ng-if="item.item.is_hidden">*</span>
{{ item.item.getTitle() }}
</div>
<ol ui-tree-nodes="" ng-model="item.children">

View File

@ -3,8 +3,9 @@
<div class="agendalist">
<!-- item type: AGENDA_ITEM = 1, HIDDEN_ITEM = 2 -->
<p ng-repeat="item in items | filter: {type: 1}" ng-class="{ 'spacer-top': !item.parent_id }">
<span ng-repeat="n in [].constructor(item.parentCount) track by $index">&nbsp;&nbsp;</span>
<p ng-repeat="item in items | filter: {type: 1}"
ng-class="item.parent_id ? 'subitem' : 'mainitem'">
<span ng-repeat="n in [].constructor(item.parentCount) track by $index">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
{{ item.getListViewTitle() }}
<i ng-if="item.closed" class="fa fa-check"></i>
</p>

View File

@ -278,6 +278,9 @@ angular.module('OpenSlidesApp.assignments.site', ['OpenSlidesApp.assignments'])
$scope.phases = phases;
$scope.alert = {};
// limit the number of users in ui-select field
$scope.limitUsers = 50;
// open edit dialog
$scope.openDialog = function (assignment) {
ngDialog.open(AssignmentForm.getDialog(assignment));

View File

@ -95,7 +95,7 @@
<ui-select-match placeholder="{{ 'Select or search a participant ...' | translate }}">
{{ $select.selected.get_full_name() }}
</ui-select-match>
<ui-select-choices repeat="user in users | filter: $select.search">
<ui-select-choices repeat="user in users | filter: $select.search | limitTo: limitUsers">
<div ng-bind-html="user.get_full_name() | highlight: $select.search"></div>
</ui-select-choices>
</ui-select>

View File

@ -23,12 +23,12 @@ body{
left: 50px;
top: 10px;
height: 50px;
margin-right: 35px;
margin-right: 25px;
float: left;
}
#eventdata {
position: relative;
left: 30px;
left: 50px;
top: 12px;
height: 50px;
overflow: hidden;
@ -297,12 +297,17 @@ tr.elected td {
.agendalist p {
font-size: 140%;
}
.agendalist .mainitem {
margin-top: 25px;
}
.agendalist .subitem {
font-size: 100%;
margin-bottom: 4px;
}
.spacer {
margin-top: 10px;
}
.spacer-top {
margin-top: 25px;
}
/*** List of speakers ***/
.slimlabel.label {

View File

@ -49,8 +49,10 @@ angular.module('OpenSlidesApp.core', [
this.messageReceivers.push(receiver);
},
reconnect: function () {
if (socket) {
socket.close();
}
}
};
var newConnect = function () {
socket = new SockJS(location.origin + "/sockjs");

View File

@ -19,8 +19,8 @@
<div id="header">
<img id="logo" src="/static/img/logo-projector.png" alt="OpenSlides" />
<div id="eventdata">
<img ng-if="config('projector_enable_logo')" id="logo" src="/static/img/logo-projector.png" alt="OpenSlides" />
<div ng-if="config('projector_enable_title')" id="eventdata">
<div class="title">
{{ config('general_event_name') }}
</div>

View File

@ -28,7 +28,7 @@
<ui-select-match placeholder="{{ 'Select or search a participant ...' | translate }}" data-allow-clear="true">
{{ $select.selected.get_full_name() }}
</ui-select-match>
<ui-select-choices repeat="user.id as user in users | filter: $select.search">
<ui-select-choices repeat="user.id as user in users | filter: $select.search | limitTo: 50">
<div ng-bind-html="user.get_full_name() | highlight: $select.search"></div>
</ui-select-choices>
</ui-select>

View File

@ -207,7 +207,7 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions'])
label: gettextCatalog.getString('Submitters'),
optionsAttr: 'bs-options',
options: User.getAll(),
ngOptions: 'option[to.valueProp] as option in to.options | filter: $select.search',
ngOptions: 'option[to.valueProp] as option in to.options | filter: $select.search | limitTo: 50',
valueProp: 'id',
labelProp: 'full_name',
placeholder: gettextCatalog.getString('Select or search a submitter ...')
@ -318,7 +318,7 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions'])
label: gettextCatalog.getString('Supporters'),
optionsAttr: 'bs-options',
options: User.getAll(),
ngOptions: 'option[to.valueProp] as option in to.options | filter: $select.search',
ngOptions: 'option[to.valueProp] as option in to.options | filter: $select.search | limitTo: 50',
valueProp: 'id',
labelProp: 'full_name',
placeholder: gettextCatalog.getString('Select or search a supporter ...')

View File

@ -121,7 +121,10 @@ angular.module('OpenSlidesApp.users', [])
},
getPerms: function() {
var allPerms = [];
var allGroups = this.groups.slice(0);
var allGroups = [];
if (this.groups) {
allGroups = this.groups.slice(0);
}
// Add registered group
allGroups.push(2);
_.forEach(allGroups, function(groupId) {

View File

@ -912,7 +912,7 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
// core
gettext('Can see the projector')
gettext('Can manage the projector')
gettext('Can see the dashboard')
gettext('Can see the front page')
gettext('Can manage tags')
gettext('Can manage configuration')
gettext('Can use the chat')

View File

@ -67,7 +67,7 @@
<h4 translate>Please note:</h4>
<ul>
<li><translate>Required comma or semicolon separated values with these column header names in the first row</translate>:<br>
<code>title, first_name, last_name, structure level, groups, comment, is active</code>
<code>title, first_name, last_name, structure_level, groups, comment, is_active</code>
<li><translate>Default groups</translate>:
<translate>Delegates</translate> <code>3</code>,
<translate>Staff</translate> <code>4</code>

View File

@ -56,7 +56,7 @@
placeholder="{{ 'Search' | translate}}">
</div>
</div>
<button class="btn btn-default" ng-click="isFilterOpen = !isFilterOpen"
<button os-perms="users.can_see_extra_data" class="btn btn-default" ng-click="isFilterOpen = !isFilterOpen"
ng-class="isFilterOpen ? 'btn-primary' : 'btn-default'">
<i class="fa fa-filter"></i>
<translate>Filter ...</translate>
@ -64,7 +64,7 @@
</div>
</div>
</div>
<div uib-collapse="!isFilterOpen" class="row spacer">
<div os-perms="users.can_see_extra_data" uib-collapse="!isFilterOpen" class="row spacer">
<div class="col-sm-6 text-right"></div>
<div class="col-sm-6 text-right form-inline">
<!-- group filter -->
@ -94,6 +94,14 @@
{{ users.length }} {{ "participants" | translate }}<span ng-if="(users|filter:{selected:true}).length > 0">,
{{(users|filter:{selected:true}).length}} {{ "selected" | translate }}</span>
</div>
<!-- set filtered users (for user with/without can_see_extra_data permissions-->
<div os-perms="users.can_see_extra_data"
ng-repeat="user in usersFiltered = (users | filter: filter.search | filter: {groups: groupFilter} |
filter: {is_present: filterPresent} | orderBy: sortColumn:reverse)"></div>
<div os-perms="!users.can_see_extra_data"
ng-repeat="user in usersFiltered = (users | filter: filter.search | orderBy: sortColumn:reverse)"></div>
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
@ -124,9 +132,7 @@
ng-class="reverse ? 'fa-sort-desc' : 'fa-sort-asc'">
</i>
<tbody>
<tr ng-repeat="user in usersFiltered = (users | filter: filter.search | filter: {groups: groupFilter} |
filter: {is_present: filterPresent} | orderBy: sortColumn:reverse) | limitTo : itemsPerPage : limitBegin"
class="animate-item"
<tr ng-repeat="user in usersFiltered | limitTo : itemsPerPage : limitBegin" class="animate-item"
ng-class="{ 'activeline': user.isProjected(), 'selected': user.selected }">
<!-- projector column -->
<td ng-show="!isDeleteMode" os-perms="core.can_manage_projector">
@ -163,5 +169,8 @@
</span>
<input os-perms="users.can_manage" type="checkbox" ng-model="user.is_present" ng-click="save(user)">
</table>
<uib-pagination total-items="usersFiltered.length" items-per-page="itemsPerPage" ng-model="currentPage" ng-change="pageChanged()"></uib-pagination>
<uib-pagination total-items="usersFiltered.length" items-per-page="itemsPerPage" ng-model="currentPage"
ng-change="pageChanged()"
class="pagination-sm" direction-links="false" boundary-links="true" first-text="&laquo;" last-text="&raquo;">
</uib-pagination>
</div>

View File

@ -89,10 +89,16 @@ class UserViewSet(ModelViewSet):
"""
if not self.request.user.has_perm('users.can_manage'):
if isinstance(response.data, dict):
try:
del response.data['default_password']
except KeyError:
pass
elif isinstance(response.data, list):
for user in response.data:
try:
del user['default_password']
except KeyError:
pass
def update(self, request, *args, **kwargs):
"""