summaryrefslogtreecommitdiffstats
path: root/apps/contacts
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-08-21 06:02:20 +0200
committerThomas Tanghus <thomas@tanghus.net>2012-08-22 12:40:35 +0200
commit5c1dd82998bff610d819550d5fd86b05248ebff2 (patch)
tree480620942766ec6e393156cc2b022e718a9cc65b /apps/contacts
parente6d87b2c4b643761becbd14d8b7a08ba30aa4269 (diff)
downloadnextcloud-server-5c1dd82998bff610d819550d5fd86b05248ebff2.tar.gz
nextcloud-server-5c1dd82998bff610d819550d5fd86b05248ebff2.zip
Minor layout change.
Diffstat (limited to 'apps/contacts')
-rw-r--r--apps/contacts/js/contacts.js19
-rw-r--r--apps/contacts/templates/part.contact.php84
2 files changed, 46 insertions, 57 deletions
diff --git a/apps/contacts/js/contacts.js b/apps/contacts/js/contacts.js
index 38f81213c09..f270cee4219 100644
--- a/apps/contacts/js/contacts.js
+++ b/apps/contacts/js/contacts.js
@@ -803,7 +803,7 @@ OC.Contacts={
OC.Contacts.Card.addPhone();
break;
case 'ADR':
- if($('#addressdisplay>dl').length == 1) {
+ if($('addresses>dl').length == 1) {
$('#addresses').show();
}
OC.Contacts.Card.editAddress('new', true);
@@ -949,10 +949,10 @@ OC.Contacts={
},
loadAddresses:function() {
$('#addresses').hide();
- $('#addressdisplay dl.propertycontainer').remove();
- var addresscontainer = $('#addressdisplay');
+ $('#addresses dl.propertycontainer').remove();
+ var addresscontainer = $('#addresses');
for(var adr in this.data.ADR) {
- addresscontainer.find('dl').first().clone().insertAfter($('#addressdisplay dl').last()).show();
+ addresscontainer.find('dl').first().clone().insertAfter($('#addresses dl').last()).show();
addresscontainer.find('dl').last().removeClass('template').addClass('propertycontainer');
addresscontainer.find('dl').last().data('checksum', this.data.ADR[adr]['checksum']);
var adrarray = this.data.ADR[adr]['value'];
@@ -991,7 +991,6 @@ OC.Contacts={
}
if(addresscontainer.find('dl').length > 1) {
$('#addresses').show();
- $('#contact_communication').show();
}
return false;
},
@@ -1000,8 +999,8 @@ OC.Contacts={
var params = {id: this.id};
if(obj === 'new') {
isnew = true;
- $('#addressdisplay dl').first().clone(true).insertAfter($('#addressdisplay dl').last()).show();
- container = $('#addressdisplay dl').last();
+ $('#addresses dl').first().clone(true).insertAfter($('#addresses dl').last()).show();
+ container = $('#addresses dl').last();
container.removeClass('template').addClass('propertycontainer');
} else {
params['checksum'] = OC.Contacts.checksumFor(obj);
@@ -1018,7 +1017,7 @@ OC.Contacts={
buttons: {
'Ok':function() {
if(isnew) {
- OC.Contacts.Card.saveAddress(this, $('#addressdisplay dl:last-child').find('input').first(), isnew);
+ OC.Contacts.Card.saveAddress(this, $('#addresses dl:last-child').find('input').first(), isnew);
} else {
OC.Contacts.Card.saveAddress(this, obj, isnew);
}
@@ -1122,7 +1121,7 @@ OC.Contacts={
},
saveAddress:function(dlg, obj, isnew){
if(isnew) {
- container = $('#addressdisplay dl').last();
+ container = $('#addresses dl').last();
obj = container.find('input').first();
} else {
checksum = OC.Contacts.checksumFor(obj);
@@ -1341,7 +1340,6 @@ OC.Contacts={
}
if($('#emaillist li').length > 1) {
$('#emails').show();
- $('#contact_communication').show();
}
$('#emaillist li:last-child').find('input[type="text"]').focus();
return false;
@@ -1404,7 +1402,6 @@ OC.Contacts={
}
if(phonelist.find('li').length > 1) {
$('#phones').show();
- $('#contact_communication').show();
}
return false;
},
diff --git a/apps/contacts/templates/part.contact.php b/apps/contacts/templates/part.contact.php
index e74eef7d7e7..491b4400ff4 100644
--- a/apps/contacts/templates/part.contact.php
+++ b/apps/contacts/templates/part.contact.php
@@ -24,8 +24,9 @@ $id = isset($_['id']) ? $_['id'] : '';
</div>
</div> <!-- contact_photo -->
- <div id="contact_identity">
<form method="post">
+
+ <div id="contact_identity">
<input type="hidden" name="id" value="<?php echo $_['id'] ?>">
<input type="hidden" name="requesttoken" value="<?php echo $_['requesttoken'] ?>">
<fieldset id="ident" class="contactpart">
@@ -49,61 +50,52 @@ $id = isset($_['id']) ? $_['id'] : '';
<a role="button" class="action delete" title="<?php echo $l->t('Delete'); ?>"></a><a role="button" class="action edit" title="<?php echo $l->t('Edit groups'); ?>"></a></dd>
</dl>
</fieldset>
- </form>
</div> <!-- contact_identity -->
- <!-- div class="delimiter"></div -->
- <div id="contact_communication" class="contactsection">
- <form method="post">
- <!-- email addresses -->
- <div id="emails">
- <ul id="emaillist" class="propertylist">
- <li class="template hidden" data-element="EMAIL">
- <input type="checkbox" class="contacts_property tip" name="parameters[TYPE][]" value="PREF" title="<?php echo $l->t('Preferred'); ?>" />
- <input type="email" required="required" class="nonempty contacts_property" name="value" value="" x-moz-errormessage="<?php echo $l->t('Please specify a valid email address.'); ?>" placeholder="<?php echo $l->t('Enter email address'); ?>" />
- <select multiple="multiple" name="parameters[TYPE][]">
- <?php echo OCP\html_select_options($_['email_types'], array()) ?>
- </select>
- <span class="listactions"><a class="action mail" title="<?php echo $l->t('Mail to address'); ?>"></a>
- <a role="button" class="action delete" title="<?php echo $l->t('Delete email address'); ?>"></a></span></li>
- </ul>
- </div> <!-- email addresses-->
-
- <!-- Phone numbers -->
- <div id="phones">
- <ul id="phonelist" class="propertylist">
- <li class="template hidden" data-element="TEL">
- <input type="checkbox" class="contacts_property tip" name="parameters[TYPE][]" value="PREF" title="<?php echo $l->t('Preferred'); ?>" />
- <input type="text" required="required" class="nonempty contacts_property" name="value" value="" placeholder="<?php echo $l->t('Enter phone number'); ?>" />
- <select multiple="multiple" name="parameters[TYPE][]">
- <?php echo OCP\html_select_options($_['phone_types'], array()) ?>
- </select>
- <a role="button" class="action delete" title="<?php echo $l->t('Delete phone number'); ?>"></a></li>
- </ul>
- </div> <!-- Phone numbers -->
+ <!-- email addresses -->
+ <div id="emails" class="hidden contactsection">
+ <ul id="emaillist" class="propertylist">
+ <li class="template hidden" data-element="EMAIL">
+ <input type="checkbox" class="contacts_property tip" name="parameters[TYPE][]" value="PREF" title="<?php echo $l->t('Preferred'); ?>" />
+ <input type="email" required="required" class="nonempty contacts_property" name="value" value="" x-moz-errormessage="<?php echo $l->t('Please specify a valid email address.'); ?>" placeholder="<?php echo $l->t('Enter email address'); ?>" />
+ <select multiple="multiple" name="parameters[TYPE][]">
+ <?php echo OCP\html_select_options($_['email_types'], array()) ?>
+ </select>
+ <span class="listactions"><a class="action mail" title="<?php echo $l->t('Mail to address'); ?>"></a>
+ <a role="button" class="action delete" title="<?php echo $l->t('Delete email address'); ?>"></a></span></li>
+ </ul>
+ </div> <!-- email addresses-->
- <!-- Addresses -->
- <div id="addresses" class="hidden">
- <div id="addressdisplay">
- <dl class="addresscard template hidden" data-element="ADR"><dt>
- <input class="adr contacts_property" name="value" type="hidden" value="" />
- <input type="hidden" class="adr_type contacts_property" name="parameters[TYPE][]" value="" />
- <span class="adr_type_label"></span><a class="action globe" title="<?php echo $l->t('View on map'); ?>"></a><a class="action edit" title="<?php echo $l->t('Edit address details'); ?>"></a><a role="button" class="action delete" title="Delete address"></a>
- </dt><dd><ul class="addresslist"></ul></dd></dl>
+ <!-- Phone numbers -->
+ <div id="phones" class="hidden contactsection">
+ <ul id="phonelist" class="propertylist">
+ <li class="template hidden" data-element="TEL">
+ <input type="checkbox" class="contacts_property tip" name="parameters[TYPE][]" value="PREF" title="<?php echo $l->t('Preferred'); ?>" />
+ <input type="text" required="required" class="nonempty contacts_property" name="value" value="" placeholder="<?php echo $l->t('Enter phone number'); ?>" />
+ <select multiple="multiple" name="parameters[TYPE][]">
+ <?php echo OCP\html_select_options($_['phone_types'], array()) ?>
+ </select>
+ <a role="button" class="action delete" title="<?php echo $l->t('Delete phone number'); ?>"></a></li>
+ </ul>
+ </div> <!-- Phone numbers -->
- </div> <!-- addressdisplay -->
- </div> <!-- Addresses -->
- </form>
- </div> <!-- contact_communication -->
+ <!-- Addresses -->
+ <div id="addresses" class="hidden contactsection">
+ <dl class="addresscard template hidden" data-element="ADR"><dt>
+ <input class="adr contacts_property" name="value" type="hidden" value="" />
+ <input type="hidden" class="adr_type contacts_property" name="parameters[TYPE][]" value="" />
+ <span class="adr_type_label"></span><a class="action globe" title="<?php echo $l->t('View on map'); ?>"></a><a class="action edit" title="<?php echo $l->t('Edit address details'); ?>"></a><a role="button" class="action delete" title="Delete address"></a>
+ </dt><dd><ul class="addresslist"></ul></dd></dl>
+ </div> <!-- Addresses -->
- <div id="contact_note" class="contactsection">
- <form class="float" method="post">
+ <div id="contact_note" class="hidden contactsection">
<div id="note" class="propertycontainer" data-element="NOTE">
<textarea class="contacts_property" name="value" required="required" placeholder="<?php echo $l->t('Add notes here.'); ?>" cols="60" wrap="hard"></textarea>
</div>
- </form>
</div> <!-- contact_note -->
+ </form>
+
<div id="actionbar">
<div id="contacts_propertymenu">
<button class="button" id="contacts_propertymenu_button"><?php echo $l->t('Add field'); ?></button>