summaryrefslogtreecommitdiffstats
path: root/apps/contacts/templates
diff options
context:
space:
mode:
Diffstat (limited to 'apps/contacts/templates')
-rw-r--r--apps/contacts/templates/index.php15
-rw-r--r--apps/contacts/templates/part.chooseaddressbook.php1
-rw-r--r--apps/contacts/templates/part.importaddressbook.php38
-rw-r--r--apps/contacts/templates/part.selectaddressbook.php27
4 files changed, 41 insertions, 40 deletions
diff --git a/apps/contacts/templates/index.php b/apps/contacts/templates/index.php
index 5b49b68e954..e13748ddde7 100644
--- a/apps/contacts/templates/index.php
+++ b/apps/contacts/templates/index.php
@@ -1,3 +1,4 @@
+<div id='notification'></div>
<script type='text/javascript'>
var totalurl = '<?php echo OCP\Util::linkToRemote('carddav'); ?>addressbooks';
var categories = <?php echo json_encode($_['categories']); ?>;
@@ -5,13 +6,21 @@
var lang = '<?php echo OCP\Config::getUserValue(OCP\USER::getUser(), 'core', 'lang', 'en'); ?>';
</script>
<div id="leftcontent">
+ <div class="hidden" id="statusbar"></div>
<div id="contacts">
</div>
+ <div id="uploadprogressbar"></div>
<div id="bottomcontrols">
<form>
- <button class="svg" id="contacts_newcontact" title="<?php echo $l->t('Add Contact'); ?>"><img class="svg" src="<?php echo OCP\Util::imagePath('contacts', 'contact-new.svg'); ?>" alt="<?php echo $l->t('Add Contact'); ?>" /></button>
+ <button class="svg" id="contacts_newcontact" title="<?php echo $l->t('Add Contact'); ?>"><img class="svg" src="<?php echo OCP\Util::imagePath('contacts', 'contact-new.svg'); ?>" alt="<?php echo $l->t('Add Contact'); ?>" /></button>
+ <button class="svg" id="contacts_import" title="<?php echo $l->t('Import'); ?>"><img class="svg" src="core/img/actions/upload.svg" alt="<?php echo $l->t('Import'); ?>" /></button>
<button class="svg" id="chooseaddressbook" title="<?php echo $l->t('Addressbooks'); ?>"><img class="svg" src="core/img/actions/settings.svg" alt="<?php echo $l->t('Addressbooks'); ?>" /></button>
</form>
+ <form id="import_upload_form" action="<?php echo OCP\Util::linkTo('contacts', 'ajax/uploadimport.php'); ?>" method="post" enctype="multipart/form-data" target="import_upload_target">
+ <input class="float" id="import_upload_start" type="file" accept="text/*" name="importfile" /></a>
+ <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $_['uploadMaxFilesize'] ?>" id="max_upload">
+ </form>
+ <iframe name="import_upload_target" id='import_upload_target' src=""></iframe>
</div>
</div>
<div id="rightcontent" class="rightcontent" data-id="<?php echo $_['id']; ?>">
@@ -27,3 +36,7 @@
<!-- Dialogs -->
<div id="dialog_holder"></div>
<!-- End of Dialogs -->
+<menu type="context" id="addressbookmenu">
+ <menuitem label="Delete" icon="core/img/actions/delete.svg" onclick="alert('Really? ' + $(this).attr('data-id'))"></menuitem>
+ <menuitem label="Rename" icon="core/img/actions/rename.svg" onclick="alert('Can\'t do that')"></menuitem>
+</menu>
diff --git a/apps/contacts/templates/part.chooseaddressbook.php b/apps/contacts/templates/part.chooseaddressbook.php
index a0ec053ab91..caed67736c5 100644
--- a/apps/contacts/templates/part.chooseaddressbook.php
+++ b/apps/contacts/templates/part.chooseaddressbook.php
@@ -14,7 +14,6 @@ for($i = 0; $i < count($option_addressbooks); $i++){
<tr>
<td colspan="5" style="padding: 0.5em;">
<a class="button" href="#" onclick="Contacts.UI.Addressbooks.newAddressbook(this);"><?php echo $l->t('New Address Book') ?></a>
- <a class="button" href="#" onclick="Contacts.UI.Addressbooks.importAddressbook(this);"><?php echo $l->t('Import from VCF') ?></a>
</td>
</tr>
<tr>
diff --git a/apps/contacts/templates/part.importaddressbook.php b/apps/contacts/templates/part.importaddressbook.php
deleted file mode 100644
index 8ceb5f3538b..00000000000
--- a/apps/contacts/templates/part.importaddressbook.php
+++ /dev/null
@@ -1,38 +0,0 @@
-<?php
-/**
- * Copyright (c) 2012 Thomas Tanghus <thomas@tanghus.net>
- * This file is licensed under the Affero General Public License version 3 or
- * later.
- * See the COPYING-README file.
- */
-?>
-<td id="importaddressbook_dialog" colspan="6">
-<table>
-<tr>
- <th><?php echo $l->t('Select address book to import to:') ?></th>
- <td>
- <form id="import_upload_form" action="<?php echo OCP\Util::linkTo('contacts', 'ajax/uploadimport.php'); ?>" method="post" enctype="multipart/form-data" target="import_upload_target">
- <input type="hidden" name="requesttoken" value="<?php echo $_['requesttoken'] ?>">
- <select id="book" name="book" class="float">
- <?php
- $contacts_options = OC_Contacts_Addressbook::all(OCP\USER::getUser());
- echo OCP\html_select_options($contacts_options, $contacts_options[0]['id'], array('value'=>'id', 'label'=>'displayname'));
- ?>
- </select>
- <span id="import_drop_target" class="droptarget float"><?php echo $l->t("Drop a VCF file<br />to import contacts."); ?> (Max. <?php echo $_['uploadMaxHumanFilesize']; ?>)</span>
- <a class="svg upload float" title="<?php echo $l->t('Select from HD'); ?>">
- <input class="float" id="import_upload_start" type="file" accept="text/*" name="importfile" /></a>
- <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $_['uploadMaxFilesize'] ?>" id="max_upload">
- </form>
- </td>
-</tr>
-</table>
-
-<input id="close_button" style="float: left;" type="button" onclick="Contacts.UI.Addressbooks.cancel(this);" value="<?php echo $l->t("Cancel"); ?>">
-<iframe name="import_upload_target" id='import_upload_target' src=""></iframe>
-</td>
-<script type="text/javascript">
-$(document).ready(function(){
- Contacts.UI.Addressbooks.loadImportHandlers();
-});
-</script> \ No newline at end of file
diff --git a/apps/contacts/templates/part.selectaddressbook.php b/apps/contacts/templates/part.selectaddressbook.php
new file mode 100644
index 00000000000..c54ddaf2e67
--- /dev/null
+++ b/apps/contacts/templates/part.selectaddressbook.php
@@ -0,0 +1,27 @@
+<div id="selectaddressbook_dialog" title="<?php echo $l->t("Select Address Books"); ?>">
+<form>
+<table style="width: 100%">
+ <?php foreach($_['addressbooks'] as $idx => $addressbook) { ?>
+ <tr>
+ <td>
+ <input id="book_<?php echo $addressbook['id']; ?>" name="book" type="radio" value="<?php echo $addressbook['id']; ?>" <?php echo ($idx==0?'checked="checked"':'')?>>
+ </td>
+ <td>
+ <label for="book_<?php echo $addressbook['id']; ?>"><?php echo $addressbook['displayname']; ?></label>
+ </td>
+ <td><?php echo $addressbook['description']; ?></td>
+ </tr>
+ <?php } ?>
+ <tr>
+ <td>
+ <input id="book_new" name="book" type="radio" value="new">
+ </td>
+ <th>
+ <input type="text" class="name" name="displayname" placeholder="<?php echo $l->t("Enter name"); ?>" />
+ </th>
+ <td><input type="text" class="desc" name="description" placeholder="<?php echo $l->t("Enter description"); ?>" /></td>
+ </tr>
+</table>
+</form>
+</div>
+