Added user profile button on nav
* Add default_profile.png file on assets * Create navmenu.js module * Load "app" on regular javascript inside template
This commit is contained in:
parent
4139c9ef74
commit
f40c9c7437
Binary file not shown.
After Width: | Height: | Size: 7.9 KiB |
|
@ -8,10 +8,14 @@
|
|||
<script type="application/javascript" src="/js/relativeTime.js"></script>
|
||||
<script type="application/javascript" src="/js/updateLocale.js"></script>
|
||||
-->
|
||||
|
||||
<link rel="stylesheet" href="/assets/fonts/fork-awesome.min.css">
|
||||
<?php tpl_styles(['normalize', 'base', 'app']) ?>
|
||||
<?php tpl_styles(['themes.'.($theme ?? DEFAULT_THEME)]) ?>
|
||||
<?php tpl_styles($styles ?? null) ?>
|
||||
|
||||
<script>var app = {};</script>
|
||||
<?php tpl_scripts(['http', 'navmenu']) ?>
|
||||
<?php tpl_scripts($scripts ?? null) ?>
|
||||
</head>
|
||||
<body class="app">
|
||||
|
@ -37,5 +41,13 @@
|
|||
"icon: search") ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($actor !== null): ?>
|
||||
<div class="flex icon button round">
|
||||
<a class="center" href="javascript:app.navmenu.show()">
|
||||
<img class="avatar round"
|
||||
src="<?php echo htmlspecialchars($actor->icon) ?>"/>
|
||||
</a>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</header>
|
||||
|
|
|
@ -6,8 +6,15 @@ module('config.app');
|
|||
|
||||
$args = urlargs(1);
|
||||
$uri = '/'.implode('/', $args);
|
||||
|
||||
$database = new DB();
|
||||
$session = session();
|
||||
$user = $database->findOne('u__users', ['_id' => $session->id_user]);
|
||||
$actor = $database->getActorByUsername($user->username);
|
||||
?>
|
||||
<?php tpl('app.header') ?>
|
||||
<?php tpl('app.header', [
|
||||
'actor' => $actor,
|
||||
]) ?>
|
||||
<main class="flex">
|
||||
<div id="app-container" class="flex center width-max">
|
||||
<div class="panel center">APP HERE</div>
|
||||
|
|
|
@ -13,6 +13,10 @@ body.app {
|
|||
top: 2px;
|
||||
}
|
||||
|
||||
img.avatar {
|
||||
width: 2.6em;
|
||||
}
|
||||
|
||||
header .component.button .fa {
|
||||
font-size: 1.3em;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
app.navmenu = {
|
||||
show: function() {
|
||||
console.log('TODO: show menu for profile');
|
||||
},
|
||||
};
|
Loading…
Reference in New Issue