From 2982212797dd64e1be13de20dc158842734ee5f8 Mon Sep 17 00:00:00 2001 From: marijus Date: Fri, 31 Oct 2014 14:33:41 +0100 Subject: more work on photo upload --- mod/photos.php | 12 +++++------- view/css/mod_photos.css | 15 ++++---------- view/css/widgets.css | 3 --- view/theme/redbasic/css/style.css | 10 ++++++---- view/tpl/photos_upload.tpl | 41 +++++++++++++++++++++++++-------------- 5 files changed, 41 insertions(+), 40 deletions(-) diff --git a/mod/photos.php b/mod/photos.php index 6aacd2955..a0f11860d 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -540,12 +540,8 @@ function photos_content(&$a) { 'addon_text' => $uploader, 'default_upload' => true); - call_hooks('photo_upload_form',$ret); - $default_upload = '
-
'; - /* Show space usage */ $r = q("select sum(size) as total from photo where aid = %d and scale = 0 ", @@ -584,15 +580,17 @@ function photos_content(&$a) { '$sessid' => session_id(), '$usage' => $usage_message, '$nickname' => $a->data['channel']['channel_address'], - '$newalbum' => t('Enter a new album name or select an existing one:'), + '$newalbum_label' => t('Enter a new album name'), + '$newalbum_placeholder' => t('or select an existing one (doubleclick)'), '$nosharetext' => t('Do not show a status post for this upload'), '$albums' => $albums['albums'], '$selname' => $selname, '$permissions' => t('Permissions'), '$aclselect' => $aclselect_e, '$uploader' => $ret['addon_text'], - '$default' => (($ret['default_upload']) ? $default_upload : ''), - '$uploadurl' => $ret['post_url'] + '$default' => (($ret['default_upload']) ? true : false), + '$uploadurl' => $ret['post_url'], + '$submit' => t('Submit') )); diff --git a/view/css/mod_photos.css b/view/css/mod_photos.css index 3832ea1a6..89041bd09 100644 --- a/view/css/mod_photos.css +++ b/view/css/mod_photos.css @@ -22,24 +22,16 @@ margin-bottom: 25px; } -#photos-upload-noshare { - margin-bottom: 10px; +#photos-upload-album { + width: 100%; } -#photos-upload-spacer, -#photos-upload-new-end { - margin-top: 25px; -} #photos-upload-new-end, #photos-upload-exist-end { clear: both; } #photos-upload-exist-end { margin-bottom: 15px; } -#photos-upload-submit { - margin-top: 15px; -} - #photos-upload-select-files-text { margin-top: 15px; @@ -63,8 +55,9 @@ margin-bottom: 15px; } -#photo-edit-caption-end, #photo-edit-tags-end, #photo-edit-albumname-end, #photo-edit-rotate-end { +#photo-edit-caption-end, #photo-edit-tags-end, #photo-edit-albumname-end, #photo-edit-rotate-end, #photos-upload-perms-end, #photos-upload-noshare-end{ clear: both; + margin-bottom: 10px; } #photo-edit-rotate-end { diff --git a/view/css/widgets.css b/view/css/widgets.css index 593e051da..df113b12e 100644 --- a/view/css/widgets.css +++ b/view/css/widgets.css @@ -26,9 +26,6 @@ /* search */ #search-text { - border: 1px solid #ccc; - padding: 5px; - line-height: 1.5; border-top-right-radius: 0px; border-bottom-right-radius: 0px; } diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 31b769460..5ffc33d31 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -13,7 +13,7 @@ html { } body { - font-family: arial,freesans,sans-serif; + font-family: sans-serif, arial, freesans; font-size: $body_font_size; background-color: $bgcolour; background-image: url('$background_image'); @@ -37,7 +37,7 @@ h5, .h5, h6, .h6 { } .jslider { - font-family: arial,freesans,sans-serif; + font-family: sans-serif, arial, freesans; } abbr { @@ -84,17 +84,19 @@ a.btn-success { input[type="text"], input[type="password"], input[type="submit"], +input[type="file"], select, textarea { - font-family: arial,freesans,sans-serif; + font-family: sans-serif, arial, freesans; font-size: $body_font_size; } input { + padding: 5px; + line-height: 1.5; border: 1px solid $input_border; -moz-border-radius: $radiuspx; border-radius: $radiuspx; - padding: 3px; } input[type="submit"] { diff --git a/view/tpl/photos_upload.tpl b/view/tpl/photos_upload.tpl index 3db292f02..4c53a7c62 100755 --- a/view/tpl/photos_upload.tpl +++ b/view/tpl/photos_upload.tpl @@ -8,11 +8,11 @@
-
- -
-
- + + +
+ + {{foreach $albums as $al}} {{if $al.text}} @@ -22,27 +22,38 @@
+ {{$aclselect}} + + {{if $default}} +
+ +
+
+ + +
+ {{/if}} +
-
- - +
+
+ {{if $uploader}} +
- - {{$aclselect}} -
- -
- {{$uploader}} + {{/if}} - {{$default}}
-- cgit v1.2.3 From d9f2944565f3bc17b21ddbbde85b3083a003f477 Mon Sep 17 00:00:00 2001 From: Stefan Parviainen Date: Fri, 31 Oct 2014 16:09:48 +0100 Subject: Fix problem with default birth date --- include/datetime.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/datetime.php b/include/datetime.php index fe0f29c7a..00bac8ad1 100644 --- a/include/datetime.php +++ b/include/datetime.php @@ -134,7 +134,10 @@ function dob($dob) { if(! $f) $f = 'ymd'; - $o = datesel($f,mktime(0,0,0,0,0,1900),mktime(),mktime(0,0,0,$month,$day,$year),'dob'); + if ($dob && $dob != '0000-00-00') + $o = datesel($f,mktime(0,0,0,0,0,1900),mktime(),mktime(0,0,0,$month,$day,$year),'dob'); + else + $o = datesel($f,mktime(0,0,0,0,0,1900),mktime(),false,'dob'); return $o; } -- cgit v1.2.3 From 5d1bb1b6854b4601eedaa9d39a40832b29d434e5 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Fri, 31 Oct 2014 16:09:46 +0000 Subject: Smarty3 now lives in store --- view/tpl/smarty3/README | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 view/tpl/smarty3/README diff --git a/view/tpl/smarty3/README b/view/tpl/smarty3/README deleted file mode 100644 index 78ff8d9a1..000000000 --- a/view/tpl/smarty3/README +++ /dev/null @@ -1,4 +0,0 @@ -view/tpl/smarty3 - -This directory must exist and be writeable by the webserver in order to store compiled template files, which are created dynamically. Please see the installation instructions. - -- cgit v1.2.3 From 5d151b988605bc5aedbef65b687a43dedbc574e9 Mon Sep 17 00:00:00 2001 From: marijus Date: Fri, 31 Oct 2014 20:25:43 +0100 Subject: do not reload page for photo upload --- mod/photos.php | 20 ++++++++------------ view/css/mod_photos.css | 5 ++--- view/theme/redbasic/css/style.css | 14 +++++--------- view/tpl/album_edit.tpl | 2 +- view/tpl/photo_album.tpl | 3 ++- view/tpl/photo_albums.tpl | 8 ++------ view/tpl/photo_view.tpl | 2 +- view/tpl/photos_recent.tpl | 3 ++- view/tpl/photos_upload.tpl | 12 +++--------- 9 files changed, 26 insertions(+), 43 deletions(-) diff --git a/mod/photos.php b/mod/photos.php index a0f11860d..d1f2b4993 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -476,11 +476,9 @@ function photos_content(&$a) { if(argc() > 3) { $datatype = argv(2); $datum = argv(3); - } - elseif((argc() > 2) && (argv(2) === 'upload')) - $datatype = 'upload'; - else + } else { $datatype = 'summary'; + } if(argc() > 4) $cmd = argv(4); @@ -528,11 +526,7 @@ function photos_content(&$a) { * Display upload form */ - if($datatype === 'upload') { - if(! ($can_post)) { - notice( t('Permission denied.')); - return; - } + if( $can_post) { $uploader = ''; @@ -575,7 +569,7 @@ function photos_content(&$a) { $albums = ((array_key_exists('albums', $a->data)) ? $a->data['albums'] : photos_albums_list($a->data['channel'],$a->data['observer'])); $tpl = get_markup_template('photos_upload.tpl'); - $o .= replace_macros($tpl,array( + $upload_form = replace_macros($tpl,array( '$pagename' => t('Upload Photos'), '$sessid' => session_id(), '$usage' => $usage_message, @@ -594,7 +588,6 @@ function photos_content(&$a) { )); - return $o; } /* @@ -725,7 +718,8 @@ function photos_content(&$a) { '$can_post' => $can_post, '$upload' => array(t('Upload'), $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/upload/' . bin2hex($album)), '$order' => $order, - + '$upload_form' => $upload_form, + '$usage' => $usage_message )); } @@ -1234,6 +1228,8 @@ function photos_content(&$a) { '$can_post' => $can_post, '$upload' => array(t('Upload'), $a->get_baseurl().'/photos/'.$a->data['channel']['channel_address'].'/upload'), '$photos' => $photos, + '$upload_form' => $upload_form, + '$usage' => $usage_message )); } diff --git a/view/css/mod_photos.css b/view/css/mod_photos.css index 89041bd09..061f2f40a 100644 --- a/view/css/mod_photos.css +++ b/view/css/mod_photos.css @@ -66,10 +66,9 @@ #photo-edit-edit, -#photo-album-edit-wrapper { +#photo-album-edit-wrapper, +#photo-upload-form { display: none; - padding: 7px 10px; - margin-bottom: 3px; } #photo-album-edit-submit, #photo-album-edit-drop { diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 5ffc33d31..114098465 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -706,9 +706,7 @@ footer { cursor: pointer; } -#photo-album-edit-wrapper, -#photo-view-wrapper, -#photo-edit-edit { +#photo-view-wrapper { background-color: $item_colour; } @@ -2335,12 +2333,10 @@ aside .nav-pills > li > a { margin-bottom: 0px; } -.section-title-submenu { - margin-top: 10px; -} - -.section-title-submenu a { - margin-right: 10px; +.section-content-tools-wrapper { + padding: 7px 10px; + background-color: $comment_item_colour; + margin-bottom: 3px; } .section-content-wrapper { diff --git a/view/tpl/album_edit.tpl b/view/tpl/album_edit.tpl index a65887d3c..a6815352a 100755 --- a/view/tpl/album_edit.tpl +++ b/view/tpl/album_edit.tpl @@ -1,4 +1,4 @@ -
+
diff --git a/view/tpl/photo_album.tpl b/view/tpl/photo_album.tpl index 0a26fc367..2c0b8e5b9 100755 --- a/view/tpl/photo_album.tpl +++ b/view/tpl/photo_album.tpl @@ -5,13 +5,14 @@ {{/if}} {{if $can_post}} -  {{$upload.0}} + {{/if}}

{{$album}}

+{{$upload_form}} {{$album_edit.1}}
{{foreach $photos as $photo}} diff --git a/view/tpl/photo_albums.tpl b/view/tpl/photo_albums.tpl index 0f8b809ac..de1105bbc 100755 --- a/view/tpl/photo_albums.tpl +++ b/view/tpl/photo_albums.tpl @@ -1,17 +1,13 @@ diff --git a/view/tpl/photo_view.tpl b/view/tpl/photo_view.tpl index c79cd7d56..d1b077f36 100755 --- a/view/tpl/photo_view.tpl +++ b/view/tpl/photo_view.tpl @@ -31,7 +31,7 @@
-
+
diff --git a/view/tpl/photos_recent.tpl b/view/tpl/photos_recent.tpl index 91b088c93..7727abcea 100755 --- a/view/tpl/photos_recent.tpl +++ b/view/tpl/photos_recent.tpl @@ -1,10 +1,11 @@
{{if $can_post}} -  {{$upload.0}} + {{/if}}

{{$title}}

+{{$upload_form}}
{{foreach $photos as $photo}} {{include file="photo_top.tpl"}} diff --git a/view/tpl/photos_upload.tpl b/view/tpl/photos_upload.tpl index 4c53a7c62..5bb0092d6 100755 --- a/view/tpl/photos_upload.tpl +++ b/view/tpl/photos_upload.tpl @@ -1,18 +1,12 @@ -
-
-
{{$usage}}
-

{{$pagename}}

-
-
- -
+
+
- + {{foreach $albums as $al}} {{if $al.text}} -- cgit v1.2.3