From 6657cf7bb1862fac05f84c253b1ed35b476e87b0 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Mon, 13 Jan 2020 22:22:50 -0500 Subject: [PATCH] Rework profile setting page with custom fields --- src/Collection/ProfileFields.php | 10 + src/Module/Settings/Profile/Index.php | 224 +++---- src/Repository/ProfileField.php | 85 +++ .../templates/settings/profile/field/edit.tpl | 13 + view/templates/settings/profile/index.tpl | 533 ++++------------- .../templates/settings/profile/field/edit.tpl | 29 + .../frio/templates/settings/profile/index.tpl | 180 +----- view/theme/vier/style.css | 1 - .../vier/templates/settings/profile/index.tpl | 552 +++++------------- 9 files changed, 463 insertions(+), 1164 deletions(-) create mode 100644 view/templates/settings/profile/field/edit.tpl create mode 100644 view/theme/frio/templates/settings/profile/field/edit.tpl diff --git a/src/Collection/ProfileFields.php b/src/Collection/ProfileFields.php index 223c3ec148..16c267621b 100644 --- a/src/Collection/ProfileFields.php +++ b/src/Collection/ProfileFields.php @@ -14,4 +14,14 @@ class ProfileFields extends BaseCollection { return parent::map($callback); } + + /** + * @param callable|null $callback + * @param int $flag + * @return ProfileFields + */ + public function filter(callable $callback = null, int $flag = 0) + { + return parent::filter($callback, $flag); + } } diff --git a/src/Module/Settings/Profile/Index.php b/src/Module/Settings/Profile/Index.php index c717833670..778f7c09c7 100644 --- a/src/Module/Settings/Profile/Index.php +++ b/src/Module/Settings/Profile/Index.php @@ -2,8 +2,9 @@ namespace Friendica\Module\Settings\Profile; -use Friendica\Content\ContactSelector; +use Friendica\Core\ACL; use Friendica\Core\Hook; +use Friendica\Core\Protocol; use Friendica\Core\Renderer; use Friendica\Core\Session; use Friendica\Core\Worker; @@ -11,12 +12,12 @@ use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Contact; use Friendica\Model\GContact; -use Friendica\Model\Profile as ProfileModel; +use Friendica\Model\Profile; +use Friendica\Model\ProfileField; use Friendica\Model\User; use Friendica\Module\BaseSettingsModule; use Friendica\Module\Security\Login; use Friendica\Network\HTTPException; -use Friendica\Network\Probe; use Friendica\Util\DateTimeFormat; use Friendica\Util\Strings; use Friendica\Util\Temporal; @@ -29,7 +30,7 @@ class Index extends BaseSettingsModule return; } - $profile = ProfileModel::getByUID(local_user()); + $profile = Profile::getByUID(local_user()); if (!DBA::isResult($profile)) { return; } @@ -66,10 +67,9 @@ class Index extends BaseSettingsModule return; } - $namechanged = $profile['username'] != $name; + $namechanged = $profile['name'] != $name; $pdesc = Strings::escapeTags(trim($_POST['pdesc'])); - $gender = Strings::escapeTags(trim($_POST['gender'])); $address = Strings::escapeTags(trim($_POST['address'])); $locality = Strings::escapeTags(trim($_POST['locality'])); $region = Strings::escapeTags(trim($_POST['region'])); @@ -77,63 +77,6 @@ class Index extends BaseSettingsModule $country_name = Strings::escapeTags(trim($_POST['country_name'])); $pub_keywords = self::cleanKeywords(Strings::escapeTags(trim($_POST['pub_keywords']))); $prv_keywords = self::cleanKeywords(Strings::escapeTags(trim($_POST['prv_keywords']))); - $marital = Strings::escapeTags(trim($_POST['marital'])); - $howlong = Strings::escapeTags(trim($_POST['howlong'])); - - $with = (!empty($_POST['with']) ? Strings::escapeTags(trim($_POST['with'])) : ''); - - if (!strlen($howlong)) { - $howlong = DBA::NULL_DATETIME; - } else { - $howlong = DateTimeFormat::convert($howlong, 'UTC', date_default_timezone_get()); - } - - // linkify the relationship target if applicable - if (strlen($with)) { - if ($with != strip_tags($profile['with'])) { - $contact_url = ''; - $lookup = $with; - if (strpos($lookup, '@') === 0) { - $lookup = substr($lookup, 1); - } - $lookup = str_replace('_', ' ', $lookup); - if (strpos($lookup, '@') || (strpos($lookup, 'http://'))) { - $contact_name = $lookup; - $links = @Probe::lrdd($lookup); - if (count($links)) { - foreach ($links as $link) { - if ($link['@attributes']['rel'] === 'http://webfinger.net/rel/profile-page') { - $contact_url = $link['@attributes']['href']; - } - } - } - } else { - $contact_name = $lookup; - - $contact = Contact::selectFirst( - ['url', 'name'], - ['? IN (`name`, `nick`) AND `uid` = ?', $lookup, local_user()] - ); - - if (DBA::isResult($contact)) { - $contact_url = $contact['url']; - $contact_name = $contact['name']; - } - } - - if ($contact_url) { - $with = str_replace($lookup, '' . $contact_name . '', $with); - if (strpos($with, '@') === 0) { - $with = substr($with, 1); - } - } - } else { - $with = $profile['with']; - } - } - - /// @TODO Not flexible enough for later expansion, let's have more OOP here - $sexual = Strings::escapeTags(trim($_POST['sexual'])); $xmpp = Strings::escapeTags(trim($_POST['xmpp'])); $homepage = Strings::escapeTags(trim($_POST['homepage'])); if ((strpos($homepage, 'http') !== 0) && (strlen($homepage))) { @@ -141,63 +84,34 @@ class Index extends BaseSettingsModule $homepage = 'http://' . $homepage; } - $hometown = Strings::escapeTags(trim($_POST['hometown'])); - $politic = Strings::escapeTags(trim($_POST['politic'])); - $religion = Strings::escapeTags(trim($_POST['religion'])); - - $likes = Strings::escapeHtml(trim($_POST['likes'])); - $dislikes = Strings::escapeHtml(trim($_POST['dislikes'])); - - $about = Strings::escapeHtml(trim($_POST['about'])); - $interest = Strings::escapeHtml(trim($_POST['interest'])); - $contact = Strings::escapeHtml(trim($_POST['contact'])); - $music = Strings::escapeHtml(trim($_POST['music'])); - $book = Strings::escapeHtml(trim($_POST['book'])); - $tv = Strings::escapeHtml(trim($_POST['tv'])); - $film = Strings::escapeHtml(trim($_POST['film'])); - $romance = Strings::escapeHtml(trim($_POST['romance'])); - $work = Strings::escapeHtml(trim($_POST['work'])); - $education = Strings::escapeHtml(trim($_POST['education'])); - $hide_friends = intval(!empty($_POST['hide-friends'])); - DI::pConfig()->set(local_user(), 'system', 'detailed_profile', intval(!empty($_POST['detailed_profile']))); + $profileFields = DI::profileField()->selectByUserId(local_user()); + + $profileFields = DI::profileField()->updateCollectionFromForm( + local_user(), + $profileFields, + $_REQUEST['profile_field'], + $_REQUEST['profile_field_order'] + ); + + DI::profileField()->saveCollection($profileFields); $result = DBA::update( 'profile', [ 'name' => $name, 'pdesc' => $pdesc, - 'gender' => $gender, 'dob' => $dob, 'address' => $address, 'locality' => $locality, 'region' => $region, 'postal-code' => $postal_code, 'country-name' => $country_name, - 'marital' => $marital, - 'with' => $with, - 'howlong' => $howlong, - 'sexual' => $sexual, 'xmpp' => $xmpp, 'homepage' => $homepage, - 'hometown' => $hometown, - 'politic' => $politic, - 'religion' => $religion, 'pub_keywords' => $pub_keywords, 'prv_keywords' => $prv_keywords, - 'likes' => $likes, - 'dislikes' => $dislikes, - 'about' => $about, - 'interest' => $interest, - 'contact' => $contact, - 'music' => $music, - 'book' => $book, - 'tv' => $tv, - 'film' => $film, - 'romance' => $romance, - 'work' => $work, - 'education' => $education, 'hide-friends' => $hide_friends, ], [ @@ -205,7 +119,7 @@ class Index extends BaseSettingsModule 'is-default' => true, ] ); - + if ($result) { info(DI::l10n()->t('Profile updated.')); } else { @@ -241,13 +155,59 @@ class Index extends BaseSettingsModule $o = ''; - $profile = ProfileModel::getByUID(local_user()); + $profile = Profile::getByUID(local_user()); if (!DBA::isResult($profile)) { throw new HTTPException\NotFoundException(); } $a = DI::app(); + $custom_fields = []; + + $profileFields = DI::profileField()->selectByUserId(local_user()); + foreach ($profileFields as $profileField) { + /** @var ProfileField $profileField */ + $defaultPermissions = ACL::getDefaultUserPermissions($profileField->permissionset->toArray()); + + $custom_fields[] = [ + 'id' => $profileField->id, + 'legend' => $profileField->label, + 'fields' => [ + 'label' => ['profile_field[' . $profileField->id . '][label]', DI::l10n()->t('Label:'), $profileField->label, DI::l10n()->t('Empty the label to delete this profile field')], + 'value' => ['profile_field[' . $profileField->id . '][value]', DI::l10n()->t('Value:'), $profileField->value, DI::l10n()->t('BBCodes allowed')], + 'acl' => ACL::getFullSelectorHTML( + DI::page(), + $a->user, + false, + $defaultPermissions, + ['network' => Protocol::DFRN], + 'profile_field[' . $profileField->id . ']' + ), + ], + 'permissions' => DI::l10n()->t('Field Permissions'), + 'permdesc' => DI::l10n()->t("(click to open/close)"), + ]; + }; + + $custom_fields[] = [ + 'id' => 'new', + 'legend' => DI::l10n()->t('Add a new profile field'), + 'fields' => [ + 'label' => ['profile_field[new][label]', DI::l10n()->t('Label:')], + 'value' => ['profile_field[new][value]', DI::l10n()->t('Value:'), '', DI::l10n()->t('BBCodes allowed')], + 'acl' => ACL::getFullSelectorHTML( + DI::page(), + $a->user, + false, + ['allow_cid' => []], + ['network' => Protocol::DFRN], + 'profile_field[new]' + ), + ], + 'permissions' => DI::l10n()->t('Field Permissions'), + 'permdesc' => DI::l10n()->t("(click to open/close)"), + ]; + DI::page()['htmlhead'] .= Renderer::replaceMacros(Renderer::getMarkupTemplate('settings/profile/index_head.tpl'), [ '$baseurl' => DI::baseUrl()->get(true), ]); @@ -270,25 +230,9 @@ class Index extends BaseSettingsModule $personal_account = !in_array($a->user['page-flags'], [User::PAGE_FLAGS_COMMUNITY, User::PAGE_FLAGS_PRVGROUP]); - $detailed_profile = - $personal_account - && DI::pConfig()->get(local_user(), 'system', 'detailed_profile', - DI::pConfig()->get(local_user(), 'system', 'detailled_profile') - ) - ; - $tpl = Renderer::getMarkupTemplate('settings/profile/index.tpl'); $o .= Renderer::replaceMacros($tpl, [ '$personal_account' => $personal_account, - '$detailed_profile' => $detailed_profile, - - '$details' => [ - 'detailed_profile', //Name - DI::l10n()->t('Show more profile fields:'), //Label - $detailed_profile, //Value - '', //Help string - [DI::l10n()->t('No'), DI::l10n()->t('Yes')] //Off - On strings - ], '$form_security_token' => self::getFormSecurityToken('settings_profile'), '$form_security_token_photo' => self::getFormSecurityToken('settings_profile_photo'), @@ -299,30 +243,15 @@ class Index extends BaseSettingsModule '$profpic' => DI::l10n()->t('Change Profile Photo'), '$profpiclink' => '/photos/' . $a->user['nickname'], '$viewprof' => DI::l10n()->t('View this profile'), - '$viewallprof' => DI::l10n()->t('View all profiles'), - '$editvis' => DI::l10n()->t('Edit visibility'), - '$cr_prof' => DI::l10n()->t('Create a new profile using these settings'), - '$cl_prof' => DI::l10n()->t('Clone this profile'), - '$del_prof' => DI::l10n()->t('Delete this profile'), - '$lbl_basic_section' => DI::l10n()->t('Basic information'), + '$lbl_personal_section' => DI::l10n()->t('Personal'), '$lbl_picture_section' => DI::l10n()->t('Profile picture'), '$lbl_location_section' => DI::l10n()->t('Location'), - '$lbl_preferences_section' => DI::l10n()->t('Preferences'), - '$lbl_status_section' => DI::l10n()->t('Status information'), - '$lbl_about_section' => DI::l10n()->t('Additional information'), - '$lbl_interests_section' => DI::l10n()->t('Interests'), - '$lbl_personal_section' => DI::l10n()->t('Personal'), - '$lbl_relation_section' => DI::l10n()->t('Relation'), '$lbl_miscellaneous_section' => DI::l10n()->t('Miscellaneous'), + '$lbl_custom_fields_section' => DI::l10n()->t('Custom Profile Fields'), '$lbl_profile_photo' => DI::l10n()->t('Upload Profile Photo'), - '$lbl_gender' => DI::l10n()->t('Your Gender:'), - '$lbl_marital' => DI::l10n()->t(' Marital Status:'), - '$lbl_sexual' => DI::l10n()->t('Sexual Preference:'), - '$lbl_ex2' => DI::l10n()->t('Example: fishing photography software'), - '$default' => '

' . DI::l10n()->t('This is your public profile.
It may be visible to anybody using the internet.') . '

', '$baseurl' => DI::baseUrl()->get(true), '$nickname' => $a->user['nickname'], '$name' => ['name', DI::l10n()->t('Display name:'), $profile['name']], @@ -335,30 +264,11 @@ class Index extends BaseSettingsModule '$postal_code' => ['postal_code', DI::l10n()->t('Postal/Zip Code:'), $profile['postal-code']], '$country_name' => ['country_name', DI::l10n()->t('Country:'), $profile['country-name']], '$age' => ((intval($profile['dob'])) ? '(' . DI::l10n()->t('Age: ') . DI::l10n()->tt('%d year old', '%d years old', Temporal::getAgeByTimezone($profile['dob'], $a->user['timezone'])) . ')' : ''), - '$gender' => DI::l10n()->t(ContactSelector::gender($profile['gender'])), - '$marital' => ['selector' => ContactSelector::maritalStatus($profile['marital']), 'value' => DI::l10n()->t($profile['marital'])], - '$with' => ['with', DI::l10n()->t('Who: (if applicable)'), strip_tags($profile['with']), DI::l10n()->t('Examples: cathy123, Cathy Williams, cathy@example.com')], - '$howlong' => ['howlong', DI::l10n()->t('Since [date]:'), ($profile['howlong'] <= DBA::NULL_DATETIME ? '' : DateTimeFormat::local($profile['howlong']))], - '$sexual' => ['selector' => ContactSelector::sexualPreference($profile['sexual']), 'value' => DI::l10n()->t($profile['sexual'])], - '$about' => ['about', DI::l10n()->t('Tell us about yourself...'), $profile['about']], '$xmpp' => ['xmpp', DI::l10n()->t('XMPP (Jabber) address:'), $profile['xmpp'], DI::l10n()->t('The XMPP address will be propagated to your contacts so that they can follow you.')], '$homepage' => ['homepage', DI::l10n()->t('Homepage URL:'), $profile['homepage']], - '$hometown' => ['hometown', DI::l10n()->t('Hometown:'), $profile['hometown']], - '$politic' => ['politic', DI::l10n()->t('Political Views:'), $profile['politic']], - '$religion' => ['religion', DI::l10n()->t('Religious Views:'), $profile['religion']], '$pub_keywords' => ['pub_keywords', DI::l10n()->t('Public Keywords:'), $profile['pub_keywords'], DI::l10n()->t('(Used for suggesting potential friends, can be seen by others)')], '$prv_keywords' => ['prv_keywords', DI::l10n()->t('Private Keywords:'), $profile['prv_keywords'], DI::l10n()->t('(Used for searching profiles, never shown to others)')], - '$likes' => ['likes', DI::l10n()->t('Likes:'), $profile['likes']], - '$dislikes' => ['dislikes', DI::l10n()->t('Dislikes:'), $profile['dislikes']], - '$music' => ['music', DI::l10n()->t('Musical interests'), $profile['music']], - '$book' => ['book', DI::l10n()->t('Books, literature'), $profile['book']], - '$tv' => ['tv', DI::l10n()->t('Television'), $profile['tv']], - '$film' => ['film', DI::l10n()->t('Film/dance/culture/entertainment'), $profile['film']], - '$interest' => ['interest', DI::l10n()->t('Hobbies/Interests'), $profile['interest']], - '$romance' => ['romance', DI::l10n()->t('Love/romance'), $profile['romance']], - '$work' => ['work', DI::l10n()->t('Work/employment'), $profile['work']], - '$education' => ['education', DI::l10n()->t('School/education'), $profile['education']], - '$contact' => ['contact', DI::l10n()->t('Contact information and Social Networks'), $profile['contact']], + '$custom_fields' => $custom_fields, ]); $arr = ['profile' => $profile, 'entry' => $o]; diff --git a/src/Repository/ProfileField.php b/src/Repository/ProfileField.php index d04104898a..3a97e23717 100644 --- a/src/Repository/ProfileField.php +++ b/src/Repository/ProfileField.php @@ -6,6 +6,7 @@ use Friendica\BaseModel; use Friendica\BaseRepository; use Friendica\Collection; use Friendica\Database\Database; +use Friendica\DI; use Friendica\Model; use Friendica\Util\DateTimeFormat; use Psr\Log\LoggerInterface; @@ -132,4 +133,88 @@ class ProfileField extends BaseRepository return parent::update($model); } + + /** + * @param int $uid User Id + * @param Collection\ProfileFields $profileFields Collection of existing profile fields + * @param array $profileFieldInputs Array of profile field form inputs indexed by profile field id + * @param array $profileFieldOrder List of profile field id in order + * @return Collection\ProfileFields + * @throws \Exception + */ + public function updateCollectionFromForm(int $uid, Collection\ProfileFields $profileFields, array $profileFieldInputs, array $profileFieldOrder) + { + $aclFormatter = DI::aclFormatter(); + + // Returns an associative array of id => order values + $profileFieldOrder = array_flip($profileFieldOrder); + + // Creation of the new field + if (!empty($profileFieldInputs['new']['label'])) { + $psid = $this->permissionSet->getIdFromACL( + $uid, + $aclFormatter->toString($profileFieldInputs['new']['contact_allow'] ?? ''), + $aclFormatter->toString($profileFieldInputs['new']['group_allow'] ?? ''), + $aclFormatter->toString($profileFieldInputs['new']['contact_deny'] ?? ''), + $aclFormatter->toString($profileFieldInputs['new']['group_deny'] ?? '') + ); + + $newProfileField = $this->insert([ + 'uid' => $uid, + 'label' => $profileFieldInputs['new']['label'], + 'value' => $profileFieldInputs['new']['value'], + 'psid' => $psid, + 'order' => $profileFieldOrder['new'], + ]); + + $profileFieldInputs[$newProfileField->id] = $profileFieldInputs['new']; + $profileFieldOrder[$newProfileField->id] = $profileFieldOrder['new']; + + $profileFields[] = $newProfileField; + } + + unset($profileFieldInputs['new']); + unset($profileFieldOrder['new']); + + // Prunes profile field whose label has been emptied + $profileFields = $profileFields->filter(function (Model\ProfileField $profileField) use (&$profileFieldInputs, &$profileFieldOrder) { + $keepModel = !isset($profileFieldInputs[$profileField->id]) || !empty($profileFieldInputs[$profileField->id]['label']); + + if (!$keepModel) { + unset($profileFieldInputs[$profileField->id]); + unset($profileFieldOrder[$profileField->id]); + $this->delete($profileField); + } + + return $keepModel; + }); + + // Regenerates the order values if items were deleted + $profileFieldOrder = array_flip(array_keys($profileFieldOrder)); + + // Update existing profile fields from form values + $profileFields = $profileFields->map(function (Model\ProfileField $profileField) use ($uid, $aclFormatter, &$profileFieldInputs, &$profileFieldOrder) { + if (isset($profileFieldInputs[$profileField->id]) && isset($profileFieldOrder[$profileField->id])) { + $psid = $this->permissionSet->getIdFromACL( + $uid, + $aclFormatter->toString($profileFieldInputs[$profileField->id]['contact_allow'] ?? ''), + $aclFormatter->toString($profileFieldInputs[$profileField->id]['group_allow'] ?? ''), + $aclFormatter->toString($profileFieldInputs[$profileField->id]['contact_deny'] ?? ''), + $aclFormatter->toString($profileFieldInputs[$profileField->id]['group_deny'] ?? '') + ); + + $profileField->psid = $psid; + $profileField->label = $profileFieldInputs[$profileField->id]['label']; + $profileField->value = $profileFieldInputs[$profileField->id]['value']; + $profileField->order = $profileFieldOrder[$profileField->id]; + + unset($profileFieldInputs[$profileField->id]); + unset($profileFieldOrder[$profileField->id]); + } + + return $profileField; + }); + + return $profileFields; + } } diff --git a/view/templates/settings/profile/field/edit.tpl b/view/templates/settings/profile/field/edit.tpl new file mode 100644 index 0000000000..6254119f32 --- /dev/null +++ b/view/templates/settings/profile/field/edit.tpl @@ -0,0 +1,13 @@ +
+ {{$profile_field.legend}} + + + + {{include file="field_input.tpl" field=$profile_field.fields.label}} + + {{include file="field_textarea.tpl" field=$profile_field.fields.value}} +
+ Permissions + {{$profile_field.fields.acl nofilter}} +
+
\ No newline at end of file diff --git a/view/templates/settings/profile/index.tpl b/view/templates/settings/profile/index.tpl index b02ee175eb..979dfcc9ef 100644 --- a/view/templates/settings/profile/index.tpl +++ b/view/templates/settings/profile/index.tpl @@ -1,442 +1,115 @@ -

{{$banner}}

{{$default nofilter}} +
+
+ -
- - +
+ + +
+
+
+ + +
+
+
+ {{$dob nofilter}} +
+
+ {{$hide_friends nofilter}} +
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ +
+
+
+ + +
+
+
+ + +
+
{{$xmpp.3}}
+
+
+ + +
+
{{$pub_keywords.3}}
+
+
+ + +
+
{{$prv_keywords.3}}
+
+
+ +
+
-{{if $detailed_profile}} -{{include file="field_yesno.tpl" field=$details}} -
- - +

{{$lbl_custom_fields_section}}

+ + {{foreach $custom_fields as $custom_field}} + {{include file="settings/profile/field/edit.tpl" profile_field=$custom_field}} + {{/foreach}} + +
+ +
+
+
-
- -
- - -
-
- - -
- -{{$gender nofilter}} -
-
- -
-{{$dob nofilter}} -
-
- -{{$hide_friends nofilter}} - -
- -
-
- - -
- - -
-
- -
- - -
-
- - -
- - -
-
- -
- - -
-
- -
- - -
-
- -
- - -
-
- -
- -
-
- -
- -{{$marital nofilter}} -
- - - - - -
- -
- -{{$sexual nofilter}} -
-
- - - -
- - -
-
- -
- - -
{{$xmpp.3}}
-
- - -
- - -
-
- -
- - -
-
- -
- - -
{{$pub_keywords.3}}
-
- -
- - -
{{$prv_keywords.3}}
-
- - -
- -
-
- -
-

-{{$about.1}} -

- - - -
-
- - -
-

-{{$interest.1}} -

- - - -
-
- - -
-

-{{$likes.1}} -

- - - -
-
- - -
-

-{{$dislikes.1}} -

- - - -
-
- - -
-

-{{$contact.1}} -

- - - -
-
- - -
- -
-
- - -
-

-{{$music.1}} -

- - - -
-
- -
-

-{{$book.1}} -

- - - -
-
- - - -
-

-{{$tv.1}} -

- - - -
-
- - - -
-

-{{$film.1}} -

- - - -
-
- - -
- -
-
- - -
-

-{{$romance.1}} -

- - - -
-
- - - -
-

-{{$work.1}} -

- - - -
-
- - - -
-

-{{$education.1}} -

- - - -
-
- - - -
- -
-
- -{{else}} -{{if $personal_account}} -{{include file="field_yesno.tpl" field=$details}} -{{/if}} -
- - -
-
- -{{if $personal_account}} -
- -{{$gender nofilter}} -
-
- -
-{{$dob nofilter}} -
-
-{{/if}} - -
- - -
-
- -
- - -
{{$xmpp.3}}
-
- - -{{$hide_friends nofilter}} - -
- - -
-
- -
- - -
-
- - -
- - -
-
- -
- - -
-
- -
- - -
-
- -
- - -
{{$pub_keywords.3}}
-
- -
- - -
{{$prv_keywords.3}}
-
- -
-

-{{$about.1}} -

- - - -
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - -{{/if}} - -
- + diff --git a/view/theme/frio/templates/settings/profile/field/edit.tpl b/view/theme/frio/templates/settings/profile/field/edit.tpl new file mode 100644 index 0000000000..cbfb55d3be --- /dev/null +++ b/view/theme/frio/templates/settings/profile/field/edit.tpl @@ -0,0 +1,29 @@ +
+ {{$profile_field.legend}} + + + + {{include file="field_input.tpl" field=$profile_field.fields.label}} + + {{include file="field_textarea.tpl" field=$profile_field.fields.value}} + + {{* Block for setting default permissions *}} +

+ {{$profile_field.permissions}} {{$profile_field.permdesc}} +

+ + {{* We include the aclModal directly into the template since we cant use frio's default modal *}} + +
\ No newline at end of file diff --git a/view/theme/frio/templates/settings/profile/index.tpl b/view/theme/frio/templates/settings/profile/index.tpl index b88a6f1a84..57f8845b66 100644 --- a/view/theme/frio/templates/settings/profile/index.tpl +++ b/view/theme/frio/templates/settings/profile/index.tpl @@ -1,4 +1,3 @@ -
{{include file="section_title.tpl" title=$banner}} @@ -48,15 +47,6 @@
- {{* Some hints to characteristics of the current profile (if available) *}} - - - {{if $personal_account}} -

{{include file="field_yesno.tpl" field=$details}}

- {{/if}} - - {{* friendica differs in $detailled_profile (all fields available and a short Version if this is variable false *}} - {{if $detailed_profile}}
{{* The personal settings *}}
@@ -74,12 +64,6 @@ {{include file="field_input.tpl" field=$pdesc}} -
- - {{$gender nofilter}} -
-
- {{$dob nofilter}} {{$hide_friends nofilter}} @@ -107,7 +91,6 @@ {{include file="field_input.tpl" field=$locality}} - {{include file="field_input.tpl" field=$postal_code}}
@@ -128,43 +111,6 @@
- {{include file="field_input.tpl" field=$hometown}} - -
- -
-
-
-
-
- - {{* The settings for relations *}} -
- -
-
-
- - {{$marital.selector nofilter}} -
-
- - {{include file="field_input.tpl" field=$with}} - - {{include file="field_input.tpl" field=$howlong}} - -
- - {{$sexual.selector nofilter}} -
-
-
@@ -192,34 +138,28 @@ {{include file="field_input.tpl" field=$prv_keywords}} - {{include file="field_input.tpl" field=$politic}} +
+ +
+
+
+
+
- {{include file="field_input.tpl" field=$religion}} - - - {{include file="field_textarea.tpl" field=$about}} - - {{include file="field_textarea.tpl" field=$contact}} - - {{include file="field_textarea.tpl" field=$interest}} - - {{include file="field_textarea.tpl" field=$likes}} - - {{include file="field_textarea.tpl" field=$dislikes}} - - {{include file="field_textarea.tpl" field=$music}} - - {{include file="field_textarea.tpl" field=$book}} - - {{include file="field_textarea.tpl" field=$tv}} - - {{include file="field_textarea.tpl" field=$film}} - - {{include file="field_textarea.tpl" field=$romance}} - - {{include file="field_textarea.tpl" field=$work}} - - {{include file="field_textarea.tpl" field=$education}} + {{* The miscellanous other settings *}} +
+ +
+
+ {{foreach $custom_fields as $custom_field}} + {{include file="settings/profile/field/edit.tpl" profile_field=$custom_field}} + {{/foreach}}
@@ -229,84 +169,6 @@
- - {{else}} - {{* if $detailed_profile not available a short version of the setting page is displayed *}} - {{include file="field_input.tpl" field=$name}} - - {{if $personal_account}} -
- - {{$gender nofilter}} -
-
- - {{$dob nofilter}} - - {{/if}} - - {{include file="field_input.tpl" field=$homepage}} - - {{include file="field_input.tpl" field=$xmpp}} - - {{$hide_friends nofilter}} - - {{include file="field_input.tpl" field=$address}} - - {{include file="field_input.tpl" field=$locality}} - - {{include file="field_input.tpl" field=$postal_code}} - -
- - -
-
- -
- - -
-
- - {{include file="field_input.tpl" field=$pub_keywords}} - - {{include file="field_input.tpl" field=$prv_keywords}} - - {{include file="field_textarea.tpl" field=$about}} - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - {{/if}}
diff --git a/view/theme/vier/style.css b/view/theme/vier/style.css index 1655e783bd..914d23fcc3 100644 --- a/view/theme/vier/style.css +++ b/view/theme/vier/style.css @@ -3240,7 +3240,6 @@ img.photo-album-photo { } #profile-edit-wrapper .toggle-section-content { background:#ededed; - max-width:599px; padding:5px; } diff --git a/view/theme/vier/templates/settings/profile/index.tpl b/view/theme/vier/templates/settings/profile/index.tpl index 841c6d17e8..5d7a94c0a1 100644 --- a/view/theme/vier/templates/settings/profile/index.tpl +++ b/view/theme/vier/templates/settings/profile/index.tpl @@ -1,450 +1,168 @@

{{$banner}}

-{{$default nofilter}} +
+
+ -
+ +
+ {{$lbl_picture_section}} » + -
-{{/if}} - + +
+ {{$lbl_personal_section}} » + +
-
- -
- - -
-
- -{{if $personal_account}} -
- -{{$gender nofilter}} -
-
- -
-{{$dob nofilter}} -
-
-{{/if}} - -
- - -
-
{{$xmpp.3}}
-
- -
- - -
-
- -{{$hide_friends nofilter}} - -
- - -
-
- -
- - -
-
- - -
- - -
-
- -
- - -
-
-
- - -
-
- -
- - -
{{$pub_keywords.3}}
-
- -
- - -
{{$prv_keywords.3}}
-
- -
-

-{{$about.1}} -

- - - -
-
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - -{{/if}} - - -
- +