From 85b8b9977957f7da7ce4011f0ea10dfef1ad492a Mon Sep 17 00:00:00 2001 From: emkael Date: Thu, 16 Jun 2016 02:37:51 +0200 Subject: * controls for rendering grouped grid view --- app/frontend/controls/grid/DummyGridElement.php | 9 +++++++++ app/frontend/controls/grid/DummyGridElement.tpl | 1 + app/frontend/controls/grid/EventGridElement.php | 9 +++++++++ app/frontend/controls/grid/EventGridElement.tpl | 5 +++++ app/frontend/controls/grid/GridElement.php | 17 ++++++++++++++++ app/frontend/controls/grid/GroupGridElement.php | 23 ++++++++++++++++++++++ app/frontend/controls/grid/GroupGridElement.tpl | 16 +++++++++++++++ app/frontend/controls/styles/CalendarGrid.css | 26 +++++++++++++++++++++++-- 8 files changed, 104 insertions(+), 2 deletions(-) create mode 100644 app/frontend/controls/grid/DummyGridElement.php create mode 100644 app/frontend/controls/grid/DummyGridElement.tpl create mode 100644 app/frontend/controls/grid/EventGridElement.php create mode 100644 app/frontend/controls/grid/EventGridElement.tpl create mode 100644 app/frontend/controls/grid/GridElement.php create mode 100644 app/frontend/controls/grid/GroupGridElement.php create mode 100644 app/frontend/controls/grid/GroupGridElement.tpl (limited to 'app') diff --git a/app/frontend/controls/grid/DummyGridElement.php b/app/frontend/controls/grid/DummyGridElement.php new file mode 100644 index 0000000..8223bb2 --- /dev/null +++ b/app/frontend/controls/grid/DummyGridElement.php @@ -0,0 +1,9 @@ + diff --git a/app/frontend/controls/grid/DummyGridElement.tpl b/app/frontend/controls/grid/DummyGridElement.tpl new file mode 100644 index 0000000..add41d9 --- /dev/null +++ b/app/frontend/controls/grid/DummyGridElement.tpl @@ -0,0 +1 @@ +
 
diff --git a/app/frontend/controls/grid/EventGridElement.php b/app/frontend/controls/grid/EventGridElement.php new file mode 100644 index 0000000..28eaefa --- /dev/null +++ b/app/frontend/controls/grid/EventGridElement.php @@ -0,0 +1,9 @@ + diff --git a/app/frontend/controls/grid/EventGridElement.tpl b/app/frontend/controls/grid/EventGridElement.tpl new file mode 100644 index 0000000..dca642a --- /dev/null +++ b/app/frontend/controls/grid/EventGridElement.tpl @@ -0,0 +1,5 @@ + + <%= $this->Data->Name %> + diff --git a/app/frontend/controls/grid/GridElement.php b/app/frontend/controls/grid/GridElement.php new file mode 100644 index 0000000..3628d4b --- /dev/null +++ b/app/frontend/controls/grid/GridElement.php @@ -0,0 +1,17 @@ +setControlState('Data', $data); + } + + public function getData() { + return $this->getControlState('Data'); + } + +} + +?> diff --git a/app/frontend/controls/grid/GroupGridElement.php b/app/frontend/controls/grid/GroupGridElement.php new file mode 100644 index 0000000..dc92239 --- /dev/null +++ b/app/frontend/controls/grid/GroupGridElement.php @@ -0,0 +1,23 @@ +GroupEvents->setDataSource($this->Data->Events); + $this->GroupEvents->dataBind(); + } + + public function stripPrefix(string $string) { + return preg_replace( + '#^' . preg_quote($this->Data->Header) . '\s*#', + '', + $string + ); + } + +} + +?> diff --git a/app/frontend/controls/grid/GroupGridElement.tpl b/app/frontend/controls/grid/GroupGridElement.tpl new file mode 100644 index 0000000..af07655 --- /dev/null +++ b/app/frontend/controls/grid/GroupGridElement.tpl @@ -0,0 +1,16 @@ + + <%= $this->Data->Header %> + (<%= count($this->Data->Events) %>) +
+ + +
+ <%# $this->SourceTemplateControl->stripPrefix($this->Data->Name) %> + (<%# $this->Data->DateString %>) +
+
+
+
+
diff --git a/app/frontend/controls/styles/CalendarGrid.css b/app/frontend/controls/styles/CalendarGrid.css index 4710993..0656200 100644 --- a/app/frontend/controls/styles/CalendarGrid.css +++ b/app/frontend/controls/styles/CalendarGrid.css @@ -8,9 +8,31 @@ div.gridDay { min-height: 8em; flex: 1 1 auto; } -div.gridEvent, div.gridItem { height: 1.5em; padding: 0.3em 0.5em; margin: 0.1em 0; } -div.gridEvent { overflow: hidden; white-space: nowrap; background: #ddd } +div.gridEvent, +div.gridItem, +div.gridGroup { + height: 1.5em; + padding: 0.3em 0.5em; + margin: 0.1em 0; +} +div.gridGroup, +div.gridEvent { + overflow: hidden; + white-space: nowrap; + background: #ddd; +} div.gridEvent.beginDate { border-top-left-radius: 1.5em; border-bottom-left-radius: 1.5em } div.gridEvent.endDate { border-top-right-radius: 1.5em; border-bottom-right-radius: 1.5em } + +div.gridGroupElements { + position: absolute; + width: 13%; + background: #eee; + white-space: normal; + display: none; + cursor: auto; +} +div.gridGroup { cursor: pointer } +div.gridGroup:hover div.gridGroupElements { display: block; } -- cgit v1.2.3