some minor work on contact edit page

This commit is contained in:
Friendika 2011-08-25 18:12:42 -07:00
parent 21c03fb522
commit 99ea045723
6 changed files with 38 additions and 6 deletions

View file

@ -46,10 +46,11 @@ function contact_reputation($current) {
} }
function contact_poll_interval($current) { function contact_poll_interval($current, $disabled = false) {
$dis = (($disabled) ? ' disabled="disabled" ' : '');
$o = ''; $o = '';
$o .= '<select id="contact-poll-interval" name="poll" />' . "\r\n"; $o .= "<select id=\"contact-poll-interval\" name=\"poll\" $dis />" . "\r\n";
$rep = array( $rep = array(
0 => t('Frequently'), 0 => t('Frequently'),
@ -67,3 +68,13 @@ function contact_poll_interval($current) {
$o .= "</select>\r\n"; $o .= "</select>\r\n";
return $o; return $o;
} }
function network_to_name($s) {
call_hooks('network_to_name', $s);
return str_replace(array(NETWORK_DFRN,NETWORK_OSTATUS,NETWORK_FEED,NETWORK_MAIL,NETWORK_DIASPORA,NETWORK_FACEBOOK,NETWORK_ZOT),
array(t('Friendika'),t('OStatus'),t('RSS/Atom'),t('Email'),t('Diaspora'),t('Facebook'),t('Zot!')),$s);
}

View file

@ -292,6 +292,9 @@ function contacts_content(&$a) {
$lblsuggest = (($r[0]['network'] === NETWORK_DFRN) $lblsuggest = (($r[0]['network'] === NETWORK_DFRN)
? '<div id="contact-suggest-wrapper"><a href="fsuggest/' . $r[0]['id'] . '" id="contact-suggest">' . t('Suggest friends') . '</a></div>' : ''); ? '<div id="contact-suggest-wrapper"><a href="fsuggest/' . $r[0]['id'] . '" id="contact-suggest">' . t('Suggest friends') . '</a></div>' : '');
$poll_enabled = (($r[0]['network'] !== NETWORK_DIASPORA) ? true : false);
$nettype = '<div id="contact-edit-nettype">' . sprintf( t('Network type: %s'),network_to_name($r[0]['network'])) . '</div>';
$o .= replace_macros($tpl,array( $o .= replace_macros($tpl,array(
'$header' => t('Contact Editor'), '$header' => t('Contact Editor'),
@ -312,7 +315,9 @@ function contacts_content(&$a) {
'$lblsuggest' => $lblsuggest, '$lblsuggest' => $lblsuggest,
'$grps' => $grps, '$grps' => $grps,
'$delete' => t('Delete contact'), '$delete' => t('Delete contact'),
'$poll_interval' => contact_poll_interval($r[0]['priority']), '$nettype' => $nettype,
'$poll_interval' => contact_poll_interval($r[0]['priority'],(! $poll_enabled)),
'$poll_enabled' => $poll_enabled,
'$lastupdtext' => t('Last updated: '), '$lastupdtext' => t('Last updated: '),
'$updpub' => t('Update public posts: '), '$updpub' => t('Update public posts: '),
'$last_update' => $last_update, '$last_update' => $last_update,

View file

@ -3,6 +3,8 @@
<div id="contact-edit-banner-name">$name</div> <div id="contact-edit-banner-name">$name</div>
$nettype
<form action="contacts/$contact_id" method="post" > <form action="contacts/$contact_id" method="post" >
<input type="hidden" name="contact_id" value="$contact_id"> <input type="hidden" name="contact_id" value="$contact_id">
@ -28,13 +30,14 @@
</div> </div>
<div id="contact-edit-nav-end"></div> <div id="contact-edit-nav-end"></div>
{{ if $poll_enabled }}
<div id="contact-edit-poll-wrapper"> <div id="contact-edit-poll-wrapper">
<div id="contact-edit-last-update-text">$lastupdtext<span id="contact-edit-last-updated">$last_update</span></div> <div id="contact-edit-last-update-text">$lastupdtext<span id="contact-edit-last-updated">$last_update</span></div>
<div id="contact-edit-poll-text">$updpub</div> <div id="contact-edit-poll-text">$updpub</div>
$poll_interval $poll_interval
<div id="contact-edit-update-now"><a href="contacts/$contact_id/update" >$udnow</a></div> <div id="contact-edit-update-now"><a href="contacts/$contact_id/update" >$udnow</a></div>
</div> </div>
{{ endif }}
</div> </div>
<div id="contact-edit-end" ></div> <div id="contact-edit-end" ></div>

View file

@ -723,7 +723,7 @@ div[id$="wrapper"] br { clear: left; }
#contact-edit-last-update-text { margin-bottom: 15px; } #contact-edit-last-update-text { margin-bottom: 15px; }
#contact-edit-last-updated { font-weight: bold; } #contact-edit-last-updated { font-weight: bold; }
#contact-edit-poll-text { display: inline; } #contact-edit-poll-text { display: inline; }
#contact-edit-end { clear: both; } #contact-edit-end { clear: both; margin-bottom: 65px;}
.contact-photo-menu-button { .contact-photo-menu-button {
position: absolute; position: absolute;

View file

@ -788,6 +788,7 @@ input#dfrn-url {
#contact-edit-end { #contact-edit-end {
clear: both; clear: both;
margin-bottom: 65px;
} }
#fsuggest-desc, #fsuggest-submit-wrapper { #fsuggest-desc, #fsuggest-submit-wrapper {
@ -1378,6 +1379,12 @@ input#dfrn-url {
margin-left: 30px; margin-left: 30px;
} }
#contact-edit-nettype {
margin-top: 5px;
margin-left: 30px;
}
#contact-edit-poll-wrapper { #contact-edit-poll-wrapper {
margin-left: 50px; margin-left: 50px;
margin-top: 30px; margin-top: 30px;

View file

@ -886,6 +886,7 @@ input#dfrn-url {
#contact-edit-end { #contact-edit-end {
clear: both; clear: both;
margin-bottom: 65px;
} }
.contact-photo-menu-button { .contact-photo-menu-button {
@ -1451,6 +1452,11 @@ padding: 5px 10px 0px;
font-weight: bold; font-weight: bold;
margin-left: 30px; margin-left: 30px;
} }
#contact-edit-nettype {
margin-top: 5px;
margin-left: 30px;
}
#contact-edit-poll-wrapper { #contact-edit-poll-wrapper {
margin-left: 50px; margin-left: 50px;