Browse Source

add module menu

main
ghost 3 years ago
parent
commit
40afd61367
  1. 3
      src/application/controller/common/module/menu.php
  2. 15
      src/application/view/common/module/menu.phtml
  3. 19
      src/application/view/home.phtml
  4. 3
      src/public/js/home.js

3
src/application/controller/common/module/menu.php

@ -0,0 +1,3 @@
<?php
require(PROJECT_DIR . '/application/view/common/module/menu.phtml');

15
src/application/view/common/module/menu.phtml

@ -0,0 +1,15 @@
<div class="menu" id="moduleMenu">
<a class="item" href="/" title="<?php echo _('Home') ?>">
<i class="bi bi-house"></i>
</a><a class="item" href="follow" title="<?php echo _('Follow') ?>">
<i class="bi bi-person"></i>
</a><a class="item" href="#todo" title="<?php echo _('Bookmarks') ?>">
<i class="bi bi-bookmarks"></i>
</a><a class="item" href="#todo" title="<?php echo _('Mentions') ?>">
<i class="bi bi-at"></i>
</a><a class="item" href="#todo" title="<?php echo _('Messages') ?>">
<i class="bi bi-envelope"></i>
</a><a class="item" href="#todo" title="<?php echo _('Settings') ?>">
<i class="bi bi-gear"></i>
</a>
</div>

19
src/application/view/home.phtml

@ -1,24 +1,7 @@
<?php include(PROJECT_DIR . '/application/controller/common/header/user.php') ?> <?php include(PROJECT_DIR . '/application/controller/common/header/user.php') ?>
<div class="container"> <div class="container">
<div class="left"> <div class="left">
<div class="menu"> <?php include(PROJECT_DIR . '/application/controller/common/module/menu.php') ?>
<a class="item active" href="<?php echo PROJECT_HOST ?>" title="<?php echo _('Home') ?>">
<i class="bi bi-house"></i>
</a><a class="item" href="following" title="<?php echo _('Following') ?>">
<i class="bi bi-person"></i>
<?php if ($followingUsersTotal) { ?>
<span><?php echo $followingUsersTotal ?></span>
<?php } ?>
</a><a class="item" href="#todo" title="<?php echo _('Bookmarks') ?>">
<i class="bi bi-bookmarks"></i>
</a><a class="item" href="#todo" title="<?php echo _('Mentions') ?>">
<i class="bi bi-at"></i>
</a><a class="item" href="#todo" title="<?php echo _('Messages') ?>">
<i class="bi bi-envelope"></i>
</a><a class="item" href="#todo" title="<?php echo _('Settings') ?>">
<i class="bi bi-gear"></i>
</a>
</div>
</div> </div>
<div class="right"> <div class="right">
<div class="post"> <div class="post">

3
src/public/js/home.js

@ -120,5 +120,8 @@ var Home = {
} }
$(document).ready(function() { $(document).ready(function() {
Home.post.get('#feed', true); Home.post.get('#feed', true);
$('#moduleMenu > a[href="/"]').addClass('active');
}); });
Loading…
Cancel
Save