diff options
-rw-r--r-- | include/datetime.php | 3 | ||||
-rwxr-xr-x | mod/events.php | 7 | ||||
-rw-r--r-- | view/css/mod_events.css | 31 | ||||
-rwxr-xr-x | view/tpl/event_form.tpl | 5 |
4 files changed, 37 insertions, 9 deletions
diff --git a/include/datetime.php b/include/datetime.php index 346d03bd4..a387d84c4 100644 --- a/include/datetime.php +++ b/include/datetime.php @@ -174,7 +174,7 @@ function timesel($format, $h, $m, $id='timepicker') { * @param $maxfrom * set maximum date from picker with id $maxfrom (none by default) */ -function datetimesel($format, $min, $max, $default, $id = 'datetimepicker', $pickdate = true, $picktime = true, $minfrom = '', $maxfrom = '') { +function datetimesel($format, $min, $max, $default, $id = 'datetimepicker', $pickdate = true, $picktime = true, $minfrom = '', $maxfrom = '',$required = false) { // Once browser support is better this could probably be replaced with native HTML5 date picker $o = ''; @@ -209,6 +209,7 @@ function datetimesel($format, $min, $max, $default, $id = 'datetimepicker', $pic $readable_format = str_replace('i','MM',$readable_format); $o .= "<div class='date'><input type='text' placeholder='$readable_format' name='$id' id='$id' $input_text />"; + $o .= (($required) ? '<span class="required" title="' . t('Required') . '" >*</span>' : ''); $o .= '</div>'; $o .= "<script type='text/javascript'>\$(function () {var picker = \$('#$id').datetimepicker({step:5,format:'$dateformat' $minjs $maxjs $pickers $defaultdatejs}); $extra_js})</script>"; return $o; diff --git a/mod/events.php b/mod/events.php index 9347331d8..7143963f4 100755 --- a/mod/events.php +++ b/mod/events.php @@ -577,12 +577,13 @@ function events_content(&$a) { '$catsenabled' => $catsenabled, '$placeholdercategory' => t('Categories (comma-separated list)'), '$category' => $category, - '$s_text' => t('Event Starts:') . ' <span class="required" title="' . t('Required') . '">*</span>', + '$s_text' => t('Event Starts:'), '$stext' => $stext, '$ftext' => $ftext, + '$required' => ' <span class="required" title="' . t('Required') . '">*</span>', '$ModalCANCEL' => t('Cancel'), '$ModalOK' => t('OK'), - '$s_dsel' => datetimesel($f,new DateTime(),DateTime::createFromFormat('Y',$syear+5),DateTime::createFromFormat('Y-m-d H:i',"$syear-$smonth-$sday $shour:$sminute"),'start_text'), + '$s_dsel' => datetimesel($f,new DateTime(),DateTime::createFromFormat('Y',$syear+5),DateTime::createFromFormat('Y-m-d H:i',"$syear-$smonth-$sday $shour:$sminute"),'start_text',true,true,'','',true), '$n_text' => t('Finish date/time is not known or not relevant'), '$n_checked' => $n_checked, '$f_text' => t('Event Finishes:'), @@ -593,7 +594,7 @@ function events_content(&$a) { '$d_orig' => $d_orig, '$l_text' => t('Location:'), '$l_orig' => $l_orig, - '$t_text' => t('Title:') . ' <span class="required" title="' . t('Required') . '">*</span>', + '$t_text' => t('Title:'), '$t_orig' => $t_orig, '$sh_text' => t('Share this event'), '$sh_checked' => $sh_checked, diff --git a/view/css/mod_events.css b/view/css/mod_events.css index ba4ec9b61..a029440cb 100644 --- a/view/css/mod_events.css +++ b/view/css/mod_events.css @@ -1,12 +1,35 @@ + #event-desc-textarea, #event-location-textarea { - width: 400px; + width: 400px; +} + +#event-summary-text, #event-start-text, #event-finish-text { + width: 200px; + float: left; } -#event-summary { - width: 400px; +#event-summary, #start_text, #finish_text { + width: 300px; + float: left; +} + +#event-category-wrap { + margin-top: 15px; } .event-cats { margin-top: 15px; - width: 400px; + width: 400px; +} + + +.required { + float: left; +} + +#event-datetime-break { + clear: both; +} +#event-nofinish-break { + margin-bottom: 10px; } diff --git a/view/tpl/event_form.tpl b/view/tpl/event_form.tpl index 2479068f3..1cea156dd 100755 --- a/view/tpl/event_form.tpl +++ b/view/tpl/event_form.tpl @@ -14,9 +14,12 @@ <input type="hidden" name="mid" value="{{$mid}}" /> <div id="event-summary-text">{{$t_text}}</div> -<input type="text" id="event-summary" name="summary" value="{{$t_orig}}" /> +<input type="text" id="event-summary" name="summary" value="{{$t_orig}}" />{{$required}} + +<div class="clear"></div> <div id="event-start-text">{{$s_text}}</div> + {{$s_dsel}} <div class="clear"></div><br /> |