Skip to content

Commit

Permalink
Fixes and features to home, profile, editor + more
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderhorner committed Feb 10, 2020
1 parent 266a319 commit 4effeb1
Show file tree
Hide file tree
Showing 44 changed files with 1,081 additions and 1,660 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
user

/vendor/
7 changes: 7 additions & 0 deletions artikel/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

RewriteEngine On


RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)$ index.php?article=$1 [B]
60 changes: 36 additions & 24 deletions artikel/artikel.css
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ html.dark .wrapper {
flex-direction: column;
justify-content: center;
height: 44px;
margin-top: 0px;
margin-right: 20px;
margin-bottom: 8px;
margin-left: 30px;
Expand Down Expand Up @@ -124,7 +125,7 @@ html.editMode .article {
}

.article {
margin-top: 34px;
margin-top: 20px;
font-family: 'Lora', serif;
}

Expand All @@ -136,25 +137,48 @@ html.editMode .article {
font-family: 'Roboto', sans-serif;
font-size: 2em;
font-weight: normal;
line-height: 48px;
line-height: 1.1;
margin: 0 !important;
}

h1, h2, h3, h4, h5, h6 {
margin: 0 0 15px;
h1, h2, h3, h4 {
font-family: 'Roboto', sans-serif;
padding: 0.4em 0 !important;
margin: 0.55em 0 -0.85em !important;
}

h1 {
font-size: 2em;
}

h2 {
font-size: 1.5em;
}

h3 {
font-size: 1.25em;
font-size: 1.2em;
}

h4 {
font-size: 1em;
}

.article ol, .article ul {
padding: 0.4em 0;
padding-left: 40px;
font-family: inherit;
margin-bottom: 1.1em;
/* margin-top: -1.1em; */
}

.article li {
padding: 5.5px 0 5.5px 3px;
}

.article p {
.article p, .ce-paragraph {
display: block;
margin: 0 0 40px;
padding: .4em 0;
margin: 0.55em 0 0.55em;
}

@media only screen and (max-width: 730px) {
Expand Down Expand Up @@ -201,20 +225,8 @@ html.dark .article figcaption {
}
}

.article ul, .article ol {
margin: 0 0 40px;
font-family: inherit;
}

blockquote {
box-sizing: content-box;
width: 100%;
margin-left: -25px;
padding: 0 0 0 22px;
border-left: 3px solid black;
font-style: oblique;
}

html.dark blockquote {
border-left: 3px solid white;
}
mark {
background-color: rgba(245,235,111,0.29);
padding: 3px 0;
color: inherit;
}
112 changes: 112 additions & 0 deletions artikel/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<?php
date_default_timezone_set('Europe/Berlin');

include '../framework/document-start.php';


if (isset($_SESSION['UID'])) {
$UID = $_SESSION['UID'];
$firstname = $_SESSION['firstname'];
$lastname = $_SESSION['lastname'];
} else {
header("Location: /login/");
die();
}



if (isset($_GET['article'])) {
$article = $_GET['article'];
$articleName = $article;
$documentTitle = $article;

// Connenct to database
include '../framework/mysqlcredentials.php';

// Check if Article exists
$stmntSearch = $pdo->prepare("SELECT AID FROM articles WHERE title = ?");

// execute statement and put response into array
$stmntSearch->execute(array($article));

// fetch
$row = $stmntSearch->fetch();

//check if article is already in database
if ($stmntSearch->rowCount() > 0) {

$AID = $row['AID'];

// Download Data
// Check if Article exists
$stmntDownload = $pdo->prepare("SELECT `htmldata`, `owner`, `status`, `publishedon` FROM articles WHERE AID = ?");

// execute statement and put response into array
$stmntDownload->execute(array($AID));

// fetch
$row = $stmntDownload->fetch();
$articleState = $row['status'];
$publishedon = $row['publishedon'];


if ($articleState == 'public') {
$articleData = $row['htmldata'];
} else {
echo 'Dieser Artikel wurde noch nicht veröffentlicht.';
die();
}
} else {
echo 'Artikel wurde nicht gefunden!';
die();
}

} else {
echo 'Kein Artikel spezifiziert!';
die();
}


?>

<head>
<title>
<?php echo $documentTitle ?> - Die Edith
</title>

<?php include '../framework/head.php'?>

<link href="https://fonts.googleapis.com/css?family=Lora:400,400i,700,700" rel="stylesheet">

<link rel="stylesheet" type="text/css" href="/artikel/artikel.css">

</head>

<body>
<?php include '../framework/nav-overlay.php'?>

<div class="wrapper">

<h1 data-AID="<?php echo $AID ?>" class="main-title">
<?php echo htmlspecialchars($articleName, ENT_QUOTES, 'UTF-8'); ?>
</h1>

<div class="article__info">
<img class="article__info__picture" src="/user/<?php echo $UID ?>/pb-small.jpg" alt="profile picture">
<div class="article__info__textbox">
<div class="article__info__textbox__name">
<?php echo $firstname." ".$lastname; ?>
</div>
<div class="article__info__textbox__time">
Unveröffentlichter Entwurf
</div>
</div>
</div>

<p class="clear"></p>


<article class="article"><?php echo $articleData ?></article>
</body>

</html>
12 changes: 12 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "alexanderhorner/die-edith",
"authors": [
{
"name": "Alexander Horner",
"email": "[email protected]"
}
],
"require": {
"codex-team/editor.js": "dev-master"
}
}
108 changes: 108 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 4 additions & 14 deletions editor/editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,6 @@
outline: 0 solid transparent;
}

.article {
margin: 34px -30px auto;
background-color: hsla(0, 0%, 50%, 0.05);
}

@media only screen and (max-width: 850px) {
.article {
margin: 34px auto auto;
}
}



#editorjs * {
box-sizing: content-box;
}
Expand Down Expand Up @@ -113,9 +100,12 @@

.ce-paragraph {
line-height: 1.58;
padding: 9px 0 21px;
}

.ce-block {
}


.ce-block__content, .ce-toolbar__content {
max-width: 680px;
}
Expand Down
Loading

0 comments on commit 4effeb1

Please sign in to comment.