You've already forked isop-mirror
feat: add page for listing companies for students
This commit is contained in:
74
frontend/app/pages/dashboard/student/companies.vue
Normal file
74
frontend/app/pages/dashboard/student/companies.vue
Normal file
@@ -0,0 +1,74 @@
|
||||
<script setup lang="ts">
|
||||
import type { CompanyData } from '~/types/company_data';
|
||||
|
||||
definePageMeta({
|
||||
middleware: ['sanctum:auth', 'student-only'],
|
||||
});
|
||||
|
||||
useSeoMeta({
|
||||
title: "Partnerské firmy | ISOP",
|
||||
ogTitle: "Partnerské firmy",
|
||||
description: "Partnerské firmy ISOP",
|
||||
ogDescription: "Partnerské firmy",
|
||||
});
|
||||
|
||||
const headers = [
|
||||
{ title: 'Názov', key: 'name', align: 'left' },
|
||||
{ title: 'IČO', key: 'ico', align: 'left' },
|
||||
{ title: 'Kontaktná osoba', key: 'contact_name', align: 'left' },
|
||||
{ title: 'Telefón', key: 'phone', align: 'middle' },
|
||||
{ title: 'E-mail', key: 'email', align: 'middle' },
|
||||
{ title: 'Prijímajú študentov', key: 'hiring', align: 'middle' },
|
||||
];
|
||||
|
||||
const { data, error } = await useSanctumFetch<CompanyData[]>('/api/companies/simple');
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<v-container fluid>
|
||||
<v-card id="page-container-card">
|
||||
<h1>Partnerské firmy</h1>
|
||||
<hr />
|
||||
|
||||
<!-- spacer -->
|
||||
<div style="height: 40px;"></div>
|
||||
|
||||
<!-- Chybová hláška -->
|
||||
<v-alert v-if="error" density="compact" :text="error?.message" title="Chyba" type="error"
|
||||
id="login-error-alert" class="mx-auto alert"></v-alert>
|
||||
|
||||
<div v-else>
|
||||
<p>Aktuálne spolupracujeme s {{ data?.length }} firmami.</p>
|
||||
|
||||
<br />
|
||||
|
||||
<v-table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th v-for="header in headers" :class="'text-' + header.align">
|
||||
<strong>{{ header.title }}</strong>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="item in data">
|
||||
<td>{{ item.name }}</td>
|
||||
<td>{{ item.ico }}</td>
|
||||
<td>{{ item.contact.name }}</td>
|
||||
<td>{{ item.contact.phone }}</td>
|
||||
<td>{{ item.contact.email }}</td>
|
||||
<td>{{ item.hiring ? "Áno" : "Nie" }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</v-table>
|
||||
</div>
|
||||
</v-card>
|
||||
</v-container>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
#page-container-card {
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user