From f40c9c7437f48086ef67f2d1474e60b47b48323a Mon Sep 17 00:00:00 2001 From: Niko Date: Fri, 11 Feb 2022 15:48:39 +0100 Subject: [PATCH] Added user profile button on nav * Add default_profile.png file on assets * Create navmenu.js module * Load "app" on regular javascript inside template --- web/data/assets/images/default_profile.png | Bin 0 -> 8109 bytes web/src/_templates/app/header.php | 12 ++++++++++++ web/src/app/app.php | 9 ++++++++- web/src/app/css/app.css | 4 ++++ web/src/app/js/navmenu.js | 5 +++++ 5 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 web/data/assets/images/default_profile.png create mode 100644 web/src/app/js/navmenu.js diff --git a/web/data/assets/images/default_profile.png b/web/data/assets/images/default_profile.png new file mode 100644 index 0000000000000000000000000000000000000000..b06387ff3d77f09079f30483eff8243dda011571 GIT binary patch literal 8109 zcmch6X*kqx+yBrMk*$<9BoazdLS!dP$ToIDl9Aom*C|VrAz5RjEHjuHvNaidGDM9q zM$uTZ#bn_w)yM-r#iXFu*P3aP z2B62sCfzvIj!QHmI+>5Ae~i|F4h|H1A*xc-6Zzew~CG5iP9KVhgLR8YR#0IFt9>O*_bAtv~; zh-091Pia}^+Df75n3c827$itK&z;)zsC%*xpN><6Hd{{7JP%nhTJw|Id%6vJTQ&An zS{MykNuJxoeLlGvZaqB>QK$CERFGGPi-wY+fT>ho(K8?5b*Cz|8xDOr1R0gn-KiKIPb*U3FYnL!( zUZ!~#c-A>bkr%_5_%(SeiS^vMd-x{#HFCGZSx+Q96q?goX0I9N_*sbVx-icz9MqF% zF~D1kwmneG+R3>qGUj`r{B!TdJ%J*eqC!vL*5%6ri=NnfHBeMWC}b>e#s&XV!S)rv z&AU?xgUeM{ZINDeBNg*lnVl68w04mDMUa-l0SOa4EI+Xq8p5&eg^H@#*6G*3Es*!3THj# zi5Iky?XjlUFTzo;6wYY+5BTAO?9nA|RNf5IuT`WXz*`jit}=;bCQTB+q2JkyA!QtOis`(nR{kE#uQK98{jgLJVc}d&=*d zZbpVEeOjYdY(hrm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Iy0;1x1*^?cAMj22Mo@>^{So(pgYj` z=Dnrt>=h)zsNqLQN}ii}52jfzuNRoH%aIU)leD%2f<*G$8wVY3>tKEE3|A{6!fHo2pyP zi_mTf-& zo6i2ZUX=@yqLbtYLE`Y+_`Z2%@)O|@dqr{uSG~Y@;!M;Z)fh0p@3zB)(oOT_euyq_ zk7SkE_Fy4r^+iMN0an0z^wbYDJ2P0BC>EfP4~S^2bczN%IDLDKEeIN*5#Dv%>x zH~t8~{Vp;craz1YTw&(p%TaSdcPGcHj-7Rz(@7QG4p_SS4~)+x&#y&)j(aTT)igK? z!(0PeL46}8)s;`wLgR!@$x5bv!^Tf}{v0>x&;Q;AZ{rWq*C+jWB`_5fym2FVfP-AN z?L3Sn4zd9xmW)7EEPV#uK{DHUohIo1Y$JHkj${C_;6nl4*9gN**wF!@qoNeQ7Ysog zY>Ij3L(bP1FNan>$u+AepgK5hYSFLVA6m;`2B@qhYu;?4JAhVp)u)v;{Vyonz^>p4PliC^FZscMOu0y;le`C6HscGA0p?(w(68i-3k1^^0N%UvV`#*>P v0RQ8p|0dBt!2f&T`rjM`|6|6R`t1P3c7}W0o9(v_2>2Q5nd(+*-+})>7QMt< literal 0 HcmV?d00001 diff --git a/web/src/_templates/app/header.php b/web/src/_templates/app/header.php index b2d4855..e18cb59 100644 --- a/web/src/_templates/app/header.php +++ b/web/src/_templates/app/header.php @@ -8,10 +8,14 @@ --> + + + + @@ -37,5 +41,13 @@ "icon: search") ?> + +
+ + + +
+ diff --git a/web/src/app/app.php b/web/src/app/app.php index 6e90d2f..4159782 100644 --- a/web/src/app/app.php +++ b/web/src/app/app.php @@ -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); ?> - + $actor, +]) ?>
APP HERE
diff --git a/web/src/app/css/app.css b/web/src/app/css/app.css index 35cfe14..8678553 100644 --- a/web/src/app/css/app.css +++ b/web/src/app/css/app.css @@ -13,6 +13,10 @@ body.app { top: 2px; } +img.avatar { + width: 2.6em; +} + header .component.button .fa { font-size: 1.3em; } diff --git a/web/src/app/js/navmenu.js b/web/src/app/js/navmenu.js new file mode 100644 index 0000000..89b2c02 --- /dev/null +++ b/web/src/app/js/navmenu.js @@ -0,0 +1,5 @@ +app.navmenu = { + show: function() { + console.log('TODO: show menu for profile'); + }, +};