Skip to content

Commit f04903a

Browse files
authored
Merge pull request #58 from CCPBioSim/views
implement changes to improve the events view
2 parents 6406bc3 + f2fb9b1 commit f04903a

5 files changed

Lines changed: 43 additions & 22 deletions

File tree

com_ccpbiosim/administrator/forms/event.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
<field name="created_by" type="createdby" default="0" label="JGLOBAL_FIELD_CREATED_BY_LABEL" description="JGLOBAL_FIELD_CREATED_BY_DESC" hidden="true" hint="COM_CCPBIOSIM_FORM_LBL_EVENT_CREATED_BY"/>
1515
<field name="modified_by" type="modifiedby" default="0" label="JGLOBAL_FIELD_MODIFIED_BY_LABEL" description="JGLOBAL_FIELD_MODIFIED_BY_DESC" hidden="true" hint="COM_CCPBIOSIM_FORM_LBL_EVENT_MODIFIED_BY"/>
1616
<field name="title" filter="safehtml" type="text" required="true" label="JGLOBAL_TITLE" description="COM_CCPBIOSIM_FORM_DESC_EVENT_TITLE" hint="Add a title for this event"/>
17+
<field name="shorturl" filter="safehtml" type="text" required="true" label="COM_CCPBIOSIM_FORM_LBL_EVENT_SHORTURL" description="COM_CCPBIOSIM_FORM_DESC_EVENT_SHORTURL" hint="COM_CCPBIOSIM_FORM_LBL_EVENT_SHORTURL"/>
1718
<field name="category" query="SELECT * FROM #__ccpbiosim_event_categories" key_field="id" value_field="eventcategory" header="Event Category" type="sql" layout="joomla.form.field.list-fancy-select" required="true" label="COM_CCPBIOSIM_FORM_LBL_EVENT_CATEGORY" description="COM_CCPBIOSIM_FORM_DESC_EVENT_CATEGORY" hint="COM_CCPBIOSIM_FORM_LBL_EVENT_CATEGORY"/>
19+
<field name="location" default="Manchester, UK" filter="safehtml" type="text" required="true" label="COM_CCPBIOSIM_FORM_LBL_EVENT_LOCATION" description="COM_CCPBIOSIM_FORM_DESC_EVENT_LOCATION" hint="COM_CCPBIOSIM_FORM_LBL_EVENT_LOCATION"/>
1820
<field name="startdatetime" type="calendar" class="inputbox" format="%Y-%m-%d %H:%M:%S" showtime="true" translateformat="true" required="true" label="COM_CCPBIOSIM_FORM_LBL_EVENT_STARTDATETIME" description="COM_CCPBIOSIM_FORM_DESC_EVENT_STARTDATETIME" hint="COM_CCPBIOSIM_FORM_LBL_EVENT_STARTDATETIME"/>
1921
<field name="enddatetime" type="calendar" class="inputbox" format="%Y-%m-%d %H:%M:%S" showtime="true" translateformat="true" required="true" label="COM_CCPBIOSIM_FORM_LBL_EVENT_ENDDATETIME" description="COM_CCPBIOSIM_FORM_DESC_EVENT_ENDDATETIME" hint="COM_CCPBIOSIM_FORM_LBL_EVENT_ENDDATETIME"/>
20-
<field name="eventdetails" editor="|" buttons="true" filter="\Joomla\CMS\Component\ComponentHelper::filterText" type="editor" required="true" label="COM_CCPBIOSIM_FORM_LBL_EVENT_EVENTDETAILS" description="COM_CCPBIOSIM_FORM_DESC_EVENT_EVENTDETAILS" hint="COM_CCPBIOSIM_FORM_LBL_EVENT_EVENTDETAILS"/>
21-
<field name="location" default="Manchester, UK" filter="safehtml" type="text" required="true" label="COM_CCPBIOSIM_FORM_LBL_EVENT_LOCATION" description="COM_CCPBIOSIM_FORM_DESC_EVENT_LOCATION" hint="COM_CCPBIOSIM_FORM_LBL_EVENT_LOCATION"/>
2222
<field name="shortdesc" maxlength="100" filter="safehtml" type="text" required="true" label="COM_CCPBIOSIM_FORM_LBL_EVENT_SHORTDESC" description="COM_CCPBIOSIM_FORM_DESC_EVENT_SHORTDESC" hint="COM_CCPBIOSIM_FORM_LBL_EVENT_SHORTDESC"/>
23+
<field name="eventdetails" editor="|" buttons="true" filter="\Joomla\CMS\Component\ComponentHelper::filterText" type="editor" required="true" label="COM_CCPBIOSIM_FORM_LBL_EVENT_EVENTDETAILS" description="COM_CCPBIOSIM_FORM_DESC_EVENT_EVENTDETAILS" hint="COM_CCPBIOSIM_FORM_LBL_EVENT_EVENTDETAILS"/>
2324
<field name="youtube" validate="url" type="url" label="COM_CCPBIOSIM_FORM_LBL_EVENT_YOUTUBE" description="COM_CCPBIOSIM_FORM_DESC_EVENT_YOUTUBE" hint="COM_CCPBIOSIM_FORM_LBL_EVENT_YOUTUBE"/>
2425
<field name="postevent" editor="|" buttons="true" filter="\Joomla\CMS\Component\ComponentHelper::filterText" type="editor" label="COM_CCPBIOSIM_FORM_LBL_EVENT_POSTEVENT" description="COM_CCPBIOSIM_FORM_DESC_EVENT_POSTEVENT" hint="COM_CCPBIOSIM_FORM_LBL_EVENT_POSTEVENT"/>
25-
<field name="shorturl" filter="safehtml" type="text" required="true" label="COM_CCPBIOSIM_FORM_LBL_EVENT_SHORTURL" description="COM_CCPBIOSIM_FORM_DESC_EVENT_SHORTURL" hint="COM_CCPBIOSIM_FORM_LBL_EVENT_SHORTURL"/>
2626
<field name="version_note" type="text" label="JGLOBAL_FIELD_VERSION_NOTE_LABEL" description="JGLOBAL_FIELD_VERSION_NOTE_DESC" class="inputbox" size="45" labelclass="control-label"/>
2727
</fieldset>
2828
</form>

com_ccpbiosim/administrator/tmpl/event/edit.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,22 @@
2424
action="<?php echo Route::_('index.php?option=com_ccpbiosim&layout=edit&id=' . (int) $this->item->id); ?>"
2525
method="post" enctype="multipart/form-data" name="adminForm" id="event-form" class="form-validate form-horizontal">
2626

27-
2827
<?php echo HTMLHelper::_('uitab.startTabSet', 'myTab', array('active' => 'event')); ?>
2928
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'event', Text::_('COM_CCPBIOSIM_TAB_EVENT', true)); ?>
3029
<div class="row-fluid">
3130
<div class="col-md-12 form-horizontal">
3231
<fieldset class="adminform">
3332
<legend><?php echo Text::_('COM_CCPBIOSIM_FIELDSET_EVENT'); ?></legend>
3433
<?php echo $this->form->renderField('title'); ?>
34+
<?php echo $this->form->renderField('shorturl'); ?>
3535
<?php echo $this->form->renderField('category'); ?>
36+
<?php echo $this->form->renderField('location'); ?>
3637
<?php echo $this->form->renderField('startdatetime'); ?>
3738
<?php echo $this->form->renderField('enddatetime'); ?>
38-
<?php echo $this->form->renderField('eventdetails'); ?>
39-
<?php echo $this->form->renderField('location'); ?>
4039
<?php echo $this->form->renderField('shortdesc'); ?>
40+
<?php echo $this->form->renderField('eventdetails'); ?>
4141
<?php echo $this->form->renderField('youtube'); ?>
4242
<?php echo $this->form->renderField('postevent'); ?>
43-
<?php echo $this->form->renderField('shorturl'); ?>
4443
<?php if ($this->state->params->get('save_history', 1)) : ?>
4544
<div class="control-group">
4645
<div class="control-label"><?php echo $this->form->getLabel('version_note'); ?></div>
@@ -58,7 +57,6 @@
5857
<?php echo $this->form->renderField('created_by'); ?>
5958
<?php echo $this->form->renderField('modified_by'); ?>
6059

61-
6260
<?php echo HTMLHelper::_('uitab.endTabSet'); ?>
6361

6462
<input type="hidden" name="task" value=""/>

com_ccpbiosim/media/css/site.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@
182182
}
183183

184184
.events-date .year {
185-
font-size: 0.7rem;
185+
font-size: 0.75rem;
186186
opacity: 0.8;
187187
}
188188

com_ccpbiosim/site/forms/eventform.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
<field name="checked_out" type="hidden" filter="unset"/>
1313
<field name="checked_out_time" type="hidden" filter="unset"/>
1414
<field name="title" filter="safehtml" type="text" required="true" label="JGLOBAL_TITLE" description="COM_CCPBIOSIM_FORM_DESC_EVENT_TITLE" hint="Add a title for this event"/>
15+
<field name="shorturl" filter="safehtml" type="text" required="true" label="COM_CCPBIOSIM_FORM_LBL_EVENT_SHORTURL" description="COM_CCPBIOSIM_FORM_DESC_EVENT_SHORTURL" hint="COM_CCPBIOSIM_FORM_LBL_EVENT_SHORTURL"/>
1516
<field name="category" query="SELECT * FROM #__ccpbiosim_event_categories" key_field="id" value_field="eventcategory" header="Event Category" type="sql" layout="joomla.form.field.list-fancy-select" required="true" label="COM_CCPBIOSIM_FORM_LBL_EVENT_CATEGORY" description="COM_CCPBIOSIM_FORM_DESC_EVENT_CATEGORY" hint="COM_CCPBIOSIM_FORM_LBL_EVENT_CATEGORY"/>
17+
<field name="location" default="Manchester, UK" filter="safehtml" type="text" required="true" label="COM_CCPBIOSIM_FORM_LBL_EVENT_LOCATION" description="COM_CCPBIOSIM_FORM_DESC_EVENT_LOCATION" hint="COM_CCPBIOSIM_FORM_LBL_EVENT_LOCATION"/>
1618
<field name="startdatetime" type="calendar" class="inputbox" format="%Y-%m-%d %H:%M:%S" showtime="true" translateformat="true" required="true" label="COM_CCPBIOSIM_FORM_LBL_EVENT_STARTDATETIME" description="COM_CCPBIOSIM_FORM_DESC_EVENT_STARTDATETIME" hint="COM_CCPBIOSIM_FORM_LBL_EVENT_STARTDATETIME"/>
1719
<field name="enddatetime" type="calendar" class="inputbox" format="%Y-%m-%d %H:%M:%S" showtime="true" translateformat="true" required="true" label="COM_CCPBIOSIM_FORM_LBL_EVENT_ENDDATETIME" description="COM_CCPBIOSIM_FORM_DESC_EVENT_ENDDATETIME" hint="COM_CCPBIOSIM_FORM_LBL_EVENT_ENDDATETIME"/>
18-
<field name="eventdetails" editor="|" buttons="true" filter="\Joomla\CMS\Component\ComponentHelper::filterText" type="editor" required="true" label="COM_CCPBIOSIM_FORM_LBL_EVENT_EVENTDETAILS" description="COM_CCPBIOSIM_FORM_DESC_EVENT_EVENTDETAILS" hint="COM_CCPBIOSIM_FORM_LBL_EVENT_EVENTDETAILS"/>
19-
<field name="location" default="Manchester, UK" filter="safehtml" type="text" required="true" label="COM_CCPBIOSIM_FORM_LBL_EVENT_LOCATION" description="COM_CCPBIOSIM_FORM_DESC_EVENT_LOCATION" hint="COM_CCPBIOSIM_FORM_LBL_EVENT_LOCATION"/>
2020
<field name="shortdesc" maxlength="100" filter="safehtml" type="text" required="true" label="COM_CCPBIOSIM_FORM_LBL_EVENT_SHORTDESC" description="COM_CCPBIOSIM_FORM_DESC_EVENT_SHORTDESC" hint="COM_CCPBIOSIM_FORM_LBL_EVENT_SHORTDESC"/>
21+
<field name="eventdetails" editor="|" buttons="true" filter="\Joomla\CMS\Component\ComponentHelper::filterText" type="editor" required="true" label="COM_CCPBIOSIM_FORM_LBL_EVENT_EVENTDETAILS" description="COM_CCPBIOSIM_FORM_DESC_EVENT_EVENTDETAILS" hint="COM_CCPBIOSIM_FORM_LBL_EVENT_EVENTDETAILS"/>
2122
<field name="youtube" validate="url" type="url" label="COM_CCPBIOSIM_FORM_LBL_EVENT_YOUTUBE" description="COM_CCPBIOSIM_FORM_DESC_EVENT_YOUTUBE" hint="COM_CCPBIOSIM_FORM_LBL_EVENT_YOUTUBE"/>
2223
<field name="postevent" editor="|" buttons="true" filter="\Joomla\CMS\Component\ComponentHelper::filterText" type="editor" label="COM_CCPBIOSIM_FORM_LBL_EVENT_POSTEVENT" description="COM_CCPBIOSIM_FORM_DESC_EVENT_POSTEVENT" hint="COM_CCPBIOSIM_FORM_LBL_EVENT_POSTEVENT"/>
23-
<field name="shorturl" filter="safehtml" type="text" required="true" label="COM_CCPBIOSIM_FORM_LBL_EVENT_SHORTURL" description="COM_CCPBIOSIM_FORM_DESC_EVENT_SHORTURL" hint="COM_CCPBIOSIM_FORM_LBL_EVENT_SHORTURL"/>
2424
<field name="version_note" type="text" label="JGLOBAL_FIELD_VERSION_NOTE_LABEL" description="JGLOBAL_FIELD_VERSION_NOTE_DESC" class="inputbox" size="45" labelclass="control-label"/>
2525
</fieldset>
2626
</form>

com_ccpbiosim/site/tmpl/events/upcoming-accordion.php

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@
4242
</div>
4343
<?php endif;?>
4444
<p>Below are upcoming events relevant to our community.</p>
45-
45+
<?php if ($canCreate) : ?>
46+
<a href="<?php echo Route::_('index.php?option=com_ccpbiosim&task=eventform.edit&id=0', false, 0); ?>"
47+
class="btn btn-success btn-small"><i
48+
class="icon-plus"></i>
49+
<?php echo Text::_('COM_CCPBIOSIM_ADD_ITEM'); ?></a>
50+
<?php endif; ?>
4651
<!-- Main Content -->
4752
<div class="container my-5">
4853
<div class="accordion" id="eventsAccordion">
@@ -61,9 +66,15 @@
6166
<a href="<?php echo Route::_('index.php?option=com_ccpbiosim&view=event&id='.(int) $item->id); ?>"
6267
class="list-group-item list-group-item-action d-flex align-items-start gap-3">
6368
<div class="events-date bg-success text-white">
64-
<div class="month">Apr</div>
65-
<div class="day">2</div>
66-
<div class="year">2026</div>
69+
<div class="month"><?php echo Factory::getDate($item->startdatetime)->format("M"); ?></div>
70+
<div class="day">
71+
<?php if (Factory::getDate($item->startdatetime)->__get("day") == Factory::getDate($item->enddatetime)->__get("day")): ?>
72+
<?php echo Factory::getDate($item->startdatetime)->__get("day"); ?>
73+
<?php else: ?>
74+
<?php echo Factory::getDate($item->startdatetime)->__get("day"); ?>-<?php echo Factory::getDate($item->enddatetime)->__get("day"); ?>
75+
<?php endif; ?>
76+
</div>
77+
<div class="year"><?php echo Factory::getDate($item->startdatetime)->__get("year"); ?></div>
6778
</div>
6879
<div>
6980
<h6 class="mb-1"><?php echo $this->escape($item->title); ?></h6>
@@ -92,9 +103,15 @@ class="list-group-item list-group-item-action d-flex align-items-start gap-3">
92103
<a href="<?php echo Route::_('index.php?option=com_ccpbiosim&view=event&id='.(int) $item->id); ?>"
93104
class="list-group-item list-group-item-action d-flex align-items-start gap-3">
94105
<div class="events-date bg-primary text-white">
95-
<div class="month">Apr</div>
96-
<div class="day">2</div>
97-
<div class="year">2026</div>
106+
<div class="month"><?php echo Factory::getDate($item->startdatetime)->format("M"); ?></div>
107+
<div class="day">
108+
<?php if (Factory::getDate($item->startdatetime)->__get("day") == Factory::getDate($item->enddatetime)->__get("day")): ?>
109+
<?php echo Factory::getDate($item->startdatetime)->__get("day"); ?>
110+
<?php else: ?>
111+
<?php echo Factory::getDate($item->startdatetime)->__get("day"); ?>-<?php echo Factory::getDate($item->enddatetime)->__get("day"); ?>
112+
<?php endif; ?>
113+
</div>
114+
<div class="year"><?php echo Factory::getDate($item->startdatetime)->__get("year"); ?></div>
98115
</div>
99116
<div>
100117
<h6 class="mb-1"><?php echo $this->escape($item->title); ?></h6>
@@ -123,9 +140,15 @@ class="list-group-item list-group-item-action d-flex align-items-start gap-3">
123140
<a href="<?php echo Route::_('index.php?option=com_ccpbiosim&view=event&id='.(int) $item->id); ?>"
124141
class="list-group-item list-group-item-action d-flex align-items-start gap-3">
125142
<div class="events-date bg-warning text-white">
126-
<div class="month">Apr</div>
127-
<div class="day">2</div>
128-
<div class="year">2026</div>
143+
<div class="month"><?php echo Factory::getDate($item->startdatetime)->format("M"); ?></div>
144+
<div class="day">
145+
<?php if (Factory::getDate($item->startdatetime)->__get("day") == Factory::getDate($item->enddatetime)->__get("day")): ?>
146+
<?php echo Factory::getDate($item->startdatetime)->__get("day"); ?>
147+
<?php else: ?>
148+
<?php echo Factory::getDate($item->startdatetime)->__get("day"); ?>-<?php echo Factory::getDate($item->enddatetime)->__get("day"); ?>
149+
<?php endif; ?>
150+
</div>
151+
<div class="year"><?php echo Factory::getDate($item->startdatetime)->__get("year"); ?></div>
129152
</div>
130153
<div>
131154
<h6 class="mb-1"><?php echo $this->escape($item->title); ?></h6>

0 commit comments

Comments
 (0)