Merge pull request #287 from discomrade/homepage-upgrades
Homepage upgrades
This commit is contained in:
commit
a3b13aa12a
|
@ -1921,3 +1921,7 @@
|
||||||
|
|
||||||
//Empty board alias
|
//Empty board alias
|
||||||
$config['boards_alias'] = array();
|
$config['boards_alias'] = array();
|
||||||
|
|
||||||
|
//Logo location for themes
|
||||||
|
$config['logo'] = 'static/logo.png';
|
||||||
|
|
||||||
|
|
|
@ -109,6 +109,9 @@ $config['secure_trip_salt'] = 'ODQ2NDM0ODlmMmRhNzk2M2EyNjJlOW';
|
||||||
//Banners
|
//Banners
|
||||||
$config['url_banner'] = '/banners.php';
|
$config['url_banner'] = '/banners.php';
|
||||||
|
|
||||||
|
//Logo location for themes
|
||||||
|
$config['logo'] = 'static/leftypol_logo.png';
|
||||||
|
|
||||||
//Date format
|
//Date format
|
||||||
$config['post_date'] = '%F (%a) %T';
|
$config['post_date'] = '%F (%a) %T';
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
<link rel="stylesheet" media="screen" href="/stylesheets/dark_red.css">
|
<link rel="stylesheet" media="screen" href="/stylesheets/dark_red.css">
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
.sidebar {
|
.sidebar {
|
||||||
|
grid-column: 1;
|
||||||
|
grid-row: 1 / 3;
|
||||||
width: 200px;
|
width: 200px;
|
||||||
border-right-color: gray;
|
border-right-color: gray;
|
||||||
border-right-style: solid;
|
border-right-style: solid;
|
||||||
|
@ -15,15 +17,30 @@
|
||||||
margin-right: 15px;
|
margin-right: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.introduction {
|
||||||
|
grid-column: 2 / 9;
|
||||||
|
grid-row: 1;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
|
grid-column: 2 / 9;
|
||||||
|
grid-row: 2;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
display: flex;
|
display: grid;
|
||||||
|
grid-template-columns: repeat(auto-fill,minmax(200px, 1fr));
|
||||||
|
gap: 20px;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.modlog {
|
||||||
|
width: 50%;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
fieldset {
|
fieldset {
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
}
|
}
|
||||||
|
@ -54,13 +71,45 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width:768px) {
|
@media (max-width:768px) {
|
||||||
.sidebar {
|
body{
|
||||||
width: 80vw;
|
display: grid;
|
||||||
border: none;
|
grid-template-columns: none;
|
||||||
|
gap: 20px;
|
||||||
|
height: 100vh;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
.main {
|
|
||||||
flex-direction: column;
|
.introduction {
|
||||||
align-items: center;
|
grid-column: 1;
|
||||||
|
grid-row: 1;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar {
|
||||||
|
grid-column: 1;
|
||||||
|
grid-row: 2;
|
||||||
|
width: 100%;
|
||||||
|
border-width: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
grid-column: 1;
|
||||||
|
grid-row: 3;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modlog {
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
table {
|
||||||
|
table-layout: fixed;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.modlog tr th {
|
||||||
|
white-space: normal;
|
||||||
|
word-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
.boardlist {
|
.boardlist {
|
||||||
|
@ -73,9 +122,11 @@
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<title>{{ settings.title }}</title>
|
<title>{{ settings.title }}</title>
|
||||||
|
<meta name="description" content="{{ description }}">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{% include 'themes/categories/' ~ settings.file_sidebar %}
|
{% include 'themes/categories/' ~ settings.file_sidebar %}
|
||||||
{% include 'themes/categories/' ~ settings.file_news %}
|
{% include 'themes/categories/' ~ settings.file_news %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,30 @@
|
||||||
{% filter remove_whitespace %}
|
{% filter remove_whitespace %}
|
||||||
<div class="content">
|
<div class="introduction">
|
||||||
|
<style style="display:none;">
|
||||||
|
.home-logo {
|
||||||
|
display: block;
|
||||||
|
margin: auto;
|
||||||
|
min-width: 100px;
|
||||||
|
width: 15%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.home-description {
|
||||||
|
margin: 20px auto 0 auto;
|
||||||
|
text-align: center;
|
||||||
|
max-width: 700px;"
|
||||||
|
}
|
||||||
|
</style>
|
||||||
{{ boardlist.top }}
|
{{ boardlist.top }}
|
||||||
<header>
|
<header>
|
||||||
<h1>{{ settings.title }}</h1>
|
<h1>{{ settings.title }}</h1>
|
||||||
|
<img src="{{ config.logo }}" alt="logo" class="home-logo">
|
||||||
<div class="subtitle">{{ settings.subtitle }}</div>
|
<div class="subtitle">{{ settings.subtitle }}</div>
|
||||||
<link rel="stylesheet" media="screen" href="{{ config.url_stylesheet }}">
|
<link rel="stylesheet" media="screen" href="{{ config.url_stylesheet }}">
|
||||||
<link rel="stylesheet" media="screen" href="/stylesheets/dark_red.css">
|
<link rel="stylesheet" media="screen" href="/stylesheets/dark_red.css">
|
||||||
|
<p class="home-description" >{{ description }}</p>
|
||||||
</header>
|
</header>
|
||||||
|
</div>
|
||||||
|
<div class="content">
|
||||||
<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>
|
||||||
|
@ -31,7 +48,7 @@
|
||||||
{% trans "Post Statistics" %}
|
{% trans "Post Statistics" %}
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<table class="modlog" style="width: 50%; text-align: left;">
|
<table class="modlog">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{% trans "Board" %}</th>
|
<th>{% trans "Board" %}</th>
|
||||||
|
@ -91,3 +108,4 @@
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
{% endfilter %}
|
{% endfilter %}
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,9 @@
|
||||||
// Build homepage
|
// Build homepage
|
||||||
public static function homepage($settings) {
|
public static function homepage($settings) {
|
||||||
global $config;
|
global $config;
|
||||||
|
$description = 'Leftypol is a fun and enjoyable space where users can post anonymously.<br>' .
|
||||||
|
'We engage in both serious political discourse and less serious informal discussions ' .
|
||||||
|
'on various topics related to leftist thought.';
|
||||||
$query = query("SELECT * FROM ``news`` ORDER BY `time` DESC") or error(db_error());
|
$query = query("SELECT * FROM ``news`` ORDER BY `time` DESC") or error(db_error());
|
||||||
$news = $query->fetchAll(PDO::FETCH_ASSOC);
|
$news = $query->fetchAll(PDO::FETCH_ASSOC);
|
||||||
$stats = Categories::getPostStatistics($settings);
|
$stats = Categories::getPostStatistics($settings);
|
||||||
|
@ -42,6 +45,7 @@
|
||||||
Array(
|
Array(
|
||||||
'config' => $config,
|
'config' => $config,
|
||||||
'settings' => $settings,
|
'settings' => $settings,
|
||||||
|
'description' => $description,
|
||||||
'categories' => Categories::getCategories($config),
|
'categories' => Categories::getCategories($config),
|
||||||
'news' => $news,
|
'news' => $news,
|
||||||
'stats' => $stats,
|
'stats' => $stats,
|
||||||
|
@ -160,3 +164,4 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue