rebuilding-platformsh/src/views/Projects.vue

73 lines
2.1 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>
<project-search slot="sub-banner"></project-search>
</banner>
2019-04-24 10:43:01 +01:00
2019-04-25 23:56:46 +02:00
<div 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">
<page-title class="mb-6">All Projects</page-title>
2019-04-24 10:43:01 +01:00
2019-04-28 19:08:48 +01:00
<project-view-switcher @changed="projectViewSwitched" :active-mode="displayMode"></project-view-switcher>
2019-04-28 13:44:20 +02:00
</div>
<div v-if="displayMode == 'grid'" class="flex flex-wrap mt-4 -mx-4 -mb-8">
2019-04-24 10:43:01 +01:00
<project-card v-for="n in 9" :key="n"></project-card>
</div>
2019-04-25 23:56:46 +02:00
2019-04-28 13:44:20 +02:00
<div v-if="displayMode == 'list'" class="bg-white shadow-md pt-6 pb-6 mt-4">
2019-04-25 23:56:46 +02:00
<table class="w-full">
<thead>
<tr class="border-b border-gray-300">
<th class="font-semibold text-left text-sm pb-3 px-6 w-1/2">Project name</th>
<th class="font-semibold text-left text-sm pb-3 px-6">Owner</th>
<th class="font-semibold text-left text-sm pb-3 px-6 w-1/4">Region</th>
</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-04-24 10:43:01 +01:00
</div>
</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>