2022-02-15 20:33:31 -07:00
|
|
|
'use strict';
|
|
|
|
|
2022-02-10 01:21:49 -07:00
|
|
|
const { TemplateView } = require('hydrogen-view-sdk');
|
|
|
|
|
2023-05-30 23:54:43 -06:00
|
|
|
const assert = require('matrix-public-archive-shared/lib/assert');
|
2022-08-30 18:10:57 -06:00
|
|
|
const CalendarView = require('matrix-public-archive-shared/views/CalendarView');
|
2023-04-05 03:25:31 -06:00
|
|
|
const TimeSelectorView = require('matrix-public-archive-shared/views/TimeSelectorView');
|
2022-02-14 20:11:55 -07:00
|
|
|
|
2022-02-10 01:21:49 -07:00
|
|
|
class RightPanelContentView extends TemplateView {
|
|
|
|
render(t, vm) {
|
2022-09-20 15:02:09 -06:00
|
|
|
assert(vm.shouldIndex !== undefined);
|
2023-04-05 03:25:31 -06:00
|
|
|
assert(vm.shouldShowTimeSelector !== undefined);
|
|
|
|
|
2023-05-30 23:54:43 -06:00
|
|
|
let maybeIndexedMessage = 'This room is not being indexed by search engines ';
|
2022-09-20 15:02:09 -06:00
|
|
|
if (vm.shouldIndex) {
|
2023-05-30 23:54:43 -06:00
|
|
|
maybeIndexedMessage = 'This room is being indexed by search engines ';
|
2022-09-20 15:02:09 -06:00
|
|
|
}
|
|
|
|
|
2022-02-10 01:21:49 -07:00
|
|
|
return t.div(
|
|
|
|
{
|
2023-04-05 03:25:31 -06:00
|
|
|
className: 'RightPanelContentView',
|
2022-02-10 01:21:49 -07:00
|
|
|
},
|
2022-09-20 15:02:09 -06:00
|
|
|
[
|
2023-04-05 03:25:31 -06:00
|
|
|
t.div({ className: 'RightPanelContentView_mainContent' }, [
|
|
|
|
t.view(new CalendarView(vm.calendarViewModel)),
|
|
|
|
t.ifView(
|
|
|
|
(vm) => vm.shouldShowTimeSelector,
|
|
|
|
(vm) => new TimeSelectorView(vm.timeSelectorViewModel)
|
|
|
|
),
|
|
|
|
]),
|
|
|
|
t.footer(
|
2022-09-20 15:02:09 -06:00
|
|
|
{
|
2023-04-05 03:25:31 -06:00
|
|
|
className: 'RightPanelContentView_footer',
|
2022-09-20 15:02:09 -06:00
|
|
|
},
|
|
|
|
[
|
2023-05-30 23:54:43 -06:00
|
|
|
t.p([
|
|
|
|
maybeIndexedMessage,
|
|
|
|
'(',
|
|
|
|
t.a(
|
|
|
|
{
|
|
|
|
className: 'external-link RightPanelContentView_footerLink',
|
|
|
|
href: 'https://github.com/matrix-org/matrix-public-archive/blob/main/docs/faq.md#how-do-i-opt-out-and-keep-my-room-from-being-indexed-by-search-engines',
|
|
|
|
target: '_blank',
|
|
|
|
},
|
|
|
|
'more info'
|
|
|
|
),
|
|
|
|
').',
|
|
|
|
]),
|
2022-09-20 15:02:09 -06:00
|
|
|
t.div(
|
|
|
|
{
|
2023-04-05 03:25:31 -06:00
|
|
|
className: 'RightPanelContentView_footerLinkList',
|
2022-09-20 15:02:09 -06:00
|
|
|
},
|
|
|
|
[
|
|
|
|
t.a(
|
|
|
|
{ className: 'RightPanelContentView_footerLink', href: vm.developerOptionsUrl },
|
|
|
|
['Developer options']
|
|
|
|
),
|
|
|
|
t.span('·'),
|
|
|
|
t.a(
|
|
|
|
{
|
|
|
|
className: 'RightPanelContentView_footerLink',
|
|
|
|
href: 'https://matrix.org/',
|
|
|
|
target: '_blank',
|
|
|
|
},
|
|
|
|
['Matrix.org']
|
|
|
|
),
|
|
|
|
]
|
|
|
|
),
|
|
|
|
]
|
|
|
|
),
|
|
|
|
]
|
2022-02-10 01:21:49 -07:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = RightPanelContentView;
|