Skip to content

Commit

Permalink
[Module][User] Adding navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
eResnova authored and michaelbilcot committed Jun 25, 2020
1 parent 5b57ba7 commit 3b64dd0
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 42 deletions.
99 changes: 60 additions & 39 deletions modules/user/controllers/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,31 +153,33 @@ public function account($sessions)

public function profile()
{
return $this->title('Profil')
->icon('fas fa-pencil-alt')
->breadcrumb()
->row()
->append($this ->col()
->size('col-7')
->append($this ->form2('profile', $this->user->profile())
->panel()
)
->append($this ->form2('profile_socials', $this->user->profile())
->panel()
->title('Liens', 'fas fa-globe')
)
)
->append($this ->col()
->size('col-5')
->append($this ->form2('avatar', $this->user->profile())
->panel()
->title('Avatar', 'fas fa-user-circle')
)
->append($this ->form2('cover', $this->user->profile())
->panel()
->title('Photo de couverture', 'far fa-image')
)
);
$this ->title('Profil')
->icon('fas fa-pencil-alt')
->breadcrumb();

return $this->_layout(function($row){
$row->append($this ->col()
->size('col-12 col-lg-7')
->append($this ->form2('profile', $this->user->profile())
->panel()
)
->append($this ->form2('profile_socials', $this->user->profile())
->panel()
->title('Liens', 'fas fa-globe')
)
)
->append($this ->col()
->size('col-12 col-lg-5')
->append($this ->form2('avatar', $this->user->profile())
->panel()
->title('Avatar', 'fas fa-user-circle')
)
->append($this ->form2('cover', $this->user->profile())
->panel()
->title('Photo de couverture', 'far fa-image')
)
);
});
}

public function sessions($sessions)
Expand Down Expand Up @@ -300,15 +302,20 @@ public function _messages($messages, $allow_delete = FALSE, $page_title, $page_i
->js('jquery.mCustomScrollbar.min')
->js('user');

return $this->panel()
->body($this->view('messages', [
'page_title' => $page_title,
'page_icon' => $page_icon,
'messages' => $messages,
'allow_delete' => $allow_delete,
'box' => $box
]), FALSE)
->style('card-group border-0');
return $this->_layout(function($row) use ($messages, $allow_delete, $page_title, $page_icon, $box){
$row->append($this ->col()
->append($this ->panel()
->body($this->view('messages', [
'page_title' => $page_title,
'page_icon' => $page_icon,
'messages' => $messages,
'allow_delete' => $allow_delete,
'box' => $box
]), FALSE)
->style('card-group border-0')
)
);
});
}

public function _messages_inbox($messages)
Expand Down Expand Up @@ -417,9 +424,14 @@ public function _messages_compose($username)
}
}

return $this->panel()
->heading()
->body($this->form()->display());
return $this->_layout(function($row){
$row->append($this ->col()
->append($this ->panel()
->heading()
->body($this->form()->display())
)
);
});
}

public function _messages_delete($message_id, $title)
Expand Down Expand Up @@ -476,7 +488,7 @@ public function _panel_profile(&$user_profile = NULL)
->size('col-4 col-lg-3');
}

public function _panel_navigation()
public function _panel_navigation($output = 'vertical')
{
$navigation = [
'panel' => TRUE,
Expand Down Expand Up @@ -514,7 +526,7 @@ public function _panel_navigation()
]
];

return $this->widget('navigation')->output('vertical', $navigation);
return $this->widget('navigation')->output($output, $navigation);
}

public function _panel_infos($user = NULL)
Expand Down Expand Up @@ -567,4 +579,13 @@ private function _panel_activities($user_id = NULL)
'user_activity' => $user_activity
]));
}

private function _layout($callback)
{
$callback($row = $this->row());

return $this->array()
->append($this->row($this->col($this->_panel_navigation('index'))))
->append($row);
}
}
44 changes: 42 additions & 2 deletions themes/azuro/css/sass/bootstrap/_nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,22 @@ ul.nav {
transition: all .15s ease-in-out;

&:hover {
background-color: rgba(0, 0, 0, .1);
background-color: rgba(0, 0, 0, .05);
color: $primary;

i.icon {
color: $text-dark-gray;
}
}

&.active {
background-color: rgba(0, 0, 0, .1);
background-color: rgba(0, 0, 0, .05);
color: $secondary;
}

> i.icon {
color: $text-light-gray;
transition: all .15s ease-in-out;
}
}

Expand All @@ -105,6 +110,41 @@ ul.nav {
}
}

.module {
ul.nav {
> li.nav-item {
> a.nav-link {
background-color: transparent;
color: #212537;
font-size: 14px;
font-family: "Titillium Web", sans-serif;
font-weight: 600;
padding: 1rem;
transition: all .15s ease-in-out;

&:hover {
background-color: rgba(0, 0, 0, .05);
color: $primary;

i.icon {
color: $text-dark-gray;
}
}

&.active {
background-color: rgba(0, 0, 0, .05);
color: $secondary;
}

> i.icon {
color: $text-light-gray;
transition: all .15s ease-in-out;
}
}
}
}
}

.list-group {
> .list-group-item {
> a {
Expand Down
Loading

0 comments on commit 3b64dd0

Please sign in to comment.