Switch to useing markdown for user formatted text

This commit is contained in:
2018-08-12 03:52:55 +02:00
parent 307eba4218
commit 79e413d194
17 changed files with 120 additions and 47 deletions

View File

@@ -99,7 +99,7 @@ else {
</div>
</div>
<p class="subtitle">Beskrivelse</p>
<p class="subtitle">Beskrivelse (<i>markdown</i>)</p>
<textarea name="desc" rows="8" class="boxinput" placeholder="Beskrivese" required><?= implode($event->getDescription(), "\n"); ?></textarea>

View File

@@ -95,7 +95,10 @@ $events = array_values(array_filter(
<p class="subnote">
<?= $event->getStart()->format("(Y-m-d H:i:s)") . " - " . $event->getStop()->format("(Y-m-d H:i:s)"); ?>
</p>
<p><?= implode($event->getDescription(), "<br>"); ?></p>
<?php
$Parsedown = new \Parsedown();
echo $Parsedown->text(implode("\n", $event->getDescription()));
?>
</div>
<div class="event-actions">

View File

@@ -53,7 +53,7 @@ $motd = $motdfetcher->getMOTD();
<p class="subnote">Ikke nødvendig</p>
<input type="text" name="title" value="<?= $motd['title'] ?>" class="boxinput" style="width:66%;"><br>
<p class="subtitle no-chin">Innhold</p>
<p class="subtitle no-chin">Innhold (<i>markdown</i>)</p>
<textarea name="content" style="width:100%" rows="8" class="boxinput"><?= implode("\n", $motd["content"]) ?></textarea>
<div style="margin-top: 2em;">

View File

@@ -87,7 +87,7 @@ foreach($members as $i => $data){
<p class="subtitle">Tittel</p>
<?= '<input type="text" name="title" value="' . $project->getName() . '" class="boxinput">' ?><br>
<p class="subtitle">Beskrivelse</p>
<p class="subtitle">Beskrivelse (<i>markdown</i>)</p>
<textarea name="desc" cols="40" rows="5" class="boxinput"><?= implode($project->getDescription(), "\n"); ?></textarea>
</div>
@@ -140,4 +140,4 @@ foreach($members as $i => $data){
</form>
<p>
</main>
</body>
</body>

View File

@@ -92,7 +92,10 @@ $projects = array_values(array_filter(
<div class="event-info">
<h3 class="no-chin"><?= $project->getName() . " (ID: " . $projectID . ")"; ?></h3>
<p class="subnote"><?= 'Organisert av: ' . $owner['name']; ?></p>
<p><?= implode($project->getDescription(), "<br>"); ?></p>
<?php
$Parsedown = new \Parsedown();
echo $Parsedown->text(implode("\n", $project->getDescription()));
?>
</div>
<div class="event-actions">
@@ -137,4 +140,4 @@ $projects = array_values(array_filter(
</div>
</main>
</body>
</body>