From 768d10536f944fececc48b91e9ada3d86b83d419 Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Tue, 26 Jul 2016 09:09:40 +0200 Subject: [PATCH] frio: templates for contact_edit and crepair --- include/contact_selectors.php | 4 +- mod/contacts.php | 4 + mod/crepair.php | 34 ++-- view/templates/contact_edit.tpl | 2 - view/templates/crepair.tpl | 62 ++---- view/theme/frio/css/style.css | 26 ++- view/theme/frio/templates/contact_edit.tpl | 192 ++++++++++++++++++ .../frio/templates/contacts-template.tpl | 2 +- view/theme/frio/templates/crepair.tpl | 54 +++++ .../theme/frio/templates/profile_advanced.tpl | 2 +- view/theme/vier/templates/contact_edit.tpl | 2 - 11 files changed, 314 insertions(+), 70 deletions(-) create mode 100644 view/theme/frio/templates/contact_edit.tpl create mode 100644 view/theme/frio/templates/crepair.tpl diff --git a/include/contact_selectors.php b/include/contact_selectors.php index 3bf68f764e..35c9d983d7 100644 --- a/include/contact_selectors.php +++ b/include/contact_selectors.php @@ -7,10 +7,10 @@ function contact_profile_assign($current,$foreign_net) { $disabled = (($foreign_net) ? ' disabled="true" ' : ''); - $o .= "\r\n"; $r = q("SELECT `id`, `profile-name` FROM `profile` WHERE `uid` = %d", - intval($_SESSION['uid'])); + intval($_SESSION['uid'])); if(count($r)) { foreach($r as $rr) { diff --git a/mod/contacts.php b/mod/contacts.php index 4eb435fc75..81bf4c03b8 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -571,6 +571,7 @@ function contacts_content(&$a) { $o .= replace_macros($tpl, array( //'$header' => t('Contact Editor'), + '$header' => t("Contact"), '$tab_str' => $tab_str, '$submit' => t('Submit'), '$lbl_vis1' => t('Profile Visibility'), @@ -604,6 +605,7 @@ function contacts_content(&$a) { '$ignore_text' => (($contact['readonly']) ? t('Unignore') : t('Ignore') ), '$insecure' => (($contact['network'] !== NETWORK_DFRN && $contact['network'] !== NETWORK_MAIL && $contact['network'] !== NETWORK_FACEBOOK && $contact['network'] !== NETWORK_DIASPORA) ? $insecure : ''), '$info' => $contact['info'], + '$cinfo' => array('info', '', $contact['info'], ''), '$blocked' => (($contact['blocked']) ? t('Currently blocked') : ''), '$ignored' => (($contact['readonly']) ? t('Currently ignored') : ''), '$archived' => (($contact['archive']) ? t('Currently archived') : ''), @@ -620,6 +622,7 @@ function contacts_content(&$a) { '$url' => $url, '$profileurllabel' => t('Profile URL'), '$profileurl' => $contact['url'], + 'account_type' => (($contact['forum'] || $contact['prv']) ? t('Forum') : ''), '$location' => bbcode($contact["location"]), '$location_label' => t("Location:"), '$about' => bbcode($contact["about"], false, false), @@ -630,6 +633,7 @@ function contacts_content(&$a) { '$contact_actions' => $contact_actions, '$contact_status' => t("Status"), '$contact_settings_label' => t('Contact Settings'), + '$contact_profile_label' => t("Profile"), )); diff --git a/mod/crepair.php b/mod/crepair.php index 5b4db09dac..3abbe343b2 100644 --- a/mod/crepair.php +++ b/mod/crepair.php @@ -24,7 +24,7 @@ function crepair_init(&$a) { if($contact_id) { $a->data['contact'] = $r[0]; - $contact = $r[0]; + $contact = $r[0]; profile_load($a, "", 0, get_contact_details_by_url($contact["url"])); } } @@ -150,15 +150,9 @@ function crepair_content(&$a) { '$return' => t('Return to contact editor'), '$update_profile' => update_profile, '$udprofilenow' => t('Refetch contact data'), - '$label_name' => t('Name'), - '$label_nick' => t('Account Nickname'), - '$label_attag' => t('@Tagname - overrides Name/Nickname'), - '$label_url' => t('Account URL'), - '$label_request' => t('Friend Request URL'), - '$label_confirm' => t('Friend Confirm URL'), - '$label_notify' => t('Notification Endpoint URL'), - '$label_poll' => t('Poll/Feed URL'), - '$label_photo' => t('New photo from this URL'), + '$contact_id' => $contact['id'], + '$lbl_submit' => t('Submit'), + '$label_remote_self' => t('Remote Self'), '$allow_remote_self' => $allow_remote_self, '$remote_self' => array('remote_self', @@ -167,16 +161,16 @@ function crepair_content(&$a) { t('Mark this contact as remote_self, this will cause friendica to repost new entries from this contact.'), $remote_self_options ), - '$contact_name' => htmlentities($contact['name']), - '$contact_nick' => htmlentities($contact['nick']), - '$contact_id' => $contact['id'], - '$contact_url' => $contact['url'], - '$request' => $contact['request'], - '$confirm' => $contact['confirm'], - '$notify' => $contact['notify'], - '$poll' => $contact['poll'], - '$contact_attag' => $contact['attag'], - '$lbl_submit' => t('Submit') + + '$name' => array('name', t('Name') , htmlentities($contact['name'])), + '$nick' => array('nick', t('Account Nickname'), htmlentities($contact['nick'])), + '$attag' => array('attag', t('@Tagname - overrides Name/Nickname'), $contact['attag']), + '$url' => array('url', t('Account URL'), $contact['url']), + '$request' => array('request', t('Friend Request URL'), $contact['request']), + 'confirm' => array('confirm', t('Friend Confirm URL'), $contact['confirm']), + 'notify' => array('notify', t('Notification Endpoint URL'), $contact['notify']), + 'poll' => array('poll', t('Poll/Feed URL'), $contact['poll']), + 'photo' => array('photo', t('New photo from this URL'), ''), )); return $o; diff --git a/view/templates/contact_edit.tpl b/view/templates/contact_edit.tpl index c5012822ec..9e86060885 100644 --- a/view/templates/contact_edit.tpl +++ b/view/templates/contact_edit.tpl @@ -1,6 +1,4 @@ -{{if $header}}

{{$header}}

{{/if}} -
{{* Insert Tab-Nav *}} diff --git a/view/templates/crepair.tpl b/view/templates/crepair.tpl index 1d20983310..ba04073b60 100644 --- a/view/templates/crepair.tpl +++ b/view/templates/crepair.tpl @@ -11,56 +11,38 @@
- + -
-{{if $update_profile}} - {{$udprofilenow}} -{{/if}} -
+
+ {{if $update_profile}} + {{$udprofilenow}} + {{/if}} +
- - -
+ {{include file="field_input.tpl" field=$name}} - - -
+ {{include file="field_input.tpl" field=$nick}} - - -
+ {{include file="field_input.tpl" field=$attag}} - - -
+ {{include file="field_input.tpl" field=$url}} - - -
- - - -
+ {{include file="field_input.tpl" field=$request}} - - -
+ {{include file="field_input.tpl" field=$confirm}} - - -
+ {{include file="field_input.tpl" field=$notify}} - - -
-{{if $allow_remote_self eq 1}} -

{{$label_remote_self}}

-{{include file="field_select.tpl" field=$remote_self}} -{{/if}} + {{include file="field_input.tpl" field=$poll}} - + {{include file="field_input.tpl" field=$photo}} -
+ {{if $allow_remote_self eq 1}} +

{{$label_remote_self}}

+ {{include file="field_select.tpl" field=$remote_self}} + {{/if}} + + + diff --git a/view/theme/frio/css/style.css b/view/theme/frio/css/style.css index c7cf213724..ed264ac2d5 100644 --- a/view/theme/frio/css/style.css +++ b/view/theme/frio/css/style.css @@ -1794,8 +1794,8 @@ ul.dropdown-menu li:hover { /* PAGES */ /* Profile-page */ -.generic-page-wrapper ,#profile-page, .profile_photo-content-wrapper, .photos-content-wrapper, -.contacts-content-wrapper, .suggest-content-wrapper, .common-content-wrapper, +.generic-page-wrapper ,#profile-page, .profile_photo-content-wrapper, + .suggest-content-wrapper, .common-content-wrapper, .allfriends-content-wrapper, .match-content-wrapper, .dirfind-content-wrapper, .directory-content-wrapper, .manage-content-wrapper, .notes-content-wrapper, .message-content-wrapper, .apps-content-wrapper, .notifications-content-wrapper, @@ -1909,6 +1909,28 @@ ul li:hover .contact-wrapper a.contact-action-link:hover { padding: 10px 0; } +/* contact-edit */ +#contact-edit-actions { + position: absolute; +} +#contact-edit-status-wrapper { + border: none; + background-color: #E1F5FE; + margin: 15px -15px; +} +#contact-edit-tools { + margin-left: -15px; + margin-right: -15px; +} +#contact-edit-tools > .panel { + padding-left: 15px; + padding-right: 15px; +} +#contact-edit-settings { + display: block; + margin: 0; +} + /* directory page */ #directory-search-heading { padding-top: 10px; diff --git a/view/theme/frio/templates/contact_edit.tpl b/view/theme/frio/templates/contact_edit.tpl new file mode 100644 index 0000000000..b4217aa436 --- /dev/null +++ b/view/theme/frio/templates/contact_edit.tpl @@ -0,0 +1,192 @@ + +
+ {{if $header}}

{{$header}}: {{$name}}{{if $account_type}} ({{$account_type}}){{/if}}

{{/if}} + +
+ + {{* Insert Tab-Nav *}} + {{$tab_str}} + + +
+
+ + {{* This is the Action menu where contact related actions like 'ignore', 'hide' can be performed *}} + +
+ + +
+ {{$contact_status}} + + {{* Block with status information about the contact *}} +
    + {{if $relation_text}}
  • {{$relation_text}}
  • {{/if}} + {{if $nettype}}
  • {{$nettype}}
  • {{/if}} + + {{if $poll_enabled}} +
  • {{$lastupdtext}} {{$last_update}}
    + {{if $poll_interval}} + {{$updpub}} {{$poll_interval}} + {{/if}} +
  • + {{/if}} + + {{if $lost_contact}}
  • {{$lost_contact}}
  • {{/if}} + {{if $insecure}}
  • {{$insecure}}
  • {{/if}} + {{if $blocked}}
  • {{$blocked}}
  • {{/if}} + {{if $ignored}}
  • {{$ignored}}
  • {{/if}} + {{if $archived}}
  • {{$archived}}
  • {{/if}} +
+ + +
{{* End of contact-edit-status-wrapper *}} + + + +
+ + {{* Some information about the contact from the profile *}} +
+ +
+
+
+
{{$profileurllabel}}
{{$profileurl}} +
+ + {{if $location}} +
+
+
{{$location_label}}
+
{{$location}}
+
+ {{/if}} + + {{if $keywords}} +
+
+
{$keywords_label}}
+
{{$keywords}}
+
+ {{/if}} + + {{if $about}} +
+
+
{{$about_label}}
+
{{$about}}
+
+ {{/if}} +
+
+
+
+ +
+ +
+
+ + + + {{include file="field_checkbox.tpl" field=$notify}} + {{if $fetch_further_information}} + {{include file="field_select.tpl" field=$fetch_further_information}} + {{if $fetch_further_information.2 == 2 }} {{include file="field_textarea.tpl" field=$ffi_keyword_blacklist}} {{/if}} + {{/if}} + {{include file="field_checkbox.tpl" field=$hidden}} + +
+ +
+
+
+
+
+ +
+ +
+
+ + {{include file="field_textarea.tpl" field=$cinfo}} + +
+ +
+
+
+
+
+ +
+ +
+ {{if $profile_select}} +
+

{{$lbl_vis2}}

+
+
+ {{$profile_select}} +
+
+ {{/if}} + +
+ +
+
+
+
+
+ +
+ + {{* End of the form *}} +
{{* End of contact-edit-content-wrapper *}} +
+
diff --git a/view/theme/frio/templates/contacts-template.tpl b/view/theme/frio/templates/contacts-template.tpl index b731749e66..68dfeb4314 100644 --- a/view/theme/frio/templates/contacts-template.tpl +++ b/view/theme/frio/templates/contacts-template.tpl @@ -1,5 +1,5 @@ -
+
{{$tabs}} diff --git a/view/theme/frio/templates/crepair.tpl b/view/theme/frio/templates/crepair.tpl new file mode 100644 index 0000000000..22605bb7a5 --- /dev/null +++ b/view/theme/frio/templates/crepair.tpl @@ -0,0 +1,54 @@ + +
+ {{include file="section_title.tpl"}} + + {{$tab_str}} + +
{{$warning}}

+
+ {{$info}}
+ +
+
+ +
+ + + +
+ {{if $update_profile}} + {{$udprofilenow}} + {{/if}} +
+ + {{include file="field_input.tpl" field=$name}} + + {{include file="field_input.tpl" field=$nick}} + + {{include file="field_input.tpl" field=$attag}} + + {{include file="field_input.tpl" field=$url}} + + {{include file="field_input.tpl" field=$request}} + + {{include file="field_input.tpl" field=$confirm}} + + {{include file="field_input.tpl" field=$notify}} + + {{include file="field_input.tpl" field=$poll}} + + {{include file="field_input.tpl" field=$photo}} + + + {{if $allow_remote_self eq 1}} +

{{$label_remote_self}}

+ {{include file="field_select.tpl" field=$remote_self}} + {{/if}} + +
+ +
+
+ +
+
diff --git a/view/theme/frio/templates/profile_advanced.tpl b/view/theme/frio/templates/profile_advanced.tpl index daa8515453..f6941640ab 100644 --- a/view/theme/frio/templates/profile_advanced.tpl +++ b/view/theme/frio/templates/profile_advanced.tpl @@ -18,7 +18,7 @@ -
+

{{$title}}