rebuilding-platformsh/src/views/Projects.vue

79 lines
2.2 KiB
Vue
Raw Normal View History

2019-04-23 21:47:32 +01:00
<template>
2019-04-24 10:43:01 +01:00
<div>
2019-04-28 16:16:15 +01:00
<banner>
2019-05-02 22:59:21 +01:00
<template v-slot:sub-banner>
<project-search/>
</template>
2019-04-28 16:16:15 +01:00
</banner>
2019-04-24 10:43:01 +01:00
2019-06-14 23:02:33 +01:00
<main class="max-w-6xl mx-auto p-6 xl:px-0">
2019-04-28 13:44:20 +02:00
<div class="flex justify-between items-baseline">
2019-06-14 23:02:33 +01:00
<page-title>All Projects</page-title>
2019-04-24 10:43:01 +01:00
2019-06-14 21:29:26 +01:00
<project-view-switcher @changed="projectViewSwitched" :mode="displayMode"></project-view-switcher>
2019-04-28 13:44:20 +02:00
</div>
2019-06-14 23:02:33 +01:00
<div class="mt-6">
<div v-if="displayMode == 'grid'" class="flex flex-wrap -mt-8 mb-4 -mx-4">
2019-06-15 20:44:37 +01:00
<div class="w-full px-4 mt-8 sm:w-1/2 lg:w-1/3" v-for="n in 9" :key="n">
2019-06-14 23:02:33 +01:00
<project-card></project-card>
</div>
</div>
2019-04-24 10:43:01 +01:00
</div>
2019-04-25 23:56:46 +02:00
2019-06-14 20:08:30 +01:00
<div v-if="displayMode == 'list'" class="pt-6 pb-6 mt-4 bg-white shadow-md">
2019-04-25 23:56:46 +02:00
<table class="w-full">
<thead>
<tr class="border-b border-gray-300">
2019-06-14 20:08:30 +01:00
<th class="w-1/2 pb-3 px-6 font-semibold text-left text-sm">Project name</th>
<th class="pb-3 px-6 font-semibold text-left text-sm">Owner</th>
<th class="w-1/4 pb-3 px-6 font-semibold text-left text-sm">Region</th>
2019-04-25 23:56:46 +02:00
</tr>
</thead>
<tbody>
<tr>
<td class="px-6 py-4">
<router-link :to="{ name: 'project', params: { id: 1 }}" class="font-semibold text-sm hover:underline">Drupal Bristol</router-link>
2019-04-25 23:56:46 +02:00
</td>
<td class="px-6 py-4">
<a href="#0" class="font-semibold text-sm hover:underline">accounts-partners</a>
</td>
<td class="px-6 py-4">
<a href="#0" class="font-semibold text-sm hover:underline">Europe (West 1)</a>
2019-04-25 23:56:46 +02:00
</td>
</tr>
</tbody>
</table>
</div>
2019-06-14 23:02:33 +01:00
</main>
2019-04-24 10:43:01 +01:00
</div>
2019-04-23 21:47:32 +01:00
</template>
<script>
2019-04-24 10:43:01 +01:00
import ProjectCard from '@/components/ProjectCard'
2019-04-26 00:07:02 +02:00
import ProjectSearch from '@/components/ProjectSearch'
2019-04-28 13:44:20 +02:00
import ProjectViewSwitcher from '@/components/ProjectViewSwitcher'
2019-04-23 21:47:32 +01:00
export default {
2019-04-24 10:44:26 +01:00
name: 'projects',
2019-04-25 23:56:46 +02:00
2019-04-23 21:47:32 +01:00
components: {
2019-04-26 00:07:02 +02:00
ProjectCard,
2019-04-28 13:44:20 +02:00
ProjectSearch,
ProjectViewSwitcher
2019-04-25 23:56:46 +02:00
},
data () {
return {
2019-04-28 13:44:20 +02:00
displayMode: 'grid'
}
},
methods: {
projectViewSwitched (mode) {
this.displayMode = mode
2019-04-25 23:56:46 +02:00
}
2019-04-23 21:47:32 +01:00
}
}
</script>