Bu bölümün görüntülenmesi poll.tpl
dosyasında yapılandırılabilir. Yayınlanan makale için oylama görüntüsü bu bölümde yapılandırılır.
Temel Oylama Etiketleri
Koşullu Etiketler
Örnek Kullanımlar
Basit Oylama Şablonu
<div class="poll-container">
<div class="poll-title">{title}</div>
<div class="poll-question">{question}</div>
[not-voted]
<form method="post" name="vote">
<div class="poll-answers">
{list}
</div>
<button type="submit" name="vote" class="poll-button">Oyunu Kullan</button>
</form>
[/not-voted]
[voted]
<div class="poll-results">
{list}
</div>
<div class="poll-total">Toplam {votes} oy kullanılmıştır.</div>
[/voted]
[closed]
<div class="poll-closed-notice">
Bu anket şu tarihte kapanmıştır: {close-date}
</div>
[/closed]
</div>
Gelişmiş Grafik Görünümlü Oylama Şablonu
<div class="advanced-poll">
<h3 class="poll-heading">
<i class="fas fa-chart-bar"></i> {title}
[closed]<span class="poll-status closed">Kapandı</span>[/closed]
[not-closed]<span class="poll-status active">Aktif</span>[/not-closed]
</h3>
<div class="poll-body">
<div class="poll-question">{question}</div>
[not-voted]
[not-closed]
<form method="post" name="vote" class="poll-form">
<div class="poll-options">
{list}
</div>
<div class="poll-controls">
<button type="submit" name="vote" class="btn btn-primary"><i class="fas fa-check-circle"></i> Oyla</button>
<button type="button" name="results" class="btn btn-outline-secondary results-btn" onclick="showResults(); return false;"><i class="fas fa-poll"></i> Sonuçlar</button>
</div>
</form>
[/not-closed]
[closed]
<div class="poll-closed-info">
<div class="alert alert-info">
<i class="fas fa-lock"></i> Bu anket oylamaya kapatılmıştır. ({close-date})
</div>
</div>
[/closed]
[/not-voted]
[voted]
<div class="poll-results-container">
<div class="results-header">
<span><i class="fas fa-chart-pie"></i> Anket Sonuçları</span>
<span class="total-votes">Toplam: {votes} oy</span>
</div>
<div class="results-body">
{list}
</div>
[not-closed]
<div class="results-note">Zaten oy kullandınız. Anket hala devam ediyor.</div>
[/not-closed]
[closed]
<div class="results-note closed">Bu anket {close-date} tarihinde kapanmıştır.</div>
[/closed]
</div>
[/voted]
</div>
<div class="poll-footer">
<div class="poll-info">
[not-voted][not-closed]<span><i class="fas fa-info-circle"></i> Oy kullandıktan sonra sonuçları göreceksiniz.</span>[/not-closed][/not-voted]
<span class="poll-date">{votes} oy kullanılmıştır</span>
</div>
</div>
</div>
<script>
function showResults() {
// Bu fonksiyon normalde gerçek zamanlı olarak anket sonuçlarını gösterir
// Burada basit bir şekilde sadece alert gösterelim
alert('Sonuçları görmek için lütfen oy kullanın.');
}
</script>
<style>
.advanced-poll {
border: 1px solid #eee;
border-radius: 8px;
overflow: hidden;
background-color: #fff;
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
margin-bottom: 20px;
}
.poll-heading {
background-color: #f8f9fa;
padding: 15px;
margin: 0;
border-bottom: 1px solid #eee;
font-size: 1.1rem;
display: flex;
justify-content: space-between;
align-items: center;
}
.poll-status {
font-size: 0.75rem;
padding: 3px 8px;
border-radius: 12px;
font-weight: normal;
}
.poll-status.active {
background-color: #28a745;
color: white;
}
.poll-status.closed {
background-color: #dc3545;
color: white;
}
.poll-body {
padding: 15px;
}
.poll-question {
font-size: 1.1rem;
margin-bottom: 15px;
font-weight: 500;
color: #333;
}
.poll-options {
margin-bottom: 15px;
}
.poll-controls {
display: flex;
gap: 10px;
}
.btn {
padding: 8px 16px;
border-radius: 4px;
cursor: pointer;
font-size: 14px;
display: inline-flex;
align-items: center;
gap: 5px;
}
.btn-primary {
background-color: #007bff;
color: white;
border: none;
}
.btn-outline-secondary {
background-color: white;
color: #6c757d;
border: 1px solid #6c757d;
}
.results-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 15px;
font-weight: 500;
}
.total-votes {
font-size: 0.9rem;
color: #6c757d;
}
.results-note {
margin-top: 15px;
padding: 10px;
background-color: #f8f9fa;
border-left: 3px solid #007bff;
font-size: 0.9rem;
}
.results-note.closed {
border-left-color: #dc3545;
}
.poll-footer {
background-color: #f8f9fa;
padding: 10px 15px;
border-top: 1px solid #eee;
font-size: 0.85rem;
color: #6c757d;
}
.poll-info {
display: flex;
justify-content: space-between;
}
.poll-closed-info {
margin: 10px 0;
}
.alert-info {
background-color: #d1ecf1;
color: #0c5460;
padding: 10px 15px;
border-radius: 4px;
display: flex;
align-items: center;
gap: 8px;
}
/* Bu kısım şablona özel olacaktır - oy seçenekleri listesi için */
.poll-result-item {
margin-bottom: 10px;
}
.poll-option-text {
margin-bottom: 5px;
}
.progress {
height: 20px;
background-color: #e9ecef;
border-radius: 4px;
overflow: hidden;
position: relative;
}
.progress-bar {
height: 100%;
background-color: #007bff;
color: white;
text-align: right;
padding-right: 5px;
display: flex;
align-items: center;
justify-content: flex-end;
}
.poll-percent {
font-weight: bold;
}
</style>
Mobil Uyumlu Oylama Şablonu
<div class="mobile-poll">
<div class="poll-header">
<h3>{title}</h3>
[closed]<div class="poll-badge closed">Anket Kapalı</div>[/closed]
</div>
<div class="poll-content">
<div class="poll-question">{question}</div>
[not-voted]
[not-closed]
<form method="post" name="vote">
<div class="poll-options-list">
{list}
</div>
<button type="submit" name="vote" class="vote-button">Oyunu Gönder</button>
</form>
[/not-closed]
[closed]
<div class="poll-closed-message">
Bu anket artık oy vermeye kapalıdır.
<span class="close-date">Kapanış tarihi: {close-date}</span>
</div>
<div class="poll-results-view">
{list}
</div>
[/closed]
[/not-voted]
[voted]
<div class="poll-voted-message">
<div class="icon-check">✓</div>
<div class="message">Oyunuz kaydedilmiştir!</div>
</div>
<div class="poll-results-view">
{list}
</div>
[/voted]
</div>
<div class="poll-footer">
<div class="poll-stats">
<div class="total-votes">Toplam Oy: <strong>{votes}</strong></div>
[closed]<div class="poll-closed-date">{close-date} tarihinde kapandı</div>[/closed]
</div>
</div>
</div>
<style>
.mobile-poll {
border-radius: 8px;
overflow: hidden;
background-color: #fff;
margin: 15px 0;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.poll-header {
background-color: #f5f7fa;
padding: 12px 15px;
border-bottom: 1px solid #e1e4e8;
position: relative;
}
.poll-header h3 {
margin: 0;
font-size: 16px;
color: #333;
padding-right: 80px;
}
.poll-badge {
position: absolute;
top: 12px;
right: 15px;
font-size: 12px;
padding: 3px 8px;
border-radius: 30px;
font-weight: 500;
}
.poll-badge.closed {
background-color: #ffecec;
color: #e74c3c;
}
.poll-content {
padding: 15px;
}
.poll-question {
font-weight: 500;
margin-bottom: 15px;
color: #333;
font-size: 15px;
}
.poll-options-list {
margin-bottom: 15px;
}
/* Bu kısmı şablona göre özel olarak uyarlayabilirsiniz */
.poll-option {
margin-bottom: 10px;
display: flex;
align-items: center;
}
.poll-option input[type="radio"] {
margin-right: 10px;
}
.vote-button {
width: 100%;
background-color: #3498db;
border: none;
color: white;
padding: 12px;
border-radius: 6px;
font-weight: 500;
font-size: 15px;
}
.poll-closed-message {
background-color: #fff4f4;
padding: 12px;
border-radius: 5px;
border-left: 3px solid #e74c3c;
margin-bottom: 15px;
font-size: 14px;
color: #c0392b;
}
.close-date {
display: block;
margin-top: 5px;
font-size: 12px;
color: #7f8c8d;
}
.poll-results-view {
margin-top: 15px;
}
.poll-voted-message {
display: flex;
align-items: center;
background-color: #eafaf1;
padding: 12px;
border-radius: 5px;
margin-bottom: 15px;
}
.icon-check {
width: 24px;
height: 24px;
background-color: #2ecc71;
border-radius: 50%;
color: white;
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
margin-right: 10px;
}
.poll-footer {
background-color: #f5f7fa;
padding: 12px 15px;
border-top: 1px solid #e1e4e8;
font-size: 13px;
color: #7f8c8d;
}
.poll-stats {
display: flex;
justify-content: space-between;
}
/* Sonuç çubukları için stil */
.poll-result {
margin-bottom: 12px;
}
.result-text {
display: flex;
justify-content: space-between;
margin-bottom: 5px;
font-size: 14px;
}
.result-percent {
font-weight: 500;
color: #2c3e50;
}
.result-bar-container {
height: 8px;
background-color: #ecf0f1;
border-radius: 4px;
overflow: hidden;
}
.result-bar {
height: 100%;
background-color: #3498db;
border-radius: 4px;
}
</style>