2018-12-23 13:17:39 +00:00
< template >
< div >
2019-03-21 00:54:48 +00:00
< div class = "fixed top-0 w-full z-30" >
2018-12-25 23:20:12 +00:00
< navbar > < / navbar >
2018-12-23 13:17:39 +00:00
2018-12-25 23:20:12 +00:00
< title-block >
< template slot = "right" >
< header-buttons : links = " [
{ title : 'Add Application' , icon : 'alpha__new-app' , disabled : false } ,
] " > < / header-buttons >
< / template >
< / title-block >
2018-12-23 13:17:39 +00:00
< / div >
2018-12-25 23:20:12 +00:00
< div class = "mt-48" >
2019-02-08 14:32:10 +00:00
< div class = "-mt-10 md:-mt-3 flex flex-row-reverse h-full" >
2019-02-08 14:05:53 +00:00
< div class = "flex-1 p-4 lg:p-12 ml-16 lg:ml-56 overflow-x-hidden" >
2018-12-25 23:20:12 +00:00
< div class = "mb-6" >
< div class = "lg:flex lg:items-baseline mb-12" >
< div class = "mr-16 mb-4 lg:mb-0" >
2019-02-08 14:22:19 +00:00
< h1 class = "text-4xl font-thin mb-2" > Applications < / h1 >
2018-12-25 23:20:12 +00:00
< / div >
2018-12-23 13:17:39 +00:00
2018-12-25 23:30:54 +00:00
< application-display-switcher class = "hidden lg:flex-1 lg:flex lg:justify-end mr-3" :mode = "display" @display-changed ="handleDisplay" > < / application-display-switcher >
2018-12-24 08:46:33 +00:00
2018-12-25 23:20:12 +00:00
< div class = "lg:flex lg:flex-row-reverse justify-between items-baseline" >
< div class = "w-full" >
< form action = "#" >
2018-12-26 13:00:21 +00:00
< label for = "applications" class = "visuallyhidden" > Filter applications < / label >
2019-03-21 00:42:57 +00:00
< input id = "applications" type = "text" placeholder = "Filter applications" class = "w-full py-2 px-3 border border-grey-400-6 rounded" >
2018-12-25 23:20:12 +00:00
< / form >
< / div >
2018-12-23 13:17:39 +00:00
< / div >
< / div >
< / div >
2018-12-25 23:20:12 +00:00
< div class = "flex flex-wrap -mx-3 -mb-6" >
< application-card
2018-12-26 01:57:49 +00:00
v - for = "application in sortedApplications"
2018-12-25 23:20:12 +00:00
: id = "application.id"
: application = "application"
: key = "application.id"
: display = "display"
class = "px-3 w-full"
2018-12-26 13:22:23 +00:00
: class = "[display == 'grid' ? 'md:w-1/2 lg:w-1/3 xl:w-1/4 mb-6 flex flex-col' : '']"
2018-12-25 23:20:12 +00:00
> < / application-card >
< / div >
2018-12-23 13:17:39 +00:00
< / div >
2019-04-09 02:14:14 +01:00
< sidebar class = "mt-3 md:-mt-2px" : links = " [
2018-12-25 23:20:12 +00:00
{ title : 'All' , icon : 'alpha__grid' , active : true , disabled : false } ,
{ title : 'Starred' , icon : 'state__starred' , active : false , disabled : false } ,
{ title : 'Recents' , icon : 'objects__recent' , active : false , disabled : false } ,
] " > < / sidebar >
< / div >
2018-12-23 13:17:39 +00:00
< / div >
< / div >
< / template >
< script >
2019-03-14 09:05:44 +00:00
import _ from 'lodash'
2019-03-30 08:17:56 +00:00
import ApiClient from '@/api-client.js'
2018-12-26 01:26:09 +00:00
import ApplicationCard from '@/components/Application/ApplicationCard'
import ApplicationDisplaySwitcher from '@/components/Application/ApplicationDisplaySwitcher'
2018-12-23 13:17:39 +00:00
export default {
2019-03-30 08:17:56 +00:00
mixins : [ ApiClient ] ,
2018-12-23 13:17:39 +00:00
components : {
ApplicationCard ,
2019-03-30 00:09:48 +00:00
ApplicationDisplaySwitcher
2018-12-23 13:17:39 +00:00
} ,
2019-03-30 00:09:48 +00:00
data ( ) {
2018-12-23 13:17:39 +00:00
return {
2019-03-30 08:17:56 +00:00
applications : this . getApplications ( ) ,
2019-03-30 00:09:48 +00:00
display : 'grid'
2018-12-23 13:17:39 +00:00
}
} ,
2018-12-24 08:46:33 +00:00
2018-12-26 01:57:49 +00:00
computed : {
sortedApplications : function ( ) {
return _ . sortBy ( this . applications , [ function ( a ) { return a . name } ] )
}
} ,
2018-12-24 08:46:33 +00:00
methods : {
2019-03-30 00:09:48 +00:00
handleDisplay ( mode ) {
2018-12-24 08:46:33 +00:00
this . display = mode
}
}
2018-12-23 13:17:39 +00:00
}
< / script >