From 01d25f28172aefe90eef80bba702c917f8ce6068 Mon Sep 17 00:00:00 2001 From: Timothy J Warren Date: Thu, 14 Apr 2016 17:00:34 -0400 Subject: [PATCH] Add ability to delete items from manga list. See #10 --- app/config/routes.php | 65 +- app/views/anime/edit.php | 2 +- app/views/manga/edit.php | 16 + public/css/base.css | 2 +- public/css/base.myth.css | 2 +- public/css/marx.css | 302 ++++--- public/css/marx.myth.css | 990 ++++++++++++--------- public/js/base/events.js | 2 +- src/Aviat/AnimeClient/Controller/Anime.php | 2 +- src/Aviat/AnimeClient/Controller/Manga.php | 22 +- src/Aviat/AnimeClient/Model/Manga.php | 7 +- 11 files changed, 820 insertions(+), 592 deletions(-) diff --git a/app/config/routes.php b/app/config/routes.php index 1fa3bb13..aa138002 100644 --- a/app/config/routes.php +++ b/app/config/routes.php @@ -46,24 +46,24 @@ return [ 'anime.add.get' => [ 'path' => '/anime/add', 'action' => 'add_form', - 'verb' => 'get' + 'verb' => 'get', ], 'anime.add.post' => [ 'path' => '/anime/add', 'action' => 'add', - 'verb' => 'post' + 'verb' => 'post', ], 'anime.details' => [ 'path' => '/anime/details/{id}', 'action' => 'details', 'tokens' => [ - 'id' => '[a-z0-9\-]+' - ] + 'id' => '[a-z0-9\-]+', + ], ], 'anime.delete' => [ 'path' => '/anime/delete', 'action' => 'delete', - 'verb' => 'post' + 'verb' => 'post', ], // --------------------------------------------------------------------- // Manga Routes @@ -75,19 +75,24 @@ return [ 'manga.add.get' => [ 'path' => '/manga/add', 'action' => 'add_form', - 'verb' => 'get' + 'verb' => 'get', ], 'manga.add.post' => [ 'path' => '/manga/add', 'action' => 'add', - 'verb' => 'post' + 'verb' => 'post', + ], + 'manga.delete' => [ + 'path' => '/manga/delete', + 'action' => 'delete', + 'verb' => 'post', ], // --------------------------------------------------------------------- // Anime Collection Routes // --------------------------------------------------------------------- 'collection.search' => [ 'path' => '/collection/search', - 'action' => 'search' + 'action' => 'search', ], 'collection.add.get' => [ 'path' => '/collection/add', @@ -98,27 +103,35 @@ return [ 'path' => '/collection/edit/{id}', 'action' => 'form', 'tokens' => [ - 'id' => '[0-9]+' - ] + 'id' => '[0-9]+', + ], ], 'collection.add.post' => [ 'path' => '/collection/add', 'action' => 'add', - 'verb' => 'post' + 'verb' => 'post', ], 'collection.edit.post' => [ 'path' => '/collection/edit', 'action' => 'edit', - 'verb' => 'post' + 'verb' => 'post', ], 'collection.view' => [ 'path' => '/collection/view{/view}', 'action' => 'index', 'params' => [], 'tokens' => [ - 'view' => '[a-z_]+' - ] + 'view' => '[a-z_]+', + ], ], + 'collection.delete' => [ + 'path' => '/collection/delete', + 'action' => 'delete', + 'verb' => 'post', + ], + // --------------------------------------------------------------------- + // Manga Collection Routes + // --------------------------------------------------------------------- // --------------------------------------------------------------------- // Default / Shared routes // --------------------------------------------------------------------- @@ -126,13 +139,13 @@ return [ 'path' => '/login', 'action' => 'login', 'controller' => AnimeClient::DEFAULT_CONTROLLER_NAMESPACE, - 'verb' => 'get' + 'verb' => 'get', ], 'login.post' => [ 'path' => '/login', 'action' => 'login_action', 'controller' => AnimeClient::DEFAULT_CONTROLLER_NAMESPACE, - 'verb' => 'post' + 'verb' => 'post', ], 'logout' => [ 'path' => '/logout', @@ -144,37 +157,37 @@ return [ 'action' => 'update', 'verb' => 'post', 'tokens' => [ - 'controller' => '[a-z_]+' - ] + 'controller' => '[a-z_]+', + ], ], 'update.post' => [ 'path' => '/{controller}/update_form', 'action' => 'form_update', 'verb' => 'post', 'tokens' => [ - 'controller' => '[a-z_]+' - ] + 'controller' => '[a-z_]+', + ], ], 'edit' => [ 'path' => '/{controller}/edit/{id}/{status}', 'action' => 'edit', 'tokens' => [ 'id' => '[0-9a-z_]+', - 'status' => '([a-zA-Z\- ]|%20)+', - ] + 'status' => '([a-zA-Z\-_]|%20)+', + ], ], 'list' => [ 'path' => '/{controller}/{type}{/view}', 'action' => AnimeClient::DEFAULT_CONTROLLER_METHOD, 'tokens' => [ 'type' => '[a-z_]+', - 'view' => '[a-z_]+' - ] + 'view' => '[a-z_]+', + ], ], 'index_redirect' => [ 'path' => '/', 'controller' => AnimeClient::DEFAULT_CONTROLLER_NAMESPACE, - 'action' => 'redirect_to_default' + 'action' => 'redirect_to_default', ], - ] + ], ]; \ No newline at end of file diff --git a/app/views/anime/edit.php b/app/views/anime/edit.php index 1e42608a..d8d959bd 100644 --- a/app/views/anime/edit.php +++ b/app/views/anime/edit.php @@ -86,7 +86,7 @@
Danger Zone -
+ diff --git a/app/views/manga/edit.php b/app/views/manga/edit.php index b281bb0e..7aabf1a9 100644 --- a/app/views/manga/edit.php +++ b/app/views/manga/edit.php @@ -84,5 +84,21 @@
+
+ Danger Zone +
+ + + + + + + + +
+
\ No newline at end of file diff --git a/public/css/base.css b/public/css/base.css index b53d8ab7..046f8f09 100644 --- a/public/css/base.css +++ b/public/css/base.css @@ -323,7 +323,7 @@ h1 a { .form tr > td:nth-child(even) { text-align: left; - min-width: 70%; + width: 70%; } .invisible tbody > tr:nth-child(odd) { diff --git a/public/css/base.myth.css b/public/css/base.myth.css index 1b55dc26..77931528 100644 --- a/public/css/base.myth.css +++ b/public/css/base.myth.css @@ -201,7 +201,7 @@ a:hover, a:active { } .form tr > td:nth-child(even) { text-align:left; - min-width:70%; + width:70%; } .invisible tbody > tr:nth-child(odd) { diff --git a/public/css/marx.css b/public/css/marx.css index d7c215a3..cc192a04 100644 --- a/public/css/marx.css +++ b/public/css/marx.css @@ -1,4 +1,6 @@ :root { + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100%; box-sizing: border-box; cursor: default; font-family: 'Open Sans', 'Nimbus Sans L', 'Helvetica Neue', Helvetica, 'Lucida Grande', sans-serif; @@ -17,17 +19,20 @@ details { display: block; } -input[type="search"] { +input[type=search] { -webkit-appearance: textfield; } -input[type="search"]::-webkit-search-cancel-button, -input[type="search"]::-webkit-search-decoration { +input[type=search]::-webkit-search-cancel-button, +input[type=search]::-webkit-search-decoration { -webkit-appearance: none; } main { display: block; + margin: 0 auto; + padding: 0 1.6em 1.6em; + padding: 0 1.6rem 1.6rem; } summary { @@ -35,7 +40,19 @@ summary { } pre { + background: #efefef; + color: #444; + display: block; + font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; + font-size: 1.4em; + font-size: 1.4rem; + margin: 1.6em 0; + margin: 1.6rem 0; overflow: auto; + padding: 1.6em; + padding: 1.6rem; + word-break: break-all; + word-wrap: break-word; } progress { @@ -43,6 +60,7 @@ progress { } small { + color: #777; font-size: 75%; } @@ -55,8 +73,14 @@ template { } textarea { + border: .1rem solid #ccc; + border-radius: 0; + display: block; + margin-bottom: .8rem; overflow: auto; + padding: .8rem; resize: vertical; + vertical-align: middle; } [hidden] { @@ -64,9 +88,9 @@ textarea { } [unselectable] { - -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; + -webkit-user-select: none; user-select: none; } @@ -92,7 +116,11 @@ textarea { } a { + -webkit-transition: .25s ease; + color: #1271db; text-decoration: none; + -webkit-transition: .25s ease; + transition: .25s ease; } audio, @@ -126,6 +154,7 @@ samp { table { border-collapse: collapse; border-spacing: 0; + margin-bottom: 1.6rem; } ::-moz-selection { @@ -142,23 +171,13 @@ button::-moz-focus-inner { border: 0; } -@media screen { - [hidden~="screen"] { - display: inherit; - } - - [hidden~="screen"]:not(:active):not(:focus):not(:target) { - clip: rect(0 0 0 0) !important; - position: absolute !important; - } -} - body { color: #444; font-family: 'Open Sans', 'Nimbus Sans L', 'Helvetica Neue', Helvetica, 'Lucida Grande', sans-serif; font-size: 1.6rem; font-style: normal; font-weight: 400; + padding: 0; } p { @@ -171,66 +190,57 @@ h3, h4, h5, h6 { - font-family: 'Lato', 'Open Sans', 'Nimbus Sans L', 'Helvetica Neue', Helvetica, 'Lucida Grande', sans-serif; + font-family: Lato, 'Open Sans', 'Nimbus Sans L', 'Helvetica Neue', Helvetica, 'Lucida Grande', sans-serif; + margin: 2em 0 1.6em; margin: 2rem 0 1.6rem; } h1 { - border-bottom: .1rem solid rgba(0, 0, 0, 0.2); + border-bottom: .1rem solid rgba(0,0,0,0.2); + font-size: 3.6em; font-size: 3.6rem; font-style: normal; font-weight: 500; } h2 { + font-size: 3em; font-size: 3rem; font-style: normal; font-weight: 500; } h3 { + font-size: 2.4em; font-size: 2.4rem; font-style: normal; font-weight: 500; - margin: 1.6rem 0 0.4rem; + margin: 1.6rem 0 .4rem; } h4 { + font-size: 1.8em; font-size: 1.8rem; font-style: normal; font-weight: 600; - margin: 1.6rem 0 0.4rem; + margin: 1.6rem 0 .4rem; } h5 { + font-size: 1.6em; font-size: 1.6rem; font-style: normal; font-weight: 600; - margin: 1.6rem 0 0.4rem; + margin: 1.6rem 0 .4rem; } h6 { color: #777; + font-size: 1.4em; font-size: 1.4rem; font-style: normal; font-weight: 600; - margin: 1.6rem 0 0.4rem; -} - -small { - color: #777; -} - -pre { - background: #efefef; - color: #444; - display: block; - font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; - font-size: 1.4rem; - margin: 1.6rem 0; - padding: 1.6rem; - word-break: break-all; - word-wrap: break-word; + margin: 1.6rem 0 .4rem; } code { @@ -242,12 +252,6 @@ code { word-wrap: break-word; } -a { - color: #1271db; - -webkit-transition: .25s ease; - transition: .25s ease; -} - a:hover, a:focus { text-decoration: none; @@ -263,7 +267,7 @@ dd { ul, ol { - margin-bottom: 0.8rem; + margin-bottom: .8rem; padding-left: 2rem; } @@ -283,10 +287,6 @@ html { font-size: 62.5%; } -body { - padding: 0; -} - main, header, footer, @@ -301,14 +301,8 @@ summary { width: 100%; } -main { - display: block; - margin: 0 auto; - padding: 0 1.6rem 1.6rem; -} - footer { - border-top: .1rem solid rgba(0, 0, 0, 0.2); + border-top: .1rem solid rgba(0,0,0,0.2); clear: both; display: inline-block; float: left; @@ -318,7 +312,7 @@ footer { } hr { - border-top: .1rem solid rgba(0, 0, 0, 0.2); + border-top: .1rem solid rgba(0,0,0,0.2); display: block; margin-bottom: 1.6rem; width: 100%; @@ -330,39 +324,25 @@ img { vertical-align: baseline; } -@media screen and (max-width: 40rem) { - article, - section, - aside { - clear: both; - display: block; - max-width: 100%; - } - - img { - margin-right: 1.6rem; - } -} - -input[type="text"], -input[type="password"], -input[type="email"], -input[type="url"], -input[type="date"], -input[type="month"], -input[type="time"], -input[type="datetime"], -input[type="datetime-local"], -input[type="week"], -input[type="number"], -input[type="search"], -input[type="tel"], -input[type="color"], +input[type=text], +input[type=password], +input[type=email], +input[type=url], +input[type=date], +input[type=month], +input[type=time], +input[type=datetime], +input[type=datetime-local], +input[type=week], +input[type=number], +input[type=search], +input[type=tel], +input[type=color], select { border: .1rem solid #ccc; border-radius: 0; display: inline-block; - padding: 0.8rem; + padding: .8rem; vertical-align: middle; } @@ -374,28 +354,28 @@ input:not([type]) { border-radius: 0; color: #444; display: inline-block; - padding: 0.8rem; + padding: .8rem; text-align: left; } -input[type="color"] { - padding: 0.8rem 1.6rem; +input[type=color] { + padding: .8rem 1.6rem; } -input[type="text"]:focus, -input[type="password"]:focus, -input[type="email"]:focus, -input[type="url"]:focus, -input[type="date"]:focus, -input[type="month"]:focus, -input[type="time"]:focus, -input[type="datetime"]:focus, -input[type="datetime-local"]:focus, -input[type="week"]:focus, -input[type="number"]:focus, -input[type="search"]:focus, -input[type="tel"]:focus, -input[type="color"]:focus, +input[type=text]:focus, +input[type=password]:focus, +input[type=email]:focus, +input[type=url]:focus, +input[type=date]:focus, +input[type=month]:focus, +input[type=time]:focus, +input[type=datetime]:focus, +input[type=datetime-local]:focus, +input[type=week]:focus, +input[type=number]:focus, +input[type=search]:focus, +input[type=tel]:focus, +input[type=color]:focus, select:focus, textarea:focus { border-color: #b3d4fc; @@ -405,31 +385,31 @@ input:not([type]):focus { border-color: #b3d4fc; } -input[type="radio"], -input[type="checkbox"] { +input[type=radio], +input[type=checkbox] { vertical-align: middle; } -input[type="file"]:focus, -input[type="radio"]:focus, -input[type="checkbox"]:focus { +input[type=file]:focus, +input[type=radio]:focus, +input[type=checkbox]:focus { outline: .1rem solid thin #444; } -input[type="text"][disabled], -input[type="password"][disabled], -input[type="email"][disabled], -input[type="url"][disabled], -input[type="date"][disabled], -input[type="month"][disabled], -input[type="time"][disabled], -input[type="datetime"][disabled], -input[type="datetime-local"][disabled], -input[type="week"][disabled], -input[type="number"][disabled], -input[type="search"][disabled], -input[type="tel"][disabled], -input[type="color"][disabled], +input[type=text][disabled], +input[type=password][disabled], +input[type=email][disabled], +input[type=url][disabled], +input[type=date][disabled], +input[type=month][disabled], +input[type=time][disabled], +input[type=datetime][disabled], +input[type=datetime-local][disabled], +input[type=week][disabled], +input[type=number][disabled], +input[type=search][disabled], +input[type=tel][disabled], +input[type=color][disabled], select[disabled], textarea[disabled] { background-color: #efefef; @@ -458,9 +438,9 @@ select:focus:invalid { color: #b94a48; } -input[type="file"]:focus:invalid:focus, -input[type="radio"]:focus:invalid:focus, -input[type="checkbox"]:focus:invalid:focus { +input[type=file]:focus:invalid:focus, +input[type=radio]:focus:invalid:focus, +input[type=checkbox]:focus:invalid:focus { outline-color: #ff4136; } @@ -480,44 +460,38 @@ label { fieldset { border: 0; margin: 0; - padding: 0.8rem 0; + padding: .8rem 0; } legend { border-bottom: .1rem solid #ccc; color: #444; display: block; - margin-bottom: 0.8rem; - padding: 0.8rem 0; + margin-bottom: .8rem; + padding: .8rem 0; width: 100%; } -textarea { - border: .1rem solid #ccc; - border-radius: 0; - display: block; - margin-bottom: 0.8rem; - padding: 0.8rem; - vertical-align: middle; -} - input[type=submit], button { - /*background-color: transparent;*/ + -moz-user-select: none; + -ms-user-select: none; + -webkit-transition: .25s ease; + -webkit-user-drag: none; + -webkit-user-select: none; border: .2rem solid #444; border-radius: 0; color: #444; cursor: pointer; display: inline-block; - margin-bottom: 0.8rem; - margin-right: 0.4rem; - padding: 0.8rem 1.6rem; + margin-bottom: .8rem; + margin-right: .4rem; + padding: .8rem 1.6rem; text-align: center; text-decoration: none; text-transform: uppercase; -webkit-transition: .25s ease; transition: .25s ease; - -webkit-user-drag: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; @@ -578,9 +552,10 @@ nav ul li { } nav a { + -webkit-transition: .25s ease; border-bottom: .2rem solid transparent; color: #444; - padding: 0.8rem 1.6rem; + padding: .8rem 1.6rem; text-decoration: none; -webkit-transition: .25s ease; transition: .25s ease; @@ -588,19 +563,15 @@ nav a { nav a:hover, nav li.selected a { - border-color: rgba(0, 0, 0, 0.2); + border-color: rgba(0,0,0,0.2); } nav a:active { - border-color: rgba(0, 0, 0, 0.56); -} - -table { - margin-bottom: 1.6rem; + border-color: rgba(0,0,0,0.56); } caption { - padding: 0.8rem 0; + padding: .8rem 0; } thead th { @@ -610,13 +581,13 @@ thead th { tr { background: #fff; - margin-bottom: 0.8rem; + margin-bottom: .8rem; } th, td { border: .1rem solid #ccc; - padding: 0.8rem 1.6rem; + padding: .8rem 1.6rem; text-align: center; vertical-align: inherit; } @@ -627,7 +598,32 @@ tfoot tr { tfoot td { color: #efefef; - font-size: 0.8rem; + font-size: .8rem; font-style: italic; - padding: 1.6rem 0.4rem; + padding: 1.6rem .4rem; +} + +@media screen { + [hidden~=screen] { + display: inherit; + } + + [hidden~=screen]:not(:active):not(:focus):not(:target) { + clip: rect(0000)!important; + position: absolute!important; + } +} + +@media screen and max-width 40rem { + article, + section, + aside { + clear: both; + display: block; + max-width: 100%; + } + + img { + margin-right: 1.6rem; + } } \ No newline at end of file diff --git a/public/css/marx.myth.css b/public/css/marx.myth.css index 9303f342..c22e49ad 100644 --- a/public/css/marx.myth.css +++ b/public/css/marx.myth.css @@ -1,433 +1,615 @@ -:root { - --default-font-list: 'Open Sans', 'Nimbus Sans L', 'Helvetica Neue', Helvetica, 'Lucida Grande', sans-serif; - box-sizing: border-box; - cursor: default; - font-family: var(--default-font-list); - line-height: 1.4; - overflow-y: scroll; - -webkit-text-size-adjust: 100%; - -ms-text-size-adjust: 100%; - text-size-adjust: 100%; } +:root +{ + --default-font-list:'Open Sans', 'Nimbus Sans L', 'Helvetica Neue', Helvetica, 'Lucida Grande', sans-serif; + -ms-text-size-adjust:100%; + -webkit-text-size-adjust:100%; + box-sizing:border-box; + cursor:default; + font-family:var(--default-font-list); + line-height:1.4; + overflow-y:scroll; + text-size-adjust:100%; +} -audio:not([controls]) { - display: none; } +audio:not([controls]) +{ + display:none; +} -details { - display: block; } +details +{ + display:block; +} -input[type="search"] { - -webkit-appearance: textfield; } - input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { - -webkit-appearance: none; } +input[type=search] +{ + -webkit-appearance:textfield; +} -main { - display: block; } +input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration +{ + -webkit-appearance:none; +} -summary { - display: block; } +main +{ + display:block; + margin:0 auto; + padding:0 1.6em 1.6em; + padding:0 1.6rem 1.6rem; +} -pre { - overflow: auto; } +summary +{ + display:block; +} -progress { - display: inline-block; } +pre +{ + background:#efefef; + color:#444; + display:block; + font-family:Menlo, Monaco, Consolas, 'Courier New', monospace; + font-size:1.4em; + font-size:1.4rem; + margin:1.6em 0; + margin:1.6rem 0; + overflow:auto; + padding:1.6em; + padding:1.6rem; + word-break:break-all; + word-wrap:break-word; +} -small { - font-size: 75%; } +progress +{ + display:inline-block; +} -big { - font-size: 125%; } +small +{ + color:#777; + font-size:75%; +} -template { - display: none; } +big +{ + font-size:125%; +} -textarea { - overflow: auto; - resize: vertical; } +template +{ + display:none; +} -[hidden] { - display: none; } +textarea +{ + border:.1rem solid #ccc; + border-radius:0; + display:block; + margin-bottom:.8rem; + overflow:auto; + padding:.8rem; + resize:vertical; + vertical-align:middle; +} -[unselectable] { - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; } +[hidden] +{ + display:none; +} -*, ::before, ::after { - border-style: solid; - border-width: 0; - box-sizing: inherit; } +[unselectable] +{ + -moz-user-select:none; + -ms-user-select:none; + -webkit-user-select:none; + user-select:none; +} -* { - font-size: inherit; - line-height: inherit; - margin: 0; - padding: 0; } +*,::before,::after +{ + border-style:solid; + border-width:0; + box-sizing:inherit; +} -::before, ::after { - text-decoration: inherit; - vertical-align: inherit; } +* +{ + font-size:inherit; + line-height:inherit; + margin:0; + padding:0; +} -a { - text-decoration: none; } +::before,::after +{ + text-decoration:inherit; + vertical-align:inherit; +} -audio, canvas, iframe, img, svg, video { - vertical-align: middle; } +a +{ + -webkit-transition:.25s ease; + color:#1271db; + text-decoration:none; + transition:.25s ease; +} -button, input, select, textarea { - border: .1rem solid #ccc; - color: inherit; - font-family: inherit; - font-style: inherit; - font-weight: inherit; - min-height: 1.4em; } +audio,canvas,iframe,img,svg,video +{ + vertical-align:middle; +} -code, kbd, pre, samp { - font-family: Menlo, Monaco, Consolas, 'Courier New', monospace, monospace; } +button,input,select,textarea +{ + border:.1rem solid #ccc; + color:inherit; + font-family:inherit; + font-style:inherit; + font-weight:inherit; + min-height:1.4em; +} -table { - border-collapse: collapse; - border-spacing: 0; } +code,kbd,pre,samp +{ + font-family:Menlo, Monaco, Consolas, 'Courier New', monospace, monospace; +} -::-moz-selection { - background-color: #b3d4fc; - text-shadow: none; } +table +{ + border-collapse:collapse; + border-spacing:0; + margin-bottom:1.6rem; +} -::selection { - background-color: #b3d4fc; - text-shadow: none; } +::-moz-selection +{ + background-color:#b3d4fc; + text-shadow:none; +} -button::-moz-focus-inner { - border: 0; } +::selection +{ + background-color:#b3d4fc; + text-shadow:none; +} + +button::-moz-focus-inner +{ + border:0; +} + +body +{ + color:#444; + font-family:var(--default-font-list); + font-size:1.6rem; + font-style:normal; + font-weight:400; + padding:0; +} + +p +{ + margin:0 0 1.6rem; +} + +h1,h2,h3,h4,h5,h6 +{ + font-family:Lato, var(--default-font-list); + margin:2em 0 1.6em; + margin:2rem 0 1.6rem; +} + +h1 +{ + border-bottom:.1rem solid rgba(0,0,0,0.2); + font-size:3.6em; + font-size:3.6rem; + font-style:normal; + font-weight:500; +} + +h2 +{ + font-size:3em; + font-size:3rem; + font-style:normal; + font-weight:500; +} + +h3 +{ + font-size:2.4em; + font-size:2.4rem; + font-style:normal; + font-weight:500; + margin:1.6rem 0 .4rem; +} + +h4 +{ + font-size:1.8em; + font-size:1.8rem; + font-style:normal; + font-weight:600; + margin:1.6rem 0 .4rem; +} + +h5 +{ + font-size:1.6em; + font-size:1.6rem; + font-style:normal; + font-weight:600; + margin:1.6rem 0 .4rem; +} + +h6 +{ + color:#777; + font-size:1.4em; + font-size:1.4rem; + font-style:normal; + font-weight:600; + margin:1.6rem 0 .4rem; +} + +code +{ + background:#efefef; + color:#444; + font-family:Menlo, Monaco, Consolas, 'Courier New', monospace; + font-size:1.4rem; + word-break:break-all; + word-wrap:break-word; +} + +a:hover,a:focus +{ + text-decoration:none; +} + +dl +{ + margin-bottom:1.6rem; +} + +dd +{ + margin-left:4rem; +} + +ul,ol +{ + margin-bottom:.8rem; + padding-left:2rem; +} + +blockquote +{ + border-left:.2rem solid #1271db; + font-family:Georgia, Times, 'Times New Roman', serif; + font-style:italic; + margin:1.6rem 0; + padding-left:1.6rem; +} + +figcaption +{ + font-family:Georgia, Times, 'Times New Roman', serif; +} + +html +{ + font-size:62.5%; +} + +main,header,footer,article,section,aside,details,summary +{ + display:block; + height:auto; + margin:0 auto; + width:100%; +} + +footer +{ + border-top:.1rem solid rgba(0,0,0,0.2); + clear:both; + display:inline-block; + float:left; + max-width:100%; + padding:1rem 0; + text-align:center; +} + +hr +{ + border-top:.1rem solid rgba(0,0,0,0.2); + display:block; + margin-bottom:1.6rem; + width:100%; +} + +img +{ + height:auto; + max-width:100%; + vertical-align:baseline; +} + +input[type=text],input[type=password],input[type=email],input[type=url],input[type=date],input[type=month],input[type=time],input[type=datetime],input[type=datetime-local],input[type=week],input[type=number],input[type=search],input[type=tel],input[type=color],select +{ + border:.1rem solid #ccc; + border-radius:0; + display:inline-block; + padding:.8rem; + vertical-align:middle; +} + +input:not([type]) +{ + -webkit-appearance:none; + background-clip:padding-box; + background-color:#fff; + border:.1rem solid #ccc; + border-radius:0; + color:#444; + display:inline-block; + padding:.8rem; + text-align:left; +} + +input[type=color] +{ + padding:.8rem 1.6rem; +} + +input[type=text]:focus,input[type=password]:focus,input[type=email]:focus,input[type=url]:focus,input[type=date]:focus,input[type=month]:focus,input[type=time]:focus,input[type=datetime]:focus,input[type=datetime-local]:focus,input[type=week]:focus,input[type=number]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=color]:focus,select:focus,textarea:focus +{ + border-color:#b3d4fc; +} + +input:not([type]):focus +{ + border-color:#b3d4fc; +} + +input[type=radio],input[type=checkbox] +{ + vertical-align:middle; +} + +input[type=file]:focus,input[type=radio]:focus,input[type=checkbox]:focus +{ + outline:.1rem solid thin #444; +} + +input[type=text][disabled],input[type=password][disabled],input[type=email][disabled],input[type=url][disabled],input[type=date][disabled],input[type=month][disabled],input[type=time][disabled],input[type=datetime][disabled],input[type=datetime-local][disabled],input[type=week][disabled],input[type=number][disabled],input[type=search][disabled],input[type=tel][disabled],input[type=color][disabled],select[disabled],textarea[disabled] +{ + background-color:#efefef; + color:#777; + cursor:not-allowed; +} + +input:not([type])[disabled] +{ + background-color:#efefef; + color:#777; + cursor:not-allowed; +} + +input[readonly],select[readonly],textarea[readonly] +{ + background-color:#efefef; + border-color:#ccc; + color:#777; +} + +input:focus:invalid,textarea:focus:invalid,select:focus:invalid +{ + border-color:#e9322d; + color:#b94a48; +} + +input[type=file]:focus:invalid:focus,input[type=radio]:focus:invalid:focus,input[type=checkbox]:focus:invalid:focus +{ + outline-color:#ff4136; +} + +select +{ + background-color:#fff; + border:.1rem solid #ccc; +} + +select[multiple] +{ + height:auto; +} + +label +{ + line-height:2; +} + +fieldset +{ + border:0; + margin:0; + padding:.8rem 0; +} + +legend +{ + border-bottom:.1rem solid #ccc; + color:#444; + display:block; + margin-bottom:.8rem; + padding:.8rem 0; + width:100%; +} + +input[type=submit],button +{ + -moz-user-select:none; + -ms-user-select:none; + -webkit-transition:.25s ease; + -webkit-user-drag:none; + -webkit-user-select:none; + border:.2rem solid #444; + border-radius:0; + color:#444; + cursor:pointer; + display:inline-block; + margin-bottom:.8rem; + margin-right:.4rem; + padding:.8rem 1.6rem; + text-align:center; + text-decoration:none; + text-transform:uppercase; + transition:.25s ease; + user-select:none; + vertical-align:baseline; +} + +input[type=submit] a,button a +{ + color:#444; +} + +input[type=submit]::-moz-focus-inner,button::-moz-focus-inner +{ + padding:0; +} + +input[type=submit]:hover,button:hover +{ + background:#444; + border-color:#444; + color:#fff; +} + +input[type=submit]:hover a,button:hover a +{ + color:#fff; +} + +input[type=submit]:active,button:active +{ + background:#6a6a6a; + border-color:#6a6a6a; + color:#fff; +} + +input[type=submit]:active a,button:active a +{ + color:#fff; +} + +input[type=submit]:disabled,button:disabled +{ + box-shadow:none; + cursor:not-allowed; + opacity:.40; +} + +nav ul +{ + list-style:none; + margin:0; + padding:0; + text-align:center; +} + +nav ul li +{ + display:inline; +} + +nav a +{ + -webkit-transition:.25s ease; + border-bottom:.2rem solid transparent; + color:#444; + padding:.8rem 1.6rem; + text-decoration:none; + transition:.25s ease; +} + +nav a:hover,nav li.selected a +{ + border-color:rgba(0,0,0,0.2); +} + +nav a:active +{ + border-color:rgba(0,0,0,0.56); +} + +caption +{ + padding:.8rem 0; +} + +thead th +{ + background:#efefef; + color:#444; +} + +tr +{ + background:#fff; + margin-bottom:.8rem; +} + +th,td +{ + border:.1rem solid #ccc; + padding:.8rem 1.6rem; + text-align:center; + vertical-align:inherit; +} + +tfoot tr +{ + background:none; +} + +tfoot td +{ + color:#efefef; + font-size:.8rem; + font-style:italic; + padding:1.6rem .4rem; +} @media screen { - [hidden~="screen"] { - display: inherit; } - [hidden~="screen"]:not(:active):not(:focus):not(:target) { - clip: rect(0 0 0 0) !important; - position: absolute !important; } } + [hidden~=screen] + { + display:inherit; + } -body { - color: #444; - font-family: var(--default-font-list); - font-size: 1.6rem; - font-style: normal; - font-weight: 400; } + [hidden~=screen]:not(:active):not(:focus):not(:target) + { + clip:rect(0000)!important; + position:absolute!important; + } +} -p { - margin: 0 0 1.6rem; } +@media screen and max-width 40rem { + article,section,aside + { + clear:both; + display:block; + max-width:100%; + } -h1, h2, h3, h4, h5, h6 { - font-family: 'Lato', var(--default-font-list); - margin: 2rem 0 1.6rem; } - -h1 { - border-bottom: .1rem solid rgba(0, 0, 0, 0.2); - font-size: 3.6rem; - font-style: normal; - font-weight: 500; } - -h2 { - font-size: 3rem; - font-style: normal; - font-weight: 500; } - -h3 { - font-size: 2.4rem; - font-style: normal; - font-weight: 500; - margin: 1.6rem 0 0.4rem; } - -h4 { - font-size: 1.8rem; - font-style: normal; - font-weight: 600; - margin: 1.6rem 0 0.4rem; } - -h5 { - font-size: 1.6rem; - font-style: normal; - font-weight: 600; - margin: 1.6rem 0 0.4rem; } - -h6 { - color: #777; - font-size: 1.4rem; - font-style: normal; - font-weight: 600; - margin: 1.6rem 0 0.4rem; } - -small { - color: #777; } - -pre { - background: #efefef; - color: #444; - display: block; - font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; - font-size: 1.4rem; - margin: 1.6rem 0; - padding: 1.6rem; - word-break: break-all; - word-wrap: break-word; } - -code { - background: #efefef; - color: #444; - font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; - font-size: 1.4rem; - word-break: break-all; - word-wrap: break-word; } - -a { - color: #1271db; - -webkit-transition: .25s ease; - transition: .25s ease; } - a:hover, a:focus { - text-decoration: none; } - -dl { - margin-bottom: 1.6rem; } - -dd { - margin-left: 4rem; } - -ul, ol { - margin-bottom: 0.8rem; - padding-left: 2rem; } - -blockquote { - border-left: .2rem solid #1271db; - font-family: Georgia, Times, 'Times New Roman', serif; - font-style: italic; - margin: 1.6rem 0; - padding-left: 1.6rem; } - -figcaption { - font-family: Georgia, Times, 'Times New Roman', serif; } - -html { - font-size: 62.5%; } - -body { - padding: 0; } - -main, header, footer, article, section, aside, details, summary { - display: block; - height: auto; - margin: 0 auto; - width: 100%; } - -main { - display: block; - margin: 0 auto; - padding: 0 1.6rem 1.6rem; } - -footer { - border-top: .1rem solid rgba(0, 0, 0, 0.2); - clear: both; - display: inline-block; - float: left; - max-width: 100%; - padding: 1rem 0; - text-align: center; } - -hr { - border-top: .1rem solid rgba(0, 0, 0, 0.2); - display: block; - margin-bottom: 1.6rem; - width: 100%; } - -img { - height: auto; - max-width: 100%; - vertical-align: baseline; } - -@media screen and (max-width: 40rem) { - article, section, aside { - clear: both; - display: block; - max-width: 100%; } - img { - margin-right: 1.6rem; } } - -input[type="text"], input[type="password"], input[type="email"], input[type="url"], input[type="date"], input[type="month"], input[type="time"], input[type="datetime"], input[type="datetime-local"], input[type="week"], input[type="number"], input[type="search"], input[type="tel"], input[type="color"], select { - border: .1rem solid #ccc; - border-radius: 0; - display: inline-block; - padding: 0.8rem; - vertical-align: middle; } - -input:not([type]) { - -webkit-appearance: none; - background-clip: padding-box; - background-color: #fff; - border: .1rem solid #ccc; - border-radius: 0; - color: #444; - display: inline-block; - padding: 0.8rem; - text-align: left; } - -input[type="color"] { - padding: 0.8rem 1.6rem; } - -input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus, input[type="url"]:focus, input[type="date"]:focus, input[type="month"]:focus, input[type="time"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="week"]:focus, input[type="number"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="color"]:focus, select:focus, textarea:focus { - border-color: #b3d4fc; } - -input:not([type]):focus { - border-color: #b3d4fc; } - -input[type="radio"], input[type="checkbox"] { - vertical-align: middle; } - -input[type="file"]:focus, input[type="radio"]:focus, input[type="checkbox"]:focus { - outline: .1rem solid thin #444; } - -input[type="text"][disabled], input[type="password"][disabled], input[type="email"][disabled], input[type="url"][disabled], input[type="date"][disabled], input[type="month"][disabled], input[type="time"][disabled], input[type="datetime"][disabled], input[type="datetime-local"][disabled], input[type="week"][disabled], input[type="number"][disabled], input[type="search"][disabled], input[type="tel"][disabled], input[type="color"][disabled], select[disabled], textarea[disabled] { - background-color: #efefef; - color: #777; - cursor: not-allowed; } - -input:not([type])[disabled] { - background-color: #efefef; - color: #777; - cursor: not-allowed; } - -input[readonly], select[readonly], textarea[readonly] { - background-color: #efefef; - border-color: #ccc; - color: #777; } - -input:focus:invalid, textarea:focus:invalid, select:focus:invalid { - border-color: #e9322d; - color: #b94a48; } - -input[type="file"]:focus:invalid:focus, input[type="radio"]:focus:invalid:focus, input[type="checkbox"]:focus:invalid:focus { - outline-color: #ff4136; } - -select { - background-color: #fff; - border: .1rem solid #ccc; } - -select[multiple] { - height: auto; } - -label { - line-height: 2; } - -fieldset { - border: 0; - margin: 0; - padding: 0.8rem 0; } - -legend { - border-bottom: .1rem solid #ccc; - color: #444; - display: block; - margin-bottom: 0.8rem; - padding: 0.8rem 0; - width: 100%; } - -textarea { - border: .1rem solid #ccc; - border-radius: 0; - display: block; - margin-bottom: 0.8rem; - padding: 0.8rem; - vertical-align: middle; } - -input[type=submit], button { - /*background-color: transparent;*/ - border: .2rem solid #444; - border-radius: 0; - color: #444; - cursor: pointer; - display: inline-block; - margin-bottom: 0.8rem; - margin-right: 0.4rem; - padding: 0.8rem 1.6rem; - text-align: center; - text-decoration: none; - text-transform: uppercase; - -webkit-transition: .25s ease; - transition: .25s ease; - -webkit-user-drag: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - vertical-align: baseline; } - input[type=submit] a, button a { - color: #444; } - -input[type=submit]::-moz-focus-inner, button::-moz-focus-inner { - padding: 0; } - -input[type=submit]:hover, button:hover { - background: #444; - border-color: #444; - color: #fff; } - input[type=submit]:hover a, button:hover a { - color: #fff; } - -input[type=submit]:active, button:active { - background: #6a6a6a; - border-color: #6a6a6a; - color: #fff; } - input[type=submit]:active a, button:active a { - color: #fff; } - -input[type=submit]:disabled, button:disabled { - box-shadow: none; - cursor: not-allowed; - opacity: .40; } - -nav ul { - list-style: none; - margin: 0; - padding: 0; - text-align: center; } - nav ul li { - display: inline; } -nav a { - border-bottom: .2rem solid transparent; - color: #444; - padding: 0.8rem 1.6rem; - text-decoration: none; - -webkit-transition: .25s ease; - transition: .25s ease; } - nav a:hover, nav li.selected a { - border-color: rgba(0, 0, 0, 0.2); } - nav a:active { - border-color: rgba(0, 0, 0, 0.56); } - -table { - margin-bottom: 1.6rem; } - -caption { - padding: 0.8rem 0; } - -thead th { - background: #efefef; - color: #444; } - -tr { - background: #fff; - margin-bottom: 0.8rem; } - -th, td { - border: .1rem solid #ccc; - padding: 0.8rem 1.6rem; - text-align: center; - vertical-align: inherit; } - -tfoot tr { - background: none; } - -tfoot td { - color: #efefef; - font-size: 0.8rem; - font-style: italic; - padding: 1.6rem 0.4rem; } \ No newline at end of file + img + { + margin-right:1.6rem; + } +} \ No newline at end of file diff --git a/public/js/base/events.js b/public/js/base/events.js index fae002f5..356d864e 100644 --- a/public/js/base/events.js +++ b/public/js/base/events.js @@ -11,7 +11,7 @@ }); // Confirm deleting of list or library items - ac.on('form.js-danger', 'submit', function (event) { + ac.on('form.js-delete', 'submit', function (event) { let proceed = confirm("Are you ABSOLUTELY SURE you want to delete this item?"); if (proceed === false) { diff --git a/src/Aviat/AnimeClient/Controller/Anime.php b/src/Aviat/AnimeClient/Controller/Anime.php index 40bba49b..dd6d4acb 100644 --- a/src/Aviat/AnimeClient/Controller/Anime.php +++ b/src/Aviat/AnimeClient/Controller/Anime.php @@ -265,7 +265,7 @@ class Anime extends BaseController { if ($response['body'] == TRUE) { - $this->set_flash_message("Successfully deleted anime", 'success'); + $this->set_flash_message("Successfully deleted anime.", 'success'); $this->cache->purge(); } else diff --git a/src/Aviat/AnimeClient/Controller/Manga.php b/src/Aviat/AnimeClient/Controller/Manga.php index fcb1e2e6..ad836699 100644 --- a/src/Aviat/AnimeClient/Controller/Manga.php +++ b/src/Aviat/AnimeClient/Controller/Manga.php @@ -28,7 +28,7 @@ class Manga extends Controller { /** * The manga model - * @var object $model + * @var MangaModel $model */ protected $model; @@ -233,5 +233,25 @@ class Manga extends Controller { $this->cache->purge(); $this->outputJSON($result['body'], $result['statusCode']); } + + /** + * Remove an manga from the list + */ + public function delete() + { + $response = $this->model->delete($this->request->getParsedBody()); + + if ($response['body'] == TRUE) + { + $this->set_flash_message("Successfully deleted manga.", 'success'); + $this->cache->purge(); + } + else + { + $this->set_flash_message('Failed to delete manga.', 'error'); + } + + $this->session_redirect(); + } } // End of MangaController.php \ No newline at end of file diff --git a/src/Aviat/AnimeClient/Model/Manga.php b/src/Aviat/AnimeClient/Model/Manga.php index d1d8b82e..24334239 100644 --- a/src/Aviat/AnimeClient/Model/Manga.php +++ b/src/Aviat/AnimeClient/Model/Manga.php @@ -13,11 +13,9 @@ namespace Aviat\AnimeClient\Model; -use GuzzleHttp\Cookie\Cookiejar; use GuzzleHttp\Cookie\SetCookie; use Aviat\Ion\Json; -use Aviat\AnimeClient\Model\API; use Aviat\AnimeClient\Hummingbird\Transformer; use Aviat\AnimeClient\Hummingbird\Enum\MangaReadingStatus; @@ -94,6 +92,7 @@ class Manga extends API { * Add a manga to the list * * @param array $data + * @return array */ public function add($data) { @@ -142,6 +141,7 @@ class Manga extends API { * * @param string $name * @return array + * @throws RuntimeException */ public function search($name) { @@ -197,7 +197,8 @@ class Manga extends API { $response = $this->get('manga_library_entries', $config); $data = $this->transform($response); - return $this->map_by_status($data); + $final = $this->map_by_status($data); + return ($status !== 'All') ? $final[$status] : $final; } /**