Skip to content

Commit

Permalink
feat: better layout for the Company settings page (#633)
Browse files Browse the repository at this point in the history
  • Loading branch information
djaiss committed Mar 16, 2021
1 parent c82ab3c commit 535e958
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 33 deletions.
2 changes: 1 addition & 1 deletion app/Http/ViewHelpers/Adminland/AdminGeneralViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static function information($company): ?array
$administratorsCollection->push([
'id' => $employee->id,
'name' => $employee->name,
'avatar' => AvatarHelper::getImage($employee),
'avatar' => AvatarHelper::getImage($employee, 22),
'url_view' => route('employees.show', [
'company' => $company,
'employee' => $employee,
Expand Down
7 changes: 7 additions & 0 deletions resources/js/Pages/Adminland/General/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
{{ $t('account.general_title') }}
</h2>

<!-- stats -->
<stat
:information="information"
/>

<!-- company name -->
<name
:information="information"
Expand All @@ -46,12 +51,14 @@
import Layout from '@/Shared/Layout';
import Name from '@/Pages/Adminland/General/Partials/Name';
import Currency from '@/Pages/Adminland/General/Partials/Currency';
import Stat from '@/Pages/Adminland/General/Partials/Stat';
export default {
components: {
Layout,
Name,
Currency,
Stat
},
props: {
Expand Down
32 changes: 0 additions & 32 deletions resources/js/Pages/Adminland/General/Partials/Name.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,12 @@

<template>
<div class="bb bb-gray">
<h3 class="ph3 fw5">
{{ $t('account.general_information') }}

<help :url="$page.props.help_links.account_general_company_name" :datacy="'help-icon-general'" :top="'2px'" />
</h3>

<!-- information about the company -->
<ul v-if="!editMode" class="list ph3">
<li class="mb3 flex-ns items-start">
<span class="dib-ns db title mb0-ns mb2">{{ $t('account.general_name') }}</span>
<span class="fw6" data-cy="company-name">{{ updatedName }}</span>
</li>
<li class="mb3 flex-ns items-start">
<span class="dib-ns db mb0-ns mb2 title">{{ $t('account.general_administrators') }}</span>
<ul class="dib list pl0">
<li v-for="admin in information.administrators" :key="admin.id" class="db pb2 admin">
<small-name-and-avatar
:name="admin.name"
:avatar="admin.avatar"
:classes="'f4 fw4'"
:top="'0px'"
:margin-between-name-avatar="'29px'"
/>
</li>
</ul>
</li>
<li class="mb4">
<span class="dib-ns db mb0-ns mb2 title">{{ $t('account.general_creation_date') }}</span>
<span class="fw6">{{ information.creation_date }}</span>
</li>
<li class="mb4">
<span class="dib-ns db mb0-ns mb2 title">{{ $t('account.general_creation_size') }}</span>
<span class="fw6">{{ $t('account.general_creation_size_kb', { size: information.total_size }) }}</span>
</li>
</ul>

<div v-if="!editMode" class="ph3 mb3">
Expand Down Expand Up @@ -97,16 +69,12 @@
import Errors from '@/Shared/Errors';
import LoadingButton from '@/Shared/LoadingButton';
import TextInput from '@/Shared/TextInput';
import SmallNameAndAvatar from '@/Shared/SmallNameAndAvatar';
import Help from '@/Shared/Help';
export default {
components: {
Errors,
Help,
LoadingButton,
TextInput,
SmallNameAndAvatar,
},
props: {
Expand Down
64 changes: 64 additions & 0 deletions resources/js/Pages/Adminland/General/Partials/Stat.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<style lang="scss" scoped>
.title {
min-width: 240px;
}
.admin:not(:last-child) {
margin-bottom: 0;
}
</style>

<template>
<div class="bb bb-gray">
<h3 class="ph3 fw5">
{{ $t('account.general_information') }}

<help :url="$page.props.help_links.account_general_company_name" :datacy="'help-icon-general'" :top="'2px'" />
</h3>

<!-- information about the company -->
<ul class="list ph3">
<li class="mb3 flex-ns items-start">
<span class="dib-ns db mb0-ns mb2 title">{{ $t('account.general_administrators') }}</span>
<ul class="dib list pl0">
<li v-for="admin in information.administrators" :key="admin.id" class="db pb2 admin">
<small-name-and-avatar
:name="admin.name"
:avatar="admin.avatar"
:classes="'f4 fw4'"
:top="'0px'"
:margin-between-name-avatar="'29px'"
/>
</li>
</ul>
</li>
<li class="mb3">
<span class="dib-ns db mb0-ns mb2 title">{{ $t('account.general_creation_date') }}</span>
<span class="fw6">{{ information.creation_date }}</span>
</li>
<li class="mb4">
<span class="dib-ns db mb0-ns mb2 title">{{ $t('account.general_creation_size') }}</span>
<span class="fw6">{{ $t('account.general_creation_size_kb', { size: information.total_size }) }}</span>
</li>
</ul>
</div>
</template>

<script>
import Help from '@/Shared/Help';
import SmallNameAndAvatar from '@/Shared/SmallNameAndAvatar';
export default {
components: {
Help,
SmallNameAndAvatar
},
props: {
information: {
type: Object,
default: null,
},
},
};
</script>

0 comments on commit 535e958

Please sign in to comment.