diff --git a/src/ajax.php b/src/ajax.php index cf403bd..b15bb3c 100644 --- a/src/ajax.php +++ b/src/ajax.php @@ -23,12 +23,13 @@ if(isset($_GET['loadLists'])) { check_token(); $t = array(); + $t['total'] = 0; if (!is_logged()) $sqlWhere = 'WHERE published=1'; else { $sqlWhere = ''; $t['list'][] = prepareAllTasksList(); // show alltasks lists only for authorized user + $t['total'] = 1; } - $t['total'] = 1; $q = $db->dq("SELECT * FROM {$db->prefix}lists $sqlWhere ORDER BY ow ASC, id ASC"); while($r = $q->fetchAssoc()) { diff --git a/src/content/lang/en.json b/src/content/lang/en.json index 64aff7e..ea8fa73 100644 --- a/src/content/lang/en.json +++ b/src/content/lang/en.json @@ -161,6 +161,8 @@ "actionNoteCancel": "cancel", "error": "Some error occurred (click for details)", "denied": "Access denied", + "listNotFound": "Not found", + "noPublicLists": "No public tasks", "invalidpass": "Wrong password", "addList": "Create new list", "addListDefault": "Todo", diff --git a/src/content/themes/default/index.php b/src/content/themes/default/index.php index 32e6b09..4540901 100644 --- a/src/content/themes/default/index.php +++ b/src/content/themes/default/index.php @@ -116,6 +116,10 @@ $().ready(function(){ + +
    @@ -258,7 +262,7 @@ $().ready(function(){ diff --git a/src/content/themes/default/style.css b/src/content/themes/default/style.css index 6154250..4ff9d7a 100644 --- a/src/content/themes/default/style.css +++ b/src/content/themes/default/style.css @@ -66,6 +66,7 @@ a { color:#0000ff; cursor:pointer; text-decoration:underline; } #msg.mtt-info .msg-details { border:1px solid #EFC300;} #lists { font-size:0.95rem; display:flex; align-items:flex-start; justify-content:flex-end; } +#mtt_body.readonly.no-lists #lists > * { visibility: hidden; } .tabs-n-button { flex-grow:1; display:flex; align-items:flex-start; } .tab-height-wrapper { box-sizing:border-box; height:2.2rem; display:flex; align-items:center; } .mtt-tabs { list-style:none; padding:0; margin:0; display:flex; justify-content:flex-start; flex-wrap:wrap; } @@ -103,7 +104,9 @@ a { color:#0000ff; cursor:pointer; text-decoration:underline; } .mtt-img-button:hover, .mtt-img-button.mtt-menu-button-active { background-color:#efefef; cursor:pointer; } .mtt-img-button span { display:block; width:16px; height:16px; } -#mtt_body.no-lists #toolbar > * { visibility:hidden; } +#mtt_body.no-lists #toolbar > * { visibility:hidden; } +#mtt_body.no-list-selected #toolbar > * { visibility:hidden; } +#mtt_body.readonly.no-lists #toolbar { visibility: hidden; } #toolbar { padding:8px; border-bottom:1px solid #DEDEDE; background:#ededed; } #toolbar .mtt-img-button:hover { background-color:#ddd; } @@ -145,7 +148,8 @@ a { color:#0000ff; cursor:pointer; text-decoration:underline; } /* */ #page_tasks h3 { display:flex; align-items:baseline; } -#mtt_body.no-lists #page_tasks h3 > * { visibility:hidden; } +#mtt_body.no-lists #page_tasks h3 { visibility:hidden; } +#mtt_body.no-list-selected #page_tasks h3 { visibility:hidden; } .mtt-notes-showhide { font-size:1rem; font-weight:normal; margin-left:5px; margin-right:5px; } .mtt-notes-showhide a { text-decoration:none; border-bottom:1px dotted; } @@ -298,6 +302,22 @@ li.task-row.task-completed .task-note-block .task-note { text-decoration:line-th .prio-zero { /*background-color:#dedede;*/ } .task-prio.prio-zero { display:none; } +#tasks_info { + display: flex; + justify-content: center; + align-content: center; + flex-direction: column; + min-height: 100px; + border: 1px solid #ccc; + border-radius: 5px; +} +#tasks_info .v { + font-size: 1.1rem; + font-weight: bold; + text-align: center; +} + + .form-row { margin-top:0.6rem; } .form-row .h { font-weight:bold; color:#333333; } .form-row div.h { margin-bottom:3px; } @@ -446,6 +466,7 @@ li.mtt-item-hidden { display:none; } #slmenucontainer li.mtt-list-hidden a { font-style:italic; } #cmenulistscontainer li.mtt-list-hidden { font-style:italic; } #mtt_body.readonly .mtt-need-list { display:none; } +#mtt_body.readonly .mtt-need-authorized { display:none; } #btnRssFeed .menu-icon { background:url(images/rss.svg) no-repeat; } #btnRssFeed.mtt-item-disabled .menu-icon { background:url(images/rss-disabled.svg) no-repeat; } diff --git a/src/includes/class.lang.php b/src/includes/class.lang.php index 870a4c0..82d74ea 100644 --- a/src/includes/class.lang.php +++ b/src/includes/class.lang.php @@ -112,6 +112,8 @@ class Lang 'actionNoteCancel', 'error', 'denied', + 'listNotFound', + 'noPublicLists', 'invalidpass', 'addList', 'addListDefault', diff --git a/src/includes/mytinytodo.js b/src/includes/mytinytodo.js index b4c580e..001369a 100644 --- a/src/includes/mytinytodo.js +++ b/src/includes/mytinytodo.js @@ -675,6 +675,7 @@ var mytinytodo = window.mytinytodo = _mtt = { } $('#page_tasks').hide(); $('#tasklist').html(''); + $('#tasks_info').hide(); tabLists.clear(); @@ -682,7 +683,7 @@ var mytinytodo = window.mytinytodo = _mtt = { { var ti = ''; var openListId = 0; - if(res && res.total) + if(res && res.total && res.list) { // open required or first non-hidden list for(var i=0; i