mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-24 12:07:10 -04:00
Refactor pages.
This commit is contained in:
parent
f19d9b9419
commit
ae677a2194
6 changed files with 40 additions and 53 deletions
|
@ -88,7 +88,7 @@ module.exports = function (suite) {
|
|||
.wrap(header)
|
||||
.write(mapSrc, true);
|
||||
|
||||
$(src + ': **/*.jade')
|
||||
$(src + ': **/*.jade, ! **/*.tpl.jade')
|
||||
.newerThan(mapSrc)
|
||||
.jade(env)
|
||||
.write(mapSrc, true);
|
||||
|
|
|
@ -26,11 +26,11 @@ class Bootstrap {
|
|||
(new Api($context))->apply();
|
||||
} else if ($context->is_info_request()) {
|
||||
define('PUBLIC_HREF', $setup->get('PUBLIC_HREF'));
|
||||
require __DIR__ . '/info.php';
|
||||
require __DIR__ . '/pages/info.php';
|
||||
} else {
|
||||
define('PUBLIC_HREF', $setup->get('PUBLIC_HREF'));
|
||||
define('FALLBACK', (new Fallback($context))->get_html());
|
||||
require __DIR__ . '/page.php';
|
||||
require __DIR__ . '/pages/index.php';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
- var PUBLIC_HREF = '<?= PUBLIC_HREF; ?>'
|
||||
|
||||
<?php header('Content-type: text/html;charset=utf-8'); ?>
|
||||
doctype html
|
||||
<!--[if lt IE 10]><html class="no-js no-browser" lang="en"><![endif]-->
|
||||
<!--[if gt IE 9]><!--><html class="no-js browser" lang="en"><!--<![endif]-->
|
||||
|
||||
head
|
||||
meta( charset="utf-8" )
|
||||
meta( http-equiv="x-ua-compatible", content="ie=edge" )
|
||||
title #{pkg.name} info page - v#{pkg.version}
|
||||
meta( name="description", content="#{pkg.name} info page - v#{pkg.version}" )
|
||||
meta( name="viewport", content="width=device-width, initial-scale=1" )
|
||||
link( rel="shortcut icon", href!="#{PUBLIC_HREF}images/favicon/favicon-16-32.ico" )
|
||||
link( rel="apple-touch-icon-precomposed", type="image/png", href!="#{PUBLIC_HREF}images/favicon/favicon-152.png" )
|
||||
link( rel="stylesheet", href="//fonts.googleapis.com/css?family=Roboto:300,400,700" )
|
||||
link( rel="stylesheet", href!="#{PUBLIC_HREF}css/styles.css" )
|
||||
script( src!="#{PUBLIC_HREF}js/scripts.js", data-module="info" )
|
||||
|
||||
body#root.info
|
||||
|
||||
div#fallback-hints
|
||||
span.noJsMsg
|
||||
| Works best with JavaScript enabled!
|
||||
span.noBrowserMsg
|
||||
| Works best in
|
||||
a( href="http://browsehappy.com" ) modern browsers
|
||||
| !
|
||||
span.backlink
|
||||
a( href="#{pkg.homepage}", title="#{pkg.name} v#{pkg.version} - #{pkg.description}" ) powered by #{pkg.name}
|
||||
|
||||
div#content
|
||||
h1#header
|
||||
a( href="#{pkg.homepage}" ) #{pkg.name}
|
||||
|
||||
div#support
|
||||
| Show your support with a donation!
|
||||
div.paypal
|
||||
form( action="https://www.paypal.com/cgi-bin/webscr", method="post", target="_top" )
|
||||
input( type="hidden", name="cmd", value="_s-xclick" )
|
||||
input( type="hidden", name="hosted_button_id", value="8WSPKWT7YBTSQ" )
|
||||
input( type="image", src!="#{PUBLIC_HREF}images/ui/paypal.svg", width="100px", border="0", name="submit", alt="PayPal - The safer, easier way to pay online!" )
|
||||
|
||||
</html>
|
10
src/_h5ai/backend/php/pages/index.php.jade
Normal file
10
src/_h5ai/backend/php/pages/index.php.jade
Normal file
|
@ -0,0 +1,10 @@
|
|||
extends ./page.tpl.jade
|
||||
|
||||
block init
|
||||
|
||||
- var TITLE = 'index - powered by ' + pkg.name + ' v' + pkg.version + ' (' + pkg.homepage + ')'
|
||||
- var MODULE = 'index'
|
||||
|
||||
block body
|
||||
|
||||
div#fallback <?= FALLBACK; ?>
|
20
src/_h5ai/backend/php/pages/info.php.jade
Normal file
20
src/_h5ai/backend/php/pages/info.php.jade
Normal file
|
@ -0,0 +1,20 @@
|
|||
extends ./page.tpl.jade
|
||||
|
||||
block init
|
||||
|
||||
- var TITLE = pkg.name + ' info page - v' + pkg.version
|
||||
- var MODULE = 'info'
|
||||
|
||||
block body
|
||||
|
||||
div#content
|
||||
h1#header
|
||||
a( href="#{pkg.homepage}" ) #{pkg.name}
|
||||
|
||||
div#support
|
||||
| Show your support with a donation!
|
||||
div.paypal
|
||||
form( action="https://www.paypal.com/cgi-bin/webscr", method="post", target="_top" )
|
||||
input( type="hidden", name="cmd", value="_s-xclick" )
|
||||
input( type="hidden", name="hosted_button_id", value="8WSPKWT7YBTSQ" )
|
||||
input( type="image", src!="#{PUBLIC_HREF}images/ui/paypal.svg", width="100px", border="0", name="submit", alt="PayPal - The safer, easier way to pay online!" )
|
|
@ -1,5 +1,6 @@
|
|||
- var PUBLIC_HREF = '<?= PUBLIC_HREF; ?>'
|
||||
- var FALLBACK = '<?= FALLBACK; ?>'
|
||||
|
||||
block init
|
||||
|
||||
<?php header('Content-type: text/html;charset=utf-8'); ?>
|
||||
doctype html
|
||||
|
@ -9,16 +10,16 @@ doctype html
|
|||
head
|
||||
meta( charset="utf-8" )
|
||||
meta( http-equiv="x-ua-compatible", content="ie=edge" )
|
||||
title index - powered by #{pkg.name} v#{pkg.version} (#{pkg.homepage})
|
||||
meta( name="description", content="index - powered by #{pkg.name} v#{pkg.version} (#{pkg.homepage})" )
|
||||
title #{TITLE}
|
||||
meta( name="description", content="#{TITLE}" )
|
||||
meta( name="viewport", content="width=device-width, initial-scale=1" )
|
||||
link( rel="shortcut icon", href!="#{PUBLIC_HREF}images/favicon/favicon-16-32.ico" )
|
||||
link( rel="apple-touch-icon-precomposed", type="image/png", href!="#{PUBLIC_HREF}images/favicon/favicon-152.png" )
|
||||
link( rel="stylesheet", href="//fonts.googleapis.com/css?family=Roboto:300,400,700" )
|
||||
link( rel="stylesheet", href!="#{PUBLIC_HREF}css/styles.css" )
|
||||
script( src!="#{PUBLIC_HREF}js/scripts.js", data-module="index" )
|
||||
script( src!="#{PUBLIC_HREF}js/scripts.js", data-module="#{MODULE}" )
|
||||
|
||||
body#root
|
||||
body#root( class="#{MODULE}" )
|
||||
|
||||
div#fallback-hints
|
||||
span.noJsMsg
|
||||
|
@ -30,6 +31,6 @@ body#root
|
|||
span.backlink
|
||||
a( href="#{pkg.homepage}", title="#{pkg.name} v#{pkg.version} - #{pkg.description}" ) powered by #{pkg.name}
|
||||
|
||||
div#fallback !{FALLBACK}
|
||||
block body
|
||||
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue