Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/polls.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordartcafe <github@dartcafe.de>2017-11-12 13:16:56 +0300
committerdartcafe <github@dartcafe.de>2017-11-12 13:16:56 +0300
commitc5cbc60ad33f60dc0fbe434bb8f2af7b0b9ea4fc (patch)
tree535dc78f742986b1c7ad432d6c33fd385fca95a1 /templates
parent59cddd53dc03b0a4f63d7b00d2a29509de408bef (diff)
Adding Information badges to sidebar
Diffstat (limited to 'templates')
-rw-r--r--templates/goto.tmpl.php51
-rw-r--r--templates/main.tmpl.php1
2 files changed, 44 insertions, 8 deletions
diff --git a/templates/goto.tmpl.php b/templates/goto.tmpl.php
index 0921eef8..4e653559 100644
--- a/templates/goto.tmpl.php
+++ b/templates/goto.tmpl.php
@@ -48,17 +48,18 @@
$votes = $_['votes'];
/** @var \OCA\Polls\Db\Comment[] $comments */
$comments = $_['comments'];
- $isAnonymous = $poll->getIsAnonymous() && $userId !== $poll->getOwner();
- $hideNames = $poll->getIsAnonymous() && $poll->getFullAnonymous();
/** @var \OCA\Polls\Db\Notification $notification */
$notification = $_['notification'];
-
+
+ $isAnonymous = $poll->getIsAnonymous() && $userId !== $poll->getOwner();
+ $hideNames = $poll->getIsAnonymous() && $poll->getFullAnonymous();
+ $access = $poll->getAccess();
if ($poll->getExpire() === null) {
$expired = false;
} else {
$expired = time() > strtotime($poll->getExpire());
}
-
+
if ($expired) {
$statusClass = 'expired-vote';
} else {
@@ -96,7 +97,7 @@
$pollUrl = $urlGenerator->linkToRouteAbsolute('polls.page.goto_poll', ['hash' => $poll->getHash()]);
?>
-<div id="app-disabled">
+<div id="app">
<div id="app-content" class="column <?php p($statusClass . ' ' . $pollTypeClass); ?>">
<div id="controls" class="controls row">
<div id="breadcrump" class="breadcrump row">
@@ -341,10 +342,46 @@
</div>
<div id="app-sidebar" class="detailsView scroll-container disappear">
- <a id="closeDetails" class="close icon-close" href="#" alt="<?php $l->t('Close');?>"></a>
- <div class="table">
+ <div class="column">
<div class="row">
+ <div class="pollInformation column">
+ <div class="status">
+ <div class="authorRow user-cell row">
+ <div class="description leftLabel"><?php p($l->t('Owner')); ?></div>
+ <div class="avatar" title="<?php p($poll->getOwner())?>"></div>
+ <div class="author"><?php p($userMgr->get($poll->getOwner())->getDisplayName()); ?></div>
+ </div>
+
+ <?php
+ if ($expired) {
+ print_unescaped('<span class="badge expired">' . $l->t('Expired'). '</span>');
+ } else {
+ if ($poll->getExpire() !== null){
+ print_unescaped('<span class="badge open">' . $l->t('Expires on %s', array(date('d.m.Y', strtotime($poll->getExpire())))) . '</span>');
+ } else {
+ print_unescaped('<span class="badge open">' . $l->t('Expires never') . '</span>');
+ }
+ }
+
+ if ($access === 'public' || $access === 'hidden' || $access === 'registered') {
+ print_unescaped('<span class="badge information">' . $access . '</span>');
+ } else {
+ print_unescaped('<span class="badge information">' . $l->t('Invitation access') . '</span>');
+ }
+ if ($isAnonymous) {
+ print_unescaped('<span class="badge information">' . $l->t('Anononymous poll') . '</span>');
+ if ($hideNames) {
+ print_unescaped('<span class="badge information">' . $l->t('Usernames hidden to Owner') . '</span>');
+ } else {
+ print_unescaped('<span class="badge information">' . $l->t('Usernames visible to Owner') . '</span>');
+ }
+ }
+ ?>
+ </div>
+
+ </div>
<div id="app-navigation-simulation">
+ <a id="closeDetails" class="close icon-close" href="#" alt="<?php $l->t('Close');?>"></a>
<ul class="with-icons">
<li>
<a id="id_copy_<?php p($poll->getId()); ?>" class="icon-clippy svg copy-link" data-clipboard-text="<?php p($pollUrl); ?>" title="<?php p($l->t('Click to get link')); ?>" href="#">
diff --git a/templates/main.tmpl.php b/templates/main.tmpl.php
index 86c78573..19048d57 100644
--- a/templates/main.tmpl.php
+++ b/templates/main.tmpl.php
@@ -121,7 +121,6 @@
$expiry_date = $l->t('Never');
if ($poll->getExpire() !== null) {
- // $expiry_date = date('d.m.Y', strtotime($poll->getExpire()));
$expiry_date = \OCP\Template::relative_modified_date(strtotime($poll->getExpire())); // does not work, because relative_modified_date seems not to recognise future time diffs
$expiry_style = ' progress';
$timestamp_style = ' live-relative-timestamp';