2
1
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2023-12-13 21:00:40 +01:00
Ghost/core/server/views/default.hbs
Gabor Javorszky 6c99b67ab3 Added client side validation
Closes #581.

* Basically adds the client side of node validator, that we're already using
* Validator is plonked onto `Ghost.Validator`
* Usage is identical as to https://github.com/chriso/node-validator
* Has sanitizing values et al
* `Ghost.Validator.error` is redefined, it populates Ghost.Validator._errors (Array)
* `Ghost.Validator.handleErrors` is supposed to print out the multiple error messages, if there are multiple (this is broken due to how notifications are presented `.html` instead of `.append`), and also apply class to element
* The ajax calls are wrapped in an if to prevent network traffic if something's not right on client side
* Added validation to general settings and user settings screens.
* On validation error, optionally adds `.input-error` to whatever element you reference, see below (if `el` exists on the error object). This is the only place where usage is different to the original implementation. Redeclared `error()` function in `init.js`
* Usage: `Ghost.Validate.check(valueToCheck, {message: "the error message", el: $('#the element')}).isEmail()`
* The element above will receive the `.input-error` class. `isEmail()` is one of the stuff you can check against.
2013-09-14 10:52:27 +01:00

101 lines
4.6 KiB
Handlebars

<!doctype html>
<!--[if (IE 8)&!(IEMobile)]><html class="no-js lt-ie9" lang="en"><![endif]-->
<!--[if (gte IE 9)| IEMobile |!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
<head>
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>{{siteTitle}}</title>
<meta name="description" content="{{siteDescription}}">
<meta name="author" content="">
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes" />
<link rel="shortcut icon" href="/favicon.ico">
<meta http-equiv="cleartype" content="on">
<link rel="stylesheet" type='text/css' href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,700'>
<link rel="stylesheet" href="/public/css/screen.css">
{{{block "pageStyles"}}}
</head>
<body class="{{bodyClass}}">
{{#unless hideNavbar}}
{{> navbar}}
{{/unless}}
<main role="main" id="main">
<aside id="flashbar">
{{> notifications}}
</aside>
{{{body}}}
</main>
<aside id="modal-container">
</aside>
<script src="/shared/vendor/jquery/jquery.js"></script>
<script src="/shared/vendor/jquery/jquery-ui-1.10.3.custom.min.js"></script>
<script src="/public/lib/jquery-utils.js"></script>
<script src="/shared/vendor/underscore.js"></script>
<script src="/shared/vendor/backbone/backbone.js"></script>
<script src="/shared/vendor/handlebars/handlebars-runtime.js"></script>
<script src="/shared/vendor/moment.js"></script>
<script src="/public/vendor/icheck/jquery.icheck.min.js"></script>
<script src="/shared/vendor/jquery/jquery.ui.widget.js"></script>
<script src="/shared/vendor/jquery/jquery.iframe-transport.js"></script>
<script src="/shared/vendor/jquery/jquery.fileupload.js"></script>
<script src="/public/vendor/codemirror/codemirror.js"></script>
<script src="/public/vendor/codemirror/addon/mode/overlay.js"></script>
<script src="/public/vendor/codemirror/mode/markdown/markdown.js"></script>
<script src="/public/vendor/codemirror/mode/gfm/gfm.js"></script>
<script src="/public/vendor/showdown/showdown.js"></script>
<script src="/public/vendor/showdown/extensions/ghostdown.js"></script>
<script src="/shared/vendor/showdown/extensions/github.js"></script>
<script src="/public/vendor/shortcuts.js"></script>
<script src="/public/vendor/validator-client.js"></script>
<script src="/public/vendor/countable.js"></script>
<script src="/public/vendor/to-title-case.js"></script>
<script src="/public/vendor/packery.pkgd.min.js"></script>
<script src="/public/vendor/jquery.hammer.min.js"></script>
<script src="/public/init.js"></script>
<script src="/public/assets/lib/uploader.js"></script>
<script src="/public/tpl/hbs-tpl.js"></script>
<script src="/public/mobile-interactions.js"></script>
<script src="/public/toggle.js"></script>
<script src="/public/markdown-actions.js"></script>
<script src="/public/helpers/index.js"></script>
<!-- // require '/public/models/*' -->
<script src="/public/models/post.js"></script>
<script src="/public/models/user.js"></script>
<script src="/public/models/tag.js"></script>
<script src="/public/models/widget.js"></script>
<script src="/public/models/settings.js"></script>
<script src="/public/models/themes.js"></script>
<script src="/public/models/uploadModal.js"></script>
<!-- // require '/public/views/*' -->
<script src="/public/views/base.js"></script>
<script src="/public/views/post-settings.js"></script>
<script src="/public/models/uploadModal.js"></script>
<script src="/public/views/blog.js"></script>
<script src="/public/views/editor.js"></script>
<script src="/public/views/editor-tag-widget.js"></script>
<script src="/public/views/login.js"></script>
<script src="/public/views/settings.js"></script>
<script src="/public/views/debug.js"></script>
<script src="/public/router.js"></script>
{{{block "bodyScripts"}}}
<script>
Ghost.init();
</script>
</body>
</html>