diff options
Diffstat (limited to 'themes')
| -rw-r--r-- | themes/okadmin/public/css/main.css | 39 | ||||
| -rw-r--r-- | themes/okadmin/public/js/app.js | 11 | ||||
| -rw-r--r-- | themes/okadmin/templates/404.liquid | 54 | ||||
| -rw-r--r-- | themes/okadmin/templates/5xx.liquid | 54 | ||||
| -rw-r--r-- | themes/okadmin/templates/index.liquid | 6 | ||||
| -rw-r--r-- | themes/okadmin/templates/partials/flash.liquid | 9 | ||||
| -rw-r--r-- | themes/okadmin/templates/partials/inputs.liquid | 4 | ||||
| -rw-r--r-- | themes/okadmin/templates/partials/tail.liquid | 8 | ||||
| -rw-r--r-- | themes/okadmin/templates/resource.liquid | 2 |
9 files changed, 166 insertions, 21 deletions
diff --git a/themes/okadmin/public/css/main.css b/themes/okadmin/public/css/main.css index 3762fd4..67271bc 100644 --- a/themes/okadmin/public/css/main.css +++ b/themes/okadmin/public/css/main.css @@ -109,7 +109,7 @@ h2 { pointer-events: none; } - /* Makes the button look like a link */ +/* Makes the button look like a link */ .main.index .resource-category button { background: none !important; height: 1.5em; @@ -117,6 +117,8 @@ h2 { padding: 0 !important; font: inherit; cursor: pointer; + font-family: Monaco, monospace; + text-transform: uppercase; } .main.index .resource-category .btn { @@ -134,7 +136,7 @@ h2 { } .main.index .resource-category .btn:hover { - border-bottom: 3px solid rgba(0, 0, 0, 0.25); + border-bottom: 1px solid rgba(0, 0, 0, 0.25); } .main.index .resource-category .btn { @@ -203,6 +205,12 @@ label { padding: 0 0.5em; margin-bottom: 1em; } +.main.resource form input[name=id] { + width: 15em; +} +button, input[type=submit] { + cursor: pointer; +} .main.resource form .group { display: block; float: left; @@ -280,18 +288,26 @@ label { background: #ddd; clear: left; text-align: left; - padding: 10px; - width: 15em; + float: left; + margin-right: 1em; position: relative; + overflow: hidden; + cursor: pointer; } .add-image-button:hover { background: #def; } +.main.resource form .add-image-button button { + margin: 0; + pointer-events: none; + width: 100%; height: 100%; +} .add-image-button input[type=file] { opacity: 0; position: absolute; top: 0; left: 0; width: 100%; height: 100%; + margin: 0; padding: 0; cursor: pointer; } li.image-element:hover .remove-image { @@ -314,13 +330,20 @@ li.image-element .remove-image:hover { } -.errors { +.success, .errors { background: white; - padding: 10px; - width: 100%; + padding: 9px 8px 7px; + width: 50%; line-height: 1.4em; + border: 1px solid; + margin: 1em; + border-radius: 2px; +} + +.success { + color: green; } -.errors .message { +.errors { color: red; } diff --git a/themes/okadmin/public/js/app.js b/themes/okadmin/public/js/app.js index 1ab9956..91a8e1a 100644 --- a/themes/okadmin/public/js/app.js +++ b/themes/okadmin/public/js/app.js @@ -28,7 +28,7 @@ var OKAdmin = function(){ $(".captioned-image-list ol").disableSelection() // delete image - $(document).on("click", ".remove-image", function(){ + $(document).on("mousedown", ".remove-image", function(){ if (confirm("Delete this image?")) { $(this).parent().remove() } @@ -50,7 +50,14 @@ var OKAdmin = function(){ })) // fix post indexing in list-driven inputs - $(".main.resource form").submit(function(){ + $(".main.resource form").submit(function(e){ + var $id = $("[name=id]") + if ($id.length && ! $id.val()) { + alert("Please enter an ID") + $id.focus() + e.preventDefault() + return + } $(".image-element").each(function(index){ $(this).find("input,textarea").each(function(){ var field = $(this).attr("name").replace(/\[[0-9]*\]/, "[" + index + "]") diff --git a/themes/okadmin/templates/404.liquid b/themes/okadmin/templates/404.liquid new file mode 100644 index 0000000..87f5342 --- /dev/null +++ b/themes/okadmin/templates/404.liquid @@ -0,0 +1,54 @@ +<!DOCTYPE html> +<html> + <head> + <title>404</title> + <style type="text/css"> + html, body { + margin: 0; + padding: 0; + font-family: "Helvetica", sans-serif; + background-image: url('http://okfoc.us/assets/images/photocopy.png'); + background-position: bottom center; + background-repeat: repeat; + background-attachment: scroll; + height: 100%; + font-size: 1.75em; + font-weight: bold; + color: #FFFFFF; + } + + a { + color: #8888FF; + text-decoration: none; + } + + a:hover { + border-bottom: 3px solid #8888FF; + } + + a:visited { + color: #8888FF; + } + + .message { + width: 700px; + padding: 1em 1em 1em 1em; + background-color: #0000FF; + margin: 0 auto; + margin-top: 1em; + } + + .message p:first-child { + margin-top: 0; + } + </style> + </head> + <body> + <div class="message"> + <p>¯\_(ツ)_/¯</p> + <p>We couldn't find that page.</p> + <p>Sure you have the right URL?</p> + <a href="javascript:history.back()">Back</a> + </div> + </body> +</html> diff --git a/themes/okadmin/templates/5xx.liquid b/themes/okadmin/templates/5xx.liquid new file mode 100644 index 0000000..f245545 --- /dev/null +++ b/themes/okadmin/templates/5xx.liquid @@ -0,0 +1,54 @@ +<!DOCTYPE html> +<html> + <head> + <title>404</title> + <style type="text/css"> + html, body { + margin: 0; + padding: 0; + font-family: "Helvetica", sans-serif; + background-image: url('http://okfoc.us/assets/images/photocopy.png'); + background-position: bottom center; + background-repeat: repeat; + background-attachment: scroll; + height: 100%; + font-size: 1.75em; + font-weight: bold; + color: #FFFFFF; + } + + a { + color: #8888FF; + text-decoration: none; + } + + a:hover { + border-bottom: 3px solid #8888FF; + } + + a:visited { + color: #8888FF; + } + + .message { + width: 700px; + padding: 0 1em 1em 1em; + background-color: #0000FF; + margin: 0 auto; + margin-top: 1em; + } + + .message p:first-child { + margin-top: 0; + } + </style> + </head> + <body> + <div class="message"> + <p>(;一_一)</p> + <p>Looks like we experienced an error.</p> + <p>Sorry about that. Maybe try again later.</p> + <a href="javascript:history.back()">Back</a> + </div> + </body> +</html> diff --git a/themes/okadmin/templates/index.liquid b/themes/okadmin/templates/index.liquid index 0672613..330ed89 100644 --- a/themes/okadmin/templates/index.liquid +++ b/themes/okadmin/templates/index.liquid @@ -8,7 +8,7 @@ {% assign resource = pair[1] %} <section class="resource-category {{name}}"> - <form action="{{resource.type}}/__batch/" method="POST"> + <form action="{{resource.type}}/__batch__/" method="POST"> <header> <h2>{{name | capitalize}}</h2> </header> @@ -26,8 +26,8 @@ <a class="btn cancel-btn" href="#">cancel</a> <button type="submit" class="btn save-btn" href="#">save</button> - <a class="btn edit-btn active" href="#">edit</a> - <a class="btn add-btn active" href="{{resource.type}}/new/">+</a> + <a class="btn edit-btn active" href="#">sort</a> + <a class="btn add-btn active" href="{{resource.type}}/__new__/">+</a> </nav> </footer> </form> diff --git a/themes/okadmin/templates/partials/flash.liquid b/themes/okadmin/templates/partials/flash.liquid index 1980ab5..e51a86b 100644 --- a/themes/okadmin/templates/partials/flash.liquid +++ b/themes/okadmin/templates/partials/flash.liquid @@ -1,8 +1,15 @@ +{% if success.length > 0 %} <div class="success"> + <div class="message">Changes saved.</div> + <!-- {% for info in success %} <div class="message">{{info.action}}</div> {% endfor %} + --> </div> +{% endif %} + +{% if errors.length > 0 %} <div class="errors"> {% for error in errors %} <div class="error"> @@ -10,4 +17,4 @@ </div> {% endfor %} </div> - +{% endif %}
\ No newline at end of file diff --git a/themes/okadmin/templates/partials/inputs.liquid b/themes/okadmin/templates/partials/inputs.liquid index 99258f3..b9cf7a3 100644 --- a/themes/okadmin/templates/partials/inputs.liquid +++ b/themes/okadmin/templates/partials/inputs.liquid @@ -29,7 +29,7 @@ {% endif %} name="{{name}}"> {% for option in spec.options %} - <option value="{{option}}" {% if option == spec.value %}selected{% endif %}>{{option}}</option> + <option value="{{option}}" {% if option == spec.value %}selected{% endif %}>{{option | capitalize}}</option> {% endfor %} </select> {% elsif type == 'video' %} @@ -56,7 +56,7 @@ </ol> <div class="add-image-button"> <input id="file" type="file" accept="image/*" multiple> - <span>+ Add images</span> + <button>+ Add images</button> </div> <input id="add-image-url" type="text" placeholder="+ Add URL"> <script type="text/html" id="captioned-image-template"> diff --git a/themes/okadmin/templates/partials/tail.liquid b/themes/okadmin/templates/partials/tail.liquid index 88764a6..b3c575d 100644 --- a/themes/okadmin/templates/partials/tail.liquid +++ b/themes/okadmin/templates/partials/tail.liquid @@ -2,8 +2,8 @@ </body> <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/3.6.0/lodash.min.js"></script> - <script src="/_admin/js/jqueryui-draggable.js"></script> - <script src="/_admin/js/upload.js"></script> - <script src="/_admin/js/parser.js"></script> - <script src="/_admin/js/app.js"></script> + <script src="/admin/js/jqueryui-draggable.js"></script> + <script src="/admin/js/upload.js"></script> + <script src="/admin/js/parser.js"></script> + <script src="/admin/js/app.js"></script> </html> diff --git a/themes/okadmin/templates/resource.liquid b/themes/okadmin/templates/resource.liquid index 8078778..abc59e9 100644 --- a/themes/okadmin/templates/resource.liquid +++ b/themes/okadmin/templates/resource.liquid @@ -16,7 +16,7 @@ </form> <form action="." method="POST" id="delete_form"> <input type="hidden" name="_method" value="DELETE"> - <button type="submit">Delete</button> + <button type="submit">Delete Record</button> </form> </section> |
