Merge pull request #928 from emanuelschuetze/1.5-fixes

Fixes for 1.5b1
This commit is contained in:
Norman Jäckel 2013-10-21 06:42:28 -07:00
commit 42efd5ce8e
7 changed files with 684 additions and 638 deletions

2
THANKS
View File

@ -46,7 +46,7 @@ OpenSlides uses parts of the following projects:
License: MIT License: MIT
and some addons: and some addons:
- jQuery UI Nested Sortable - jQuery UI Nested Sortable
<http://mjsarfatti.com/code/nestedSortable/> <https://github.com/mjsarfatti/nestedSortable/>
License: MIT License: MIT
- jQuery UI Slider Access - jQuery UI Slider Access
<http://trentrichardson.com/examples/jQuery-SliderAccess/> <http://trentrichardson.com/examples/jQuery-SliderAccess/>

View File

@ -1,10 +1,16 @@
{% load i18n %} {% load i18n %}
{% load highlight %} {% load highlight %}
{% if perms.agenda.can_see_agenda %} {% if perms.agenda.can_see_agenda and result.object.type == result.object.AGENDA_ITEM %}
<li> <li>
<a href="{{ result.object.get_absolute_url }}">{{ result.object }}</a><br> <a href="{{ result.object.get_absolute_url }}">{{ result.object }}</a><br>
<span class="app">{% trans "Agenda" %}</a></span><br> <span class="app">{% trans "Agenda" %}</a></span><br>
{% highlight result.text with request.GET.q %} {% highlight result.text with request.GET.q %}
</li> </li>
{% elif perms.agenda.can_see_orga_items and result.object.type == result.object.ORGANIZATIONAL_ITEM %}
<li>
<a href="{{ result.object.get_absolute_url }}"><i>[{{ result.object }}]</i></a><br>
<span class="app">{% trans "Agenda" %} ({% trans "Organizational item" %})</a></span><br>
{% highlight result.text with request.GET.q %}
</li>
{% endif %} {% endif %}

View File

@ -144,19 +144,26 @@ class AgendaItemView(SingleObjectMixin, FormView):
Show an agenda item. Show an agenda item.
""" """
# TODO: use 'SingleObjectTemplateResponseMixin' to choose the right template name # TODO: use 'SingleObjectTemplateResponseMixin' to choose the right template name
permission_required = 'agenda.can_see_agenda'
template_name = 'agenda/view.html' template_name = 'agenda/view.html'
model = Item model = Item
context_object_name = 'item' context_object_name = 'item'
form_class = AppendSpeakerForm form_class = AppendSpeakerForm
def has_permission(self, request, *args, **kwargs):
"""
Checks if the user has the required permission.
"""
if self.get_object().type == Item.ORGANIZATIONAL_ITEM:
permission = request.user.has_perm('agenda.can_see_orga_items')
else:
permission = request.user.has_perm('agenda.can_see_agenda')
return permission
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
self.object = self.get_object() self.object = self.get_object()
list_of_speakers = self.object.get_list_of_speakers() list_of_speakers = self.object.get_list_of_speakers()
active_slide = get_active_slide() active_slide = get_active_slide()
active_type = active_slide.get('type', None) active_type = active_slide.get('type', None)
kwargs.update({ kwargs.update({
'object': self.object, 'object': self.object,
'list_of_speakers': list_of_speakers, 'list_of_speakers': list_of_speakers,
@ -594,10 +601,16 @@ class CurrentListOfSpeakersView(RedirectView):
messages.success(request, _('%s is now finished.') % current_speaker) messages.success(request, _('%s is now finished.') % current_speaker)
reverse_to_dashboard = True reverse_to_dashboard = True
if reverse_to_dashboard or not self.request.user.has_perm('agenda.can_see_agenda'): if item.type == Item.ORGANIZATIONAL_ITEM:
return reverse('dashboard') if reverse_to_dashboard or not self.request.user.has_perm('agenda.can_see_orga_items'):
return reverse('dashboard')
else:
return reverse('item_view', args=[item.pk])
else: else:
return reverse('item_view', args=[item.pk]) if reverse_to_dashboard or not self.request.user.has_perm('agenda.can_see_agenda'):
return reverse('dashboard')
else:
return reverse('item_view', args=[item.pk])
def register_tab(request): def register_tab(request):

View File

@ -16,6 +16,7 @@ from django.utils.importlib import import_module
from haystack.views import SearchView as _SearchView from haystack.views import SearchView as _SearchView
from openslides import get_git_commit_id, get_version, RELEASE from openslides import get_git_commit_id, get_version, RELEASE
from openslides.config.api import config
from openslides.utils.signals import template_manipulation from openslides.utils.signals import template_manipulation
from openslides.utils.views import TemplateView from openslides.utils.views import TemplateView
@ -76,7 +77,7 @@ class SearchView(_SearchView):
template = 'core/search.html' template = 'core/search.html'
def __call__(self, request): def __call__(self, request):
if not request.user.is_authenticated(): if not request.user.is_authenticated() and not config['system_enable_anonymous']:
raise PermissionDenied raise PermissionDenied
return super(SearchView, self).__call__(request) return super(SearchView, self).__call__(request)

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-09-02 13:52+0200\n" "POT-Creation-Date: 2013-10-20 20:19+0200\n"
"Language: en\n" "Language: en\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"

View File

@ -37,7 +37,7 @@
</form> &nbsp; </form> &nbsp;
<!-- login/logout button --> <!-- login/logout button -->
<div class="btn-group pull-right"> <div class="btn-group">
{% if user.is_authenticated %} {% if user.is_authenticated %}
<a href="#" data-toggle="dropdown" class="btn dropdown-toggle"> <a href="#" data-toggle="dropdown" class="btn dropdown-toggle">
<i class="icon-user"></i> {{ user.username }} <i class="icon-user"></i> {{ user.username }}