DONE: add allowance payout trace for admin, improve UI on voting side, increase pagination number
This commit is contained in:
@@ -11,6 +11,9 @@
|
||||
<div>
|
||||
<div class="vote-section-kicker">Senarai Calon</div>
|
||||
<h4 class="vote-content-title">Pilih Calon Anda</h4>
|
||||
<p class="vote-page-hint">
|
||||
Tekan kad calon untuk melihat maklumat penuh (pendidikan & pengalaman).
|
||||
</p>
|
||||
</div>
|
||||
<div class="alert alert-warning vote-alert" role="alert">
|
||||
Anda hanya boleh memilih <b>satu (1) orang calon</b> sahaja.
|
||||
@@ -21,32 +24,35 @@
|
||||
<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>
|
||||
<th>No. Calon</th>
|
||||
<th></th>
|
||||
<th>Nama</th>
|
||||
<th>Unit</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(nominee, index) in data.nominees" v-if="nominee.position_id == position.id"
|
||||
: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 vote-nominee-photo" />
|
||||
</td>
|
||||
<td>{{ nominee.name }}</td>
|
||||
<td>{{ nominee.unit }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="panel-body vote-panel-body vote-nominee-cards-wrap">
|
||||
<div class="vote-nominee-card-list">
|
||||
<div v-for="(nominee, index) in data.nominees" v-if="nominee.position_id == position.id"
|
||||
:key="nominee.id" class="vote-nominee-card"
|
||||
:class="{ 'vote-nominee-card--selected': allSelectedNomineeIds.includes(nominee.id) }"
|
||||
@click="viewNomineeDetails(nominee)">
|
||||
<div class="vote-nominee-card__pick" @click.stop>
|
||||
<input type="checkbox" class="vote-nominee-card__checkbox" :id="'vote-nominee-' + nominee.id"
|
||||
:disabled="disabledCheckboxes[index]"
|
||||
:checked="allSelectedNomineeIds.includes(nominee.id)"
|
||||
@change="vote(position.id, nominee.id)" />
|
||||
</div>
|
||||
<img :src="createBase64ImageUrl(nominee.photo)" class="vote-nominee-card__photo" alt="" />
|
||||
<div class="vote-nominee-card__body">
|
||||
<span class="vote-nominee-card__no">#{{ nominee.no_calon }}</span>
|
||||
<div class="vote-nominee-card__name">{{ nominee.name }}</div>
|
||||
<div class="vote-nominee-card__unit">
|
||||
<span class="vote-nominee-card__label">Unit</span>
|
||||
{{ nominee.unit }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="vote-nominee-card__chev" aria-hidden="true">
|
||||
<i class="fa fa-angle-right"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!data.nominees.some(n => n.position_id == position.id)" class="vote-empty-state">
|
||||
Tiada calon untuk jawatan ini.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -97,6 +103,83 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="showNomineeModal" class="vote-nominee-modal-backdrop" @click.self="closeNomineeModal">
|
||||
<div class="modal-dialog vote-nominee-modal-dialog" role="dialog" aria-modal="true"
|
||||
aria-labelledby="vote-nominee-modal-title">
|
||||
<div class="modal-content vote-nominee-modal-content">
|
||||
<div class="modal-header vote-nominee-modal-header">
|
||||
<div>
|
||||
<h5 class="modal-title vote-nominee-modal-title" id="vote-nominee-modal-title">Maklumat
|
||||
Calon</h5>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body vote-nominee-modal-body">
|
||||
<div class="vote-nominee-photo-section">
|
||||
<div class="vote-nominee-photo-card">
|
||||
<img :src="nomineeViewed.photo" class="thumbnail vote-nominee-viewed-photo" alt="" />
|
||||
<div class="vote-nominee-photo-meta">
|
||||
<div class="vote-nominee-modal-name">{{ nomineeViewed.name }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="vote-nominee-detail-section">
|
||||
<div class="vote-nominee-summary-grid">
|
||||
<div class="vote-nominee-summary-item">
|
||||
<span class="vote-nominee-summary-label">Nama</span>
|
||||
<span class="vote-nominee-summary-value">{{ nomineeViewed.name || '-' }}</span>
|
||||
</div>
|
||||
<div class="vote-nominee-summary-item">
|
||||
<span class="vote-nominee-summary-label">No. Calon</span>
|
||||
<span class="vote-nominee-summary-value">{{ nomineeViewed.no_calon || '-' }}</span>
|
||||
</div>
|
||||
<div class="vote-nominee-summary-item">
|
||||
<span class="vote-nominee-summary-label">No. Anggota</span>
|
||||
<span class="vote-nominee-summary-value">{{ nomineeViewed.no_anggota || '-'
|
||||
}}</span>
|
||||
</div>
|
||||
<div class="vote-nominee-summary-item">
|
||||
<span class="vote-nominee-summary-label">Unit</span>
|
||||
<span class="vote-nominee-summary-value">{{ nomineeViewed.unit || '-' }}</span>
|
||||
</div>
|
||||
<div class="vote-nominee-summary-item">
|
||||
<span class="vote-nominee-summary-label">Umur</span>
|
||||
<span class="vote-nominee-summary-value">{{ nomineeViewed.umur || '-' }}</span>
|
||||
</div>
|
||||
<div class="vote-nominee-summary-item">
|
||||
<span class="vote-nominee-summary-label">Jawatan Sekarang</span>
|
||||
<span class="vote-nominee-summary-value">{{ nomineeViewed.jawatan_sekarang || '-'
|
||||
}}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="vote-nominee-section-card">
|
||||
<div class="vote-nominee-section-title">Taraf Pendidikan</div>
|
||||
<ol v-if="nomineeViewed.education && nomineeViewed.education.length"
|
||||
class="vote-nominee-detail-list">
|
||||
<li v-for="(item, idx) in nomineeViewed.education" :key="'ed-' + idx">{{ item }}
|
||||
</li>
|
||||
</ol>
|
||||
<p v-else class="vote-nominee-detail-empty">Tiada maklumat pendidikan.</p>
|
||||
</div>
|
||||
|
||||
<div class="vote-nominee-section-card">
|
||||
<div class="vote-nominee-section-title">Pengalaman Kerja</div>
|
||||
<ol v-if="nomineeViewed.experience && nomineeViewed.experience.length"
|
||||
class="vote-nominee-detail-list">
|
||||
<li v-for="(item, idx) in nomineeViewed.experience" :key="'ex-' + idx">{{ item }}
|
||||
</li>
|
||||
</ol>
|
||||
<p v-else class="vote-nominee-detail-empty">Tiada maklumat pengalaman kerja.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer vote-nominee-modal-footer">
|
||||
<button type="button" class="btn btn-success" @click="closeNomineeModal">Tutup</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade app-modal vote-confirm-modal" id="vote-modal" tabindex="-1" role="dialog"
|
||||
aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
@@ -159,7 +242,9 @@ export default {
|
||||
name: {},
|
||||
selectedNominees: {
|
||||
},
|
||||
max: 1
|
||||
max: 1,
|
||||
nomineeViewed: {},
|
||||
showNomineeModal: false
|
||||
}
|
||||
},
|
||||
|
||||
@@ -328,9 +413,14 @@ export default {
|
||||
return 'No Partylist';
|
||||
},
|
||||
|
||||
view: function (index) {
|
||||
this.x = this.data.nominees[index];
|
||||
this.util.showModal('#nominee-information-modal');
|
||||
viewNomineeDetails: function (nominee) {
|
||||
this.nomineeViewed = { ...nominee };
|
||||
this.nomineeViewed.photo = this.createBase64ImageUrl(nominee.photo);
|
||||
this.showNomineeModal = true;
|
||||
},
|
||||
|
||||
closeNomineeModal: function () {
|
||||
this.showNomineeModal = false;
|
||||
},
|
||||
|
||||
createBase64ImageUrl: function (base64ImageData) {
|
||||
@@ -425,6 +515,14 @@ export default {
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.vote-page-hint {
|
||||
margin: 8px 0 0;
|
||||
font-size: 1.35rem;
|
||||
color: #5f7388;
|
||||
line-height: 1.5;
|
||||
max-width: 520px;
|
||||
}
|
||||
|
||||
.vote-limit-pill {
|
||||
margin-bottom: 18px;
|
||||
padding: 12px 14px;
|
||||
@@ -553,54 +651,134 @@ export default {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.vote-table {
|
||||
margin-bottom: 0;
|
||||
.vote-nominee-cards-wrap {
|
||||
padding: 16px 18px 20px;
|
||||
background: #f7fafc;
|
||||
}
|
||||
|
||||
.vote-table thead {
|
||||
background: #f4f8fd;
|
||||
.vote-nominee-card-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.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;
|
||||
.vote-nominee-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 14px;
|
||||
padding: 14px 16px;
|
||||
border-radius: 16px;
|
||||
border: 1px solid #e6edf5;
|
||||
background: #fff;
|
||||
cursor: pointer;
|
||||
transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
|
||||
}
|
||||
|
||||
.vote-nominee-photo {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
margin-bottom: 0;
|
||||
.vote-nominee-card:hover {
|
||||
border-color: #b8d4f5;
|
||||
box-shadow: 0 8px 22px rgba(47, 128, 237, 0.12);
|
||||
}
|
||||
|
||||
.vote-nominee-card--selected {
|
||||
border-color: #2f80ed;
|
||||
box-shadow: 0 0 0 2px rgba(47, 128, 237, 0.28);
|
||||
background: #f5f9ff;
|
||||
}
|
||||
|
||||
.vote-nominee-card__pick {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
align-self: stretch;
|
||||
padding-right: 4px;
|
||||
}
|
||||
|
||||
.vote-nominee-card__checkbox {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
cursor: pointer;
|
||||
vertical-align: middle;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.vote-nominee-card__pick .vote-nominee-card__checkbox:disabled {
|
||||
cursor: not-allowed;
|
||||
opacity: 0.55;
|
||||
}
|
||||
|
||||
.vote-nominee-card__photo {
|
||||
flex-shrink: 0;
|
||||
width: 72px;
|
||||
height: 72px;
|
||||
margin: 0;
|
||||
border-radius: 16px;
|
||||
border: 2px solid #dbe8ff;
|
||||
object-fit: cover;
|
||||
box-shadow: 0 8px 18px rgba(47, 128, 237, 0.12);
|
||||
}
|
||||
|
||||
.vote-nominee-card__body {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.vote-nominee-card__no {
|
||||
display: inline-block;
|
||||
margin-bottom: 4px;
|
||||
padding: 3px 10px;
|
||||
border-radius: 999px;
|
||||
background: #dcecff;
|
||||
color: #1e5fbf;
|
||||
font-size: 1.2rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.vote-nominee-card__name {
|
||||
font-size: 1.65rem;
|
||||
font-weight: 700;
|
||||
color: #17324d;
|
||||
line-height: 1.35;
|
||||
margin-bottom: 6px;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.vote-nominee-card__unit {
|
||||
font-size: 1.35rem;
|
||||
color: #48627e;
|
||||
line-height: 1.45;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.vote-nominee-card__label {
|
||||
display: block;
|
||||
font-size: 1.1rem;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.04em;
|
||||
color: #8a9caf;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.vote-nominee-card__chev {
|
||||
flex-shrink: 0;
|
||||
color: #b0c4de;
|
||||
font-size: 2rem;
|
||||
line-height: 1;
|
||||
width: 24px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.vote-empty-state {
|
||||
padding: 22px 16px;
|
||||
text-align: center;
|
||||
color: #6f8193;
|
||||
font-size: 1.4rem;
|
||||
border-radius: 14px;
|
||||
border: 1px dashed #cfddec;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.vote-modal-content {
|
||||
border: 0;
|
||||
border-radius: 18px;
|
||||
@@ -671,9 +849,26 @@ export default {
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
/* Keep Unit visible on mobile; hide photo column instead */
|
||||
.vote-table thead th:nth-child(3),
|
||||
.vote-table tbody td:nth-child(3) {
|
||||
.vote-nominee-cards-wrap {
|
||||
padding: 12px 12px 16px;
|
||||
}
|
||||
|
||||
.vote-nominee-card {
|
||||
gap: 12px;
|
||||
padding: 12px 14px;
|
||||
}
|
||||
|
||||
.vote-nominee-card__photo {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
border-radius: 14px;
|
||||
}
|
||||
|
||||
.vote-nominee-card__name {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.vote-nominee-card__chev {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -723,4 +918,188 @@ export default {
|
||||
box-shadow: 0 12px 24px rgba(40, 167, 69, 0.24);
|
||||
}
|
||||
}
|
||||
|
||||
/* Nominee detail overlay — above voter/index navbar (.floating-header z-index 2000) */
|
||||
.vote-nominee-modal-backdrop {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 2500;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 24px 16px;
|
||||
background: rgba(7, 25, 48, 0.72);
|
||||
backdrop-filter: blur(3px);
|
||||
}
|
||||
|
||||
.vote-nominee-modal-dialog {
|
||||
width: 100%;
|
||||
max-width: 960px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.vote-nominee-modal-content {
|
||||
border: 0;
|
||||
border-radius: 20px;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
|
||||
}
|
||||
|
||||
.vote-nominee-modal-header {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
padding: 20px 24px 16px;
|
||||
border-bottom: 1px solid #e7edf5;
|
||||
background: linear-gradient(135deg, #0d6efd, #2f80ed);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.vote-nominee-modal-title {
|
||||
margin: 4px 0 0;
|
||||
font-size: 2.2rem;
|
||||
font-weight: 700;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.vote-nominee-modal-body {
|
||||
display: flex;
|
||||
gap: 24px;
|
||||
padding: 24px;
|
||||
background: #f5f8fc;
|
||||
}
|
||||
|
||||
.vote-nominee-photo-section {
|
||||
flex: 0 0 300px;
|
||||
}
|
||||
|
||||
.vote-nominee-photo-card {
|
||||
padding: 18px;
|
||||
border-radius: 18px;
|
||||
background: #fff;
|
||||
border: 1px solid #e5ebf3;
|
||||
box-shadow: 0 10px 24px rgba(35, 64, 97, 0.08);
|
||||
}
|
||||
|
||||
.vote-nominee-viewed-photo {
|
||||
width: 100%;
|
||||
height: 320px;
|
||||
object-fit: contain;
|
||||
object-position: center;
|
||||
border: 0;
|
||||
border-radius: 14px;
|
||||
margin: 0 0 16px;
|
||||
background: #eef3f8;
|
||||
}
|
||||
|
||||
.vote-nominee-photo-meta {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.vote-nominee-modal-name {
|
||||
font-size: 2rem;
|
||||
font-weight: 700;
|
||||
color: #17324d;
|
||||
}
|
||||
|
||||
.vote-nominee-detail-section {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.vote-nominee-summary-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 14px;
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
|
||||
.vote-nominee-summary-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
padding: 14px 16px;
|
||||
border-radius: 14px;
|
||||
background: #fff;
|
||||
border: 1px solid #e5ebf3;
|
||||
box-shadow: 0 8px 22px rgba(35, 64, 97, 0.06);
|
||||
}
|
||||
|
||||
.vote-nominee-summary-label {
|
||||
font-size: 1.2rem;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.04em;
|
||||
color: #6f8193;
|
||||
}
|
||||
|
||||
.vote-nominee-summary-value {
|
||||
font-size: 1.6rem;
|
||||
font-weight: 600;
|
||||
line-height: 1.4;
|
||||
color: #17324d;
|
||||
}
|
||||
|
||||
.vote-nominee-section-card {
|
||||
margin-bottom: 16px;
|
||||
padding: 18px 20px;
|
||||
border-radius: 16px;
|
||||
background: #fff;
|
||||
border: 1px solid #e5ebf3;
|
||||
box-shadow: 0 8px 22px rgba(35, 64, 97, 0.06);
|
||||
}
|
||||
|
||||
.vote-nominee-section-title {
|
||||
margin-bottom: 12px;
|
||||
font-size: 1.5rem;
|
||||
font-weight: 700;
|
||||
color: #17324d;
|
||||
}
|
||||
|
||||
.vote-nominee-detail-list {
|
||||
margin: 0;
|
||||
padding-left: 20px;
|
||||
color: #30475f;
|
||||
}
|
||||
|
||||
.vote-nominee-detail-list li {
|
||||
margin-bottom: 8px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.vote-nominee-detail-empty {
|
||||
margin: 0;
|
||||
color: #6f8193;
|
||||
}
|
||||
|
||||
.vote-nominee-modal-footer {
|
||||
padding: 16px 24px 22px;
|
||||
border-top: 1px solid #e7edf5;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.vote-nominee-modal-backdrop {
|
||||
align-items: flex-start;
|
||||
overflow-y: auto;
|
||||
padding: 16px 10px;
|
||||
}
|
||||
|
||||
.vote-nominee-modal-body {
|
||||
flex-direction: column;
|
||||
padding: 18px;
|
||||
}
|
||||
|
||||
.vote-nominee-photo-section {
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
|
||||
.vote-nominee-viewed-photo {
|
||||
height: 260px;
|
||||
}
|
||||
|
||||
.vote-nominee-summary-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user