From: rabuzarus <> Date: Sun, 18 Oct 2015 15:12:48 +0000 (+0200) Subject: template rework: use viewcontact_template.tpl for contact dealing pages X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f9c0c1d6967bdefe4f00700a19b8eba44063e3f7;p=friendica.git template rework: use viewcontact_template.tpl for contact dealing pages --- diff --git a/mod/contacts.php b/mod/contacts.php index c562c9822d..bdb25b022b 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -799,6 +799,7 @@ function contacts_content(&$a) { '$cmd' => $a->cmd, '$contacts' => $contacts, '$contact_drop_confirm' => t('Do you really want to delete this contact?'), + 'multiselect' => 1, '$batch_actions' => array( 'contacts_batch_update' => t('Update'), 'contacts_batch_block' => t('Block')."/".t("Unblock"), diff --git a/mod/dirfind.php b/mod/dirfind.php index 9e02a47e20..77e86c5db3 100644 --- a/mod/dirfind.php +++ b/mod/dirfind.php @@ -141,8 +141,8 @@ function dirfind_content(&$a, $prefix = "") { $entry = array( 'url' => zrl($jj->url), 'name' => htmlentities($jj->name), - 'photo' => proxy_url($jj->photo, false, PROXY_SIZE_THUMB), - 'tags' => $jj->tags, + 'thumb' => proxy_url($jj->photo, false, PROXY_SIZE_THUMB), + 'img_hover' => $jj->tags, 'conntxt' => $conntxt, 'connlnk' => $connlnk, 'photo_menu' => $photo_menu, @@ -151,11 +151,11 @@ function dirfind_content(&$a, $prefix = "") { $entries[] = $entry; } - $tpl = get_markup_template('match.tpl'); + $tpl = get_markup_template('viewcontact_template.tpl'); $o .= replace_macros($tpl,array( 'title' => sprintf( t('People Search - %s'), $search), - '$entries' => $entries, + '$contacts' => $entries, '$paginate' => paginate($a), )); diff --git a/mod/match.php b/mod/match.php index 380f6e74a4..f6174da66c 100644 --- a/mod/match.php +++ b/mod/match.php @@ -56,32 +56,40 @@ function match_content(&$a) { if(count($j->results)) { + $id = 0; + foreach($j->results as $jj) { $match_nurl = normalise_link($jj->url); $match = q("SELECT `nurl` FROM `contact` WHERE `uid` = '%d' AND nurl='%s' LIMIT 1", intval(local_user()), dbesc($match_nurl)); + if (!count($match)) { $jj->photo = str_replace("http:///photo/", get_server()."/photo/", $jj->photo); $connlnk = $a->get_baseurl() . '/follow/?url=' . $jj->url; + $photo_menu = array(array(t("View Profile"), zrl($jj->url))); + $photo_menu[] = array(t("Connect/Follow"), $connlnk); + $entry = array( 'url' => zrl($jj->url), 'name' => $jj->name, - 'photo' => proxy_url($jj->photo, false, PROXY_SIZE_THUMB), + 'thumb' => proxy_url($jj->photo, false, PROXY_SIZE_THUMB), 'inttxt' => ' ' . t('is interested in:'), 'conntxt' => t('Connect'), 'connlnk' => $connlnk, - 'tags' => $jj->tags + 'img_hover' => $jj->tags, + 'photo_menu' => $photo_menu, + 'id' => ++$id, ); - $entries[] = $entry; } + $entries[] = $entry; } - $tpl = get_markup_template('match.tpl'); + $tpl = get_markup_template('viewcontact_template.tpl'); $o .= replace_macros($tpl,array( '$title' => t('Profile Match'), - 'entries' => $entries, + '$contacts' => $entries, '$paginate' => paginate($a), )); diff --git a/mod/suggest.php b/mod/suggest.php index 760bbf06ae..5241e485ee 100644 --- a/mod/suggest.php +++ b/mod/suggest.php @@ -72,31 +72,41 @@ function suggest_content(&$a) { return $o; } + require_once 'include/contact_selectors.php'; + foreach($r as $rr) { $connlnk = $a->get_baseurl() . '/follow/?url=' . (($rr['connect']) ? $rr['connect'] : $rr['url']); + $ignlnk = $a->get_baseurl() . '/suggest?ignore=' . $rr['id']; + $photo_menu = array(array(t("View Profile"), zrl($jj->url))); + $photo_menu[] = array(t("Connect/Follow"), $connlnk); + $photo_menu[] = array(t('Ignore/Hide'), $ignlnk); $entry = array( 'url' => zrl($rr['url']), - 'url_clean' => $rr['url'], + 'itemurl' => $rr['url'], + 'img_hover' => $rr['url'], 'name' => $rr['name'], - 'photo' => proxy_url($rr['photo'], false, PROXY_SIZE_THUMB), - 'ignlnk' => $a->get_baseurl() . '/suggest?ignore=' . $rr['id'], + 'thumb' => proxy_url($rr['photo'], false, PROXY_SIZE_THUMB), + 'ignlnk' => $ignlnk, 'ignid' => $rr['id'], 'conntxt' => t('Connect'), 'connlnk' => $connlnk, - 'ignore' => t('Ignore/Hide') + 'photo_menu' => $photo_menu, + 'ignore' => t('Ignore/Hide'), + 'network' => network_to_name($rr['network'], $rr['url']), + 'id' => ++$id, ); $entries[] = $entry; } - $tpl = get_markup_template('suggest_friends.tpl'); + $tpl = get_markup_template('viewcontact_template.tpl'); $o .= replace_macros($tpl,array( '$title' => t('Friend Suggestions'), - '$entries' => $entries, + '$contacts' => $entries, + )); -// $o .= paginate($a); return $o; } diff --git a/mod/viewcontacts.php b/mod/viewcontacts.php index a6bf74b288..927a597524 100644 --- a/mod/viewcontacts.php +++ b/mod/viewcontacts.php @@ -48,7 +48,7 @@ function viewcontacts_content(&$a) { if($rr['self']) continue; - $url = $rr['url']; + $url = $rr['url']; // route DFRN profiles through the redirect diff --git a/view/templates/contact_template.tpl b/view/templates/contact_template.tpl index d4f65f70f9..4e8c04297d 100644 --- a/view/templates/contact_template.tpl +++ b/view/templates/contact_template.tpl @@ -7,9 +7,10 @@ {{$contact.name}} - {{if !$no_contacts_checkbox}} + {{if $multiselect}} {{/if}} + {{if $contact.photo_menu}} menu
diff --git a/view/templates/contacts-template.tpl b/view/templates/contacts-template.tpl index 896f9af4c9..bec295924e 100644 --- a/view/templates/contacts-template.tpl +++ b/view/templates/contacts-template.tpl @@ -1,5 +1,5 @@ -

{{$header}}{{if $total}} ({{$total}}){{/if}}

+

{{$header}}{{if $total}} ({{$total}}){{/if}}

{{if $finding}}

{{$finding}}

{{/if}} diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css index ae2530b6a2..7220b4c47f 100644 --- a/view/theme/duepuntozero/style.css +++ b/view/theme/duepuntozero/style.css @@ -891,6 +891,10 @@ input#dfrn-url { .contact-entry-photo img { border: none; } +.contact-entry-photo a img { + width: 80px; + height: 80px; +} .contact-entry-photo-end { clear: both; } diff --git a/view/theme/frost-mobile/style.css b/view/theme/frost-mobile/style.css index f4b46fed84..ef030c5f3a 100644 --- a/view/theme/frost-mobile/style.css +++ b/view/theme/frost-mobile/style.css @@ -1124,6 +1124,8 @@ input#dfrn-url { .contact-entry-photo img { border: none; + width: 80px; + height: 80px; } .contact-entry-photo-end { clear: both; diff --git a/view/theme/frost-mobile/templates/contact_template.tpl b/view/theme/frost-mobile/templates/contact_template.tpl index a2506fc17e..42f4b7372a 100644 --- a/view/theme/frost-mobile/templates/contact_template.tpl +++ b/view/theme/frost-mobile/templates/contact_template.tpl @@ -29,8 +29,8 @@
-
{{$contact.name}}

-{{if $contact.alt_text}}
{{$contact.alt_text}}
{{/if}} +
{{$contact.name}}

+ {{if $contact.alt_text}}
{{$contact.alt_text}}
{{/if}}
{{$contact.network}}
diff --git a/view/theme/frost-mobile/templates/viewcontact_template.tpl b/view/theme/frost-mobile/templates/viewcontact_template.tpl new file mode 100644 index 0000000000..3b68410f95 --- /dev/null +++ b/view/theme/frost-mobile/templates/viewcontact_template.tpl @@ -0,0 +1,12 @@ + +{{include file="section_title.tpl"}} + +
+{{foreach $contacts as $contact}} + {{include file="contact_template.tpl"}} +{{/foreach}} +
+ +
+ +{{$paginate}} diff --git a/view/theme/frost/style.css b/view/theme/frost/style.css index 8b87c3bd42..66121baf34 100644 --- a/view/theme/frost/style.css +++ b/view/theme/frost/style.css @@ -1093,15 +1093,19 @@ input#dfrn-url { .contact-entry-photo img { border: none; } +.contact-entry-photo a img { + width: 80px; + height: 80px; +} .contact-entry-photo-end { clear: both; } .contact-entry-name { - float: left; + /*float: left;*/ margin-left: 0px; margin-right: 10px; padding-bottom: 5px; - width: 120px; + /*width: 120px;*/ font-weight: 600; overflow: hidden; } diff --git a/view/theme/frost/templates/contact_template.tpl b/view/theme/frost/templates/contact_template.tpl index 7a29bd0455..1ed1471a6e 100644 --- a/view/theme/frost/templates/contact_template.tpl +++ b/view/theme/frost/templates/contact_template.tpl @@ -10,8 +10,8 @@ {{if $contact.photo_menu}} menu -
- +
{{/if}}
-
{{$contact.name}}

-{{if $contact.alt_text}}
{{$contact.alt_text}}
{{/if}} +
{{$contact.name}}
+ {{if $contact.alt_text}}
{{$contact.alt_text}}
{{/if}}
{{$contact.network}}
diff --git a/view/theme/quattro/dark/style.css b/view/theme/quattro/dark/style.css index 1eda67de13..b0489af808 100644 --- a/view/theme/quattro/dark/style.css +++ b/view/theme/quattro/dark/style.css @@ -1543,6 +1543,31 @@ span[id^="showmore-wrap"] { left: 0px; top: 63px; } +.contact-wrapper .drop { + background-image: url('../../../images/icons/22/delete.png'); + display: block; + width: 22px; + height: 22px; + position: relative; + top: 10px; + left: -10px; + z-index: 99; +} +.contact-wrapper .drophide { + background-image: url('../../../images/icons/22/delete.png'); + display: block; + width: 22px; + height: 22px; + opacity: 0.3; + position: relative; + top: 10px; + left: -10px; + z-index: 99; +} +.contact-wrapper .contact-entry-connect { + padding-top: 5px; + font-weight: bold; +} .directory-item { float: left; width: 200px; diff --git a/view/theme/quattro/green/style.css b/view/theme/quattro/green/style.css index 71569971e5..0c7050045d 100644 --- a/view/theme/quattro/green/style.css +++ b/view/theme/quattro/green/style.css @@ -1543,6 +1543,31 @@ span[id^="showmore-wrap"] { left: 0px; top: 63px; } +.contact-wrapper .drop { + background-image: url('../../../images/icons/22/delete.png'); + display: block; + width: 22px; + height: 22px; + position: relative; + top: 10px; + left: -10px; + z-index: 99; +} +.contact-wrapper .drophide { + background-image: url('../../../images/icons/22/delete.png'); + display: block; + width: 22px; + height: 22px; + opacity: 0.3; + position: relative; + top: 10px; + left: -10px; + z-index: 99; +} +.contact-wrapper .contact-entry-connect { + padding-top: 5px; + font-weight: bold; +} .directory-item { float: left; width: 200px; diff --git a/view/theme/quattro/lilac/style.css b/view/theme/quattro/lilac/style.css index 55b81e5daf..c5f655427a 100644 --- a/view/theme/quattro/lilac/style.css +++ b/view/theme/quattro/lilac/style.css @@ -1543,6 +1543,31 @@ span[id^="showmore-wrap"] { left: 0px; top: 63px; } +.contact-wrapper .drop { + background-image: url('../../../images/icons/22/delete.png'); + display: block; + width: 22px; + height: 22px; + position: relative; + top: 10px; + left: -10px; + z-index: 99; +} +.contact-wrapper .drophide { + background-image: url('../../../images/icons/22/delete.png'); + display: block; + width: 22px; + height: 22px; + opacity: 0.3; + position: relative; + top: 10px; + left: -10px; + z-index: 99; +} +.contact-wrapper .contact-entry-connect { + padding-top: 5px; + font-weight: bold; +} .directory-item { float: left; width: 200px; diff --git a/view/theme/quattro/quattro.less b/view/theme/quattro/quattro.less index 3c9915576f..cd604b656a 100644 --- a/view/theme/quattro/quattro.less +++ b/view/theme/quattro/quattro.less @@ -877,6 +877,27 @@ span[id^="showmore-wrap"] { left: 0px; top: 63px; } + .drop { + background-image: url('../../../images/icons/22/delete.png'); + display: block; width: 22px; height: 22px; + position: relative; + top: 10px; + left: -10px; + z-index: 99; + } + .drophide { + background-image: url('../../../images/icons/22/delete.png'); + display: block; width: 22px; height: 22px; + opacity: 0.3; + position: relative; + top: 10px; + left: -10px; + z-index: 99; + } + .contact-entry-connect { + padding-top: 5px; + font-weight: bold; + } } .directory-item { float: left; diff --git a/view/theme/quattro/templates/contact_template.tpl b/view/theme/quattro/templates/contact_template.tpl index 0f0207b2bf..634630d9ab 100644 --- a/view/theme/quattro/templates/contact_template.tpl +++ b/view/theme/quattro/templates/contact_template.tpl @@ -1,5 +1,6 @@
+ {{if $contact.ignlnk}}{{/if}}
{{$contact.name}} - {{if !$no_contacts_checkbox}} + {{if $multiselect}} {{/if}} {{if $contact.photo_menu}} @@ -30,6 +31,10 @@
{{$contact.itemurl}}
{{$contact.network}}
+ {{if $contact.connlnk}} +
{{$contact.conntxt}}
+ {{/if}} +
diff --git a/view/theme/smoothly/style.css b/view/theme/smoothly/style.css index 46d8902aeb..3fe04c0649 100644 --- a/view/theme/smoothly/style.css +++ b/view/theme/smoothly/style.css @@ -291,7 +291,7 @@ section { margin: 10px 0 0 230px; } -.login-form, +.login-form { margin-top: 10px; } @@ -2784,7 +2784,7 @@ margin-left: 0px; font-weight: bold; } -.contact-entry-name { +.contact-entry-name, .contact-entry-connect { width: 100px; overflow: hidden; font: #999; @@ -2805,6 +2805,11 @@ margin-left: 0px; -webkit-box-shadow: 0 0 8px #BDBDBD;*/ } +.contact-entry-photo a img { + width: 80px; + height: 80px; +} + .contact-entry-edit-links .icon { border: 1px solid #babdb6; border-radius: 3px; diff --git a/view/theme/vier/style.css b/view/theme/vier/style.css index 1c03edc6bf..d914d944a2 100644 --- a/view/theme/vier/style.css +++ b/view/theme/vier/style.css @@ -2282,6 +2282,10 @@ aside #id_password { float: left; margin: 0px 10px 10px 0px; } +.contact-entry-photo a img { + width: 80px; + height: 80px; +} /* profile match wrapper */ .profile-match-wrapper { float: left; diff --git a/view/theme/vier/templates/contact_template.tpl b/view/theme/vier/templates/contact_template.tpl index 5271112d83..a065b8fbf4 100644 --- a/view/theme/vier/templates/contact_template.tpl +++ b/view/theme/vier/templates/contact_template.tpl @@ -7,7 +7,7 @@ {{$contact.name}} - {{if !$no_contacts_checkbox}} + {{if $multiselect}} {{/if}} {{if $contact.photo_menu}}