forked from misterGF/CoPilot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request misterGF#75 from Namoshek/refactor-dash-into-compo…
…nents Refactors common code into own components
- Loading branch information
Showing
16 changed files
with
641 additions
and
264 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<template> | ||
<footer class="main-footer"> | ||
<strong>Copyright © {{ year }} | ||
<a href="javascript:;">CoPilot</a>.</strong> All rights reserved. | ||
</footer> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'DashFooter', | ||
data: function () { | ||
return { | ||
year: new Date().getFullYear() | ||
} | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<template> | ||
<header class="main-header"> | ||
<span class="logo-mini"> | ||
<a href="/"><img src="/static/img/copilot-logo-white.svg" alt="Logo" class="img-responsive center-block logo"></a> | ||
</span> | ||
<!-- Header Navbar --> | ||
<nav class="navbar navbar-static-top" role="navigation"> | ||
<!-- Sidebar toggle button--> | ||
<a href="javascript:;" class="sidebar-toggle" data-toggle="offcanvas" role="button"> | ||
<span class="sr-only">Toggle navigation</span> | ||
</a> | ||
|
||
<!-- Navbar Right Menu --> | ||
<div class="navbar-custom-menu"> | ||
<ul class="nav navbar-nav"> | ||
<messages-menu></messages-menu> | ||
<notifications-menu></notifications-menu> | ||
<tasks-menu></tasks-menu> | ||
<user-menu :user="user"></user-menu> | ||
</ul> | ||
</div> | ||
</nav> | ||
</header> | ||
</template> | ||
|
||
<script> | ||
import { mapState } from 'vuex' | ||
import MessagesMenu from './MessagesMenu' | ||
import NotificationsMenu from './NotificationsMenu' | ||
import TasksMenu from './TasksMenu' | ||
import UserMenu from './UserMenu' | ||
export default { | ||
name: 'DashHeader', | ||
components: { | ||
MessagesMenu, | ||
NotificationsMenu, | ||
TasksMenu, | ||
UserMenu | ||
}, | ||
props: ['user'], | ||
computed: { | ||
...mapState([ | ||
'userInfo' | ||
]) | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<template> | ||
<li> | ||
<a href="javascript:;"> | ||
<h4> | ||
<span>{{message.title}}</span> | ||
<small> | ||
<i class="fa fa-clock-o"></i> | ||
<span>{{message.createdAt}}</span> | ||
</small> | ||
</h4> | ||
<p>{{message.body}}</p> | ||
</a> | ||
</li> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'MessageItem', | ||
props: ['message'] | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.navbar-nav > .messages-menu > .dropdown-menu > li .menu > li > a > h4, | ||
.navbar-nav > .messages-menu > .dropdown-menu > li .menu > li > a > p { | ||
margin-left: 0; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<template> | ||
<li class="dropdown messages-menu"> | ||
<a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown"> | ||
<i class="fa fa-envelope-o"></i> | ||
<span class="label label-success">{{ userInfo.messages | count }}</span> | ||
</a> | ||
<ul class="dropdown-menu"> | ||
<li class="header">You have {{ userInfo.messages | count }} message(s)</li> | ||
<li v-if="userInfo.messages.length > 0"> | ||
<!-- inner menu: contains the messages --> | ||
<ul class="menu"> | ||
<message-item v-for="message in userInfo.messages" | ||
:key="message.id" | ||
:message="message"></message-item> | ||
</ul> | ||
<!-- /.menu --> | ||
</li> | ||
<li class="footer" v-if="userInfo.messages.length > 0"> | ||
<a href="javascript:;">See All Messages</a> | ||
</li> | ||
</ul> | ||
</li> | ||
</template> | ||
|
||
<script> | ||
import { mapState } from 'vuex' | ||
import MessageItem from './MessageItem' | ||
export default { | ||
name: 'MessagesMenu', | ||
components: { | ||
MessageItem | ||
}, | ||
computed: { | ||
...mapState([ | ||
'userInfo' | ||
]) | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<template> | ||
<li class="notification-item"> | ||
<a href="javascript:;"> | ||
<h4> | ||
<span>{{ notification.title }}</span> | ||
<small class="time pull-right"> | ||
<i class="fa fa-clock-o"></i> | ||
<span>{{ notification.createdAt }}</span> | ||
</small> | ||
</h4> | ||
<p>{{ notification.body }}</p> | ||
</a> | ||
</li> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: { | ||
notification: { | ||
type: Object, | ||
required: true | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.navbar-custom-menu > .navbar-nav > li.notifications-menu > .dropdown-menu > li > ul.menu { | ||
li > a > h4, | ||
li > a > p { | ||
margin: 0; | ||
white-space: normal; | ||
word-break: break-word; | ||
} | ||
li > a > h4 { | ||
font-size: 15px; | ||
small { | ||
font-size: 10px; | ||
} | ||
} | ||
li > a > p { | ||
font-size: 12px; | ||
} | ||
li > a > h4 > span { | ||
display: inline-block; | ||
} | ||
li > a > h4 > small.time { | ||
margin-top: 3px; | ||
} | ||
} | ||
</style> |
Oops, something went wrong.