DONE: enhance UI on admin and voter side, add docker config, fix delete button modal not showing

This commit is contained in:
ISMAIL MASSERAN
2026-04-02 11:59:56 +08:00
parent bed56792e6
commit 4369b079cb
31 changed files with 3044 additions and 1216 deletions
@@ -1,37 +1,51 @@
<template>
<div class="row col-md-10 col-md-offset-1">
<div class="col-md-4">
<h4>UNDIAN CALON ANGGOTA LEMBAGA</h4>
<hr />
<ul class="list-group">
<li class="list-group-item" v-for="position in data.positions">
<b>{{ position.name }} : </b>
</li>
<ul class="list-group">
<li class="list-group-item" v-for="nominee_id in selected[0].nominee_id">
<b> - [{{ getNomineeNo(nominee_id) }}] {{ getSelectedNomineeName(nominee_id) }}</b>
<div class="vote-page row col-md-10 col-md-offset-1">
<div class="col-md-4 vote-sidebar-column">
<div class="vote-summary-card">
<div class="vote-section-kicker">Ringkasan Undian</div>
<h4 class="vote-page-title">UNDIAN CALON ANGGOTA LEMBAGA</h4>
<p class="vote-page-subtitle">Semak calon yang telah dipilih sebelum menghantar undi anda.</p>
<div class="vote-limit-pill">
Anda hanya boleh memilih <b>satu (1) orang calon</b> sahaja.
</div>
<ul class="list-group vote-summary-list">
<li class="list-group-item vote-summary-item">
<div class="vote-position-name">Calon Dipilih</div>
<div v-if="selected[0] && selected[0].nominee_id.length" class="vote-selected-list">
<div class="vote-selected-item" v-for="nominee_id in selected[0].nominee_id" :key="nominee_id">
<span class="vote-selected-badge">#{{ getNomineeNo(nominee_id) }}</span>
<span>{{ getSelectedNomineeName(nominee_id) }}</span>
</div>
</div>
<div v-else class="vote-empty-selection">
Belum ada calon dipilih.
</div>
</li>
<li class="list-group-item vote-summary-action">
<button class="btn btn-success btn-block vote-submit-button" @click="checkUndi()">UNDI</button>
</li>
</ul>
<li class="list-group-item">
<center>
<button class="btn btn-success" @click="checkUndi()">UNDI</button>
<!-- <button class="btn btn-default" @click="reset()">Reset</button> -->
</center>
</li>
</ul>
</div>
<div class="col-md-8">
<h4>Senarai Calon</h4>
<div class="alert alert-warning " role="alert">
Anda hanya boleh memilih <b> satu (1) orang calon</b> sahaja.
</div>
<hr />
<div class="panel panel-info" v-for="position in data.positions">
<div class="panel-heading">{{ position.name }}</div>
<div class="panel-body table-responsive">
<table class="table table-hover">
</div>
<div class="col-md-8 vote-content-column">
<div class="vote-content-header">
<div>
<div class="vote-section-kicker">Senarai Calon</div>
<h4 class="vote-content-title">Pilih Calon Anda</h4>
</div>
<div class="alert alert-warning vote-alert" role="alert">
Anda hanya boleh memilih <b>satu (1) orang calon</b> sahaja.
</div>
</div>
<div class="panel panel-info vote-panel" v-for="position in data.positions" :key="position.id">
<div class="panel-heading vote-panel-heading">
<span>{{ position.name }}</span>
<span class="vote-panel-badge">Calon Aktif</span>
</div>
<div class="panel-body table-responsive vote-panel-body">
<table class="table table-hover vote-table">
<thead>
<tr>
<th></th>
@@ -43,13 +57,12 @@
</thead>
<tbody>
<tr v-for="(nominee, index) in data.nominees" v-if="nominee.position_id == position.id"
:key="nominee.id">
<td><input type="checkbox" :id="nominee.id" :disabled="disabledCheckboxes[index]"
:key="nominee.id" class="vote-row">
<td class="vote-checkbox-cell"><input type="checkbox" :id="nominee.id" :disabled="disabledCheckboxes[index]"
@change="vote(position.id, nominee.id)" />
</td>
<td>{{ nominee.no_calon }}</td>
<td><img @click="view(i)" :src="createBase64ImageUrl(nominee.photo)" class="thumbnail"
style="height: 60px;width: 60px;" />
<td><img @click="view(i)" :src="createBase64ImageUrl(nominee.photo)" class="thumbnail vote-nominee-photo" />
</td>
<td>{{ nominee.name }}</td>
<td>{{ nominee.unit }}</td>
@@ -60,20 +73,30 @@
</div>
</div>
<div class="modal" id="vote-modal" tabindex="-2" role="dialog" aria-labelledby="exampleModalLabel"
<div class="modal vote-confirm-modal" id="vote-modal" tabindex="-2" role="dialog" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel"></h5>
<div class="modal-content vote-modal-content">
<div class="modal-header vote-modal-header">
<div>
<div class="vote-section-kicker">Pengesahan</div>
<h5 class="modal-title vote-modal-title" id="exampleModalLabel">Sahkan Undian Anda</h5>
</div>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<h5>Nota: Sila pastikan anda telah membuat undian dengan betul.</h5>
<div class="modal-body vote-modal-body">
<h5 class="vote-modal-note">Nota: Sila pastikan anda telah membuat undian dengan betul.</h5>
<div class="vote-modal-selection" v-if="selected[0] && selected[0].nominee_id.length">
<div class="vote-modal-selection-title">Calon dipilih</div>
<div class="vote-selected-item" v-for="nominee_id in selected[0].nominee_id" :key="nominee_id">
<span class="vote-selected-badge">#{{ getNomineeNo(nominee_id) }}</span>
<span>{{ getSelectedNomineeName(nominee_id) }}</span>
</div>
</div>
</div>
<div class="modal-footer">
<div class="modal-footer vote-modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
<button type="button" class="btn btn-primary" @click="submit()">Hantar</button>
</div>
@@ -261,3 +284,299 @@ export default {
}
}
</script>
<style scoped>
.vote-page {
margin-top: 18px;
margin-bottom: 36px;
}
.vote-sidebar-column,
.vote-content-column {
margin-bottom: 24px;
}
.vote-summary-card {
padding: 22px 20px;
border-radius: 20px;
background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
border: 1px solid #e2ebf5;
box-shadow: 0 16px 34px rgba(35, 64, 97, 0.08);
position: sticky;
top: 120px;
}
.vote-section-kicker {
margin-bottom: 8px;
color: #2f80ed;
font-size: 1.2rem;
font-weight: 700;
letter-spacing: 0.08em;
text-transform: uppercase;
}
.vote-page-title,
.vote-content-title {
margin: 0 0 8px;
color: #17324d;
font-weight: 700;
}
.vote-page-subtitle {
margin-bottom: 16px;
color: #5f7388;
line-height: 1.6;
}
.vote-limit-pill {
margin-bottom: 18px;
padding: 12px 14px;
border-radius: 12px;
background: #eef5ff;
border: 1px solid #d7e7ff;
color: #31506f;
line-height: 1.6;
}
.vote-summary-list {
margin-bottom: 0;
}
.vote-summary-item,
.vote-summary-action {
border: 0;
border-bottom: 1px solid #edf2f7;
padding: 14px 0;
background: transparent;
}
.vote-summary-list .vote-summary-item:last-of-type {
border-bottom: 1px solid #edf2f7;
}
.vote-position-name {
margin-bottom: 10px;
color: #17324d;
font-size: 1.5rem;
font-weight: 700;
}
.vote-selected-list {
display: flex;
flex-direction: column;
gap: 10px;
}
.vote-selected-item {
display: flex;
align-items: center;
gap: 10px;
padding: 10px 12px;
border-radius: 12px;
background: #fff;
border: 1px solid #e6edf5;
color: #30475f;
}
.vote-selected-badge {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 48px;
padding: 5px 10px;
border-radius: 999px;
background: #dcecff;
color: #1e5fbf;
font-size: 1.2rem;
font-weight: 700;
}
.vote-empty-selection {
color: #7a8ea3;
font-style: italic;
}
.vote-summary-action {
padding-top: 18px;
border-bottom: 0;
}
.vote-submit-button {
padding-top: 12px;
padding-bottom: 12px;
border-radius: 12px;
font-weight: 700;
letter-spacing: 0.04em;
box-shadow: 0 12px 24px rgba(40, 167, 69, 0.24);
}
.vote-content-header {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 18px;
margin-bottom: 18px;
}
.vote-alert {
margin-bottom: 0;
border-radius: 12px;
box-shadow: 0 10px 24px rgba(255, 193, 7, 0.15);
}
.vote-panel {
margin-bottom: 20px;
border: 0;
border-radius: 18px;
overflow: hidden;
box-shadow: 0 16px 34px rgba(35, 64, 97, 0.1);
}
.vote-panel-heading {
display: flex;
align-items: center;
justify-content: space-between;
padding: 16px 20px;
background: linear-gradient(135deg, #1d4e89, #2f80ed);
color: #fff !important;
font-size: 1.7rem;
font-weight: 700;
}
.vote-panel-badge {
padding: 6px 10px;
border-radius: 999px;
background: rgba(255, 255, 255, 0.18);
font-size: 1.2rem;
font-weight: 600;
}
.vote-panel-body {
padding: 0;
background: #fff;
}
.vote-table {
margin-bottom: 0;
}
.vote-table thead {
background: #f4f8fd;
}
.vote-table thead th {
border-bottom: 1px solid #dce7f5;
color: #48627e;
font-size: 1.25rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.03em;
}
.vote-table tbody td {
vertical-align: middle;
border-top: 1px solid #edf2f7;
color: #22384f;
}
.vote-row {
transition: background-color 0.18s ease, box-shadow 0.18s ease;
}
.vote-row:hover {
background: #f8fbff;
box-shadow: inset 4px 0 0 #2f80ed;
}
.vote-checkbox-cell input[type="checkbox"] {
width: 18px;
height: 18px;
cursor: pointer;
}
.vote-nominee-photo {
width: 64px;
height: 64px;
margin-bottom: 0;
border-radius: 16px;
border: 2px solid #dbe8ff;
object-fit: cover;
box-shadow: 0 8px 18px rgba(47, 128, 237, 0.12);
}
.vote-modal-content {
border: 0;
border-radius: 18px;
overflow: hidden;
box-shadow: 0 18px 40px rgba(0, 0, 0, 0.2);
}
.vote-modal-header {
padding: 18px 22px;
background: linear-gradient(135deg, #0d6efd, #2f80ed);
color: #fff;
}
.vote-modal-title {
margin: 4px 0 0;
font-size: 2rem;
font-weight: 700;
}
.vote-modal-header .close {
color: #fff;
opacity: 0.9;
text-shadow: none;
}
.vote-modal-body {
padding: 22px;
background: #f7fbff;
}
.vote-modal-note {
margin-top: 0;
margin-bottom: 14px;
color: #17324d;
}
.vote-modal-selection-title {
margin-bottom: 10px;
font-size: 1.4rem;
font-weight: 700;
color: #17324d;
}
.vote-modal-footer {
padding: 16px 22px 20px;
background: #fff;
}
@media (max-width: 991px) {
.vote-summary-card {
position: static;
top: auto;
}
.vote-content-header {
flex-direction: column;
}
}
@media (max-width: 767px) {
.vote-page {
margin-top: 8px;
}
.vote-panel-heading {
flex-direction: column;
align-items: flex-start;
gap: 8px;
}
.vote-table thead th:nth-child(5),
.vote-table tbody td:nth-child(5) {
display: none;
}
}
</style>