Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements for the Default theme #282

Closed
wants to merge 11 commits into from
42 changes: 25 additions & 17 deletions PodcastGenerator/admin/login.php
Expand Up @@ -50,23 +50,31 @@
<link rel="shortcut icon" type="image/x-icon" href="<?php echo $config['url']; ?>favicon.ico">
</head>

<body>
<div class="container">
<h1><?php echo htmlspecialchars($config['podcast_title']); ?> - Login</h1>
<?php
if (isset($error)) {
echo '<strong><p style="color: red;">' . $error . '</p></strong>';
}
?>
<form action="login.php?login=1" method="POST">
<?php echo _('Username'); ?>:<br>
<input type="text" name="username"><br>
<?php echo _('Password'); ?>:<br>
<input type="password" name="password"><br>
<small><a href="forgot.php"><?php echo _('Forgot Password?'); ?></a></small><br>
<br>
<input type="submit" value="<?php echo _('Sign In'); ?>" class="btn btn-success">
</form>
<body class="bg-light">
<div class="container m-auto">
<div class="align-items-center justify-content-md-center p-3 row vh-100">
<div class="col-xl-5 col-lg-5 col-md-10 col-sm-12 bg-white p-4">
<h2><?php echo htmlspecialchars($config['podcast_title']); ?> - Login</h2>
<?php
if (isset($error)) {
echo '<strong><p style="color: red;">' . $error . '</p></strong>';
}
?>
<form action="login.php?login=1" method="POST">
<div class="form-group">
<?php echo _('Username'); ?>:<br>
<input class="form-control" type="text" name="username">
</div>
<div class="form-group">
<?php echo _('Password'); ?>:<br>
<input class="form-control" type="password" name="password"><br>
<small><a href="forgot.php"><?php echo _('Forgot Password?'); ?></a></small><br>
<br>
<input type="submit" value="<?php echo _('Sign In'); ?>" class="btn btn-success">
</div>
</form>
</div>
</div>
</div>
</body>

Expand Down
13 changes: 6 additions & 7 deletions PodcastGenerator/admin/navbar.php
@@ -1,12 +1,13 @@
<nav class="navbar navbar-expand-lg navbar-dark bg-danger">
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not use a dark background honestly. I think the admin interface/bar should differ from the default theme

<div class="container">
<a class="navbar-brand" href="index.php">Admin</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="<?php echo _('Toggle navigation'); ?>">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="index.php">Home</a>
<a class="nav-link" href="../index.php">Home</a>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we changing the path of index.php to the parent directory?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right...
I have nested the navbar inside a container (looks a bit more clear) making this, the navbar is less wider and i couldnt fit all the previous menu links inside it...
Since the "Admin" and "Home" in the administrator navbar were pointing to the same link i have removed "View Podcast" which pointed to the main homepage, and modified "Home" so it will point to the main page (like the "view podcast" button did previously).

Hope i made it clear :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please leave the View Podcast button as it is, the home button is intended to access the homepage of the admin interface (with the news blog)

</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Expand Down Expand Up @@ -59,12 +60,10 @@
</li>
</ul>
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="<?php echo $config['url']; ?>" target="_blank"><?php echo _('View Podcast'); ?></a>
</li>
<li class="nav-item">
<a class="nav-link" href="logout.php">Logout - <?php echo $_SESSION["username"]; ?></a>
<li class="nav-item nav-pills">
<a class="nav-link active p-1" href="logout.php">Logout - <?php echo $_SESSION["username"]; ?></a>
</li>
</ul>
</div>
</div>
</nav>
43 changes: 22 additions & 21 deletions PodcastGenerator/setup/index.php
Expand Up @@ -18,29 +18,30 @@
<link rel="stylesheet" href="../core/bootstrap/style.css">
</head>

<body>
<div class="container">
<h1>Podcast Generator - Setup</h1>
<?php
if ($isdev) {
?>
<div class="alert alert-danger" role="alert">
<body class="bg-light">
<div class="container m-auto">
<div class="align-items-center justify-content-md-center p-3 row vh-100">
<div class="col-xl-7 col-lg-7 col-md-10 col-sm-12 bg-white p-4 shadow">
<h2>Podcast Generator - Setup</h2>
<?php
if ($isdev) {
?>
<div class="alert alert-danger" role="alert">
WARNING!: You use a development version of Podcast Generator!<br>
Please use a release version rather than this. You can find them <a class="alert-link" href="https://github.com/PodcastGenerator/PodcastGenerator/releases" target="_blank">here</a>
NeaMitika marked this conversation as resolved.
Show resolved Hide resolved
</div>
<?php
}
?>
<p>
WARNING!: You use a development version of Podcast Generator!<br>
Please use a release version rather than this. You can find them <a href="https://github.com/PodcastGenerator/PodcastGenerator/releases">here</a>
Howdy and welcome to Podcast Generator <?php echo $version; ?>!<br>
Thanks for choosing a <a href="http://emilengler.com" target="_blank">Emil Engler</a> and <a href="http://betella.net" target="_blank">Alberto Betella</a> software, have a cookie 🍪!<br>
This is Free and Open Source Software
<hr>
<a href="step1.php" class="btn btn-block btn-success">Begin Installation</a>
</p>
</div>
<?php
}
?>
<p>
Howdy and welcome to Podcast Generator <?php echo $version; ?>!<br>
Thanks for choosing a <a href="http://emilengler.com" target="_blank">Emil Engler</a> and <a href="http://betella.net" target="_blank">Alberto Betella</a> software, have a cookie 🍪!<br>
This is Free and Open Source Software<br>
<br>
<hr>
<a href="step1.php" class="btn btn-success">Begin Installation</a>
</p>
</div>
</div>
</div>
</body>

Expand Down
39 changes: 19 additions & 20 deletions PodcastGenerator/setup/step1.php
Expand Up @@ -34,26 +34,25 @@
<link rel="stylesheet" href="../core/bootstrap/style.css">
</head>

<body>
<div class="container">
<h1>Podcast Generator - Step 1</h1>
<h3>Please choose a language</h3>
<p>
<form action="step1.php?done=1" method="POST">
<select name="lang">
<?php
foreach ($languages as $item) {
echo '<option value=' . $item->code . '>' . $item->name . '</option>'."\n";
}
?>
</select>
<br>
<br>
<input type="submit" value="Submit" class="btn btn-success">
</form>
<br>
<small>If your desired language can't be choosen, you should execute <code>locale -a</code> and might append <code>.utf8</code> to <code>scriptlang</code> in the config</small>
</p>
<body class="bg-light">
<div class="container m-auto">
<div class="align-items-center justify-content-md-center p-3 row vh-100">
<div class="col-xl-7 col-lg-7 col-md-10 col-sm-12 bg-white p-4 shadow">
<h2>Podcast Generator - <small>Step 1</small></h2>
<p class="lead">Please choose a language</p>
<form action="step1.php?done=1" method="POST">
<select class="custom-select mb-4" name="lang">
<?php
foreach ($languages as $item) {
echo '<option value=' . $item->code . '>' . $item->name . '</option>'."\n";
}
?>
</select>
<input type="submit" value="Submit" class="btn btn-success mb-3 btn-block">
</form>
<small>If your desired language can't be choosen, you should execute <code>locale -a</code> and might append <code>.utf8</code> to <code>scriptlang</code> in the config</small>
</div>
</div>
</div>
</body>

Expand Down
65 changes: 33 additions & 32 deletions PodcastGenerator/setup/step2.php
Expand Up @@ -62,38 +62,39 @@
<meta charset="utf-8">
<link rel="stylesheet" href="../core/bootstrap/style.css">
</head>
<body>
<div class="container">
<h1>Podcast Generator - Step 2</h1>
<p>
We are now checking if our data direcotires are writable so you can actual store the data.<br>
<?php
if($media_write)
echo "<p style=\"color: green;\">Media is writeable</p>";
else
echo "<p style=\"color: red;\">Media is not writeable</p>";
if($images_write)
echo "<p style=\"color: green;\">Images is writeable</p>";
else
echo "<p style=\"color: red;\">Images is not writeable</p>";
if($scripts_write)
echo "<p style=\"color: green;\">Scripts is writeable</p>";
else
echo "<p style=\"color: red;\">Scripts is not writeable</p>";
// Try to adjust file permissions
if(!$media_write || !$images_write || !$scripts_write) {
echo "<p>Try to adjust file permissions</p>";
chmod("$media_directory", 0777);
chmod("$images_directory", 0777);
chmod("$script_directory", 0777);
echo "<strong><p style=\"color: red;\">Please <a href=\"step2.php\">reload</a> this page, if you still see this page you need to adjust the permissions manually</p></strong>";
}
else {
echo "<a href=\"step3.php\" class=\"btn btn-success\">Continue</a>";
}
?>
<br>
</p>
<body class="bg-light">
<div class="container m-auto">
<div class="align-items-center justify-content-md-center p-3 row vh-100">
<div class="col-xl-7 col-lg-7 col-md-10 col-sm-12 bg-white p-4 shadow">
<h2>Podcast Generator - <small>Step 2</small></h2>
<p><small>We are now checking if our data direcotires are writable so you can actual store the data.</small></p>
<?php
if($media_write)
echo "<p style=\"color: green;\">Media is writeable</p>";
else
echo "<p style=\"color: red;\">Media is not writeable</p>";
if($images_write)
echo "<p style=\"color: green;\">Images is writeable</p>";
else
echo "<p style=\"color: red;\">Images is not writeable</p>";
if($scripts_write)
echo "<p style=\"color: green;\">Scripts is writeable</p>";
else
echo "<p style=\"color: red;\">Scripts is not writeable</p>";
// Try to adjust file permissions
if(!$media_write || !$images_write || !$scripts_write) {
echo "<p>Try to adjust file permissions</p>";
chmod("$media_directory", 0777);
chmod("$images_directory", 0777);
chmod("$script_directory", 0777);
echo "<strong><p style=\"color: red;\">Please <a href=\"step2.php\">reload</a> this page, if you still see this page you need to adjust the permissions manually</p></strong>";
}
else {
echo "<a href=\"step3.php\" class=\"btn btn-success btn-block\">Continue</a>";
}
?>
</div>
</div>
</div>
</body>
</html>
58 changes: 29 additions & 29 deletions PodcastGenerator/setup/step3.php
Expand Up @@ -48,35 +48,35 @@
<meta charset="utf-8">
<link rel="stylesheet" href="../core/bootstrap/style.css">
</head>
<body>
<div class="container">
<h1>Podcast Generator - Step 3</h1>
<p>
We are now creating the admin account for the admin area.<br>
<form method="POST" action="step3.php?create=1">
<div class="form-group">
<label for="username">Enter Username:</label>
<input type="text" class="form-control" name="username" id="username" name="username">
</div>
<div class="form-group">
<label for="password">Enter Password:</label>
<input type="password" class="form-control" name="password" id="password" name="password">
</div>
<div class="form-group">
<label for="password2">Repeat Password:</label>
<input type="password" class="form-control" name="password2" id="password2" name="password2">
</div>
<button type="submit" class="btn btn-success">Submit</button>
</form>
<br>
<?php
if(isset($error)) {
echo "<strong><p style=\"color: red;\">Error: $error</p>";
}
?>

<br>
</p>
<body class="bg-light">
<div class="container m-auto">
<div class="align-items-center justify-content-md-center p-3 row vh-100">
<div class="col-xl-7 col-lg-7 col-md-10 col-sm-12 bg-white p-4 shadow">
<h2>Podcast Generator - <small>Step 3</small></h2>
<p><small>We are now creating the admin account for the admin area.</small></p>
<form method="POST" action="step3.php?create=1">
<div class="form-group">
<label for="username">Enter Username:</label>
<input type="text" class="form-control" name="username" id="username" name="username">
</div>
<div class="form-group">
<label for="password">Enter Password:</label>
<input type="password" class="form-control" name="password" id="password" name="password">
</div>
<div class="form-group">
<label for="password2">Repeat Password:</label>
<input type="password" class="form-control" name="password2" id="password2" name="password2">
</div>
<hr>
<button type="submit" class="btn btn-success btn-block">Submit</button>
</form>
<?php
if(isset($error)) {
echo "<strong><p style=\"color: red;\">Error: $error</p>";
}
?>
</div>
</div>
</div>
</body>
</html>
40 changes: 22 additions & 18 deletions PodcastGenerator/themes/default/categories.php
Expand Up @@ -3,8 +3,9 @@

<head>
<title><?php echo htmlspecialchars($config["podcast_title"]); ?></title>
<link rel="stylesheet" href="<?php echo htmlspecialchars($config["theme_path"]); ?>style/bootstrap.css">
<meta charset="utf-8">
<link rel="stylesheet" href="<?php echo htmlspecialchars($config["theme_path"]); ?>style/bootstrap.css">
<link rel="stylesheet" href="<?php echo htmlspecialchars($config["theme_path"]); ?>style/custom.css">
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous"> <meta charset="utf-8">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is problematic.
I don't think using CDNs is a good idea especially because we need to provide a privacy policy then.
I would suggest to download that file and put it into PodcastGenerator/themes/default/style/font-awesome.min.css.
And then change the line to this

<link rel="stylesheet" href="<?php echo htmlspecialchars($config["theme_path"]); ?>style/font-awesome.min.css"

Also please add a linebreak before the tag

<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
</head>
Expand All @@ -18,22 +19,25 @@
<?php
include "js.php";
include "jumbotron.php";
if (!isset($_GET["cat"])) {
?>
<ul>
<?php
foreach ($categories_xml as $item) {
echo "<li><a href=\"categories.php?cat=" . $item->id . "\">" . $item->description . "</a></li>";
}
?>
</ul>
<hr>
<a href="categories.php?cat=all"><?php echo _('All Episodes'); ?></a>
<?php
} else {
include 'listepisodes.php';
}
?>
echo '<div class="row">';
if (!isset($_GET["cat"])) {
?>
<div class="col">
<div class="list-group">
<a class="list-group-item list-group-item-action" href="categories.php?cat=all"><?php echo _('All Episodes'); ?></a>
<?php
foreach ($categories_xml as $item) {
echo "<a class='list-group-item list-group-item-action' href=\"categories.php?cat=" . $item->id . "\">" . $item->description . "</a>";
}
?>
</div>
</div>
<?php
} else {
include 'listepisodes.php';
}
echo '</div>'
?>
</div>
</body>

Expand Down
2 changes: 2 additions & 0 deletions PodcastGenerator/themes/default/index.php
Expand Up @@ -4,6 +4,8 @@
<head>
<title><?php echo htmlspecialchars($config["podcast_title"]); ?></title>
<link rel="stylesheet" href="<?php echo htmlspecialchars($config["theme_path"]); ?>style/bootstrap.css">
<link rel="stylesheet" href="<?php echo htmlspecialchars($config["theme_path"]); ?>style/custom.css">
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here as well

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="<?php echo htmlspecialchars($config["podcast_subtitle"]); ?>">
Expand Down