Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync conference page titles with menu item titles #3236

Merged
merged 1 commit into from Feb 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.rst
Expand Up @@ -48,6 +48,7 @@ Improvements
- Add user setting whether to show future events or not by default in a
category. Also keep the per-category status in the session (:issue:`3233`,
thanks :user:`bpedersen2`)
- Keep page titles in sync with conference menu item titles (:issue:`3236`)

Internal Changes
^^^^^^^^^^^^^^^^
Expand Down
Expand Up @@ -6,7 +6,7 @@
{% from 'events/reviews/_common.html' import render_timeline_section %}

{% block title %}
{%- trans %}Call for Abstracts{% endtrans -%}
{{- page_title -}}
{% endblock %}

{% macro render_user_abstract_list(event, abstracts) %}
Expand Down
@@ -1,7 +1,7 @@
{% extends 'events/display/conference/base.html' %}

{% block title %}
{%- trans %}Reviewing Area{% endtrans -%}
{{- page_title -}}
{% endblock %}

{% block description %}
Expand Down
1 change: 0 additions & 1 deletion indico/modules/events/contributions/controllers/display.py
Expand Up @@ -25,7 +25,6 @@
from indico.modules.events.abstracts.util import filter_field_values
from indico.modules.events.contributions.lists import ContributionDisplayListGenerator
from indico.modules.events.contributions.models.contributions import Contribution
from indico.modules.events.contributions.models.fields import ContributionFieldVisibility
from indico.modules.events.contributions.models.persons import AuthorType, ContributionPersonLink
from indico.modules.events.contributions.models.subcontributions import SubContribution
from indico.modules.events.contributions.util import (get_contribution_ical_file,
Expand Down
@@ -1,7 +1,7 @@
{% extends 'events/contributions/display/contribution_person_list_base.html' %}

{% block title -%}
{% trans %}List of Authors{% endtrans %}
{{- page_title -}}
{%- endblock %}

{% block list %}
Expand Down
Expand Up @@ -4,7 +4,7 @@
{% from 'events/management/_lists.html' import render_displayed_entries_fragment %}

{% block title %}
{% trans %}Contribution List{% endtrans %}
{{- page_title -}}
{% endblock %}

{% block content -%}
Expand Down
@@ -1,7 +1,7 @@
{% extends 'events/contributions/display/contribution_person_list_base.html' %}

{% block title -%}
{% trans %}List of Speakers{% endtrans %}
{{- page_title -}}
{%- endblock %}

{% block list %}
Expand Down
@@ -1,7 +1,7 @@
{% extends 'events/display/conference/base.html' %}

{% block title -%}
{% trans %}My Contributions{% endtrans %}
{{- page_title -}}
{%- endblock %}

{% block content -%}
Expand Down
2 changes: 1 addition & 1 deletion indico/modules/events/papers/templates/_base.html
@@ -1,5 +1,5 @@
{% extends 'events/reviews/_base.html' %}

{% block title %}
{% trans %}Call for Papers{% endtrans %}
{{- page_title -}}
{% endblock %}
Expand Up @@ -6,10 +6,6 @@
{% from 'events/reviews/_common.html' import render_timeline_section %}
{% from 'message_box.html' import message_box %}

{% block title %}
{%- trans %}Call for Papers{% endtrans -%}
{% endblock %}

{% block content %}
<div class="call-for-papers">
{% set cfp = event.cfp %}
Expand Down
Expand Up @@ -4,7 +4,7 @@
{% from 'message_box.html' import message_box %}

{% block title %}
{%- trans %}Judging Area{% endtrans -%}
{{- page_title -}}
{% endblock %}

{% block description %}
Expand Down
Expand Up @@ -5,7 +5,7 @@
{% from 'message_box.html' import message_box %}

{% block title %}
{%- trans %}Reviewing Area{% endtrans -%}
{{- page_title -}}
{% endblock %}

{% block description %}
Expand Down
@@ -1,5 +1,5 @@
{% extends 'events/display/conference/base.html' %}

{% block title %}
{%- trans %}Registration{% endtrans -%}
{{- page_title -}}
{% endblock %}
Expand Up @@ -7,7 +7,7 @@
{% from 'message_box.html' import message_box %}

{% block title %}
{% trans %}Participant List{% endtrans %}
{{- page_title -}}
{% endblock %}

{% block subtitle %}
Expand Down
@@ -1,7 +1,7 @@
{% extends 'events/display/conference/base.html' %}

{% block title %}
{% trans %}My Sessions{% endtrans %}
{{- page_title -}}
{% endblock %}

{% block content %}
Expand Down
@@ -1,7 +1,7 @@
{% extends 'events/display/conference/base.html' if event.type == 'conference' else 'layout/meeting_page_base.html' %}

{% block title %}
{%- trans %}Surveys{% endtrans -%}
{{- page_title -}}
{% endblock %}

{% block content %}
Expand Down
2 changes: 1 addition & 1 deletion indico/modules/events/timetable/templates/display.html
Expand Up @@ -2,7 +2,7 @@
{% from 'events/timetable/_timetable.html' import render_timetable %}

{% block title %}
{%- trans %}Timetable{% endtrans -%}
{{- page_title -}}
{% endblock %}

{% block content %}
Expand Down
5 changes: 1 addition & 4 deletions indico/modules/events/tracks/controllers.py
Expand Up @@ -25,7 +25,6 @@
from indico.core.db.sqlalchemy.descriptions import RENDER_MODE_WRAPPER_MAP
from indico.legacy.pdfinterface.conference import ProgrammeToPDF
from indico.modules.events.controllers.base import RHDisplayEventBase
from indico.modules.events.layout.util import get_menu_entry_by_name
from indico.modules.events.management.controllers import RHManageEventBase
from indico.modules.events.tracks.forms import ProgramForm, TrackForm
from indico.modules.events.tracks.models.tracks import Track
Expand Down Expand Up @@ -122,7 +121,6 @@ def _process(self):

class RHDisplayTracks(RHDisplayEventBase):
def _process(self):
page_title = get_menu_entry_by_name('program', self.event).localized_title
program = track_settings.get(self.event, 'program')
render_mode = track_settings.get(self.event, 'program_render_mode')
program = RENDER_MODE_WRAPPER_MAP[render_mode](program)
Expand All @@ -131,8 +129,7 @@ def _process(self):
subqueryload('abstract_reviewers'))
.order_by(Track.position)
.all())
return WPDisplayTracks.render_template('display.html', self.event,
page_title=page_title, program=program, tracks=tracks)
return WPDisplayTracks.render_template('display.html', self.event, program=program, tracks=tracks)


class RHTracksPDF(RHDisplayEventBase):
Expand Down
20 changes: 15 additions & 5 deletions indico/modules/events/views.py
Expand Up @@ -20,6 +20,7 @@

from flask import render_template, request
from sqlalchemy.orm import load_only
from werkzeug.utils import cached_property

from indico.modules.admin.views import WPAdmin
from indico.modules.core.settings import core_settings, social_settings
Expand Down Expand Up @@ -216,6 +217,7 @@ def __init__(self, rh, event_, **kwargs):
assert event_ == kwargs.setdefault('event', event_)
self.event = event_
kwargs['conf_layout_params'] = self._get_layout_params()
kwargs['page_title'] = self.sidemenu_title
WPEventBase.__init__(self, rh, event_, **kwargs)

def _get_layout_params(self):
Expand All @@ -239,14 +241,22 @@ def get_extra_css_files(self):
def _getHeader(self):
return render_event_header(self.event, conference_layout=True).encode('utf-8')

@property
def sidemenu_option(self):
@cached_property
def sidemenu_entry(self):
if not self.menu_entry_name:
return None
name = build_menu_entry_name(self.menu_entry_name, self.menu_entry_plugin)
entry = get_menu_entry_by_name(name, self.event)
if entry:
return entry.id
return get_menu_entry_by_name(name, self.event)

@cached_property
def sidemenu_option(self):
entry = self.sidemenu_entry
return entry.id if entry else None

@cached_property
def sidemenu_title(self):
entry = self.sidemenu_entry
return entry.localized_title if entry else ''

def _getHeadContent(self):
return '\n'.join([
Expand Down
2 changes: 1 addition & 1 deletion indico/modules/vc/templates/event_vc.html
Expand Up @@ -3,7 +3,7 @@
{% from 'vc/list_vc_rooms.html' import render_vc_rooms_list %}

{% block title %}
{% trans %}Videoconference Rooms{% endtrans %}
{{- page_title -}}
{% endblock %}

{% block content %}
Expand Down