From d2f7bae5c60afd4aedf57a9aeefd4b1d600f7d15 Mon Sep 17 00:00:00 2001 From: Maxime Corteel Date: Sun, 17 Apr 2016 01:00:54 +0200 Subject: [PATCH 1/4] Design changes --- appinfo/routes.php | 2 +- controller/pagecontroller.php | 13 +- css/create.css | 86 ++++ css/list.css | 24 ++ css/main.css | 319 +++++++------- css/vote.css | 172 ++++++++ db/commentmapper.php | 2 +- img/home.svg | 5 + img/no.svg | 77 ++++ img/share.svg | 6 + img/yes.svg | 4 + js/create_edit.js | 133 +----- js/start.js | 38 +- js/vote.js | 257 ++++-------- templates/create.tmpl.php | 209 +++++----- templates/goto.tmpl.php | 757 +++++++++++++++++----------------- templates/main.tmpl.php | 32 +- templates/no.acc.tmpl.php | 30 +- 18 files changed, 1143 insertions(+), 1023 deletions(-) create mode 100644 css/create.css create mode 100644 css/list.css create mode 100644 css/vote.css create mode 100644 img/home.svg create mode 100644 img/no.svg create mode 100644 img/share.svg create mode 100644 img/yes.svg diff --git a/appinfo/routes.php b/appinfo/routes.php index 0d1b873a4..d594d1ec0 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -21,7 +21,7 @@ $application = new Application(); $application->registerRoutes($this, array('routes' => array( array('name' => 'page#index', 'url' => '/', 'verb' => 'GET'), - array('name' => 'page#goto_poll', 'url' => '/goto/{hash}', 'verb' => 'GET'), + array('name' => 'page#goto_poll', 'url' => '/poll/{hash}', 'verb' => 'GET'), array('name' => 'page#edit_poll', 'url' => '/edit/{hash}', 'verb' => 'GET'), array('name' => 'page#create_poll', 'url' => '/create', 'verb' => 'GET'), array('name' => 'page#delete_poll', 'url' => '/delete', 'verb' => 'POST'), diff --git a/controller/pagecontroller.php b/controller/pagecontroller.php index d4a00217b..f97ba91ac 100644 --- a/controller/pagecontroller.php +++ b/controller/pagecontroller.php @@ -36,6 +36,7 @@ use \OCP\IURLGenerator; use OCP\Security\ISecureRandom; use \OCP\AppFramework\Http\TemplateResponse; use \OCP\AppFramework\Http\RedirectResponse; +use \OCP\AppFramework\Http\JSONResponse; use \OCP\AppFramework\Controller; $userMgr = \OC::$server->getUserManager(); @@ -162,8 +163,9 @@ class PageController extends Controller { } catch(\OCP\AppFramework\Db\DoesNotExistException $e) { $notification = null; } - if($this->hasUserAccess($poll)) return new TemplateResponse('polls', 'goto.tmpl', ['poll' => $poll, 'dates' => $dates, 'comments' => $comments, 'votes' => $votes, 'notification' => $notification, 'userId' => $this->userId, 'userMgr' => $this->manager, 'urlGenerator' => $this->urlGenerator, 'avatarManager' => $this->avatarManager]); - else { + if($this->hasUserAccess($poll)) { + return new TemplateResponse('polls', 'goto.tmpl', ['poll' => $poll, 'dates' => $dates, 'comments' => $comments, 'votes' => $votes, 'notification' => $notification, 'userId' => $this->userId, 'userMgr' => $this->manager, 'urlGenerator' => $this->urlGenerator, 'avatarManager' => $this->avatarManager]); + } else { \OCP\User::checkLoggedIn(); return new TemplateResponse('polls', 'no.acc.tmpl', []); } @@ -361,7 +363,7 @@ class PageController extends Controller { } } } else { - $userId = $userId . ' (extern)'; + $userId = $userId; } $poll = $this->eventMapper->find($pollId); if($changed === 'true') { @@ -408,7 +410,7 @@ class PageController extends Controller { $this->sendNotifications($pollId, $userId); $hash = $this->eventMapper->find($pollId)->getHash(); $url = $this->urlGenerator->linkToRoute('polls.page.goto_poll', ['hash' => $hash]); - return new RedirectResponse($url); + return new JSONResponse(array('comment' => $commentBox, 'date' => date('Y-m-d H:i:s'), 'userName' => $this->manager->get($userId)->getDisplayName())); } public function getPollsForUser() { @@ -435,8 +437,7 @@ class PageController extends Controller { foreach ($user_groups as $user_group) { if ($user_group === $grp) return true; } - } - else if (strpos($item, 'user_') === 0) { + } else if (strpos($item, 'user_') === 0) { $usr = substr($item, 5); if ($usr === \OCP\User::getUser()) return true; } diff --git a/css/create.css b/css/create.css new file mode 100644 index 000000000..ed0956021 --- /dev/null +++ b/css/create.css @@ -0,0 +1,86 @@ +#access_rights { + display :none; + border: 1px solid #DDD; + margin: 15px; + padding: 5px; + border-radius: 3px; + max-height: 150px; + overflow-y: auto; +} + +#access_rights h3 { + margin: 0 0 5px; +} +.cl_access_item { + padding: 5px; + background-color: white; + color: #333; + cursor: pointer; +} + +.cl_access_item:hover { + background-color: #EEE; +} + +.cl_access_item.selected { + background-color: #409AE7; + color: #FFF; +} + +.cl_access_item.selected:hover { + background-color: #337AB7; + color: #FFF; +} + +textarea { + min-height: 66px; +} + +.choices { + margin-top: 10px; +} + +.choices td { + min-width: 30px; +} + +table td { + text-align: center; +} + +.text-row, .date-row { + font-weight: bold; + padding: 2px 5px; + background-color: #337AB7; + color: #FFF; + text-align: left; +} + +.text-row:hover, .date-row:hover { + background-color: #D9534F; + text-decoration: line-through; +} + +#selected-dates-table tr:first-child td { + font-weight: bold; + padding: 2px 5px; + background-color: #337AB7; + color: #FFF; + +} + +table .icon-close { + cursor: pointer; + background-color: #D9534F; + padding: 0 5px; +} + +table .icon-checkmark { + cursor: pointer; + background-color: #5CB85C; + padding: 0 5px; +} + +#expiration { + max-width: 200px; +} diff --git a/css/list.css b/css/list.css new file mode 100644 index 000000000..b523f039a --- /dev/null +++ b/css/list.css @@ -0,0 +1,24 @@ +table { + width: 100%; +} + +table thead th { + font-weight: bold; + text-align: left; + padding: 3px 5px; + background-color: #337AB7; + color: #FFF; +} + +table tbody td { + text-align: left; + padding: 3px 5px; +} + +tbody tr:nth-child(even) { + background-color: #D4F7FF; +} + +tbody tr:nth-child(even):hover { + background-color: #CDF5FF; +} diff --git a/css/main.css b/css/main.css index 717db03e4..108292a79 100644 --- a/css/main.css +++ b/css/main.css @@ -1,14 +1,6 @@ -#content-wrapper { - position: relative; -} - -body { - margin: 10px; -} - h1 { - font-size: 2em; - margin-bottom: 15px; + font-size: 1.8em; + margin-bottom: 5px; } h2 { @@ -16,45 +8,80 @@ h2 { margin: 10px 0 5px 0; } -footer { - text-align: center; - color: #777; +a { + color: #35537a; } -th, tr, td { - padding: 4px; - text-align: center; +a:not(.button):hover { + text-decoration: underline; } -th { - font-weight: bold; +#app header { + padding-top: 15px; } -tr:nth-child(even), tr:nth-child(even):hover, tr:nth-child(even) a { - background: #35537a; - color: #eee; +.row:after { + content: "."; + display:block; + height:0; + clear:both; + visibility:hidden; } -tr:nth-child(odd) { +.col-100 { + width: 100%; + padding: 0px 15px; } +.col-70 { + width: 65%; + float: left; + padding: 0px 15px; +} + +.col-50 { + width: 50%; + float: left; + padding: 0px 15px; +} + +.col-30 { + width: 35%; + float: left; + padding: 0px 15px; +} + +@media(max-width: 1000px) { + .col-70, .col-30, .col-50 { + float: none; + width: 100%; + } +} + +input[type="text"] { + display: block; + width: 100%; +} + +textarea { + min-width: 100%; + max-width: 100%; +} + + table { - border: 1px solid #aaa; + border: 1px solid #DDD; border-radius: 3px; } +.form-actions { + padding: 15px; +} + .goto_poll { width: 100%; } -input.input_field { - width: 20%; -} - -.label_h1 { - display:block; -} - div.new_poll { width: 100%; } @@ -70,11 +97,11 @@ div.partic_all { } div.partic_yes { - background-color: #6fff70; /*green*/ + background-color: #5CB85C; /*green*/ } div.partic_no { - background-color: #ff6f6f; /*red*/ + background-color: #D9534F; /*red*/ } input.table_button { @@ -97,6 +124,14 @@ div.scroll_div_dialog { overflow-y: auto; } +.bordered { + border-left: 1px solid #FFF; +} + +tbody th { + text-align: left; +} + td.td_shown { visibility: visible; } @@ -145,26 +180,16 @@ td.td_shown { } .input_title{ + display: block; font-size: 1.2em; + margin-top: 5px; } .padded td { padding: 10px; } -.cl_create_form { - min-width: 60%; - margin-bottom: 10px; -} - -.vote_table { - margin-top: 10px; -} - -.cl_create_form td { - padding: 3px; - text-align: left; - vertical-align: center; - text-align: center; +.vote_table thead th { + min-width: 40px; } .time-slot-cell { @@ -172,12 +197,14 @@ td.td_shown { } .toggle-all { - width: 20px; + min-width: 40px; + cursor: pointer; } .user-cell { - padding-left: 20px; - padding-right: 20px; + text-align: left; + min-width: 100px; + height: 40px; } .userNameImg { @@ -212,7 +239,7 @@ td.td_shown { background-color: #82de82; } -.cl_poll_access, .cl_poll_url, .cl_click, .cl_delete, .cl_date_time_header { +.cl_poll_url, .cl_click, .cl_delete, .cl_date_time_header { cursor: pointer; } @@ -237,12 +264,6 @@ td.td_shown { .cl_maybe:before, .cl_maybe:after{ content: "?"; } -.cl_total_y { - background-color: #6fff70; /*green*/ -} -.cl_total_n { - background-color: #ff6f6f; /*red*/ -} .win_row { color: #5ef56c; @@ -276,11 +297,6 @@ td.td_shown { margin-left: 5px; } -.date { - font-size: 0.8em; - color: #555; -} - #id_tab_total { height: 2em; width: 100%; @@ -301,138 +317,79 @@ td.td_shown { padding-left: 2px; } -/* users, groups... */ -#dialog-overlay { - /* set it to fill the whil screen */ - width:100%; - height:100%; - - /* transparency for different browsers */ - filter:alpha(opacity=50); - -moz-opacity:0.5; - -khtml-opacity: 0.5; - opacity: 0.5; - background:#000; - /* make sure it appear behind the dialog box but above everything else */ - position:absolute; - top:0; left:0; - z-index:3000; - /* hide it by default */ - display:none; -} - -#text-title, #id_expire_date { - margin-left: 5px; -} - -#dialog-box { - padding: 10px; - /* css3 drop shadow */ - -webkit-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5); - -moz-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5); - box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5); - /* css3 border radius */ - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; - - background:#eee; - /* styling of the dialog box, i have a fixed dimension for this demo */ - width:400px; - /* make sure it has the highest z-index */ - position:absolute; - z-index:5000; - /* hide it by default */ - display:none; -} - -div#dialog-message { - padding: 0 0 20px 0; -} - -#table_groups, #table_users { - width: 100%; - padding: 20px 5px 10px 5px; - table-layout: fixed; - overflow-y: auto; -} - -#table_users { - padding-left: 10px; -} - -.cl_group_item, .cl_user_item { - background-color: white; - color: #000000; -} -.cl_group_item_selected, .cl_user_item_selected { - background-color: #1d2d44; - color: #8e96a1; -} - -/* STUFF FROM mypolls */ -ul { - padding: 5px; - padding-left: 12px; -} - -#app-content { - padding: 5px; -} - -#polls { +.input-group { + position: relative; + display: table; + border-collapse: separate; width: 100%; } -#poll-table { - width: 100%; +.input-group>input, .input-group-addon, .input-group-btn { + display: table-cell; } -#poll-desc, #comments-container, #poll-dates { - margin-bottom: 15px; +.input-group-addon { + padding: 6px 12px; + font-size: 14px; + line-height: 1; + color: #555; + text-align: center; + background-color: #eee; + border: 1px solid #ccc; + border-radius: 4px; + white-space: nowrap; + vertical-align: middle; + width: 1%; + } + +.input-group-addon input[type="checkbox"] { + margin: 0; } -#comment-text { +.input-group-btn { + vertical-align: top; +} + +.input-group-btn .btn { + height: 31.25px; + border: 1px solid #DDD; + margin: 0; + border-radius: 3px; + vertical-align: middle; display: block; + width: 100%; } -#datepicker { +.input-group>input { + position: relative; + z-index: 2; float: left; - padding-right: 15px; + width: 100%; + margin: 0; } -#new-poll-form-warn { - color: red; +.input-group input:first-child, .input-group .input-group-btn:first-child .btn, .input-group-addon:first-child { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} +.input-group input:last-child, .input-group .input-group-btn:last-child .btn, .input-group-addon:last-child { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} +.input-group .input-group-btn:first-child .btn, .input-group-addon:first-child { + border-right: none; +} +.input-group .input-group-btn:last-child .btn, .input-group-addon:last-child { + border-left: none; } -#poll-dates table { - min-width: 50%; -} - -#check_notif { - margin-bottom: 10px; -} - -.poll-cell-not, .poll-cell-is, .poll-cell-maybe, .poll-cell-un, .poll-cell-active-not, .poll-cell-active-is, .poll-cell-active-maybe, .poll-cell-active-un { -} - -.poll-cell-un, .poll-cell-active-un { - background-color: #fff; -} - -.poll-cell-is, .poll-cell-active-is, .date-text-selected, .selected-all { - background-color: #6fff70; /*green*/ -} - -.poll-cell-maybe, .poll-cell-active-maybe, .selected-maybe { - background-color: #fcff6f; /*yellow*/ -} - -.poll-cell-not, .poll-cell-active-not, .date-text-not-selected, .selected-none { - background-color: #ff6f6f; /*red*/ -} - -.date-row:hover, .date-col:hover, .text-row:hover { - background-color: red; - color: black; +.alert-info { + margin-left: 50%; + transform:translateX(-50%); + width: auto; + padding: 5px 15px; + text-align: center; + border: 1px solid #1D2D44; + border-top: 0; + border-radius: 0 0 3px 3px; } diff --git a/css/vote.css b/css/vote.css new file mode 100644 index 000000000..f796a9a3f --- /dev/null +++ b/css/vote.css @@ -0,0 +1,172 @@ +.vote_table { + width: 100%; +} + +.vote_table thead tr:nth-child(even) th, .vote_table tfoot tr:nth-child(even) th, .vote_table tfoot tr:nth-child(even) td { + background-color: #337AB7; + color: #FFF; +} + +.vote_table thead tr:nth-child(odd) th, .vote_table tfoot tr:nth-child(odd) th, .vote_table tfoot tr:nth-child(odd) td { + background: #35537a; + color: #FFF; +} + +tbody.votes tr:nth-child(even) { + background-color: #D4F7FF; +} + +tbody.votes tr:nth-child(even):hover { + background-color: #CDF5FF; +} + +tbody.total th { + text-align: right; +} + +th, tr, td { + padding: 4px; + text-align: center; +} + +th { + font-weight: bold; +} + +#polls { + width: 100%; +} + +#poll-table { + width: 100%; +} + +#poll-desc, #comments-container, #poll-dates { + margin-bottom: 15px; +} + +#datepicker { + float: left; + padding-right: 15px; +} + +#new-poll-form-warn { + color: red; +} + +#poll-dates table { + min-width: 50%; +} + +#check_notif { + margin-bottom: 10px; +} + +tr.current-user th { + background-color: #337AB7; + color: #FFF +} + +tr.current-user td, tr.current-user th { + border-top: 3px solid #337AB7; + border-bottom: 3px solid #337AB7; +} + +th.external { + padding-left: 40px; + font-style: italic; +} + +th.external input{ + min-width: 100px; +} + +.poll-cell-un, .poll-cell-active-un { + background-color: #FFF3CD; +} + +.poll-cell-is, .poll-cell-active-is, .date-text-selected, .selected-all { + background-color: #6AD56A; /*green*/ + background-image: url('../img/yes.svg'); + background-repeat: no-repeat; + background-position: center; + transition: background-color 0.2s; +} + +.poll-cell-not, .poll-cell-active-not, .date-text-not-selected, .selected-none { + background-image: url('../img/no.svg'); + background-repeat: no-repeat; + background-position: center; + transition: background-color 0.2s; +} + +.share { + margin: 10px 0; +} + +.share .input-group-addon{ + background-image: url('../img/share.svg'); + background-repeat: no-repeat; + background-position: 10px center; + padding-left: 35px; +} + +.comment { + border: 1px solid #DDD; + border-radius: 3px; + margin-bottom: 10px; +} + +.comment .comment-header { + background-color: #EEE; + border-bottom: 1px solid #DDD; + border-radius: 3px 3px 0 0; + padding: 2px 5px; +} + +.comment .comment-date { + float: right; + font-size: 0.9em; + color: #555; +} + +.comment .comment-content { + padding: 5px; +} + +.new-comment .icon-loading-small { + float: left; + margin-top: 10px; + display: none; +} + +.new-comment .comment-content textarea { + display: block; + min-width: 100%; + max-width: 100%; + min-height: 66px; +} + +td.total { + padding: 2px 0 1px; + color: #FFF; + font-weight: bold; +} + +.color_yes, .poll-cell-is, .poll-cell-active-is { + background-color: #6AD56A; /*green*/ +} +.color_no, .poll-cell-not, .poll-cell-active-not { + background-color: #D9534F; /*red*/ +} +.color_maybe, .poll-cell-maybe, .poll-cell-active-maybe, .poll-cell-un, .poll-cell-active-un { + background-color: #FFF0C3; /*yellow*/ +} + +.home-link { + background-image: url('../img/home.svg'); + background-repeat: no-repeat; + background-position: 5px center; + padding-left: 26px; + float: right; +} diff --git a/db/commentmapper.php b/db/commentmapper.php index 94060dd85..056f07a77 100644 --- a/db/commentmapper.php +++ b/db/commentmapper.php @@ -65,7 +65,7 @@ class CommentMapper extends Mapper { * @return Comment[] */ public function findByPoll($pollId, $limit=null, $offset=null) { - $sql = 'SELECT * FROM `*PREFIX*polls_comments` WHERE poll_id=?'; + $sql = 'SELECT * FROM `*PREFIX*polls_comments` WHERE poll_id=? ORDER BY Dt DESC'; return $this->findEntities($sql, [$pollId], $limit, $offset); } diff --git a/img/home.svg b/img/home.svg new file mode 100644 index 000000000..2edc3af25 --- /dev/null +++ b/img/home.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/img/no.svg b/img/no.svg new file mode 100644 index 000000000..c270f76f4 --- /dev/null +++ b/img/no.svg @@ -0,0 +1,77 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/img/share.svg b/img/share.svg new file mode 100644 index 000000000..d67d35c6e --- /dev/null +++ b/img/share.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/img/yes.svg b/img/yes.svg new file mode 100644 index 000000000..964624a9c --- /dev/null +++ b/img/yes.svg @@ -0,0 +1,4 @@ + + + + diff --git a/js/create_edit.js b/js/create_edit.js index 51f34bb34..50674abd3 100644 --- a/js/create_edit.js +++ b/js/create_edit.js @@ -2,8 +2,6 @@ var g_chosen_datetimes = []; var g_chosen_texts = []; var g_chosen_groups = []; var g_chosen_users = []; -var g_tmp_groups = []; -var g_tmp_users = []; var chosen_type = 'event'; var access_type = ''; @@ -11,21 +9,15 @@ $(document).ready(function () { // enable / disable date picker $('#id_expire_set').click(function(){ $('#id_expire_date').prop("disabled", !this.checked); - - // TODO: this would be nice, for some reason it doesn't work - //if (this.checked) { - // $("id_expire_date").focus(); - //} + if (this.checked) { + $("#id_expire_date").focus(); + } }); var privateRadio = document.getElementById('private'); var hiddenRadio = document.getElementById('hidden'); var publicRadio = document.getElementById('public'); var selectRadio = document.getElementById('select'); - privateRadio.onclick = hideSelectTable; - hiddenRadio.onclick = hideSelectTable; - publicRadio.onclick = hideSelectTable; - selectRadio.onclick = showSelectTable; if(privateRadio.checked) access_type = 'registered'; if(hiddenRadio.checked) access_type = 'hidden'; if(publicRadio.checked) access_type = 'public'; @@ -176,40 +168,24 @@ $(document).ready(function () { text.value = ''; }); - $(document).on('click', '#button_cancel_access', function(e) { - g_tmp_groups = []; - g_tmp_users = []; - closeAccessDialog(); - }); - - $(document).on('click', '#button_ok_access', function(e) { - g_chosen_groups = g_tmp_groups; - g_chosen_users = g_tmp_users; - g_tmp_groups = []; - g_tmp_users = []; - closeAccessDialog(); - }); - $(document).on('click', '.cl_user_item', function(e) { - $(this).switchClass('cl_user_item', 'cl_user_item_selected'); - g_tmp_users.push(this.id); + if($(this).hasClass('selected')) { + var index = g_chosen_users.indexOf(this.id); + if(index > -1) g_chosen_users.splice(index, 1); + } else { + g_chosen_users.push(this.id); + } + $(this).toggleClass('selected'); }); - - $(document).on('click', '.cl_user_item_selected', function(e) { - $(this).switchClass('cl_user_item_selected', 'cl_user_item'); - var index = g_tmp_users.indexOf(this.id); - if(index > -1) g_tmp_users.splice(index, 1); - }); - + $(document).on('click', '.cl_group_item', function(e) { - $(this).switchClass('cl_group_item', 'cl_group_item_selected'); - g_tmp_groups.push(this.id); - }); - - $(document).on('click', '.cl_group_item_selected', function(e) { - $(this).switchClass('cl_group_item_selected', 'cl_group_item'); - var index = g_tmp_groups.indexOf(this.id); - if(index > -1) g_tmp_groups.splice(index, 1); + if($(this).hasClass('selected')) { + var index = g_chosen_groups.indexOf(this.id); + if(index > -1) g_chosen_groups.splice(index, 1); + } else { + g_chosen_groups.push(this.id); + } + $(this).toggleClass('selected'); }); $('.toggleable-row').hover( @@ -254,9 +230,9 @@ $(document).ready(function () { $('input[type=radio][name=accessType]').change(function() { access_type = this.value; if(access_type == 'select') { - showAccessDialog(); + $("#access_rights").show(); } else { - closeAccessDialog(); + $("#access_rights").hide(); } }); @@ -434,72 +410,3 @@ function addColToList(ts, text, dateTs) { td.id = ts; } } - -//Popup dialog -function showAccessDialog() { - var message = t('polls', 'Please choose the groups or users you want to add to your poll.'); - - // get the screen height and width - var maskHeight = $(document).height(); - var maskWidth = $(window).width(); - - // calculate the values for center alignment - //var dialogTop = (maskHeight / 3) - ($('#dialog-box').height()); - // todo: height doesn't work - var dialogTop = 100; - var dialogLeft = (maskWidth / 2) - ($('#dialog-box').width() / 2); - - // assign values to the overlay and dialog box - $('#dialog-overlay').css({height: maskHeight, width: maskWidth}).show(); - $('#dialog-box').css({top: dialogTop, left: dialogLeft}).show(); - - // display the message - $('#dialog-message').html(message); - - var unselectedGrps = [].slice.call(document.getElementsByClassName('cl_group_item')); - var selectedGrps = [].slice.call(document.getElementsByClassName('cl_group_item_selected')); - var unselectedUsers = [].slice.call(document.getElementsByClassName('cl_user_item')); - var selectedUsers = [].slice.call(document.getElementsByClassName('cl_user_item_selected')); - cells_grp = unselectedGrps.concat(selectedGrps); - cells_usr = unselectedUsers.concat(selectedUsers); - - var tmpGroups = g_chosen_groups.slice(); - for(var i=0; i= 0){ - newUserTypes.push(0); - newUserDates.push(cells[i].id); - } else if (cells[i].className.indexOf('poll-cell-active-is') >= 0){ - newUserTypes.push(1); - newUserDates.push(cells[i].id); - } else if(cells[i].className.indexOf('poll-cell-active-maybe') >= 0){ - newUserTypes.push(2); - newUserDates.push(cells[i].id); - } else { - newUserTypes.push(-1); - newUserDates.push(cells[i].id); - } - } +$.fn.switchClass = function(a, b) { + this.removeClass(a); + this.addClass(b); + return this; +} +$(document).ready(function () { $('#submit_finish_vote').click(function() { var form = document.finish_vote; var ac = document.getElementById('user_name'); @@ -37,6 +23,19 @@ $(document).ready(function () { } } check_notif = document.getElementById('check_notif'); + var newUserDates = [], newUserTypes = []; + $(".cl_click").each(function() { + if($(this).hasClass('poll-cell-active-not')) { + newUserTypes.push(0); + } else if ($(this).hasClass('poll-cell-active-is')){ + newUserTypes.push(1); + } else if($(this).hasClass('poll-cell-active-maybe')){ + newUserTypes.push(2); + } else { + newUserTypes.push(-1); + } + newUserDates.push(parseInt($(this).attr('id'))); + }); form.elements['dates'].value = JSON.stringify(newUserDates); form.elements['types'].value = JSON.stringify(newUserTypes); form.elements['notif'].value = (check_notif && check_notif.checked) ? 'true' : 'false'; @@ -44,179 +43,75 @@ $(document).ready(function () { form.submit(); }); - $('#submit_send_comment').click(function() { + $('#submit_send_comment').click(function(e) { + e.preventDefault(); var form = document.send_comment; var comm = document.getElementById('commentBox'); - if(comm.value.length <= 0) { + if(comm.value.trim().length <= 0) { alert(t('polls', 'Please add some text to your comment before submitting it.')); return; } - form.submit(); + var data = { + pollId: form.elements['pollId'].value, + userId: form.elements['userId'].value, + commentBox: comm.value.trim() + }; + $('.new-comment .icon-loading-small').show(); + $.post(form.action, data, function(data) { + $('.comments .comment:first').after('
' + data.date + '' + data.userName + '
' + data.comment + '
'); + $('.new-comment textarea').val('').focus(); + $('.new-comment .icon-loading-small').hide(); + }).error(function() { + alert(t('polls', 'An error occurred, your comment was not posted...')); + $('.new-comment .icon-loading-small').hide(); + }); + }); + + $(".share input").click(function() { + $(this).select(); }); }); -$(document).on('click', '.toggle-all', function(e) { - if($(this).attr('class').indexOf('selected-all') > -1) { - var selected = $(this).parent().children('.poll-cell-active-is'); - var maybes = $(this).parent().children('.poll-cell-active-maybe'); - for(var i=0; i -1) { - var selected = $(this).parent().children('.poll-cell-active-is'); - var unselected = $(this).parent().children('.poll-cell-active-not'); - for(var i=0; i -1) { - newUserDates.splice(index, 1); - newUserTypes.splice(index, 1); - } - newUserDates.push(ts); - newUserTypes.push(1); - if(cl.indexOf('poll-cell-active-not') > -1) { - var total_no = document.getElementById('id_n_' + ts); - var intNo = parseInt(total_no.innerHTML); - if(intNo >= 1) total_no.innerHTML = intNo - 1; - else total_no.innerHTML = '0'; - } - var total_yes = document.getElementById('id_y_' + ts); - total_yes.innerHTML = parseInt(total_yes.innerHTML) + 1; - cell.switchClass('poll-cell-active-maybe', 'poll-cell-active-is'); - findNewMaxCount(); - updateStrongCounts(); -} - -function deselectItem(cell) { - values_changed = true; - var ts = cell.attr('id'); - var index = newUserDates.indexOf(ts); - if(index > -1) { - newUserDates.splice(index, 1); - newUserTypes.splice(index, 1); - } - newUserDates.push(ts); - newUserTypes.push(0); - var total_yes = document.getElementById('id_y_' + ts); - var total_no = document.getElementById('id_n_' + ts); - var intYes = parseInt(total_yes.innerHTML); - if(intYes >= 1) total_yes.innerHTML = intYes - 1; - else total_yes.innerHTML = '0'; - total_no.innerHTML = parseInt(total_no.innerHTML) + 1; - cell.switchClass('poll-cell-active-is', 'poll-cell-active-not'); - findNewMaxCount(); - updateStrongCounts(); -} - -function maybeItem(cell) { - values_changed = true; - var ts = cell.attr('id'); - var index = newUserDates.indexOf(ts); - if(index > -1) { - newUserDates.splice(index, 1); - newUserTypes.splice(index, 1); - } - newUserDates.push(ts); - newUserTypes.push(2); - var total_no = document.getElementById('id_n_' + ts); - var intNo = parseInt(total_no.innerHTML); - if(intNo >= 1) total_no.innerHTML = intNo - 1; - else total_no.innerHTML = '0'; - cell.switchClass('poll-cell-active-not', 'poll-cell-active-maybe'); - cell.switchClass('poll-cell-active-un', 'poll-cell-active-maybe'); - findNewMaxCount(); - updateStrongCounts(); -} - -function findNewMaxCount(){ - var cell_tot_y = document.getElementsByClassName('cl_total_y'); - var cell_tot_n = document.getElementsByClassName('cl_total_n'); +function updateCounts(){ max_votes = 0; - for(var i=0; i max_votes) max_votes = curr; - } -} - -function updateStrongCounts(){ - var cell_tot_y = document.getElementsByClassName('cl_total_y'); - var cell_tot_n = document.getElementsByClassName('cl_total_n'); - - for(var i=0; i max_votes) { + max_votes = yes - no; } - else { - cell_tot_y[i].style.fontWeight = 'bold'; - cell_win.className = 'win_row icon-checkmark'; - } - } + }); + var i = 0; + $('td.total').each(function() { + var yes = parseInt($(this).find('.color_yes').text()); + var no = parseInt($(this).find('.color_no').text()); + $('#id_total_' + i++).toggleClass('icon-checkmark', yes - no == max_votes); + }); } diff --git a/templates/create.tmpl.php b/templates/create.tmpl.php index 2caf6de5b..498a2531e 100644 --- a/templates/create.tmpl.php +++ b/templates/create.tmpl.php @@ -1,5 +1,6 @@ +
+
+
@@ -40,124 +44,113 @@ -
- -

t('Edit poll') . ' ' . $poll->getTitle()); ?>

- -

t('Create new poll')); ?>

- - - - - - -
t('Access')); ?>
- - /> - - - /> - - - /> - - - > - - ... - - - -
t('Type')); ?>
- - getType() === '0') print_unescaped('checked'); ?> /> - - - - getType() === '1') print_unescaped('checked'); ?>> - - -
- getExpire() !== null) ? print_unescaped('value="true" checked') : print_unescaped('value="false"'); ?> /> - - getExpire() === null) ? print_unescaped('disabled="true"') : print_unescaped('value="' . $expireStr . '"'); ?> name="expire_date_input" /> -
-
getType() === '1') print_unescaped('style="display:none;"'); ?> > - -
- - - -
-
-
getType() === '0') print_unescaped('style="display:none;"'); ?> > - - -
- - -
+
+
+ +

t('Edit poll') . ' ' . $poll->getTitle()); ?>

+ +

t('Create new poll')); ?>

+
+
+ +
+
+

t('Basic information')); ?>

+ + + + -
- - -
- + -
-
- - - -
- - -
- - -
- - -
- + /> + - - - - - -
-
- - - - + /> + + + /> + + + > + + ... + +
+
+

t('Groups')); ?>

+
    -
- - +
  • + +
  • -
    t('Groups')); ?>
    +
    -
    -
    - - - - +
    +

    t('Users')); ?>

    +
      search(''); ?> -
    - - +
  • + getDisplayName()); ?> +
  • -
    t('Users')); ?>
    - getDisplayName()); ?> -
    +
    -
    - - +
    + + + + + + getType() === '0') print_unescaped('checked'); ?> /> + + + + getType() === '1') print_unescaped('checked'); ?>> + + + +
    +
    + getExpire() !== null) ? print_unescaped('value="true" checked') : print_unescaped('value="false"'); ?> /> +
    + getExpire() === null) ? print_unescaped('disabled="true"') : print_unescaped('value="' . $expireStr . '"'); ?> name="expire_date_input" /> +
    +
    +
    +

    t('Choices')); ?>

    +
    getType() === '1') print_unescaped('style="display:none;"'); ?> > + + + +
    +
    +
    getType() === '0') print_unescaped('style="display:none;"'); ?> > + +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    + + + + + + t('Cancel')); ?> +
    + +
    +
    diff --git a/templates/goto.tmpl.php b/templates/goto.tmpl.php index c70d660ea..29c012a25 100644 --- a/templates/goto.tmpl.php +++ b/templates/goto.tmpl.php @@ -1,21 +1,25 @@ getType(); -if ($poll->getExpire() === null) $expired = false; -else { + +if ($poll->getExpire() === null) { + $expired = false; +} else { $expired = time() > strtotime($poll->getExpire()); } @@ -24,10 +28,8 @@ if ($poll->getType() === '0') { $arr_dates = null; // will be like: [21.02] => 3 $arr_years = null; // [1992] => 6 foreach($dates as $d) { - $date = date('d.m.Y', strtotime($d->getDt())); - $arr = explode('.', $date); - $day_month = $arr[0] . '.' . $arr[1] . '.'; // 21.02 - $year = $arr[2]; // 1992 + $day_month = date('d.m', strtotime($d->getDt())); + $year = date('Y', strtotime($d->getDt())); if (isset($arr_dates[$day_month])) { $arr_dates[$day_month] += 1; @@ -35,396 +37,397 @@ if ($poll->getType() === '0') { $arr_dates[$day_month] = 1; } - // ----- if (isset($arr_years[$year])) { $arr_years[$year] += 1; } else { $arr_years[$year] = 1; } - } $for_string_dates = ''; - foreach (array_keys($arr_dates) as $dt) { // date (13.09) - $for_string_dates .= '' . $dt . ''; + foreach (array_keys($arr_dates) as $dt) { + $for_string_dates .= '' . $dt . ''; } $for_string_years = ''; - foreach (array_keys($arr_years) as $year) { // year (1992) - $for_string_years .= '' . $year . ''; + foreach (array_keys($arr_years) as $year) { + $for_string_years .= '' . $year . ''; } - } -if($poll->getDescription() !== null && $poll->getDescription() !== '') $line = str_replace("\n", '
    ', $poll->getDescription()); -else $line = $l->t('No description provided.'); +if ($poll->getDescription() !== null && $poll->getDescription() !== '') { + $line = str_replace("\n", '
    ', $poll->getDescription()); +} else { + $line = $l->t('No description provided.'); +} -// ----------- title / descr -------- +// init array for counting 'yes'-votes for each date +$total_y = array(); +$total_n = array(); +for ($i = 0 ; $i < count($dates) ; $i++) { + $total_y[$i] = 0; + $total_n[$i] = 0; +} +$user_voted = array(); + +$pollUrl = OCP\Util::linkToAbsolute('', $urlGenerator->linkToRoute('polls.page.goto_poll', ['hash' => $poll->getHash()])); ?> - - - -

    getTitle()); ?>

    -
    - - -

    t('Poll URL')); ?>

    -

    - linkToRoute('polls.page.goto_poll', ['hash' => $poll->getHash()]); - ?> - -

    - - -
    - - - - - getText(). '">' . $el->getText() . ''); - } - } - ?> - - ' . $for_string_dates . ''); - - print_unescaped(''); - for ($i = 0; $i < count($dates); $i++) { - $ch_obj = date('H:i', strtotime($dates[$i]->getDt())); - print_unescaped(''); - } - print_unescaped(''); - } - - // init array for counting 'yes'-votes for each dt - $total_y = array(); - $total_n = array(); - for ($i = 0; $i < count($dates); $i++){ - $total_y[$i] = 0; - $total_n[$i] = 0; - } - $user_voted = array(); - // -------------- other users --------------- - // loop over users - ?> - getUserId()])) { - $others[$vote->getUserId()] = array(); - } - array_push($others[$vote->getUserId()], $vote); - } - foreach (array_keys($others) as $usr) { - if ($usr === $userId) { - // if poll expired, just put current user among the others; - // otherwise skip here to add current user as last row (to vote) - if (!$expired) { - $user_voted = $others[$usr]; - continue; - } - } - print_unescaped(''); - print_unescaped(''); - print_unescaped(''); //empty cell for toggle vote (only current user) - $i_tot = -1; - - // loop over dts - foreach($dates as $dt) { - $i_tot++; - - $date_id = ''; - if ($poll_type === '0') { - $date_id = strtotime($dt->getDt()); - } - else { - $date_id = $dt->getText(); - } - // look what user voted for this dts - $found = false; - foreach ($others[$usr] as $vote) { - if ($date_id === strtotime($vote->getDt())) { - if ($vote->getType() === '1') { - $cl = 'poll-cell-is'; - $total_y[$i_tot]++; - } - else if ($vote->getType() === '0') { - $cl = 'poll-cell-not'; - $total_n[$i_tot]++; - } else { - $cl = 'poll-cell-maybe'; - } - $found = true; - break; - } - } - if(!$found) { - $cl = 'poll-cell-un'; - } - print_unescaped(''); - } - print_unescaped(''); - } - } - // -------------- current user -------------- - ?> - - '); - $avatar = $avaMgr->getAvatar($userId)->get(32); - if($avatar !== false) { - $avatarImg = ''; - } else { - $avatarImg = '
    ' . strtoupper($userId[0]) . '
    '; - } - print_unescaped($avatarImg); - p($userMgr->get($userId)->getDisplayName()); - print_unescaped(''); - } else { - print_unescaped(''); - } - print_unescaped(''); - $i_tot = -1; - $date_id = ''; - foreach ($dates as $dt) { - $i_tot++; - if ($poll_type === '0') { - $date_id = strtotime($dt->getDt()); - } else { - $date_id = $dt->getText(); - } - // see if user already has data for this event - $cl = 'poll-cell-active-un'; - if (isset($user_voted)) { - foreach ($user_voted as $obj) { - $voteVal = null; - if($poll_type === '0') $voteVal = strtotime($obj->getDt()); - else $voteVal = $obj->getText(); - if ($voteVal === $date_id) { - if ($obj->getType() === '1') { - $cl = 'poll-cell-active-is'; - $total_y[$i_tot]++; - } else if ($obj->getType() === '0') { - $cl = 'poll-cell-active-not'; - $total_n[$i_tot]++; - } else if($obj->getType() === '2'){ - //$total_m[$i_tot]++; - $cl = 'poll-cell-active-maybe'; - } - break; - } - } - } - print_unescaped(''); - } - } - ?> - - - - - - - - - - - - - - - - '); - - endfor; - ?> - - '); - for ($i = 0; $i < count($dates); $i++) { - $ch_obj = date('H:i', strtotime($dates[$i]->getDt())); - print_unescaped(''); - } - print_unescaped(''); - print_unescaped('' . $for_string_dates . ''); - } - ?> - - - - getText() . '">' . $el->getText() . ''); - } - } - ?> - -
    ' . $ch_obj . '
    '); - if($userMgr->get($usr) != null) { - $avatar = $avaMgr->getAvatar($usr)->get(32); - if($avatar !== false) { - $avatarImg = ''; - } else { - $avatarImg = '
    ' . strtoupper($usr[0]) . '
    '; - } - print_unescaped($avatarImg); - p($userMgr->get($usr)->getDisplayName()); - } - else p($usr); - print_unescaped('
    t('Total')); ?>: - - - - getDt()); ?> - - getText()); ?> - - - - - - -
    - - - - - - - - - - class=""> -
    -
    t('Win:')); ?>
    ' . $ch_obj . '
    -
    - - - /> - -
    - - - -
    - - - - - - - -
    - - - -
    -

    t('Poll expired')); ?>

    -

    - t('The poll expired on %s. Voting is disabled, but you can still comment.', array(date('d.m.Y H:i', strtotime($poll->getExpire()))))); ?> -

    -
    - - - -

    t('Comments')); ?>

    -
    - - -
    - get($comment->getUserId())->getDisplayName()); - print_unescaped(' ' . date('d.m.Y H:i', strtotime($comment->getDt())) . ''); - ?> -
    - getComment()); ?> -
    - - - t('No comments yet. Be the first.')); ?> - -
    -
    - - - -

    t('Write new Comment')); ?>

    - -
    - -
    diff --git a/templates/main.tmpl.php b/templates/main.tmpl.php index 005b7f3e4..6cbd4aa4d 100644 --- a/templates/main.tmpl.php +++ b/templates/main.tmpl.php @@ -1,21 +1,26 @@ - -

    t('Summary')); ?>

    -
    - linkToRoute('polls.page.index'); - ?> +
    +
    +
    +
    +
    +

    t('Summary')); ?>

    +
    +
    +
    t('No existing polls.')); ?> + @@ -26,11 +31,13 @@ + + getHash(); + $pollUrl = $urlGenerator->linkToRoute('polls.page.goto_poll', array('hash' => $poll->getHash())); ?> - + - +
    t('Title')); ?> t('Description')); ?>t('Access')); ?> t('Options')); ?>
    @@ -44,7 +51,7 @@ } ?> getCreated()))); ?>getCreated()))); ?> getOwner() === $userId) p($l->t('Yourself')); @@ -92,7 +99,7 @@
    getOwner() === $userId) print_unescaped('class="cl_poll_access" id="cl_poll_access_' . $poll->getId() . '" title="'.$l->t('Edit access').'"'); ?> > + t($poll->getAccess())); ?> @@ -100,15 +107,20 @@ +
    + +
    +
    +
    - -

    -
    - t('Error')); ?> -
    -

    -

    -
    - t('You are not allowed to view this poll or the poll does not exist.')); ?> -
    -

    +
    +
    +
    +
    +
    +
    +

    + t('Access denied')); ?> +

    +

    + t('You are not allowed to view this poll or the poll does not exist.')); ?> +

    +
    +
    +
    +
    +
    +
    From 20ac169a4b6ddda9660f565cec98ab478a8649df Mon Sep 17 00:00:00 2001 From: Vinzenz Date: Mon, 25 Apr 2016 14:02:05 +0200 Subject: [PATCH 2/4] minor style adjustments --- css/create.css | 6 +++--- css/list.css | 12 +++++++++++- css/main.css | 4 ++-- css/vote.css | 11 +++++------ 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/css/create.css b/css/create.css index ed0956021..d942c7d7d 100644 --- a/css/create.css +++ b/css/create.css @@ -57,7 +57,7 @@ table td { } .text-row:hover, .date-row:hover { - background-color: #D9534F; + background-color: #ff6f6f; text-decoration: line-through; } @@ -71,13 +71,13 @@ table td { table .icon-close { cursor: pointer; - background-color: #D9534F; + background-color: #ff6f6f; padding: 0 5px; } table .icon-checkmark { cursor: pointer; - background-color: #5CB85C; + background-color: #6fff70; padding: 0 5px; } diff --git a/css/list.css b/css/list.css index b523f039a..851332301 100644 --- a/css/list.css +++ b/css/list.css @@ -16,9 +16,19 @@ table tbody td { } tbody tr:nth-child(even) { - background-color: #D4F7FF; + background-color: #337AB7; + color: #fff; } tbody tr:nth-child(even):hover { background-color: #CDF5FF; + color: #000; +} + +tbody tr:nth-child(even):hover a { + color: #000; +} + +tbody tr:nth-child(even) a { + color: #fff; } diff --git a/css/main.css b/css/main.css index 108292a79..3193f6acd 100644 --- a/css/main.css +++ b/css/main.css @@ -97,11 +97,11 @@ div.partic_all { } div.partic_yes { - background-color: #5CB85C; /*green*/ + background-color: #6fff70; /*green*/ } div.partic_no { - background-color: #D9534F; /*red*/ + background-color: #ff6f6f; /*red*/ } input.table_button { diff --git a/css/vote.css b/css/vote.css index f796a9a3f..06c3923a5 100644 --- a/css/vote.css +++ b/css/vote.css @@ -3,12 +3,11 @@ } .vote_table thead tr:nth-child(even) th, .vote_table tfoot tr:nth-child(even) th, .vote_table tfoot tr:nth-child(even) td { - background-color: #337AB7; color: #FFF; } .vote_table thead tr:nth-child(odd) th, .vote_table tfoot tr:nth-child(odd) th, .vote_table tfoot tr:nth-child(odd) td { - background: #35537a; + background-color: #337AB7; color: #FFF; } @@ -86,7 +85,7 @@ th.external input{ } .poll-cell-is, .poll-cell-active-is, .date-text-selected, .selected-all { - background-color: #6AD56A; /*green*/ + background-color: #6fff70; /*green*/ background-image: url('../img/yes.svg'); background-repeat: no-repeat; background-position: center; @@ -154,13 +153,13 @@ td.total { } .color_yes, .poll-cell-is, .poll-cell-active-is { - background-color: #6AD56A; /*green*/ + background-color: #6fff70; /*green*/ } .color_no, .poll-cell-not, .poll-cell-active-not { - background-color: #D9534F; /*red*/ + background-color: #ff6f6f; /*red*/ } .color_maybe, .poll-cell-maybe, .poll-cell-active-maybe, .poll-cell-un, .poll-cell-active-un { - background-color: #FFF0C3; /*yellow*/ + background-color: #fcff6f; /*yellow*/ } .home-link { From 1959c0b3aa074d78a90cb9563fc28ad1bab58e1a Mon Sep 17 00:00:00 2001 From: Vinzenz Date: Mon, 25 Apr 2016 14:02:29 +0200 Subject: [PATCH 3/4] update language files --- l10n/de.json | 8 ++++++++ l10n/de.php | 8 ++++++++ l10n/de_DE.json | 8 ++++++++ l10n/en.json | 8 ++++++++ l10n/en.php | 8 ++++++++ 5 files changed, 40 insertions(+) diff --git a/l10n/de.json b/l10n/de.json index 14e336bf0..2002c6f9c 100644 --- a/l10n/de.json +++ b/l10n/de.json @@ -1,5 +1,6 @@ { "translations": { "Polls" : "Umfragen", + "Poll" : "Umfrage", "Summary" : "Übersicht", "No existing polls." : "Keine Umfragen vorhanden.", "Title" : "Name", @@ -35,14 +36,20 @@ "click to add" : "Klicke zum Hinzufügen", "date\\time" : "Datum/Zeit", "Poll URL" : "Umfrage-Link", + "Link" : "Link", "Total" : "Gesamt", + "Best option" : "Bestes Ergebnis", + "All" : "Alle", "No description provided." : "Keine Beschreibung angegeben.", "Write new Comment" : "Neuer Kommentar", "Comments" : "Kommentare", "No comments yet. Be the first." : "Bisher keine Kommentare. Sei der Erste.", "Send!" : "Abschicken!", "Vote!" : "Abstimmen!", + "Polls summary" : "Umfrage-Übersicht", "Home" : "Startseite", + "Update poll" : "Umfrage aktualisieren", + "Create poll" : "Umfrage erstellen", "participated" : "abgestimmt", "Yourself" : "Dir", "Select" : "Wählen", @@ -67,6 +74,7 @@ "Description (will be shown as tooltip on the summary page)" : "Beschreibung (wird als Tooltip in der Übersicht angezeigt)", "Poll expired" : "Umfrage abgelaufen", "The poll expired on %s. Voting is disabled, but you can still comment." : "Die Umfrage lief am %s ab. Die Abstimmung ist geschlossen, aber es kann weiterhin kommentiert werden.", + "Access denied" : "Zugriff verweigert", "You are not allowed to view this poll or the poll does not exist." : "Dir fehlt die Berechtigung zur Anzeige dieser Abstimmung oder diese Abstimmung existiert nicht.", "Error" : "Fehler", "d.m.Y H:i" : "d.m.Y H:i", diff --git a/l10n/de.php b/l10n/de.php index 3a01c0d48..883c8e42f 100644 --- a/l10n/de.php +++ b/l10n/de.php @@ -1,6 +1,7 @@ "Umfragen", + "Poll" => "Umfrage", "Summary" => "Übersicht", "No existing polls." => "Keine Umfragen vorhanden.", "Title" => "Name", @@ -36,14 +37,20 @@ $TRANSLATIONS = array( "click to add" => "Klicke zum Hinzufügen", "date\\time" => "Datum/Zeit", "poll URL" => "Umfrage-Link", + "Link" => "Link", "Total" => "Gesamt", + "Best option" => "Bestes Ergebnis", + "All" => "Alle", "No description provided." => "Keine Beschreibung angegeben.", "Write new Comment" => "Neuer Kommentar", "Comments" => "Kommentare", "No comments yet. Be the first." => "Bisher keine Kommentare. Sei der Erste.", "Send!" => "Abschicken!", "Vote!" => "Abstimmen!", + "Polls summary" => "Umfrage-Übersicht", "Home" => "Startseite", + "Update poll" => "Umfrage aktualisieren", + "Create poll" => "Umfrage erstellen", "participated" => "abgestimmt", "Yourself" => "Dir", "Select" => "Wählen", @@ -68,6 +75,7 @@ $TRANSLATIONS = array( "Description (will be shown as tooltip on the summary page)" => "Beschreibung (wird als Tooltip in der Übersicht angezeigt)", "Poll expired" => "Umfrage abgelaufen", "The poll expired on %s. Voting is disabled, but you can still comment." => "Die Umfrage lief am %s ab. Die Abstimmung ist geschlossen, aber es kann weiterhin kommentiert werden.", + "Access denied" => "Zugriff verweigert", "You are not allowed to view this poll or the poll does not exist." => "Ihnen fehlt die Berechtigung zur Anzeige dieser Abstimmung oder diese Abstimmung existiert nicht.", "Error" => "Fehler", "d.m.Y H:i" => "d.m.Y H:i", diff --git a/l10n/de_DE.json b/l10n/de_DE.json index d0bb8986e..4b5127a03 100644 --- a/l10n/de_DE.json +++ b/l10n/de_DE.json @@ -1,5 +1,6 @@ { "translations": { "Polls" : "Umfragen", + "Poll" : "Umfrage", "Summary" : "Übersicht", "No existing polls." : "Keine Umfragen vorhanden.", "Title" : "Name", @@ -35,14 +36,20 @@ "click to add" : "Zum Hinzufügen klicken", "date\\time" : "Datum/Zeit", "Poll URL" : "Umfrage-Link", + "Link" : "Link", "Total" : "Gesamt", + "Best option" : "Bestes Ergebnis", + "All" : "Alle", "No description provided." : "Keine Beschreibung angegeben.", "Write new Comment" : "Neuer Kommentar", "Comments" : "Kommentare", "No comments yet. Be the first." : "Bisher keine Kommentare. Sei der Erste.", "Send!" : "Abschicken!", "Vote!" : "Abstimmen!", + "Polls summary" : "Umfrage-Übersicht", "Home" : "Startseite", + "Update poll" : "Umfrage aktualisieren", + "Create poll" : "Umfrage erstellen", "participated" : "abgestimmt", "Yourself" : "Ihnen", "Select" : "Wählen", @@ -67,6 +74,7 @@ "Description (will be shown as tooltip on the summary page)" : "Beschreibung (wird als Tooltip in der Übersicht angezeigt)", "Poll expired" : "Umfrage abgelaufen", "The poll expired on %s. Voting is disabled, but you can still comment." : "Die Umfrage lief am %s ab. Die Abstimmung ist geschlossen, aber es kann weiterhin kommentiert werden.", + "Access denied" : "Zugriff verweigert", "You are not allowed to view this poll or the poll does not exist." : "Ihnen fehlt die Berechtigung zur Anzeige dieser Abstimmung oder diese Abstimmung existiert nicht.", "Error" : "Fehler", "d.m.Y H:i" : "d.m.Y H:i", diff --git a/l10n/en.json b/l10n/en.json index 2c50fbe92..d8cbb5571 100644 --- a/l10n/en.json +++ b/l10n/en.json @@ -1,5 +1,6 @@ { "translations": { "Polls" : "Polls", + "Poll" : "Poll", "Summary" : "Summary", "No existing polls." : "No existing polls.", "Title" : "Title", @@ -35,13 +36,19 @@ "click to add" : "click to add", "date\\time" : "date\\time", "Poll URL" : "Poll URL", + "Link" : "Link", "Total" : "Total", + "Best option" : "Best option", + "All" : "All", "No description provided." : "No description provided.", "Write new Comment" : "Write new Comment", "Comments" : "Comments", "No comments yet. Be the first." : "No comments yet. Be the first.", "Send!" : "Send!", "Vote!" : "Vote!", + "Polls summary" : "Polls summary", + "Update poll" : "Update poll", + "Create poll" : "Create poll", "Home" : "Home", "participated" : "participated", "Yourself" : "Yourself", @@ -67,6 +74,7 @@ "Description (will be shown as tooltip on the summary page)" : "Description (will be shown as tooltip on the summary page)", "Poll expired" : "Poll expired", "The poll expired on %s. Voting is disabled, but you can still comment." : "The poll expired on %s. Voting is disabled, but you can still comment.", + "Access denied" : "Access denied", "You are not allowed to view this poll or the poll does not exist." : "You are not allowed to view this poll or the poll does not exist.", "Error" : "Error", "Hello %s,

    %s shared the poll '%s' with you. To go directly to the poll, you can use this link: %s" : "Hello %s,

    %s shared the poll '%s' with you. To go directly to the poll, you can use this link: %s", diff --git a/l10n/en.php b/l10n/en.php index 448536370..2b50ff8bb 100644 --- a/l10n/en.php +++ b/l10n/en.php @@ -1,6 +1,7 @@ "Polls", + "Poll" => "Poll", "Summary" => "Summary", "No existing polls." => "No existing polls.", "Title" => "Title", @@ -36,14 +37,20 @@ $TRANSLATIONS = array( "click to add" => "click to add", "date\\time" => "date\\time", "Poll URL" => "Poll URL", + "Link" => "Link", "Total" => "Total", + "Best option" => "Best option", + "All" => "Alle", "No description provided." => "No description provided.", "Write new Comment" => "Write new Comment", "Comments" => "Comments", "No comments yet. Be the first." => "No comments yet. Be the first.", "Send!" => "Send!", "Vote!" => "Vote!", + "Polls summary" => "Polls summary", "Home" => "Home", + "Update poll" => "Update poll", + "Create poll" => "Create poll", "participated" => "participated", "Yourself" => "Yourself", "Select" => "Select", @@ -68,6 +75,7 @@ $TRANSLATIONS = array( "Description (will be shown as tooltip on the summary page)" => "Description (will be shown as tooltip on the summary page)", "Poll expired" => "Poll expired", "The poll expired on %s. Voting is disabled, but you can still comment." => "The poll expired on %s. Voting is disabled, but you can still comment.", + "Access denied" => "Access denied", "You are not allowed to view this poll or the poll does not exist." => "You are not allowed to view this poll or the poll does not exist.", "Error" => "Error", "Hello %s,

    %s shared the poll '%s' with you. To go directly to the poll, you can use this link: %s" => "Hello %s,

    %s shared the poll '%s' with you. To go directly to the poll, you can use this link: %s", From c28537578d0b10c4be1ded4db731ca03cf564df9 Mon Sep 17 00:00:00 2001 From: Vinzenz Date: Mon, 25 Apr 2016 14:02:56 +0200 Subject: [PATCH 4/4] add 'link' to l10n --- templates/goto.tmpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/goto.tmpl.php b/templates/goto.tmpl.php index 29c012a25..7ba9ec4c0 100644 --- a/templates/goto.tmpl.php +++ b/templates/goto.tmpl.php @@ -332,7 +332,7 @@ $pollUrl = OCP\Util::linkToAbsolute('', $urlGenerator->linkToRoute('polls.page.g