From a41a05e6c0b0fa5f9497f0880a2db9d8d7374092 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 17 Mar 2016 11:50:53 +0100 Subject: bring more structure to profiles edit --- mod/profiles.php | 41 ++-- view/theme/redbasic/css/style.css | 2 - view/tpl/admin_profiles.tpl | 2 +- view/tpl/profile_advanced.tpl | 2 +- view/tpl/profile_edit.tpl | 393 ++++++++++++++++++++++---------------- view/tpl/profile_vcard.tpl | 2 +- view/tpl/profile_vcard_short.tpl | 2 +- 7 files changed, 253 insertions(+), 191 deletions(-) diff --git a/mod/profiles.php b/mod/profiles.php index c3f5679fe..aebcc9022 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -248,7 +248,7 @@ function profiles_post(&$a) { $profile_name = notags(trim($_POST['profile_name'])); if(! strlen($profile_name)) { - notify( t('Profile Name is required.') . EOL); + notice( t('Profile Name is required.') . EOL); return; } @@ -277,7 +277,7 @@ function profiles_post(&$a) { $v = validate_channelname($name); if($v) { - $notice($v); + notice($v); $namechanged = false; $name = $orig[0]['name']; } @@ -687,31 +687,36 @@ function profiles_content(&$a) { '$submit' => t('Submit'), '$viewprof' => t('View this profile'), '$editvis' => t('Edit visibility'), - '$coverpic' => t('Change Cover Photo'), - '$profpic' => t('Change Profile Photo'), + '$coverpic' => t('Change cover photo'), + '$profpic' => t('Change profile photo'), '$cr_prof' => t('Create a new profile using these settings'), '$cl_prof' => t('Clone this profile'), '$del_prof' => t('Delete this profile'), + '$addthing' => t('Add profile things'), + '$personal' => t('Personal'), + '$location' => t('Location'), + '$relation' => t('Relation'), + '$miscellaneous'=> t('Miscellaneous'), '$exportable' => feature_enabled(local_channel(),'profile_export'), '$lbl_import' => t('Import profile from file'), '$lbl_export' => t('Export profile to file'), - '$lbl_gender' => t('Your Gender'), - '$lbl_marital' => t('Marital Status'), - '$lbl_sexual' => t('Sexual Preference'), + '$lbl_gender' => t('Your gender'), + '$lbl_marital' => t('Marital status'), + '$lbl_sexual' => t('Sexual preference'), '$baseurl' => $a->get_baseurl(true), '$profile_id' => $r[0]['id'], - '$profile_name' => array('profile_name', t('Profile Name'), $r[0]['profile_name'], '', '*'), + '$profile_name' => array('profile_name', t('Profile name'), $r[0]['profile_name'], t('Required'), '*'), '$is_default' => $is_default, '$default' => t('This is your default profile.') . EOL . translate_scope(map_scope($channel['channel_r_profile'])), '$advanced' => $advanced, - '$name' => array('name', t('Your Full Name'), $r[0]['name']), + '$name' => array('name', t('Your full name'), $r[0]['name'], t('Required'), '*'), '$pdesc' => array('pdesc', t('Title/Description'), $r[0]['pdesc']), '$dob' => dob($r[0]['dob']), '$hide_friends' => $hide_friends, - '$address' => array('address', t('Street Address'), $r[0]['address']), + '$address' => array('address', t('Street address'), $r[0]['address']), '$locality' => array('locality', t('Locality/City'), $r[0]['locality']), '$region' => array('region', t('Region/State'), $r[0]['region']), - '$postal_code' => array('postal_code', t('Postal/Zip Code'), $r[0]['postal_code']), + '$postal_code' => array('postal_code', t('Postal/Zip code'), $r[0]['postal_code']), '$country_name' => array('country_name', t('Country'), $r[0]['country_name']), '$gender' => gender_selector($r[0]['gender']), '$gender_min' => gender_selector_min($r[0]['gender']), @@ -724,20 +729,20 @@ function profiles_content(&$a) { '$about' => array('about', t('Tell us about yourself'), $r[0]['about']), '$homepage' => array('homepage', t('Homepage URL'), $r[0]['homepage']), '$hometown' => array('hometown', t('Hometown'), $r[0]['hometown']), - '$politic' => array('politic', t('Political Views'), $r[0]['politic']), - '$religion' => array('religion', t('Religious Views'), $r[0]['religion']), + '$politic' => array('politic', t('Political views'), $r[0]['politic']), + '$religion' => array('religion', t('Religious views'), $r[0]['religion']), '$keywords' => array('keywords', t('Keywords used in directory listings'), $r[0]['keywords'], t('Example: fishing photography software')), '$likes' => array('likes', t('Likes'), $r[0]['likes']), '$dislikes' => array('dislikes', t('Dislikes'), $r[0]['dislikes']), '$music' => array('music', t('Musical interests'), $r[0]['music']), '$book' => array('book', t('Books, literature'), $r[0]['book']), '$tv' => array('tv', t('Television'), $r[0]['tv']), - '$film' => array('film', t('Film/dance/culture/entertainment'), $r[0]['film']), + '$film' => array('film', t('Film/Dance/Culture/Entertainment'), $r[0]['film']), '$interest' => array('interest', t('Hobbies/Interests'), $r[0]['interest']), - '$romance' => array('romance',t('Love/romance'), $r[0]['romance']), - '$work' => array('work', t('Work/employment'), $r[0]['work']), - '$education' => array('education', t('School/education'), $r[0]['education']), - '$contact' => array('contact', t('Contact information and Social Networks'), $r[0]['contact']), + '$romance' => array('romance',t('Love/Romance'), $r[0]['romance']), + '$work' => array('work', t('Work/Employment'), $r[0]['work']), + '$education' => array('education', t('School/Education'), $r[0]['education']), + '$contact' => array('contact', t('Contact information and social networks'), $r[0]['contact']), '$channels' => array('channels', t('My other channels'), $r[0]['channels']), '$extra_fields' => $extra_fields, )); diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 5aee57cad..4115ea764 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -128,8 +128,6 @@ pre { .heart { color: #FF0000; - font-size: 100%; - margin-right: 5px; } nav, diff --git a/view/tpl/admin_profiles.tpl b/view/tpl/admin_profiles.tpl index 8962c21b3..dd7250df0 100644 --- a/view/tpl/admin_profiles.tpl +++ b/view/tpl/admin_profiles.tpl @@ -1,5 +1,5 @@
-
 {{$new}}

{{$title}}

+
 {{$new}}

{{$title}}

diff --git a/view/tpl/profile_advanced.tpl b/view/tpl/profile_advanced.tpl index a724c41bb..f928aa3ee 100755 --- a/view/tpl/profile_advanced.tpl +++ b/view/tpl/profile_advanced.tpl @@ -71,7 +71,7 @@ {{if $f == 'marital'}} {{if $profile.marital}}
-
{{$profile.marital.0}}
+
 {{$profile.marital.0}}
{{$profile.marital.1}}{{if in_array('with',$fields)}}{{if $profile.marital.with}} ({{$profile.marital.with}}){{/if}}{{/if}}{{if in_array('howlong',$fields)}}{{if $profile.howlong}} {{$profile.howlong}}{{/if}}{{/if}}
{{/if}} diff --git a/view/tpl/profile_edit.tpl b/view/tpl/profile_edit.tpl index daa56e15c..c7da20f81 100755 --- a/view/tpl/profile_edit.tpl +++ b/view/tpl/profile_edit.tpl @@ -13,12 +13,15 @@ {{$coverpic}} {{/if}} + {{if ! $is_default}} {{/if}} {{if $profile_clone_link}} @@ -51,185 +54,241 @@
-
+
+ + {{if $is_default}} {{/if}} -
- - - {{include file="field_input.tpl" field=$profile_name}} - {{include file="field_input.tpl" field=$name}} - - {{if $fields.pdesc}} - {{include file="field_input.tpl" field=$pdesc}} - {{/if}} - - {{if $fields.gender}} -
- - {{if $advanced}} - {{$gender}} - {{else}} - {{$gender_min}} - {{/if}} +
+
+ +
+
+ {{include file="field_input.tpl" field=$profile_name}} + + {{include file="field_input.tpl" field=$name}} + + {{if $fields.pdesc}} + {{include file="field_input.tpl" field=$pdesc}} + {{/if}} + + {{if $fields.gender}} +
+ + {{if $advanced}} + {{$gender}} + {{else}} + {{$gender_min}} + {{/if}} +
+
+ {{/if}} + + {{if $fields.dob}} + {{$dob}} + {{/if}} + + {{include file="field_checkbox.tpl" field=$hide_friends}} + +
+ +
+
+
+
-
- {{/if}} - - {{if $fields.dob}} - {{$dob}} - {{/if}} - - {{include file="field_checkbox.tpl" field=$hide_friends}} - -
- + {{if $fields.address || $fields.locality || $fields.postal_code || $fields.region || $fields.country_name || $fields.hometown}} +
+ +
+
+ {{if $fields.address}} + {{include file="field_input.tpl" field=$address}} + {{/if}} + + {{if $fields.locality}} + {{include file="field_input.tpl" field=$locality}} + {{/if}} + + {{if $fields.postal_code}} + {{include file="field_input.tpl" field=$postal_code}} + {{/if}} + + {{if $fields.region}} + {{include file="field_input.tpl" field=$region}} + {{/if}} + + {{if $fields.country_name}} + {{include file="field_input.tpl" field=$country_name}} + {{/if}} + + {{if $fields.hometown}} + {{include file="field_input.tpl" field=$hometown}} + {{/if}} + +
+ +
+
+
+
-
- - {{if $fields.address}} - {{include file="field_input.tpl" field=$address}} - {{/if}} - - {{if $fields.locality}} - {{include file="field_input.tpl" field=$locality}} - {{/if}} - - {{if $fields.postal_code}} - {{include file="field_input.tpl" field=$postal_code}} - {{/if}} - - {{if $fields.region}} - {{include file="field_input.tpl" field=$region}} - {{/if}} - - {{if $fields.country_name}} - {{include file="field_input.tpl" field=$country_name}} - {{/if}} - - {{if $fields.hometown}} - {{include file="field_input.tpl" field=$hometown}} - {{/if}} - -
- -
-
- - {{if $fields.marital }} -
- - {{if $advanced}} - {{$marital}} - {{else}} - {{$marital_min}} {{/if}} + {{if $fields.marital || $fields.sexual}} +
+ +
+
+ {{if $fields.marital }} +
+ + {{if $advanced}} + {{$marital}} + {{else}} + {{$marital_min}} + {{/if}} +
+
+ + {{if $fields.with}} + {{include file="field_input.tpl" field=$with}} + {{/if}} + + {{if $fields.howlong}} + {{include file="field_input.tpl" field=$howlong}} + {{/if}} + {{/if}} + + {{if $fields.sexual}} +
+ + {{$sexual}} +
+
+ {{/if}} + +
+ +
+
+
+
-
- - {{if $fields.with}} - {{include file="field_input.tpl" field=$with}} - {{/if}} - - {{if $fields.howlong}} - {{include file="field_input.tpl" field=$howlong}} {{/if}} -
- {{/if}} - - {{if $fields.homepage}} - {{include file="field_input.tpl" field=$homepage}} - {{/if}} - - {{if $fields.sexual}} -
- - {{$sexual}} + {{if $fields.keywords || $fields.politic || $fields.religion || $fields.about || $fields.contact || $fields.homepage || $fields.interest || $fields.likes || $fields.dislikes || $fields.channels || $fields.music || $fields.book || $fields.tv || $fields.romance || $fields.education || $extra_fields}} +
+ +
+
+ {{if $fields.homepage}} + {{include file="field_input.tpl" field=$homepage}} + {{/if}} + + {{if $fields.keywords}} + {{include file="field_input.tpl" field=$keywords}} + {{/if}} + + {{if $fields.politic}} + {{include file="field_input.tpl" field=$politic}} + {{/if}} + + {{if $fields.religion}} + {{include file="field_input.tpl" field=$religion}} + {{/if}} + + {{if $fields.about}} + {{include file="field_textarea.tpl" field=$about}} + {{/if}} + + {{if $fields.contact}} + {{include file="field_textarea.tpl" field=$contact}} + {{/if}} + + {{if $fields.interest}} + {{include file="field_textarea.tpl" field=$interest}} + {{/if}} + + {{if $fields.likes}} + {{include file="field_textarea.tpl" field=$likes}} + {{/if}} + + {{if $fields.dislikes}} + {{include file="field_textarea.tpl" field=$dislikes}} + {{/if}} + + {{if $fields.channels}} + {{include file="field_textarea.tpl" field=$channels}} + {{/if}} + + {{if $fields.music}} + {{include file="field_textarea.tpl" field=$music}} + {{/if}} + + {{if $fields.book}} + {{include file="field_textarea.tpl" field=$book}} + {{/if}} + + {{if $fields.tv}} + {{include file="field_textarea.tpl" field=$tv}} + {{/if}} + + {{if $fields.film}} + {{include file="field_textarea.tpl" field=$film}} + {{/if}} + + {{if $fields.romance}} + {{include file="field_textarea.tpl" field=$romance}} + {{/if}} + + {{if $fields.work}} + {{include file="field_textarea.tpl" field=$work}} + {{/if}} + + {{if $fields.education}} + {{include file="field_textarea.tpl" field=$education}} + {{/if}} + + {{if $extra_fields}} + {{foreach $extra_fields as $field }} + {{include file="field_input.tpl" field=$field}} + {{/foreach}} + {{/if}} +
+ +
+
+
+
-
- {{/if}} - - {{if $fields.politic}} - {{include file="field_input.tpl" field=$politic}} {{/if}} - - {{if $fields.religion}} - {{include file="field_input.tpl" field=$religion}} - {{/if}} - - {{if $fields.keywords}} - {{include file="field_input.tpl" field=$keywords}} - {{/if}} - - {{if $fields.about}} - {{include file="field_textarea.tpl" field=$about}} - {{/if}} - - {{if $fields.contact}} - {{include file="field_textarea.tpl" field=$contact}} - {{/if}} - - - {{if $fields.interest}} - {{include file="field_textarea.tpl" field=$interest}} - {{/if}} - - {{if $fields.likes}} - {{include file="field_textarea.tpl" field=$likes}} - {{/if}} - - {{if $fields.dislikes}} - {{include file="field_textarea.tpl" field=$dislikes}} - {{/if}} - - {{if $fields.channels}} - {{include file="field_textarea.tpl" field=$channels}} - {{/if}} - - {{if $fields.music}} - {{include file="field_textarea.tpl" field=$music}} - {{/if}} - - {{if $fields.book}} - {{include file="field_textarea.tpl" field=$book}} - {{/if}} - - {{if $fields.tv}} - {{include file="field_textarea.tpl" field=$tv}} - {{/if}} - - {{if $fields.film}} - {{include file="field_textarea.tpl" field=$film}} - {{/if}} - - - {{if $fields.romance}} - {{include file="field_textarea.tpl" field=$romance}} - {{/if}} - - {{if $fields.work}} - {{include file="field_textarea.tpl" field=$work}} - {{/if}} - - {{if $fields.education}} - {{include file="field_textarea.tpl" field=$education}} - {{/if}} - - {{if $extra_fields}} - {{foreach $extra_fields as $field }} - {{include file="field_input.tpl" field=$field}} - {{/foreach}} - {{/if}} - -
- -
-
-
diff --git a/view/tpl/profile_vcard.tpl b/view/tpl/profile_vcard.tpl index 943cc6339..cff1e4e14 100755 --- a/view/tpl/profile_vcard.tpl +++ b/view/tpl/profile_vcard.tpl @@ -45,7 +45,7 @@ {{if $gender}}
{{$gender}}
{{$profile.gender}}
{{/if}} - {{if $marital}}
{{$marital}}
{{$profile.marital}}
{{/if}} + {{if $marital}}
 {{$marital}}
{{$profile.marital}}
{{/if}} {{if $homepage}}
{{$homepage}}
{{$profile.homepage}}
{{/if}} diff --git a/view/tpl/profile_vcard_short.tpl b/view/tpl/profile_vcard_short.tpl index 91102306c..d3762d950 100755 --- a/view/tpl/profile_vcard_short.tpl +++ b/view/tpl/profile_vcard_short.tpl @@ -26,7 +26,7 @@ {{if $gender}}
{{$gender}}
{{$profile.gender}}
{{/if}} - {{if $marital}}
{{$marital}}
{{$profile.marital}}
{{/if}} + {{if $marital}}
 {{$marital}}
{{$profile.marital}}
{{/if}} {{if $homepage}}
{{$homepage}}
{{$profile.homepage}}
{{/if}} -- cgit v1.2.3