updated to materialize2

This commit is contained in:
marko
2023-04-22 12:06:25 +02:00
parent 293eb81714
commit f5ef53b53c
6 changed files with 76 additions and 60 deletions

View File

@@ -46,3 +46,7 @@ h3 {
h6 { h6 {
font-size: 1.1rem; font-size: 1.1rem;
} }
ul.sidenav li {
list-style-type: none;
}

View File

@@ -19,6 +19,7 @@ function initSelects() {
var selectElements = document.querySelectorAll('select'); var selectElements = document.querySelectorAll('select');
// var selectInstances = // var selectInstances =
M.FormSelect.init(selectElements, {}); M.FormSelect.init(selectElements, {});
console.log('initSelect');
} }
// Init SideNav menu // Init SideNav menu
@@ -33,7 +34,8 @@ function initModals() {
var modalElements = document.querySelectorAll('.modal'); var modalElements = document.querySelectorAll('.modal');
// var modalInstances = // var modalInstances =
M.Modal.init(modalElements, { M.Modal.init(modalElements, {
'onOpenEnd': initSelects // @todo Temporary disabled. Normally the selects need to be init after the modal shows. MaterializeCss 2 seems to change this.
// 'onOpenEnd': initSelects
}); });
}; };

View File

@@ -3,6 +3,7 @@ require_once 'events.inc.php';
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
@@ -14,7 +15,8 @@ require_once 'events.inc.php';
<script src="events.js"></script> <script src="events.js"></script>
<title><?php echo($meta['title']); ?></title> <title><?php echo($meta['title']); ?></title>
<meta name="description" content="<?php echo($meta['description']); ?>" /> <meta name="description"
content="<?php echo($meta['description']); ?>" />
<link rel="icon" href="<?echo($config['ressourceUrl']);?>/graphiken/icons/cwsv.ico" /> <link rel="icon" href="<?echo($config['ressourceUrl']);?>/graphiken/icons/cwsv.ico" />
<link rel="apple-touch-icon" href="<?echo($config['baseUrl']);?>/apple-touch-icon.png"> <link rel="apple-touch-icon" href="<?echo($config['baseUrl']);?>/apple-touch-icon.png">
@@ -43,4 +45,5 @@ require_once 'events.inc.php';
</main> </main>
<?php } ?> <?php } ?>
</body> </body>
</html> </html>

View File

@@ -150,7 +150,7 @@ class Event
. $this->getHtmlStarterList(); . $this->getHtmlStarterList();
$kids = participo::getKids(); $kids = participo::getKids();
$modal .= '<div class="row">'; $modal .= '<div class="row">';
$modal .= '<div>Deadline zum Eintragen: ' . $this->deadline->format('Y-m-d') . '</div>'; $modal .= '<div class="s12">Deadline zum Eintragen: ' . $this->deadline->format('Y-m-d') . '</div>';
$today = new DateTime(); $today = new DateTime();
if ( if (
@@ -164,6 +164,7 @@ class Event
$modal .= '<div>Es ist leider zu spät noch jemanden einzutragen!</div>'; $modal .= '<div>Es ist leider zu spät noch jemanden einzutragen!</div>';
} }
$modal .= '</div>'; $modal .= '</div>';
$modal .= $modal .=
'</div>' . // end modal-content '</div>' . // end modal-content
'<div class="modal-footer">' . '<div class="modal-footer">' .
@@ -295,8 +296,8 @@ class Event
public function getHtmlAddStarterForm($user, $options = []) public function getHtmlAddStarterForm($user, $options = [])
{ {
$defaults = [ $defaults = [
'formClass' => 'card col s12 m6 l3', 'formClass' => 's12 m6 xl3',
'inputClass' => 'input-field', 'inputClass' => 'input-field col s12',
'buttonClass' => 'btn' 'buttonClass' => 'btn'
]; ];
@@ -305,18 +306,20 @@ class Event
$returnToUrl = $options['returnToUrl'] ?? urlencode(getCurPagesUrl()); $returnToUrl = $options['returnToUrl'] ?? urlencode(getCurPagesUrl());
$key = isset($_SESSION['apiKey']) ? $_SESSION['apiKey'] : null; $key = isset($_SESSION['apiKey']) ? $_SESSION['apiKey'] : null;
$selectId = 'form-selectType-event-' . $this->id . '-user-' . $user->getId();
$form = $form =
'<form class="' . $options['formClass'] . '" action="api.starter.add.php" method="post">' '<form class="' . $options['formClass'] . '" action="api.starter.add.php" method="post">'
. '<input type="hidden" name="eventId" id="eventId" value="' . $this->id . '">' . '<input type="hidden" name="eventId" id="eventId" value="' . $this->id . '">'
. '<input type="hidden" name="userId" id="userId" value="' . $user->getId() . '">' . '<input type="hidden" name="userId" id="userId" value="' . $user->getId() . '">'
. '<input type="hidden" name="returnToUrl" id="returnToUrl" value="' . $returnToUrl . '" >' . '<input type="hidden" name="returnToUrl" id="returnToUrl" value="' . $returnToUrl . '" >'
. '<div class="input-field">' . '<div class="' . $options['inputClass'] . '">'
. '<select id="selectTypeForm" name="type">' . '<label for="' . $selectId . '">' . $user->getName() . ', ' . $user->getFirstname() . '</label>'
. '<select id="' . $selectId . '" name="type">'
. '<option value="1" selected="">als Starter</option>' . '<option value="1" selected="">als Starter</option>'
. '<option value="2">als Zuschauer</option>' . '<option value="2">als Zuschauer</option>'
. '<option value="3">keine Teilnahme</option>' . '<option value="3">keine Teilnahme</option>'
. '</select>' . '</select>'
. '<label for="selectTypeForm">' . $user->getName() . ', ' . $user->getFirstname() . '</label>'
. '</div>' . '</div>'
. '<input class="' . $options['buttonClass'] . '" type="submit" name="submit" value="eintragen">' . '<input class="' . $options['buttonClass'] . '" type="submit" name="submit" value="eintragen">'
. '</form>'; . '</form>';

View File

@@ -2,17 +2,21 @@
if ($_SESSION['login']) { if ($_SESSION['login']) {
?> ?>
<ul id="slide-out" class="sidenav"> <ul id="slide-out" class="sidenav">
<li><div class="user-view"> <li>
<div class="user-view">
<div class="background"> <div class="background">
<img src="images/office.jpg"> <img src="images/office.jpg">
</div> </div>
<a href="#user"><img class="circle" src="images/yuna.jpg"></a> <a href="#user"><img class="circle" src="images/yuna.jpg"></a>
<a href="#name"><span class="white-text name">John Doe</span></a> <a href="#name"><span class="white-text name">John Doe</span></a>
<a href="#email"><span class="white-text email">jdoe@example.com</span></a> <a href="#email"><span class="white-text email">jdoe@example.com</span></a>
</div></li> </div>
</li>
<li><a href="#!"><i class="material-icons">cloud</i>First Link With Icon</a></li> <li><a href="#!"><i class="material-icons">cloud</i>First Link With Icon</a></li>
<li><a href="#!">Second Link</a></li> <li><a href="#!">Second Link</a></li>
<li><div class="divider"></div></li> <li>
<div class="divider"></div>
</li>
<li><a class="subheader">Subheader</a></li> <li><a class="subheader">Subheader</a></li>
<li><a class="waves-effect" href="#!">Third Link With Waves</a></li> <li><a class="waves-effect" href="#!">Third Link With Waves</a></li>
</ul> </ul>