Skip to content

Commit

Permalink
Update to bulma 0.6 and remove unused things
Browse files Browse the repository at this point in the history
  • Loading branch information
lbanchio committed Dec 14, 2017
1 parent 4fd5ab8 commit d5d8922
Show file tree
Hide file tree
Showing 49 changed files with 62 additions and 4,850 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div align="center">
div align="center">
<p><img width="200" src="https://github.com/vue-bulma/vue-admin/blob/master/client/assets/[email protected]"></p>

<h1>Vue Admin</h1>
Expand Down
2 changes: 0 additions & 2 deletions client/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ export default {
@import '~bulma';
@import '~wysiwyg.css/wysiwyg.sass';
$fa-font-path: '~font-awesome/fonts/';
@import '~font-awesome/scss/font-awesome';
Expand Down
16 changes: 0 additions & 16 deletions client/app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Vue from 'vue'
import axios from 'axios'
import VueAxios from 'vue-axios'
import VueAuth from '@websanova/vue-auth'
import NProgress from 'vue-nprogress'
import { sync } from 'vuex-router-sync'
import App from './App.vue'
Expand All @@ -12,21 +11,6 @@ import { TOGGLE_SIDEBAR } from 'vuex-store/mutation-types'

Vue.router = router
Vue.use(VueAxios, axios)
Vue.use(VueAuth, {
auth: {
request: function (req, token) {
this.options.http._setHeaders.call(this, req, {Authorization: 'Bearer ' + token})
},
response: function (res) {
// Get Token from response body
return res.data
}
},
http: require('@websanova/vue-auth/drivers/http/axios.1.x.js'),
router: require('@websanova/vue-auth/drivers/router/vue-router.2.x.js'),
loginData: { url: 'http://localhost:6789/login', fetchUser: false },
refreshData: { enabled: false }
})

Vue.use(NProgress)

Expand Down
2 changes: 1 addition & 1 deletion client/components/layout/AppMain.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default {
</script>

<style lang="scss">
@import '~bulma/sass/utilities/variables';
@import '~bulma/sass/utilities/initial-variables';
@import '~bulma/sass/utilities/mixins';
.app-main {
Expand Down
15 changes: 0 additions & 15 deletions client/components/layout/Levelbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,15 @@
</h3>
</div>
<div class="level-item" v-if="!!codelink">
<tooltip label="View code" placement="right" size="small" :rounded="true">
<span class="icon">
<a :href="codelink">
<i class="fa fa-github"></i>
</a>
</span>
</tooltip>
</div>
</div>

<div class="level-right is-hidden-mobile">
<breadcrumb :list="list"></breadcrumb>
</div>
</nav>
</template>

<script>
import Breadcrumb from 'vue-bulma-breadcrumb'
import Tooltip from 'vue-bulma-tooltip'
export default {
components: {
Breadcrumb,
Tooltip
},
data () {
Expand Down
130 changes: 49 additions & 81 deletions client/components/layout/Navbar.vue
Original file line number Diff line number Diff line change
@@ -1,99 +1,67 @@
<template>
<section class="hero is-bold app-navbar animated" :class="{ slideInDown: show, slideOutDown: !show }">
<div class="hero-head">
<nav class="nav">
<div class="nav-left">
<a class="nav-item is-hidden-tablet" @click="toggleSidebar({opened: !sidebar.opened})">
<i class="fa fa-bars" aria-hidden="true" v-show="!sidebar.hidden"></i>
</a>
</div>
<div class="nav-center">
<a class="nav-item hero-brand" href="/">
<img src="~assets/logo.svg" :alt="pkginfo.description">
<tooltip :label="'v' + pkginfo.version" placement="right" type="success" size="small" :no-animate="true" :always="true" :rounded="true">
<div class="is-hidden-mobile">
<span class="vue">Vue</span><strong class="admin">Admin</strong>
</div>
</tooltip>
<nav class="navbar is-fixed-top" id="main-navbar" role="navigation" aria-label="main navigation">
<div class="navbar-brand">
<router-link :to="{name: 'dashboard'}">
<img src="~assets/logo.png" alt="" width="42" class="header-logo">
</router-link>


<button class="button navbar-burger" @click="toggleSidebar({opened: !sidebar.opened})">
<span></span>
<span></span>
<span></span>
</button>
</div>

<div class="navbar-menu">
<div class="navbar-start">
<!-- navbar items -->
</div>

<div class="navbar-end">
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link">
Usuario
</a>
<div class="navbar-dropdown is-boxed">
<hr class="navbar-divider">
<a class="navbar-item">Cerrar sesion</a>
</div>
</div>
<div class="nav-right is-flex">
<router-link v-if="!$auth.check()" to="/login" class="nav-item">Login</router-link>
<a v-if="$auth.check()" @click="logout" class="nav-item">Logout</a>
<div class="navbar-item">

</div>
</nav>
</div>
</div>
</section>
</nav>
</template>

<script>
import Tooltip from 'vue-bulma-tooltip'
import { mapGetters, mapActions } from 'vuex'
import { mapGetters, mapActions } from 'vuex'
export default {
export default {
components: {
Tooltip
},
components: {
},
props: {
show: Boolean
},
props: {
show: Boolean
},
computed: mapGetters({
pkginfo: 'pkg',
sidebar: 'sidebar'
}),
computed: mapGetters({
sidebar: 'sidebar'
}),
methods: {
...mapActions([
'toggleSidebar'
]),
logout () {
this.$auth.logout({
redirect: 'Home',
makeRequest: false
// params: {},
// success: function () {},
// error: function () {},
// etc...
})
methods: {
...mapActions([
'toggleSidebar'
])
}
}
}
</script>

<style lang="scss">
@import '~bulma/sass/utilities/variables';
.app-navbar {
position: fixed;
min-width: 100%;
z-index: 1024;
box-shadow: 0 2px 3px rgba(17, 17, 17, 0.1), 0 0 0 1px rgba(17, 17, 17, 0.1);
.container {
margin: auto 10px;
}
.nav-right {
align-items: stretch;
align-items: stretch;
flex: 1;
justify-content: flex-end;
overflow: hidden;
overflow-x: auto;
white-space: nowrap;
}
}
.hero-brand {
.vue {
margin-left: 10px;
color: #36AC70;
}
.admin {
color: #28374B;
}
}
<style lang="sass">
#main-navbar
z-index: 1024
box-shadow: 1px 1px 1px #ccc
</style>
15 changes: 2 additions & 13 deletions client/components/layout/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,17 @@
<i class="fa fa-angle-down"></i>
</span>
</a>

<expanding v-if="item.children && item.children.length">
<ul v-show="isExpanded(item)">
<li v-for="subItem in item.children" v-if="subItem.path">
<router-link :to="generatePath(item, subItem)">
{{ subItem.meta && subItem.meta.label || subItem.name }}
</router-link>
</li>
</ul>
</expanding>
</li>
</ul>
</aside>
</template>

<script>
import Expanding from 'vue-bulma-expanding'
import { mapGetters, mapActions } from 'vuex'
export default {
components: {
Expanding
},
props: {
Expand Down Expand Up @@ -133,7 +122,7 @@ export default {
</script>

<style lang="scss">
@import '~bulma/sass/utilities/variables';
@import '~bulma/sass/utilities/initial-variables';
@import '~bulma/sass/utilities/mixins';
.app-sidebar {
Expand Down
22 changes: 3 additions & 19 deletions client/router/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Vue from 'vue'
import Router from 'vue-router'
import menuModule from 'vuex-store/modules/menu'
Vue.use(Router)

export default new Router({
Expand All @@ -14,28 +13,13 @@ export default new Router({
component: require('../views/Home')
},
{
name: 'Login',
path: '/login',
component: require('../views/auth/Login')
name: 'Dashboard',
path: '/dashboard',
component: require('../views/dashboard/index.vue')
},
...generateRoutesFromMenu(menuModule.state.items),
{
path: '*',
redirect: '/'
}
]
})

// Menu should have 2 levels.
function generateRoutesFromMenu (menu = [], routes = []) {
for (let i = 0, l = menu.length; i < l; i++) {
let item = menu[i]
if (item.path) {
routes.push(item)
}
if (!item.component) {
generateRoutesFromMenu(item.children, routes)
}
}
return routes
}
47 changes: 0 additions & 47 deletions client/store/modules/menu/charts.js

This file was deleted.

Loading

0 comments on commit d5d8922

Please sign in to comment.