diff --git a/web/app/controllers/list.php b/web/app/controllers/list.php index c116d6c..6fee16a 100644 --- a/web/app/controllers/list.php +++ b/web/app/controllers/list.php @@ -166,11 +166,12 @@ $pag = new Paginator($pag_config); $('#input-show_tags_mode').click(function() { if (this.checked) { $.cookie('show_tags_mode', '', { - path: '/' + path: '/list', + expires: 365, }); } else { $.removeCookie('show_tags_mode', { - path: '/' + path: '/list', }); } location.reload(); @@ -178,11 +179,12 @@ $pag = new Paginator($pag_config); $('#input-show_submit_mode').click(function() { if (this.checked) { $.cookie('show_submit_mode', '', { - path: '/' + path: '/list', + expires: 365, }); } else { $.removeCookie('show_submit_mode', { - path: '/' + path: '/list', }); } location.reload(); @@ -190,11 +192,12 @@ $pag = new Paginator($pag_config); $('#input-show_difficulty').click(function() { if (this.checked) { $.cookie('show_difficulty', '', { - path: '/' + path: '/list', + expires: 365, }); } else { $.removeCookie('show_difficulty', { - path: '/' + path: '/list', }); } location.reload(); diff --git a/web/app/controllers/lists.php b/web/app/controllers/lists.php index 96babbf..2e81ef3 100644 --- a/web/app/controllers/lists.php +++ b/web/app/controllers/lists.php @@ -45,8 +45,10 @@ function getListTR($info) { if ($list->info['is_hidden']) { $html .= ' ' . UOJLocale::get('hidden') . ' '; } - foreach ($list->queryTags() as $tag) { - $html .= ' ' . HTML::escape($tag) . ' '; + if (isset($_COOKIE['show_tags_mode'])) { + foreach ($list->queryTags() as $tag) { + $html .= ' ' . HTML::escape($tag) . ' '; + } } $html .= HTML::tag('td', [], max(0, $accepted)); $html .= HTML::tag('td', [], count($problems)); @@ -121,11 +123,12 @@ $pag = new Paginator([ $('#input-show_tags_mode').click(function() { if (this.checked) { $.cookie('show_tags_mode', '', { - path: '/' + path: '/lists', + expires: 365, }); } else { $.removeCookie('show_tags_mode', { - path: '/' + path: '/lists', }); } location.reload(); diff --git a/web/app/controllers/problem_set.php b/web/app/controllers/problem_set.php index dcad8b0..0de0224 100644 --- a/web/app/controllers/problem_set.php +++ b/web/app/controllers/problem_set.php @@ -288,11 +288,12 @@ $pag = new Paginator([ $('#input-show_tags_mode').click(function() { if (this.checked) { $.cookie('show_tags_mode', '', { - path: '/' + path: '/problems', + expires: 365, }); } else { $.removeCookie('show_tags_mode', { - path: '/' + path: '/problems', }); } location.reload(); @@ -300,11 +301,12 @@ $pag = new Paginator([ $('#input-show_submit_mode').click(function() { if (this.checked) { $.cookie('show_submit_mode', '', { - path: '/' + path: '/problems', + expires: 365, }); } else { $.removeCookie('show_submit_mode', { - path: '/' + path: '/problems' }); } location.reload(); @@ -312,11 +314,12 @@ $pag = new Paginator([ $('#input-show_difficulty').click(function() { if (this.checked) { $.cookie('show_difficulty', '', { - path: '/' + path: '/problems', + expires: 365, }); } else { $.removeCookie('show_difficulty', { - path: '/' + path: '/problems' }); } location.reload();