This commit is contained in:
Oliver Davies 2018-12-26 01:21:54 +00:00
parent 864529e950
commit 85b70fd33f
8 changed files with 0 additions and 0 deletions

View file

@ -0,0 +1,72 @@
<template>
<div>
<div v-if="display == 'grid'" class="bg-white p-4 border-grey rounded border flex-1">
<div class="flex flex-col h-full justify-between">
<div class="flex mb-12 justify-between">
<div>
<div>
<router-link :to="{name: 'environments', params: {id: id}}" class="text-blue-dark no-underline hover:underline focus:underline"><h2 class="mb-1">{{ application.name }}</h2></router-link>
</div>
<div>
<a href="#0" class="text-blue-dark no-underline hover:underline focus:underline">{{ application.environments['prod'].url }}</a>
</div>
</div>
<div class="ml-2">
<button type="button" @click="starred = !starred" class="focus:outline-none" :class="[starred ? 'text-orange hover:text-orange-light focus:text-orange-light' : 'text-grey focus:text-orange hover:text-orange']">
<svg class="h-6 w-6 fill-current" role="presentation"><use :xlink:href="`/img/icons.symbol.svg#state__${starred ? 'starred' : 'unstarred'}`"></use></svg>
</button>
</div>
</div>
<application-tags :type="application.type" :level="application.level"></application-tags>
</div>
</div>
<div v-if="display == 'list'" class="bg-white p-3 border-grey border-b">
<div class="-mx-2">
<div class="flex flex-row-reverse items-center justify-between">
<div class="flex flex-1 justify-between items-center -mx-2">
<div class="flex-1 px-2">
<router-link :to="{name: 'environments', params: {id: id}}" class="text-blue-dark no-underline hover:underline focus:underline"><h2 class="text-base font-normal mb-1">{{ application.name }}</h2></router-link>
</div>
<application-tags :type="application.type" :level="application.level" class="w-1/4 px-2"></application-tags>
<div class="w-2/5 px-2">
<a href="#0" class="text-blue-dark no-underline hover:underline focus:underline">{{ application.environments['prod'].url }}</a>
</div>
</div>
<div class="px-2">
<button type="button" @click="starred = !starred" class="focus:outline-none" :class="[starred ? 'text-orange hover:text-orange-light focus:text-orange-light' : 'text-grey focus:text-orange hover:text-orange']">
<svg class="h-6 w-6 fill-current" role="presentation"><use :xlink:href="`/img/icons.symbol.svg#state__${starred ? 'starred' : 'unstarred'}`"></use></svg>
</button>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import ApplicationTags from '@/components/ApplicationTags'
export default {
components: {
ApplicationTags,
},
props: {
application: Object,
display: String,
id: Number,
},
data() {
return {
starred: false,
}
}
}
</script>

View file

@ -0,0 +1,23 @@
<template>
<div>
<div class="bg-grey-lightest rounded overflow-hidden">
<button type="button" class="p-2 focus:outline-none" :class="[mode == 'grid' ? 'bg-blue-light text-white' : 'text-grey-darkest']" @click="$emit('display-changed', 'grid')">
<svg class="h-5 w-5 fill-current" role="presentation"><use xlink:href="/img/icons.symbol.svg#actions__grid"></use></svg>
<span class="visuallyhidden">Grid</span>
</button>
<button type="button" class="p-2 focus:outline-none" :class="[mode == 'list' ? 'bg-blue-light text-white' : 'text-grey-darkest']" @click="$emit('display-changed', 'list')">
<svg class="h-5 w-5 fill-current" role="presentation"><use xlink:href="/img/icons.symbol.svg#actions__list"></use></svg>
<span class="visuallyhidden">List</span>
</button>
</div>
</div>
</template>
<script>
export default {
props: {
mode: String,
},
}
</script>

View file

@ -0,0 +1,17 @@
<template>
<div>
<ul class="list-reset flex flex-wrap -mr-2 -mb-2">
<li class="text-2xs uppercase py-1 px-2 rounded border border-transparent bg-blue-light text-white mr-2 mb-2">{{ type }}</li>
<li class="text-2xs uppercase py-1 px-2 rounded border border-grey bg-white mr-2 mb-2">{{ level }}</li>
</ul>
</div>
</template>
<script>
export default {
props: {
level: String,
type: String,
},
}
</script>