From 991cbd604a588e676bf316aa120f223071bdff94 Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Mon, 8 Feb 2016 01:56:15 +0100 Subject: [PATCH 1/6] contact-edit-actions-button: initial commit --- mod/contacts.php | 71 ++++++++++++++++++++++++++++++++- view/global.css | 69 ++++++++++++++++++++++---------- view/templates/contact_edit.tpl | 24 ++++++----- 3 files changed, 132 insertions(+), 32 deletions(-) diff --git a/mod/contacts.php b/mod/contacts.php index 0b421433e0..248ed47ab3 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -565,6 +565,8 @@ function contacts_content(&$a) { ($contact['rel'] == CONTACT_IS_FOLLOWER)) $follow = $a->get_baseurl(true)."/follow?url=".urlencode($contact["url"]); + $contact_actions = contact_action_menu($contact); + $o .= replace_macros($tpl, array( //'$header' => t('Contact Editor'), @@ -574,7 +576,7 @@ function contacts_content(&$a) { '$lbl_vis2' => sprintf( t('Please choose the profile you would like to display to %s when viewing your profile securely.'), $contact['name']), '$lbl_info1' => t('Contact Information / Notes'), '$infedit' => t('Edit contact notes'), - '$common_text' => $common_text, + //'$common_text' => $common_text, '$common_link' => $a->get_baseurl(true) . '/common/loc/' . local_user() . '/' . $contact['id'], '$all_friends' => $all_friends, '$relation_text' => $relation_text, @@ -622,7 +624,9 @@ function contacts_content(&$a) { '$about' => bbcode($contact["about"], false, false), '$about_label' => t("About:"), '$keywords' => $contact["keywords"], - '$keywords_label' => t("Tags:") + '$keywords_label' => t("Tags:"), + '$contact_action_button' => t("Actions"), + '$contact_actions' => $contact_actions, )); @@ -954,3 +958,66 @@ function _contact_detail_for_template($rr){ ); } + +function contact_action_menu($contact) { + + $contact_action_menu = array( + 'suggest' => array( + 'label' => t('Suggest friends'), + 'url' => app::get_baseurl(true) . '/fsuggest/' . $contact['id'], + 'title' => '', + 'sel' => '', + 'id' => 'suggest', + ), + + 'update' => array( + 'label' => t('Update now'), + 'url' => app::get_baseurl(true) . '/contacts/' . $contact['id'] . '/update', + 'title' => '', + 'sel' => '', + 'id' => 'update', + ), + + 'repair' => array( + 'label' => t('Repair'), + 'url' => app::get_baseurl(true) . '/crepair/' . $contact['id'], + 'title' => t('Advanced Contact Settings'), + 'sel' => '', + 'id' => 'repair', + ), + + 'block' => array( + 'label' => (intval($contact['blocked']) ? t('Unblock') : t('Block') ), + 'url' => app::get_baseurl(true) . '/contacts/' . $contact['id'] . '/block', + 'title' => t('Toggle Blocked status'), + 'sel' => (intval($contact['blocked']) ? 'active' : ''), + 'id' => 'toggle-block', + ), + + 'ignore' => array( + 'label' => (intval($contact['readonly']) ? t('Unignore') : t('Ignore') ), + 'url' => app::get_baseurl(true) . '/contacts/' . $contact['id'] . '/ignore', + 'title' => t('Toggle Ignored status'), + 'sel' => (intval($contact['readonly']) ? 'active' : ''), + 'id' => 'toggle-ignore', + ), + + 'archive' => array( + 'label' => (intval($contact['archive']) ? t('Unarchive') : t('Archive') ), + 'url' => app::get_baseurl(true) . '/contacts/' . $contact['id'] . '/archive', + 'title' => t('Toggle Archive status'), + 'sel' => (intval($contact['archive']) ? 'active' : ''), + 'id' => 'toggle-archive', + ), + + 'delete' => array( + 'label' => t('Delete'), + 'url' => app::get_baseurl(true) . '/contacts/' . $contact['id'] . '/drop', + 'title' => t('Delete contact'), + 'sel' => '', + 'id' => 'delete', + ) + ); + + return $contact_action_menu; +} diff --git a/view/global.css b/view/global.css index 8646bf8e44..df001ed362 100644 --- a/view/global.css +++ b/view/global.css @@ -1,6 +1,28 @@ /* General style rules .*/ .pull-right { float: right } +/* General designing elements */ +.btn { + outline: none; + -moz-box-shadow: inset 0px 1px 0px 0px #ffffff; + -webkit-box-shadow: inset 0px 1px 0px 0px #ffffff; + box-shadow: inset 0px 1px 0px 0px #ffffff; + background-color: #ededed; + text-indent: 0; + border: 1px solid #dcdcdc; + display: inline-block; + color: #777777; + padding: 5px 10px; + text-align: center; +} + +ul.menu-popup li.divider { + height: 1px; + margin: 3px 0; + overflow: hidden; + background-color: #2d2d2d;; +} + /* List of social Networks */ img.connector, img.connector-disabled { height: 40px; @@ -277,20 +299,20 @@ a { margin: 10px 0 10px; } .version-match { - font-weight: bold; - color: #00a700; + font-weight: bold; + color: #00a700; } .federation-graph { - width: 400px; - height: 400px; - float: right; - margin: 20px; + width: 400px; + height: 400px; + float: right; + margin: 20px; } .federation-network-graph { - width: 240px; - height: 240px; - float: left; - margin: 20px; + width: 240px; + height: 240px; + float: left; + margin: 20px; } ul.federation-stats, ul.credits { @@ -302,10 +324,10 @@ ul.credits li { width: 240px; } table#federation-stats { - width: 100%; + width: 100%; } td.federation-data { - border-bottom: 1px solid #000; + border-bottom: 1px solid #000; } .contact-entry-photo img { @@ -329,25 +351,30 @@ td.federation-data { } .crepair-label { - margin-top: 10px; - float: left; - width: 250px; + margin-top: 10px; + float: left; + width: 250px; } .crepair-input { - margin-top: 10px; - float: left; - width: 200px; + margin-top: 10px; + float: left; + width: 200px; } .renderinfo { - clear: both; + clear: both; } .p-addr { - clear: both; + clear: both; } #live-community { - clear: both; + clear: both; } + +/* contact-edit */ +#contact-edit-actions { + float: right; +} \ No newline at end of file diff --git a/view/templates/contact_edit.tpl b/view/templates/contact_edit.tpl index 15863b6a27..682ebfa36a 100644 --- a/view/templates/contact_edit.tpl +++ b/view/templates/contact_edit.tpl @@ -4,6 +4,21 @@ {{$tab_str}} +
+ {{$contact_action_button}} + + +
+ @@ -35,15 +50,6 @@