Rangitaki Control Center (rcc) improvments; Complete material design

This commit is contained in:
mmk2410 2015-06-16 16:16:51 +02:00
parent 9d9b9ca962
commit 4d6a7dc1e4
11 changed files with 410 additions and 152 deletions

View file

@ -24,8 +24,8 @@ $blogdisqus = 'rangitaki';
$bloganalytics = '';
// Footer - set here the text for your footer (e.g. a copyright info). You can replace the whole text after the '=' with your own one.
$blogfooter = 'Rangitaki ' . date("Y") . ' <a href="https://github.com/mmk2410/Rangitaki" target="blank">github.com/mmk2410/Rangitaki</a>';
// This enables the optional online post upload. Please read the documentation before you enable it.
$post_upload = 'no';
// This enables the optional rangitaki control center. Please read the documentation before you enable it.
$rcc= 'no';
// Here you can disable and enable the navigation menu. Usefull if you have no subblogs and no home directory
$nav_drawer = 'yes';
?>

View file

@ -38,7 +38,6 @@ THE SOFTWARE.
<meta name="author" content="<?php echo $blogauthor; ?>" />
<meta name="description" content="<?php echo $blogdescription; ?>" />
<meta name="theme-color" content="#ac2900"/>
<meta http-equiv="CACHE-CONTROL" content="no-cache" />
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
<!--CSS no change needed-->
<link rel="stylesheet" type="text/css" href="res/css/rangitaki.css" />

View file

@ -1,12 +0,0 @@
This is the Blog of the Blog Engine **pBlog**
pBlog is based on PHP, XML and Markdown. It is easy to install and to configure.
The latest Version of the 0.2 series is **0.2.1**
The latest Version of the development stream isn' ready yet.
** !IMPORTANT! Please read [this](index.php?article=About-the-Future-of-pBlog) for more information about the different versions of pBlog.**
You can find the source code on [GitHub](https://github.com/mmk2410/pBlog).

View file

@ -25,20 +25,30 @@ THE SOFTWARE.
<html>
<head>
<meta charset="UTF-8">
<title></title>
<title>Rangitaki Control Center</title>
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
<link rel="stylesheet" href="../res/rcc.css" />
</head>
<body>
<?php
if($_POST['passwd'] == ""){
?>
<form action="./" method="post">
<p>Password: <input type="password" name="passwd"/></p>
<input type="submit" value="Get password"/>
</form>
<?php
} else {
echo password_hash($_POST['passwd'], PASSWORD_DEFAULT);
}
?>
<div class="header">
<a href="../" class="title">Rangitaki Control Center</a>
</div>
<div class="main">
<section class="card">
<div class="headline">Password Generator</div>
<?php
if ($_POST['passwd'] == "") {
?>
<form action="./" method="post">
<p>New password:<br><br><input type="password" class="itextfield" name="passwd"/></p>
<input type="submit" value="Get password" class="button"/>
</form>
<?php
} else {
echo "<p style='word-wrap: break-word;'>" . password_hash($_POST['passwd'], PASSWORD_DEFAULT) . "</p>";
}
?>
</section>
</div>
</body>
</html>

114
rcc/index.php Normal file
View file

@ -0,0 +1,114 @@
<!DOCTYPE html>
<!--
The MIT License
Copyright 2015 mmk.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<html>
<head>
<meta charset="UTF-8">
<title>Rangitaki Control Center</title>
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
<link rel="stylesheet" href="./res/rcc.css" />
</head>
<body>
<div class="header">
<a href="./" class="title">Rangitaki Control Center</a>
</div>
<div class="main">
<?php
include '../config.php';
if ($rcc == "yes") {
if ($_POST['passwd'] == "") {
?>
<section class="card">
<div class="headline">Log In</div>
<form action="./" method="post">
<p>Password:<br><br><input type="password" class="itextfield" name="passwd"/></p>
<input type="Submit" class="button" value="Log in"/>
</form>
</section>
<?php
} else {
chmod("passwd.txt", 0644);
$hash = file_get_contents("passwd.txt");
chmod("passwd.txt", 0000);
if (password_verify($_POST['passwd'], $hash)) {
?>
<section class="card">
<div class="headline">File Upload</div>
<form enctype="multipart/form-data" action="uploaded/" method="POST">
<select name="blog">
<?php
$blogs = scandir("../blogs/");
foreach ($blogs as $blog) {
if (strlen($blog) >= 3 && substr($blog, -3) == ".md") {
$blog = substr($blog, 0, -3);
echo "<option value='$blog'>$blog</option>";
}
}
?>
</select>
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
<input id="" name="userfile" type="file" value="Choose a file" />
<br>
<br>
<input id="button" type="submit" value="Upload" class="button"/>
</form>
</section>
<?php
} else {
?>
<section class="card">
<div class="headline">Wrong Password</div>
<p>
Please go back and try again.
</p>
<a href="./" class="button">GO BACK</a>
</section>
<?php
}
}
?>
<section class="card">
<div class="headline">Password</div>
<p>
Generate a new password.
</p>
<a class="button" href="./genpas/">
GENERATOR
</a>
</section>
<?php
} else {
?>
<section class="card">
<div class="headline">Rangitaki Control Center</div>
<p>
The Rangitaki Control Center is disabled. You can enable it in your config file. But please read first the documentation.
</p>
</section>
<?php
}
?>
</div>
</body>
</html>

213
rcc/res/rcc.css Normal file
View file

@ -0,0 +1,213 @@
/*
The MIT License
Copyright 2015 mmk2410.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
/*
Created on : Jun 14, 2015, 6:13:38 PM
Author : mmk2410
*/
/* BODY */
body{
font-family: "Roboto", sans-serif;
background: #f6f6f6;
color: #383838;
margin-top: 94px;
}
.main{
height: 100%;
width: 100%;
margin-left: 0px;
}
/* HEADER */
.header{
background-color: #ff4415;
position: fixed;
top: 0px;
right: 0px;
left: 0px;
width: 100%;
height: 64px;
box-shadow: 2px 0px 2px 2px rgba(62, 62, 62, 0.45);
}
.title{
color: #fff;
font-size: 23px;
text-decoration: none;
line-height: 64px;
vertical-align: middle;
left: 75px;
position: absolute;
}
/* MAIN */
.card{
margin-right: auto;
margin-left: auto;
width: 75%;
background: #fff;
border-radius: 2px;
padding: 24px;
box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3);
margin-bottom: 40px;
max-width: 1160px;
}
.headline{
font-size: 24px;
color: #383838!important;
text-decoration: none;
display: block;
padding-bottom: 8px;
border-bottom: none!important;
}
.card > p{
font-size: 14px;
line-height: 24px;
}
/* FOOTER */
.footer{
font-size: 12px;
text-align: center;
}
.footer a{
color: #383838;
text-decoration: none;
border-bottom: 1px solid transparent;
border-bottom-color: transparent;
transition: border-bottom-color 150ms ease-in-out 100ms;
}
.footer a:hover{
border-bottom-color: #383838;
}
/* BUTTON */
.button {
text-decoration: none;
color: #fff;
background-color: #ff4415;
line-height: 36px;
min-width: 64px;
text-align: center;
height: 36px;
padding: 8px;
border-width: 1px;
border-style: solid;
border-color: #ff4415;
box-shadow: 0.4px 1px 1.5px 1px #aaa;
-moz-box-shadow: 0.4px 1px 1.5px 1px #aaa;
-webkit-box-shadow: 0.4px 1px 1.5px 1px #aaa;
border-radius: 2px;
margin-top: 4px;
margin-bottom: 5px;
letter-spacing: 0.4px;
font-weight: 700;
font-size: 14px;
transition-property: box-shadow;
transition-delay: 50ms;
transition-duration: 125ms;
transition-timing-function: ease;
-moz-transition-property: box-shadow;
-moz-transition-delay: 50ms;
-moz-transition-duration: 125ms;
-moz-transition-timing-function: ease;
-webkit-transition-property: box-shadow;
-webkit-transition-delay: 50ms;
-webkit-transition-duration: 125ms;
-webkit-transition-timing-function: ease;
cursor: pointer;
}
.button:hover, .button:hover {
box-shadow: 0.5px 1.8px 2.1px 1.4px #aaa;
-moz-box-shadow: 0.5px 1.8px 2.1px 1.4px #aaa;
-webkit-box-shadow: 0.5px 1.8px 2.1px 1.4px #aaa; }
input.button{
padding: 0px 8px;
}
/* INPUT FIELD */
.itextfield{
border-color: transparent;
border-width: 1px;
font-size: 16px;
line-height: 22px;
border-bottom-color: #aaa;
transition-property: border-bottom-color;
transition-delay: 50ms;
transition-duration: 125ms;
transition-timing-function: ease;
-moz-transition-property: border-bottom-color;
-moz-transition-delay: 50ms;
-moz-transition-duration: 125ms;
-moz-transition-timing-function: ease;
-webkit-transition-property: border-bottom-color;
-webkit-transition-delay: 50ms;
-webkit-transition-duration: 125ms;
-webkit-transition-timing-function: ease;
}
.itextfield:focus{
border-bottom-color: #ff4415;
border-width: 2px;
outline: none;
}
/* FORM */
form{
margin-top: 20px;
}
@media screen and (min-width: 1440px) {
.card{
width: 1160px;
}
}
@media screen and (max-width: 720px){
.card{
width: 82%;
}
.title{
left: 25px;
}
}

57
rcc/uploaded/index.php Normal file
View file

@ -0,0 +1,57 @@
<!DOCTYPE html>
<!--
The MIT License
Copyright 2015 mmk.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<html>
<head>
<meta charset="UTF-8">
<title>Rangitaki Control Center</title>
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
<link rel="stylesheet" href="../res/rcc.css" />
</head>
<body>
<div class="header">
<a href="../" class="title">Rangitaki Control Center</a>
</div>
<div class="main">
<section class="card">
<div class="headline">File Upload</div>
<?php
if ($_FILES['userfile']['name'] == "") {
echo "<p>You have to choose a file!</p>";
} else {
$blog = $_POST['blog'];
$uploaddir = "../..//articles/$blog/";
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "<p>The post was successfully uploaded and is now published.</p>";
} else {
echo "<p>During the uploading process an error occured! <br> Error Code:" . ($_FILES['userfile']['error'] . "</p>");
}
}
?>
</section>
</div>
</body>
</html>

View file

@ -254,12 +254,9 @@ body{
width: calc(100% - 300px);
}
.card{
width: 1160px;
}
}
@media screen and (max-width: 720px){
.card{

View file

@ -1,73 +0,0 @@
<!DOCTYPE html>
<!--
The MIT License
Copyright 2015 mmk.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<html>
<head>
<meta charset="UTF-8">
<title>Rangitaki Upload</title>
</head>
<body>
<?php
include '../config.php';
if($post_upload == "yes"){
if($_POST['passwd'] == ""){
?>
<form action="./" method="post">
<p>Password: <input type="password" name="passwd"/></p>
<input type="Submit" value="Log in"/>
</form>
<?php
} else {
chmod("passwd.txt", 0644);
$hash = file_get_contents("passwd.txt");
chmod("passwd.txt", 0000);
if(password_verify($_POST['passwd'], $hash)){
?>
<form enctype="multipart/form-data" action="uploaded/" method="POST">
<select name="blog">
<?php
$blogs = scandir("../blogs/");
foreach ($blogs as $blog) {
if(strlen($blog) >= 3 && substr($blog, -3) == ".md"){
$blog = substr($blog, 0, -3);
echo "<option value='$blog'>$blog</option>";
}
}
?>
</select>
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
<input id="" name="userfile" type="file" value="Choose a file" />
<input id="button" type="submit" value="Upload" />
</form>
<?php
} else {
echo "Wrong password";
}
}
} else {
echo "Post upload is disabled.";
}
?>
</body>
</html>

View file

@ -1,47 +0,0 @@
<!DOCTYPE html>
<!--
The MIT License
Copyright 2015 mmk.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<?php
if($_FILES['userfile']['name'] == ""){
echo "You have to choose a file!";
} else {
$blog = $_POST['blog'];
$uploaddir = "../..//articles/$blog/";
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "The post was successfully uploaded and is now published.";
} else {
echo "During the uploading process an error occured! <br> Error Code:" . ($_FILES['userfile']['error']);
}
}
?>
</body>
</html>