Skip to content

Commit

Permalink
neues Design (ich werde kein Designer)
Browse files Browse the repository at this point in the history
- neue Wildfly-Version (31.0.0Final)
- Markdown-Code kann bei Klick kopiert werden (wenn man JS eingeschaltet hat, wenn nicht: manuell selektieren wie vorher :P)
  • Loading branch information
schipplock committed Feb 18, 2024
1 parent 9a917cd commit a7122f4
Show file tree
Hide file tree
Showing 875 changed files with 778 additions and 1,279 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ RUN cd /src && mvn clean package
FROM ubuntu:22.04 AS base
SHELL ["/bin/bash", "-c"]

ENV WILDFLY_VERSION=30.0.1.Final
ENV WILDFLY_VERSION=31.0.0.Final
ENV JBOSS_HOME=/opt/jboss/wildfly
ENV LAUNCH_JBOSS_IN_BACKGROUND=true
ENV LANG=de_DE.utf8
Expand Down Expand Up @@ -47,7 +47,7 @@ FROM base

COPY docker/entrypoint.sh /bin/entrypoint.sh
COPY docker/postgresql-42.7.1.jar $JBOSS_HOME/standalone/deployments/postgresql-driver.jar
COPY --from=build-war /src/target/tilstory-0.0.8.war $JBOSS_HOME/standalone/deployments/tilstory.war
COPY --from=build-war /src/target/tilstory-0.0.9.war $JBOSS_HOME/standalone/deployments/tilstory.war
COPY docker/standalone.xml $JBOSS_HOME/standalone/configuration/standalone.xml
COPY docker/application.keystore $JBOSS_HOME/standalone/configuration/application.keystore

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ Meine Blogsoftware. TIL = Today I learned.

## Screenshots

![](</screenshots/screenshot1_small.png>)
![](</screenshots/screenshot2_small.png>)
![](<screenshots/screenshot1_small.png>)
![](<screenshots/screenshot2_small.png>)

## Das Image bauen

```bash
docker build --network=host --force-rm -t ghcr.io/schipplock/tilstory:v0.0.8 .
docker build --network=host -t ghcr.io/schipplock/tilstory:v0.0.9 .
```
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ services:
- flywaydb

tilstory-app:
image: ghcr.io/schipplock/tilstory:v0.0.8
image: ghcr.io/schipplock/tilstory:v0.0.9
container_name: tilstory-app
networks:
local-net:
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ limitations under the License.
<groupId>de.schipplock.web</groupId>
<artifactId>tilstory</artifactId>
<packaging>war</packaging>
<version>0.0.8</version>
<version>0.0.9</version>
<name>TILstory</name>
<description>Today I learned - blogging tool</description>
<url>https://github.com/schipplock/tilstory</url>
Expand Down
8 changes: 3 additions & 5 deletions src/main/webapp/403.jsp
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<%@ page session="false" language="java" contentType="text/html; charset=UTF-8" trimDirectiveWhitespaces="true" %>
<jsp:include page="/WEB-INF/includes/header.jsp" />
<section class="post">
<h1 style="color:red">403 - Forbidden</h1>
<h2 class="error-description">Forbidden</h2>
<p>Der Server hat die Anfrage verstanden, weigert sich aber, sie zu autorisieren.</p>
</section>
<h1 style="color:red">403 - Forbidden</h1>
<h2 class="error-description">Forbidden</h2>
<p>Der Server hat die Anfrage verstanden, weigert sich aber, sie zu autorisieren.</p>
<jsp:include page="/WEB-INF/includes/footer.jsp" />
8 changes: 3 additions & 5 deletions src/main/webapp/404.jsp
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<%@ page session="false" language="java" contentType="text/html; charset=UTF-8" trimDirectiveWhitespaces="true" %>
<jsp:include page="/WEB-INF/includes/header.jsp" />
<section class="post">
<h1 style="color:red">404</h1>
<h2 class="error-description">Not Found</h2>
<p>Der Server konnte die angeforderte Seite nicht finden.</p>
</section>
<h1 style="color:red">404</h1>
<h2 class="error-description">Not Found</h2>
<p>Der Server konnte die angeforderte Seite nicht finden.</p>
<jsp:include page="/WEB-INF/includes/footer.jsp" />
8 changes: 3 additions & 5 deletions src/main/webapp/500.jsp
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<%@ page session="false" language="java" contentType="text/html; charset=UTF-8" trimDirectiveWhitespaces="true" %>
<jsp:include page="/WEB-INF/includes/header.jsp" />
<section class="post">
<h1 style="color:red">500</h1>
<h2 class="error-description">Internal Server Error</h2>
<p>Es ist ein unerwarteter Fehler aufgetreten.</p>
</section>
<h1 style="color:red">500</h1>
<h2 class="error-description">Internal Server Error</h2>
<p>Es ist ein unerwarteter Fehler aufgetreten.</p>
<jsp:include page="/WEB-INF/includes/footer.jsp" />
5 changes: 0 additions & 5 deletions src/main/webapp/WEB-INF/includes/admin/footer.jsp

This file was deleted.

28 changes: 12 additions & 16 deletions src/main/webapp/WEB-INF/includes/admin/header.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,19 @@
<html lang="de">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/main.css.jsp">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/main.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/admin.css">
<title>${settings:name()} Admin</title>
<main>

<header>
<h1># <a href="${pageContext.request.contextPath}/">${settings:name()}</a></h1>
<h2>Kurze Texte von ${settings:author()}</h2>
<h3>
<a href="https://github.com/schipplock/tilstory" target="_blank">TILStory 0.0.8</a> |
<a href="${pageContext.request.contextPath}/rss.jsp">rss</a>
</h3>
<h1># <a href="${pageContext.request.contextPath}/">${settings:name()} Admin</a></h1>
<nav>
<ul>
<li><a href="${pageContext.request.contextPath}/">startseite</a></li>
<li><a href="${pageContext.request.contextPath}/admin.jsp">verfassen</a></li>
<li><a href="${pageContext.request.contextPath}/settings.jsp">einstellungen</a></li>
<li><a href="${pageContext.request.contextPath}/profile.jsp">profil</a></li>
<li><a href="${pageContext.request.contextPath}/admin.jsp?logoff">abmelden</a></li>
</ul>
</nav>
</header>
<nav id="menu">
<b id="menulabel">menü:</b>
<a href="${pageContext.request.contextPath}/">startseite</a> |
<a href="${pageContext.request.contextPath}/admin.jsp">verfassen</a> |
<a href="${pageContext.request.contextPath}/settings.jsp">einstellungen</a> |
<a href="${pageContext.request.contextPath}/profile.jsp">profil</a> |
<a href="${pageContext.request.contextPath}/admin.jsp?logoff">abmelden</a>
</nav>
32 changes: 17 additions & 15 deletions src/main/webapp/WEB-INF/includes/footer.jsp
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
<%@ page session="false" language="java" contentType="text/html; charset=UTF-8" trimDirectiveWhitespaces="true" %>
<%@ taglib prefix="fn" uri="jakarta.tags.functions" %>
<%@ taglib prefix="settings" uri="/WEB-INF/settings.tld" %>
<footer id="kontakt">
<h2>Impressum und ViSdP</h2>
<p>${settings:imprint()}</p>
<br />
<p>
<strong>Telefon:</strong> ${settings:phone()}<br />
<strong>E-Mail:</strong> <span class="email" id="email">${settings:reversedEmail()}</span>
</p>
<br />
<h2>Datenschutzerklärung</h2>
<p>
${settings:privacyPolicy()}
</p>
<footer>
<section id="impressum">
<h2>Impressum und ViSdP</h2>
<p>${settings:imprint()}</p>
<p>
<strong>Telefon:</strong> 0163-17(2*3)-11-18<br>
<strong>E-Mail:</strong> <span class="email" id="email">ed.kcolppihcs@saerdna</span>
</p>
</section>

<section id="datenschutz">
<h2>Datenschutzerkl&auml;rung</h2>
<p>
${settings:privacyPolicy()}
</p>
</section>
</footer>
</main>

<script>
(function() {
(() => {
document.getElementById("email").innerHTML = '<a href="mailto:' + "${settings:reversedEmail()}".split("").reverse().join("") + '">${settings:reversedEmail()}</a>'
})();
</script>
21 changes: 7 additions & 14 deletions src/main/webapp/WEB-INF/includes/header.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,13 @@
<html lang="de">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/main.css.jsp">
<link rel="apple-touch-icon" sizes="180x180" href="${pageContext.request.contextPath}/graphics/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="${pageContext.request.contextPath}/graphics/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="${pageContext.request.contextPath}/graphics/favicon-16x16.png">
<link rel="manifest" href="${pageContext.request.contextPath}/site.webmanifest">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/main.css">
<link rel="icon" href="assets/images/fav-icon/fav-icon.png">
<link rel="alternate" type="application/rss+xml" href="${pageContext.request.contextPath}/rss.jsp" />
<title>${settings:name()}</title>

<main>
<header>
<h1># <a href="${pageContext.request.contextPath}/">${settings:name()}</a></h1>
<h2>Kurze Texte von ${settings:author()}</h2>
<h3>
<a href="https://github.com/schipplock/tilstory" target="_blank">TILStory 0.0.8</a> |
<a href="${pageContext.request.contextPath}/rss.jsp">rss</a>
</h3>
</header>
<header>
<h1># <a href="${pageContext.request.contextPath}/">${settings:name()}</a>
<h2>Kurze Texte<br>von ${settings:author()}</h2>
</header>
82 changes: 45 additions & 37 deletions src/main/webapp/admin.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,24 @@
</c:if>

<jsp:include page="/WEB-INF/includes/admin/header.jsp" />
<section class="container">
<h2>Verfassen</h2>
</section>

<section id="new-post">
<section class="post">
<form method="post" action="${pageContext.request.contextPath}/post" enctype="multipart/form-data">
<input type="hidden" name="id" value="${id}" />
Überschrift:<br />
<input type="text" name="subject" value="${subject}" required /><br />
Text:<br />
<textarea name="body" rows="10" required>${body}</textarea><br />
<textarea name="body" rows="20" required>${body}</textarea><br />
<hr />
<input type="file" name="file" id="file" multiple /><br />
<c:if test="${not empty param.id and files.getRowCount() > 0}">
<table style="width:100%" class="styled-table">
<c:forEach var="file" items="${files.rows}">
<tr>
<td style="width:25px">
<td style="width:250px">
<label class="checkbox">
<input type="checkbox" name="files" value="${file.filename}" id="file_${file.filename}" title="markieren zum löschen" />
<span>löschen</span>
<span>löschen?</span>
</label>
</td>
<td>
Expand All @@ -67,9 +64,13 @@
</tr>
<tr>
<td colspan="2">
<code>
<c:set var="markdownFilePrefix" value="" />
<c:if test="${fn:endsWith(file.filename, '.jpg') or fn:endsWith(file.filename, '.jpeg') or fn:endsWith(file.filename, '.png')}">
!</c:if>[${file.filename}](&lt;${pageContext.request.contextPath}/_files/${guid}/${file.filename}&gt;)</code>
<c:set var="markdownFilePrefix" value="!" />
</c:if>
<c:set var="markdownFileText" value="${markdownFilePrefix}[${file.filename}](&lt;${pageContext.request.contextPath}/_files/${guid}/${file.filename}&gt;)" />
<input type="hidden" id="copyFileMarkdown${file.filename}" value="${markdownFileText}">
<code onclick="copyToClipboard('copyFileMarkdown${file.filename}')">${markdownFileText}</code>
</td>
</tr>
</c:forEach>
Expand All @@ -83,40 +84,47 @@
<hr />
<input type="submit" value="speichern" />
</form>
<c:if test="${not empty param.id}">
<div class="postcontent">
<h2 class="subject">${subject}</h2>
<postrenderer:render>
${body}
</postrenderer:render>
<p class="created">
Autor: ${settings:author()}, Erstellt: <fmt:formatDate value="${created}" type="both" dateStyle="short" timeStyle="short" />
<c:if test="${not empty updated}">
, aktualisiert: <fmt:formatDate value="${updated}" type="both" dateStyle="short" timeStyle="short" />
</c:if>,
<sql:query var="posthits" dataSource="postgres">
select count(guid) as hits from posthits where guid = ?::uuid
<sql:param value="${guid}" />
</sql:query>
Aufrufe: ${posthits.rows[0].hits}
</p>
</div>
</c:if>
</section>

<c:if test="${not empty param.id}">
<section class="container">
<h2>Vorschau</h2>
</section>
<section class="post">
<h1 class="subject"><a href="${pageContext.request.contextPath}/?postId=${guid}#post${guid}" target="_blank">#${id}:</a>&nbsp;${subject}</h1>
<h2 class="author">ein Beitrag von ${settings:author()}</h2>
<postrenderer:render>
${body}
</postrenderer:render>
<p class="created">Erstellt: <fmt:formatDate value="${created}" type="both" dateStyle="short" timeStyle="short" />
<c:if test="${not empty updated}">
, aktualisiert: <fmt:formatDate value="${updated}" type="both" dateStyle="short" timeStyle="short" />
</c:if>
</p>
</section>
</c:if>

<c:if test="${posts.getRowCount() > 0}">
<c:forEach var="post" items="${posts.rows}">
<section class="post postcontentless post-list" id="post${post.rows[0].guid}">
<h1 class="subject">
<c:if test="${not post.draft}"><b style="cursor:default" title="veröffentlicht, für alle sichtbar">🟢</b></c:if>
<c:if test="${post.draft}"><b style="cursor:default" title="noch nicht veröffentlicht, für niemanden sichtbar">🔴</b></c:if>
<a href="${pageContext.request.contextPath}/admin.jsp?id=${post.id}">#${post.id}:&nbsp;${post.subject}</a>
</h1>
<hr>
<section class="post-list" id="post${post.rows[0].guid}">
<c:forEach var="post" items="${posts.rows}">
<form method="post" action="${pageContext.request.contextPath}/post" enctype="multipart/form-data" onsubmit="return confirm('Den Beitrag unwiderruflich löschen?')">
<input type="hidden" name="_method" value="DELETE" />
<input type="hidden" name="id" value="${post.id}" />
<button type="submit" class="delete-button" title="l&ouml;schen">löschen</button>
</form>
</section>
</c:forEach>
<h1 class="subject">
<c:if test="${not post.draft}"><b style="cursor:default" title="veröffentlicht, für alle sichtbar">🟢</b></c:if>
<c:if test="${post.draft}"><b style="cursor:default" title="noch nicht veröffentlicht, für niemanden sichtbar">🔴</b></c:if>
<a href="${pageContext.request.contextPath}/admin.jsp?id=${post.id}">#${post.id}:&nbsp;${post.subject}</a>
</h1>
</c:forEach>
</section>
</c:if>
<jsp:include page="/WEB-INF/includes/admin/footer.jsp" />

<script>
let copyToClipboard = (id) => navigator.clipboard.writeText(document.getElementById(id).value);
</script>

<jsp:include page="/WEB-INF/includes/footer.jsp" />
Loading

0 comments on commit a7122f4

Please sign in to comment.