From abcc70722c3577e63b53fcd3acf19d2916d810df Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 5 Feb 2015 19:37:55 -0800 Subject: event form cleanup backported from trinidad - still need to style the checkboxes --- include/datetime.php | 3 ++- mod/events.php | 7 ++++--- view/css/mod_events.css | 31 +++++++++++++++++++++++++++---- 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 .= "
"; + $o .= (($required) ? '*' : ''); $o .= '
'; $o .= ""; 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:') . ' *', + '$s_text' => t('Event Starts:'), '$stext' => $stext, '$ftext' => $ftext, + '$required' => ' *', '$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:') . ' *', + '$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 @@
{{$t_text}}
- +{{$required}} + +
{{$s_text}}
+ {{$s_dsel}}

-- cgit v1.2.3