make the profile minimal by default. Use features to enable the advanced form.

This commit is contained in:
friendica 2014-08-01 01:24:03 -07:00
parent 1199fe415a
commit ff8351437e
6 changed files with 404 additions and 337 deletions

View File

@ -24,6 +24,8 @@ function get_features() {
// This is per post, and different from fixed expiration 'expire' which isn't working yet
array('content_expire', t('Content Expiration'), t('Remove posts/comments and/or private messages at a future time')),
array('multi_profiles', t('Multiple Profiles'), t('Ability to create multiple profiles')),
array('advanced_profiles', t('Advanced Profiles'), t('Additional profile sections and selections')),
array('webpages', t('Web Pages'), t('Provide managed web pages on your channel')),
array('private_notes', t('Private Notes'), t('Enables a tool to store notes and reminders')),
// prettyphoto has licensing issues and will no longer be provided in core -

View File

@ -18,6 +18,25 @@ function gender_selector($current="",$suffix="") {
return $o;
}
function gender_selector_min($current="",$suffix="") {
$o = '';
$select = array('', t('Male'), t('Female'), t('Other'));
call_hooks('gender_selector_min', $select);
$o .= "<select name=\"gender$suffix\" id=\"gender-select$suffix\" size=\"1\" >";
foreach($select as $selection) {
if($selection !== 'NOTRANSLATION') {
$selected = (($selection == $current) ? ' selected="selected" ' : '');
$o .= "<option value=\"$selection\" $selected >$selection</option>";
}
}
$o .= '</select>';
return $o;
}
function sexpref_selector($current="",$suffix="") {
$o = '';
$select = array('', t('Males'), t('Females'), t('Gay'), t('Lesbian'), t('No Preference'), t('Bisexual'), t('Autosexual'), t('Abstinent'), t('Virgin'), t('Deviant'), t('Fetish'), t('Oodles'), t('Nonsexual'));
@ -37,6 +56,25 @@ function sexpref_selector($current="",$suffix="") {
}
function sexpref_selector_min($current="",$suffix="") {
$o = '';
$select = array('', t('Males'), t('Females'), t('Other'));
call_hooks('sexpref_selector_min', $select);
$o .= "<select name=\"sexual$suffix\" id=\"sexual-select$suffix\" size=\"1\" >";
foreach($select as $selection) {
if($selection !== 'NOTRANSLATION') {
$selected = (($selection == $current) ? ' selected="selected" ' : '');
$o .= "<option value=\"$selection\" $selected >$selection</option>";
}
}
$o .= '</select>';
return $o;
}
function marital_selector($current="",$suffix="") {
$o = '';
$select = array('', t('Single'), t('Lonely'), t('Available'), t('Unavailable'), t('Has crush'), t('Infatuated'), t('Dating'), t('Unfaithful'), t('Sex Addict'), t('Friends'), t('Friends/Benefits'), t('Casual'), t('Engaged'), t('Married'), t('Imaginarily married'), t('Partners'), t('Cohabiting'), t('Common law'), t('Happy'), t('Not looking'), t('Swinger'), t('Betrayed'), t('Separated'), t('Unstable'), t('Divorced'), t('Imaginarily divorced'), t('Widowed'), t('Uncertain'), t('It\'s complicated'), t('Don\'t care'), t('Ask me') );
@ -53,3 +91,20 @@ function marital_selector($current="",$suffix="") {
$o .= '</select>';
return $o;
}
function marital_selector_min($current="",$suffix="") {
$o = '';
$select = array('', t('Single'), t('Dating'), t('Cohabiting'), t('Married'), t('Separated'), t('Divorced'), t('Widowed'), t('It\'s complicated'), t('Other'));
call_hooks('marital_selector_min', $select);
$o .= "<select name=\"marital\" id=\"marital-select\" size=\"1\" >";
foreach($select as $selection) {
if($selection !== 'NOTRANSLATION') {
$selected = (($selection == $current) ? ' selected="selected" ' : '');
$o .= "<option value=\"$selection\" $selected >$selection</option>";
}
}
$o .= '</select>';
return $o;
}

View File

@ -485,6 +485,7 @@ function profiles_content(&$a) {
'$editselect' => $editselect,
));
$advanced = ((feature_enabled(local_user(),'advanced_profiles')) ? true : false);
$opt_tpl = get_markup_template("profile-hide_friends.tpl");
$hide_friends = replace_macros($opt_tpl,array(
@ -558,6 +559,7 @@ function profiles_content(&$a) {
'$profile_id' => $r[0]['id'],
'$profile_name' => $r[0]['profile_name'],
'$default' => (($is_default) ? '<p id="profile-edit-default-desc">' . t('This is your <strong>public</strong> profile.<br />It <strong>may</strong> be visible to anybody using the internet.') . '</p>' : ""),
'$advanced' => $advanced,
'$name' => $r[0]['name'],
'$pdesc' => $r[0]['pdesc'],
'$dob' => dob($r[0]['dob']),
@ -569,10 +571,13 @@ function profiles_content(&$a) {
'$country_name' => $r[0]['country_name'],
'$age' => ((intval($r[0]['dob'])) ? '(' . t('Age: ') . age($r[0]['dob'],$a->user['timezone'],$a->user['timezone']) . ')' : ''),
'$gender' => gender_selector($r[0]['gender']),
'$gender_min' => gender_selector_min($r[0]['gender']),
'$marital' => marital_selector($r[0]['marital']),
'$marital_min' => marital_selector_min($r[0]['marital']),
'$with' => $r[0]['with'],
'$howlong' => ($r[0]['howlong'] === '0000-00-00 00:00:00' ? '' : datetime_convert('UTC',date_default_timezone_get(),$r[0]['howlong'])),
'$sexual' => sexpref_selector($r[0]['sexual']),
'$sexual_min' => sexpref_selector_min($r[0]['sexual']),
'$about' => $r[0]['about'],
'$homepage' => $r[0]['homepage'],
'$hometown' => $r[0]['hometown'],

File diff suppressed because it is too large Load Diff

View File

@ -1 +1 @@
2014-07-31.753
2014-08-01.754

View File

@ -41,7 +41,11 @@
<div id="profile-edit-gender-wrapper" >
<label id="profile-edit-gender-label" for="gender-select" >{{$lbl_gender}} </label>
{{if $advanced}}
{{$gender}}
{{else}}
{{$gender_min}}
{{/if}}
</div>
<div id="profile-edit-gender-end"></div>
@ -106,7 +110,11 @@
<div id="profile-edit-marital-wrapper" >
<label id="profile-edit-marital-label" for="profile-edit-marital" >{{$lbl_marital}} </label>
{{if $advanced}}
{{$marital}}
{{else}}
{{$marital_min}}
{{/if}}
</div>
<div class="clear"></div>
<label id="profile-edit-with-label" for="profile-edit-with" > {{$lbl_with}} </label>
@ -119,7 +127,11 @@
<div id="profile-edit-sexual-wrapper" >
<label id="profile-edit-sexual-label" for="sexual-select" >{{$lbl_sexual}} </label>
{{if $advanced}}
{{$sexual}}
{{else}}
{{$sexual_min}}
{{/if}}
</div>
<div id="profile-edit-sexual-end"></div>
@ -131,6 +143,8 @@
</div>
<div id="profile-edit-homepage-end"></div>
{{if $advanced}}
<div id="profile-edit-politic-wrapper" >
<label id="profile-edit-politic-label" for="profile-edit-politic" >{{$lbl_politic}} </label>
<input type="text" size="32" name="politic" id="profile-edit-politic" value="{{$politic}}" />
@ -143,6 +157,8 @@
</div>
<div id="profile-edit-religion-end"></div>
{{/if}}
<div id="profile-edit-pubkeywords-wrapper" >
<label id="profile-edit-pubkeywords-label" for="profile-edit-pubkeywords" >{{$lbl_pubkey}} </label>
<input type="text" size="32" name="keywords" id="profile-edit-pubkeywords" title="{{$lbl_ex2}}" value="{{$keywords}}" />
@ -165,6 +181,19 @@
<div id="about-jot-end"></div>
<div id="contact-jot-wrapper" >
<p id="contact-jot-desc" >
{{$lbl_social}}
</p>
<textarea rows="10" cols="72" id="contact-jot-text" name="contact" >{{$contact}}</textarea>
</div>
<div id="contact-jot-end"></div>
{{if $advanced}}
<div id="interest-jot-wrapper" >
<p id="interest-jot-desc" >
{{$lbl_hobbies}}
@ -198,16 +227,6 @@
<div id="dislikes-jot-end"></div>
<div id="contact-jot-wrapper" >
<p id="contact-jot-desc" >
{{$lbl_social}}
</p>
<textarea rows="10" cols="72" id="contact-jot-text" name="contact" >{{$contact}}</textarea>
</div>
<div id="contact-jot-end"></div>
<div id="channels-jot-wrapper" >
<p id="channels-jot-desc" >
{{$lbl_channels}}
@ -309,7 +328,7 @@
</div>
<div id="education-jot-end"></div>
{{/if}}
<div class="profile-edit-submit-wrapper" >
<input type="submit" name="submit" class="profile-edit-submit-button" value="{{$submit}}" />