Merge pull request #58 from nonmakina/sidebarFix
Fixes the sidebar so that it doesn't use iframes.
This commit is contained in:
commit
9934d4c178
|
@ -4,16 +4,77 @@
|
||||||
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
|
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||||
|
|
||||||
<link rel="stylesheet" media="screen" href="{{ config.url_stylesheet }}">
|
<link rel="stylesheet" media="screen" href="{{ config.url_stylesheet }}">
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
iframe{border:none;margin:0;padding:0;height:99%;position:absolute}
|
.sidebar {
|
||||||
iframe#sidebar{left:0;top:0;width:15%}
|
width: 200px;
|
||||||
iframe#main{border-left:1px solid black;left:15%;top:0;width:85%}
|
border-right-color: gray;
|
||||||
</style>
|
border-right-style: solid;
|
||||||
<title>{{ settings.title }}</title>
|
border-width: 2px;
|
||||||
|
margin-right: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
display: flex;
|
||||||
|
height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
fieldset {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
legend {
|
||||||
|
width: 100%;
|
||||||
|
margin-left: -15px;
|
||||||
|
background: #98E;
|
||||||
|
border: 1px solid white;
|
||||||
|
color: white;
|
||||||
|
font-weight: bold;
|
||||||
|
padding: 5px 5px
|
||||||
|
}
|
||||||
|
|
||||||
|
ul {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
li {
|
||||||
|
list-style: none;
|
||||||
|
padding: 0 4px;
|
||||||
|
margin: 0 4px
|
||||||
|
}
|
||||||
|
|
||||||
|
li a.system {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width:768px) {
|
||||||
|
.sidebar {
|
||||||
|
width: 80vw;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
.main {
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.boardlist {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
footer {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<title>{{ settings.title }}</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<iframe src="{{ settings.file_sidebar }}" id="sidebar" name="sidebar"></iframe>
|
{% include 'themes/categories/' ~ settings.file_sidebar %}
|
||||||
<iframe src="{{ settings.file_news }}" id="main" name="main"></iframe>
|
{% include 'themes/categories/' ~ settings.file_news %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,18 +1,11 @@
|
||||||
{% filter remove_whitespace %}
|
{% filter remove_whitespace %}
|
||||||
<!doctype html>
|
{{ boardlist.top }}
|
||||||
<html>
|
<div class="content">
|
||||||
<head>
|
|
||||||
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
|
|
||||||
<title>{{ settings.title }}</title>
|
|
||||||
<link rel="stylesheet" media="screen" href="{{ config.url_stylesheet }}"/>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
{{ boardlist.top }}
|
|
||||||
<header>
|
<header>
|
||||||
<h1>{{ settings.title }}</h1>
|
<h1>{{ settings.title }}</h1>
|
||||||
<div class="subtitle">{{ settings.subtitle }}</div>
|
<div class="subtitle">{{ settings.subtitle }}</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div class="ban">
|
<div class="ban">
|
||||||
{% if not news %}
|
{% if not news %}
|
||||||
<p style="text-align:center" class="unimportant">{% trans %}(No news to show.){% endtrans %}</p>
|
<p style="text-align:center" class="unimportant">{% trans %}(No news to show.){% endtrans %}</p>
|
||||||
|
@ -30,13 +23,12 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
<p class="unimportant" style="margin-top:20px;text-align:center;">- Tinyboard +
|
<p class="unimportant" style="margin-top:20px;text-align:center;">- Tinyboard +
|
||||||
<a href="https://engine.vichan.net/">vichan</a> {{ config.version }} -
|
<a href="https://engine.vichan.net/">vichan</a> {{ config.version }} -
|
||||||
<br>Tinyboard Copyright © 2010-2014 Tinyboard Development Group
|
<br>Tinyboard Copyright © 2010-2014 Tinyboard Development Group
|
||||||
<br><a href="https://engine.vichan.net/">vichan</a> Copyright © 2012-2016 vichan-devel</p>
|
<br><a href="https://engine.vichan.net/">vichan</a> Copyright © 2012-2016 vichan-devel</p>
|
||||||
</footer>
|
</footer>
|
||||||
</body>
|
</div>
|
||||||
</html>
|
|
||||||
{% endfilter %}
|
{% endfilter %}
|
||||||
|
|
|
@ -1,21 +1,5 @@
|
||||||
{% filter remove_whitespace %}
|
{% filter remove_whitespace %}
|
||||||
<!doctype html>
|
<div class="sidebar">
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
|
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
|
||||||
<title>{{ settings.title }}</title>
|
|
||||||
<link rel="stylesheet" media="screen" href="{{ config.url_stylesheet }}"/>
|
|
||||||
<style type="text/css">
|
|
||||||
fieldset{margin:10px 0}
|
|
||||||
legend{width:100%;margin-left:-15px;background:#98E;border:1px solid white;color:white;font-weight:bold;padding:5px 5px}
|
|
||||||
ul{margin:0;padding:0}
|
|
||||||
li{list-style:none;padding:0 4px;margin: 0 4px}
|
|
||||||
li a.system{font-weight:bold}
|
|
||||||
</style>
|
|
||||||
<base target="main"/>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>{{ settings.title }}</legend>
|
<legend>{{ settings.title }}</legend>
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -50,6 +34,6 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</fieldset>
|
</fieldset>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</body>
|
</div>
|
||||||
</html>
|
|
||||||
{% endfilter %}
|
{% endfilter %}
|
||||||
|
|
|
@ -28,8 +28,17 @@
|
||||||
// Build homepage
|
// Build homepage
|
||||||
public static function homepage($settings) {
|
public static function homepage($settings) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
return Element('themes/categories/frames.html', Array('config' => $config, 'settings' => $settings));
|
return Element(
|
||||||
|
'themes/categories/frames.html',
|
||||||
|
Array(
|
||||||
|
'config' => $config,
|
||||||
|
'settings' => $settings,
|
||||||
|
'categories' => Categories::getCategories($config),
|
||||||
|
'boardlist' => createBoardlist(false)
|
||||||
|
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build news page
|
// Build news page
|
||||||
|
@ -43,7 +52,7 @@
|
||||||
'settings' => $settings,
|
'settings' => $settings,
|
||||||
'config' => $config,
|
'config' => $config,
|
||||||
'news' => $news,
|
'news' => $news,
|
||||||
'boardlist' => createBoardlist(false)
|
'boardlist' => createBoardlist(false)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,6 +60,14 @@
|
||||||
public static function sidebar($settings) {
|
public static function sidebar($settings) {
|
||||||
global $config, $board;
|
global $config, $board;
|
||||||
|
|
||||||
|
return Element('themes/categories/sidebar.html', Array(
|
||||||
|
'settings' => $settings,
|
||||||
|
'config' => $config,
|
||||||
|
'categories' => Categories::getCategories($config)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function getCategories($config) {
|
||||||
$categories = $config['categories'];
|
$categories = $config['categories'];
|
||||||
|
|
||||||
foreach ($categories as &$boards) {
|
foreach ($categories as &$boards) {
|
||||||
|
@ -61,12 +78,8 @@
|
||||||
$board = Array('title' => $title, 'uri' => sprintf($config['board_path'], $board));
|
$board = Array('title' => $title, 'uri' => sprintf($config['board_path'], $board));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return Element('themes/categories/sidebar.html', Array(
|
return $categories;
|
||||||
'settings' => $settings,
|
|
||||||
'config' => $config,
|
|
||||||
'categories' => $categories
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue