Themes/Legacy: Add plugin with 'nicecompact' theme (#127)

* Add plugin (data copied from core)
* Only apply styles to event area
This commit is contained in:
Adrian 2021-05-11 17:53:18 +02:00 committed by GitHub
parent 805f653e97
commit f52ee3184a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 459 additions and 0 deletions

View File

@ -0,0 +1,6 @@
graft indico_themes_legacy/static
graft indico_themes_legacy/templates
graft indico_themes_legacy/themes
recursive-include indico_themes_legacy *.yaml
global-exclude *.pyc __pycache__ .keep

View File

@ -0,0 +1,28 @@
# This file is part of the Indico plugins.
# Copyright (C) 2002 - 2021 CERN
#
# The Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License;
# see the LICENSE file for more details.
import os
from indico.core import signals
from indico.core.plugins import IndicoPlugin, IndicoPluginBlueprint
class LegacyThemesPlugin(IndicoPlugin):
"""Legacy Themes
Provides legacy event themes
"""
def init(self):
super().init()
self.connect(signals.plugin.get_event_themes_files, self._get_themes_yaml)
def get_blueprints(self):
return IndicoPluginBlueprint(self.name, __name__)
def _get_themes_yaml(self, sender, **kwargs):
return os.path.join(self.root_path, 'themes-legacy.yaml')

View File

@ -0,0 +1,79 @@
{% from 'events/display/common/_legacy.html' import render_event_time, render_location %}
{% from 'events/display/common/_manage_button.html' import render_manage_button %}
<table class="eventHeader">
<tr>
<td>
<div style="font-weight:bold;">
{{ render_manage_button(event, 'EVENT', toggle_notes=false, show_note_operations=true) }}
{% if event.has_note %}
<div class="toolbar right thin">
<div class="group">
<a href="{{ url_for('event_notes.view', event) }}" class="i-button normal-button">
{% trans %}Minutes{% endtrans %}
</a>
</div>
</div>
{% endif %}
{{ event.title }}
</div>
<br>
{{ render_event_time(event, timezone) }}
<br>
{{ render_location(event) }}
<br><br>
</td>
<td style="width: 1%; white-space: nowrap;">
<table class="headerLegendsBorder" cellpadding="1" align="right">
<tr>
<td>
<table class="headerLegendsContent" cellpadding="2">
<tr>
<td>
<table>
<tr>
<td class="sessionsLegend">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</td>
<td class="titleClass">: Sessions</td>
</tr>
</table>
</td>
<td>
<table cellspacing="0">
<tr>
<td class="contribsLegendSilver">
&nbsp;&nbsp;&nbsp;
</td>
<td>/</td>
<td class="contribsLegendGrey">
&nbsp;&nbsp;&nbsp;
</td>
<td class="titleClass">: Talks</td>
</tr>
</table>
</td>
<td>
<table>
<tr>
<td class="breaksLegend">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</td>
<td class="titleClass">: Breaks</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<center>
<table class="dayList" cellpadding="0">
{{ template_hook('meeting-body', event=event) }}
</table>
</center>

View File

@ -0,0 +1,171 @@
{% from 'attachments/_display.html' import render_attachments_folders %}
{% from 'events/display/common/_manage_button.html' import render_manage_button %}
{% from 'events/display/indico/_common.html' import render_users %}
{% macro render_break(break_, timezone) %}
<tr>
<td valign="top" bgcolor="#FFdcdc">
{{ break_.timetable_entry.start_dt | format_time(timezone=timezone) }}
</td>
<td valign="top" bgcolor="#FFcccc" align="center" colspan="1">
---&nbsp;{{ break_.title }}&nbsp;---
</td>
</tr>
{% endmacro %}
{% macro render_session_block(block, timezone) %}
{% set entries = block.timetable_entry.children %}
<tr>
<td valign="top" bgcolor="#b0e0ff" width="5%">
<span style="font-weight:bold;">
{{ block.timetable_entry.start_dt | format_time(timezone=timezone) }}
</span>
</td>
<td colspan="1" bgcolor="#90c0f0">
<div style="float:right">
{{ render_manage_button(block, 'SESSION_BLOCK', toggle_notes=false, show_note_operations=true) }}
{% if block.has_note %}
<div class="toolbar right thin">
<div class="group">
<a href="{{ url_for('event_notes.view', block) }}" class="i-button">
{% trans %}Minutes{% endtrans %}
</a>
</div>
</div>
{% endif %}
</div>
<span style="font-weight:bold;">
{{- block.session.title }}
</span>
{% set conveners = block.person_links|list %}
{% if conveners %}
-{{ render_users(conveners, span_class="speakerList", separator=' ') }}
{% endif %}
(until {{ block.timetable_entry.end_dt | format_time(timezone=timezone) }})
{% if not block.inherits_location %}
({{ block.room_name }})
{% endif %}
<div style="float:right">
{{ render_attachments_folders(item=block.session) }}
</div>
</td>
</tr>
{% for entry in entries|sort(attribute='object.title')|sort(attribute='start_dt') %}
{% if entry.type.name == 'CONTRIBUTION' and entry.object.can_access(session.user) %}
{{ render_contribution(entry.contribution, timezone, loop.index) }}
{% elif entry.type.name == 'BREAK' %}
{{ render_break(entry.break_, timezone) }}
{% endif %}
{% endfor %}
{% endmacro %}
{% macro render_contribution(contrib, timezone, index) %}
<tr bgcolor="{{ 'silver' if index % 2 != 0 else '#D2D2D2' }}">
<td bgcolor="{{ '#D0D0D0' if index % 2 != 0 else '#E2E2E2' }}" valign="top" width="5%">
{{ contrib.start_dt | format_time(timezone=timezone) }}
</td>
<td valign="top">
{{ contrib.title }}
{% set speakers = contrib.person_links|selectattr("is_speaker")|list %}
{% if speakers %}
- {{ render_users(speakers, span_class="speakerList", separator=' ') }}
{% endif %}
&nbsp;
{% if not contrib.inherits_location %}
({{ contrib.room_name }})
{% endif %}
<div style="float: right">
<div style="float: left">
{{ render_attachments_folders(item=contrib) }}
</div>
<div style="float: right">
{{ render_manage_button(contrib, 'CONTRIBUTION', toggle_notes=false, show_note_operations=true) }}
{% if contrib.has_note %}
<div class="toolbar right thin">
<div class="group">
<a href="{{ url_for('event_notes.view', contrib) }}" class="i-button">
{% trans %}Minutes{% endtrans %}
</a>
</div>
</div>
{% endif %}
</div>
</div>
</td>
</tr>
{% endmacro %}
{% macro render_entry(entry, timezone, index) %}
{% if entry.type.name == 'CONTRIBUTION' -%}
{{ render_contribution(entry.object, timezone, index) }}
{% elif entry.type.name == 'SESSION_BLOCK' -%}
{{ render_session_block(entry.object, timezone) }}
{% elif entry.type.name == 'BREAK' -%}
{{ render_break(entry.object, timezone) }}
{% endif %}
{% endmacro %}
<tr>
<td></td>
{% for day, _ in days %}
<td class="headerselected" align="center" bgcolor="#000060">
<span style="color:white; font-weight:bold;">
{{ day | format_date(format='medium', timezone=timezone) }}
</span>
<br>
</td>
{% endfor %}
</tr>
<tr bgcolor="white">
<td valign="top" class="headerselected" bgcolor="#000060" width="30">
<table width="100%" cellspacing="0" cellpadding="2" border="0">
<tr>
<td align="center" class="headerselected" bgcolor="#000060">
<span style="font-size: x-small; font-weight:bold; color:white;" >
AM
</span>
</td>
</tr>
</table>
</td>
{% for day, entries in days %}
<td valign="top" bgcolor="gray">
<table width="100%" cellspacing="1" cellpadding="3" border="0">
{% for entry in entries %}
{% if entry.start_dt.astimezone(tz_object).hour < 12 %}
{{ render_entry(entry, tz_object, loop.index) }}
{% endif %}
{% endfor %}
</table>
</td>
{% endfor %}
</tr>
<tr>
<td valign="top" class="headerselected" bgcolor="#000060">
<table width="100%" cellspacing="0" cellpadding="2" border="0">
<tr>
<td align="center" class="headerselected" bgcolor="#000060">
<span style="font-size: x-small; font-weight:bold; color:white;" >
PM
</span>
</td>
</tr>
</table>
</td>
{% for day, entries in days %}
<td valign="top" bgcolor="gray">
<table width="100%" cellspacing="1" cellpadding="3" border="0">
{% for entry in entries %}
{% if entry.start_dt.astimezone(tz_object).hour >= 12 %}
{{ render_entry(entry, tz_object, loop.index) }}
{% endif %}
{% endfor %}
</table>
</td>
{% endfor %}
</tr>

View File

@ -0,0 +1,10 @@
definitions:
nicecompact:
event_types: [conference, meeting]
stylesheet: compact.scss
template: :compact_event.html
tt_template: :compact_timetable.html
title: Compact style
user_visible: true
settings:
page_is_dark: false

View File

@ -0,0 +1,121 @@
@import 'base/palette';
div.main {
color: #000;
background: #fff;
font-family: helvetica, verdana, sans-serif;
> div {
overflow: auto;
}
p,
br,
dl,
strong,
em,
h1,
h2,
a {
font-family: helvetica, verdana, sans-serif;
font-size: 8pt;
color: #000;
}
td {
font-family: helvetica, verdana, sans-serif;
font-size: 8pt;
color: #000;
}
table p {
margin-top: 0;
}
.headerselected {
color: #fff;
background: #006;
}
a:visited {
color: #00f;
background: transparent;
text-decoration: none;
}
a:active {
color: $bright-orange;
background: transparent;
}
a:hover {
color: $bright-orange;
background: transparent;
}
a.img:hover {
color: #00c;
background: transparent;
}
a.img:active {
color: #00c;
background: transparent;
font-weight: normal;
}
table.eventHeader {
background: white;
width: 100%;
}
table.headerLegendsBorder {
background: silver;
border-spacing: 3px;
border: 0;
text-align: right;
}
table.headerLegendsContent {
background: white;
border-spacing: 0;
border: 0;
width: 100%;
text-align: right;
}
td.headerLegends {
text-align: right;
}
td.sessionsLegend {
background: #90c0f0;
}
td.contribsLegendSilver {
background: silver;
}
td.contribsLegendGrey {
background: #d2d2d2;
}
td.breaksLegend {
background: #fcc;
}
table.dayList {
background: white;
border-spacing: 1px;
border: 0;
width: 100%;
}
.titleClass {
font-weight: bold;
}
.speakerList {
color: green;
}
}

30
themes_legacy/setup.cfg Normal file
View File

@ -0,0 +1,30 @@
[metadata]
name = indico-plugin-themes-legacy
version = 3.0-dev
description = Legacy themes for Indico
url = https://github.com/indico/indico-plugins
license = MIT
author = Indico Team
author_email = indico-team@cern.ch
classifiers =
Environment :: Plugins
Environment :: Web Environment
License :: OSI Approved :: MIT License
Programming Language :: Python :: 3.9
[options]
packages = find:
zip_safe = false
include_package_data = true
python_requires = ~=3.9
install_requires =
indico>=3.0.dev0
[options.entry_points]
indico.plugins =
themes_legacy = indico_themes_legacy.plugin:LegacyThemesPlugin
[pydocstyle]
ignore = D100,D101,D102,D103,D104,D105,D107,D203,D213

11
themes_legacy/setup.py Normal file
View File

@ -0,0 +1,11 @@
# This file is part of the Indico plugins.
# Copyright (C) 2002 - 2021 CERN
#
# The Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License;
# see the LICENSE file for more details.
from setuptools import setup
setup()

View File

@ -0,0 +1,3 @@
{
"indicoTheme": "indico_themes_legacy/themes-legacy.yaml"
}