online version of the infoZettel
This commit is contained in:
6
homepage/participo/css/parsedownCard.css
Normal file
6
homepage/participo/css/parsedownCard.css
Normal file
@@ -0,0 +1,6 @@
|
||||
.parsedownCard h1{
|
||||
font-size: 2.0rem;
|
||||
}
|
||||
.parsedownCard h2{
|
||||
font-size: 1.75rem;
|
||||
}
|
||||
21
homepage/participo/images/info.svg
Normal file
21
homepage/participo/images/info.svg
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg viewBox="0 0 744.09447 1052.362179" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<defs>
|
||||
<linearGradient id="b">
|
||||
<stop stop-color="#1f55d1" offset="0"/>
|
||||
<stop stop-color="#c9daff" offset="1"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="a" xlink:href="#b"/>
|
||||
<radialGradient id="c" cx=".65278" cy=".67832" r="1.8433" fx=".67361" fy=".66434" xlink:href="#b"/>
|
||||
</defs>
|
||||
<path transform="translate(1.039 -1.7757)" d="m523.75 510.49a190.62 190.62 0 1 0 -381.25 0 190.62 190.62 0 1 0 381.25 0z" fill="url(#c)" fill-rule="evenodd" stroke="url(#a)" stroke-width="8"/>
|
||||
<path transform="translate(32.914 40.099)" d="m445 468.61a143.75 143.75 0 1 0 -287.5 0 143.75 143.75 0 1 0 287.5 0z" fill="#fff" fill-rule="evenodd" stroke="url(#a)" stroke-width="8"/>
|
||||
<path transform="scale(42.739 26.7)" d="m7.3966 17.236h1.0781v6.5625h-1.0781v-6.5625zm0-2.5547h1.0781v1.3594h-1.0781v-1.3594z" fill="#919191"/>
|
||||
<text transform="scale(42.739 26.7)" x="6.15463" y="23.61115" font-family="Bitstream Vera Sans" font-size="12">
|
||||
<tspan>i</tspan>
|
||||
</text>
|
||||
<path transform="scale(31.938 26.851)" d="m32.2376,17.8471c-.57544,1e-005-1.03034.22559-1.36468.67676s-.50153,1.06934-.50153,1.85449 .1662,1.40332.4986,1.85449 .78827.67676 1.36761.67676c.57153,0 1.02447-.22656 1.35883-.67969s.50152-1.07031.50153-1.85156-.16718-1.39355-.50153-1.84863-.7873-.68261-1.35883-.68262zm-.00293-.91406c.9375,1e-005 1.67382.30469 2.20898.91406s.80273,1.45313.80273,2.53125c-1e-005,1.07422-.26758,1.91699-.80273,2.52832s-1.27149.91699-2.20898.91699-1.67871-.30566-2.21191-.91699-.79981-1.4541-.7998-2.52832c0-1.07812.2666-1.92187.7998-2.53125s1.27051-.91406 2.21191-.91406zm-3.43359-2.39063v.89063h-1.02795c-.38794,1e-005-.65735.07838-.80823.23511s-.22632.43897-.22632.84668v.58227h1.78125v.84375h-1.78125v5.71875h-1.07813v-5.71875h-1.03125v-.84375h1.03125v-.4585c0-.72997.16974-1.26183.50922-1.59558s.87787-.5006 1.61517-.50061h1.01624zm-5.46094,5.14783v3.96936h-1.07813v-3.9342c0-.62011-.12171-1.08429-.36511-1.39252s-.60865-.46234-1.0957-.46234c-.58496,0-1.04633.18537-1.38409.55609s-.50666.87616-.50665,1.5163v3.71667h-1.07813v-6.5625h1.07813v1.00781c.25879-.39257.56372-.68603.91479-.88037s.75598-.2915 1.21472-.2915c.75683,1e-005 1.3294.23316 1.71771.69946s.58245,1.15223.58246,2.05774z" fill="#919191"/>
|
||||
<text transform="scale(31.938 26.851)" x="16.58452" y="23.48566" font-family="Bitstream Vera Sans" font-size="12">
|
||||
<tspan>nfo</tspan>
|
||||
</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.5 KiB |
@@ -118,6 +118,15 @@ echo(
|
||||
'actions' => [
|
||||
AppCardAction::fromArray(['caption'=>"Planer", 'link'=>"/pages/desktop/wkParticipo"]),
|
||||
],
|
||||
])->htmlCode().
|
||||
AppCard::fromArray([
|
||||
'link' => "infoZettel",
|
||||
'title' => "Infozettel",
|
||||
'description'=> "Online-Variante der Infozettel und Newsletter",
|
||||
'imgUrl' => "images/info.svg",
|
||||
'actions' => [
|
||||
AppCardAction::fromArray(['caption'=>"Info", 'link'=>"infoZettel"]),
|
||||
],
|
||||
])->htmlCode()
|
||||
);
|
||||
?>
|
||||
|
||||
104
homepage/participo/infoZettel.php
Normal file
104
homepage/participo/infoZettel.php
Normal file
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
||||
require_once("config/participo.php");
|
||||
|
||||
require_once("./local/dbConf.php");
|
||||
require_once("./local/cwsvJudo.php");
|
||||
|
||||
require_once("./lib/db.php");
|
||||
require_once("./lib/api.php");
|
||||
require_once("./lib/participoLib/participo.php");
|
||||
|
||||
require_once("./auth.php");
|
||||
|
||||
$basePath = $config['basePath'];
|
||||
require_once($basePath."/config/cwsvJudo.config.php");
|
||||
require_once($basePath."/ressourcen/phpLib/parsedown/Parsedown.php");
|
||||
require_once($basePath."/ressourcen/phpLib/Spyc/Spyc.php");
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
|
||||
<!-- MaterializeCss Ressources -->
|
||||
<!-- - Compiled and minified CSS -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@materializecss/materialize@1.1.0-alpha/dist/css/materialize.min.css">
|
||||
<!-- - Compiled and minified JavaScript -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/@materializecss/materialize@1.1.0-alpha/dist/js/materialize.min.js"></script>
|
||||
<!-- - Import Google Icon Font-->
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
|
||||
|
||||
<!-- participo specific style adjustments -->
|
||||
<link rel="stylesheet" href="css/participo.css">
|
||||
<!-- adjustments to parsedowncards (smaller headings) -->
|
||||
<link rel="stylesheet" href="css/parsedownCard.css">
|
||||
|
||||
<!-- inits for the materializeCss -->
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var elems = document.querySelectorAll('.sidenav');
|
||||
var instances = M.Sidenav.init(elems, {
|
||||
// specify options here
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<title>InfoZettel</title>
|
||||
<meta name="description" content="InfoZettel der Judoka des Chemnitzer WSV">
|
||||
|
||||
<link rel="icon" href="<?echo($config['ressourceUrl']);?>/graphiken/icons/cwsv.ico" />
|
||||
<link rel="apple-touch-icon" href="<?echo($config['baseUrl']);?>/apple-touch-icon.png">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<header>
|
||||
<nav class="indigo darken-4">cwsvJudo InfoZettel<a class="right top-nav sidenav-trigger waves-effect waves-light hide-on-large-only" href="#" data-target="nav-mobile">
|
||||
<i class="material-icons">menu</i>
|
||||
</a></nav>
|
||||
<ul class="sidenav sidenav-fixed sidenav-close" id="nav-mobile">
|
||||
<li class="logo">
|
||||
<a style="height:auto;" class="brand-logo" id="logo-container" href="/participo/">
|
||||
<img style="max-width:100%;height:12vh;" class="responsive-img" src="http://cwsvjudo.bplaced.net/ressourcen/graphiken/logos/cwsvJudoLogoWappen.x256.png" />
|
||||
</a>
|
||||
</li>
|
||||
<li><?php require_once("sidenav/loginStatus.php");?></li>
|
||||
<li class="bold">
|
||||
<a class="waves-effect waves-teal left-align" href="/participo">zurück</a>
|
||||
</li>
|
||||
<li class="bold">
|
||||
<a class="waves-effect waves-teal right-align" href="#infos">Infos</a>
|
||||
</li>
|
||||
</ul>
|
||||
</header>
|
||||
|
||||
<?php
|
||||
if($_SESSION['login']){
|
||||
?>
|
||||
<main>
|
||||
<!-- List of Infos -->
|
||||
<div class="row" id="infoList">
|
||||
<?php
|
||||
// get a list of all infoZettel
|
||||
$fileList = glob($basePath."/infoZettel/*.md");
|
||||
rsort($fileList);
|
||||
|
||||
foreach($fileList as $file){
|
||||
$infoZettel = loadMarkdownFile($file);
|
||||
echo(
|
||||
AppCard::fromArray([
|
||||
'title' => $infoZettel['yaml']['title'],
|
||||
'description'=> Parsedown::instance()->text( $infoZettel['mdText'] ),
|
||||
])->htmlCode(['extraClass'=>"parsedownCard"])
|
||||
);
|
||||
}
|
||||
?>
|
||||
</div><!-- End of Infos -->
|
||||
</main>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
@@ -69,13 +69,14 @@ class AppCard{
|
||||
*
|
||||
* @return string html code for the AppCard
|
||||
*/
|
||||
public function htmlCode(){
|
||||
public function htmlCode($options=[]){
|
||||
$extraClass = $options['extraClass'] ?? "";
|
||||
$actionListCode = "";
|
||||
foreach($this->actionList as $a){
|
||||
$actionListCode .= $a->htmlCode();
|
||||
}
|
||||
return
|
||||
"<div style=\"padding:1%;\" class=\"col s12 m6\">".
|
||||
"<div style=\"padding:1%;\" class=\"col s12 m6 ".$extraClass."\">".
|
||||
"<div style=\"margin:1%;\" class=\"card blue-grey darken-1\">".
|
||||
(($this->link!=null)?("<a href=\"".$this->appLink."\">"):(""))."<div class=\"card-content white-text\">".
|
||||
"<span class=\"card-title\">".$this->title."</span>".
|
||||
@@ -155,4 +156,53 @@ if( !empty($anRetMessage) ){
|
||||
$retHtmlString .= "</div>";
|
||||
}
|
||||
return $retHtmlString;
|
||||
}?>
|
||||
}
|
||||
|
||||
/**
|
||||
* load a MarkdownFile with yaml header
|
||||
*
|
||||
* @param string $fileName filename of the markdown file
|
||||
* @return array assocative array('yaml'=>array(..), 'mdText'=>string) containing the yamlHeader as associative array and the markdown text as string
|
||||
*/
|
||||
function loadMarkdownFile($fileName){
|
||||
// load the whole file
|
||||
$fileText = file_get_contents($fileName);
|
||||
// split at '---' to get ((),yamls,array)
|
||||
$fileParts = preg_split('/[\n]*[-]{3}[\n]/', $fileText, 3);
|
||||
// not all mdfiles have a yamlHeader, so the mdText can be at different indices
|
||||
$yaml=[];
|
||||
$mdText = "";
|
||||
switch( count($fileParts) ){
|
||||
case 1:{
|
||||
$mdText = $fileParts[0];
|
||||
break;
|
||||
}
|
||||
case 3:{
|
||||
$yaml = Spyc::YAMLLoadString($fileParts[1]);
|
||||
$mdText = $fileParts[2];
|
||||
break;
|
||||
}
|
||||
default:{
|
||||
$mdText = $fileText;
|
||||
}
|
||||
|
||||
}
|
||||
// get a title, if none is in the markdown
|
||||
if(!array_key_exists('title', $yaml)){
|
||||
// find the first heading, set it as header and remove it from the markdown
|
||||
if( preg_match("/^#(.*)$/m", $mdText, $matches) ){
|
||||
$yaml['title'] = $matches[1];
|
||||
$mdText = preg_replace("/^#(.*)$/m", "", $mdText, 1);
|
||||
}
|
||||
else{
|
||||
// fallback for the title, if not even one heading is found
|
||||
$yaml['title'] = "<fehlender Titel>";
|
||||
}
|
||||
}
|
||||
|
||||
return array(
|
||||
'yaml' => $yaml
|
||||
, 'mdText' => $mdText
|
||||
);
|
||||
}
|
||||
?>
|
||||
@@ -24,7 +24,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
|
||||
<title>Infozettel der Judoka des CWSV</title>
|
||||
<meta name="description" content="Onlineversion der Handzettel für die Judoka des Chemnitzer WSV">
|
||||
<meta name="description" content="Onlineversion der Handzettel für die Judoka des Chemnitzer WSV">
|
||||
|
||||
<link rel="icon" href="/ressourcen/graphiken/icons/cwsv.ico" />
|
||||
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
|
||||
|
||||
Reference in New Issue
Block a user