Merge pull request #82 from ostcar/stable/1.3.x
fixed changing language on the projector
This commit is contained in:
commit
98f4ec8f2a
@ -318,7 +318,7 @@ class AssignmentPollDelete(DeleteView):
|
|||||||
return reverse('assignment_view', args=[self.assignment.id])
|
return reverse('assignment_view', args=[self.assignment.id])
|
||||||
|
|
||||||
def get_success_message(self):
|
def get_success_message(self):
|
||||||
return _('Ballot was successfully deleted.') % self.object
|
return _('Ballot was successfully deleted.') % self.object
|
||||||
|
|
||||||
|
|
||||||
class AssignmentPDF(PDFView):
|
class AssignmentPDF(PDFView):
|
||||||
|
@ -478,7 +478,7 @@ def login(request):
|
|||||||
extra_content = {}
|
extra_content = {}
|
||||||
try:
|
try:
|
||||||
admin = User.objects.get(pk=1)
|
admin = User.objects.get(pk=1)
|
||||||
if admin.check_password(admin.default_password):
|
if admin.check_password(admin.default_password):
|
||||||
extra_content['first_time_message'] = _(
|
extra_content['first_time_message'] = _(
|
||||||
"Installation was successfully! Use %(user)s "
|
"Installation was successfully! Use %(user)s "
|
||||||
"(password: %(password)s) for first login.<br>"
|
"(password: %(password)s) for first login.<br>"
|
||||||
|
@ -89,9 +89,10 @@ def set_active_slide(sid, argument=None):
|
|||||||
|
|
||||||
|
|
||||||
def clear_projector_cache():
|
def clear_projector_cache():
|
||||||
cache.delete('projector_content')
|
for language, __ in settings.LANGUAGES:
|
||||||
cache.delete('projector_scrollcontent')
|
cache.delete('projector_content_' + language)
|
||||||
cache.delete('projector_data')
|
cache.delete('projector_scrollcontent_' + language)
|
||||||
|
cache.delete('projector_data_' + language)
|
||||||
|
|
||||||
|
|
||||||
def register_slidemodel(model, model_name=None, control_template=None, weight=0):
|
def register_slidemodel(model, model_name=None, control_template=None, weight=0):
|
||||||
|
@ -104,25 +104,26 @@ class Projector(TemplateView, AjaxMixin):
|
|||||||
return context
|
return context
|
||||||
|
|
||||||
def get_ajax_context(self, **kwargs):
|
def get_ajax_context(self, **kwargs):
|
||||||
content = cache.get('projector_content')
|
language = self.request.LANGUAGE_CODE
|
||||||
|
content = cache.get('projector_content_' + language)
|
||||||
if not content:
|
if not content:
|
||||||
content = render_block_to_string(
|
content = render_block_to_string(
|
||||||
self.get_template_names()[0],
|
self.get_template_names()[0],
|
||||||
'content', self.data)
|
'content', self.data)
|
||||||
cache.set('projector_content', content, 1)
|
cache.set('projector_content_' + language, content, 1)
|
||||||
|
|
||||||
scrollcontent = cache.get('projector_scrollcontent')
|
scrollcontent = cache.get('projector_scrollcontent')
|
||||||
if not scrollcontent:
|
if not scrollcontent:
|
||||||
scrollcontent = render_block_to_string(
|
scrollcontent = render_block_to_string(
|
||||||
self.get_template_names()[0],
|
self.get_template_names()[0],
|
||||||
'scrollcontent', self.data)
|
'scrollcontent', self.data)
|
||||||
cache.set('projector_scrollcontent', scrollcontent, 1)
|
cache.set('projector_scrollcontent_' + language, scrollcontent, 1)
|
||||||
|
|
||||||
# TODO: do not call the hole data-methode, if we only need some vars
|
# TODO: do not call the hole data-methode, if we only need some vars
|
||||||
data = cache.get('projector_data')
|
data = cache.get('projector_data_' + language)
|
||||||
if not data:
|
if not data:
|
||||||
data = self.data
|
data = self.data
|
||||||
cache.set('projector_data', data)
|
cache.set('projector_data_' + language, data)
|
||||||
# clear cache if countdown is enabled
|
# clear cache if countdown is enabled
|
||||||
if config['countdown_state'] == 'active':
|
if config['countdown_state'] == 'active':
|
||||||
clear_projector_cache()
|
clear_projector_cache()
|
||||||
|
Loading…
Reference in New Issue
Block a user