Merge pull request #4 from ok2/codex/hide-idea-input-on-decision
Add decided badge to idea cards
This commit is contained in:
commit
046e84e996
26
index.html
26
index.html
@ -233,12 +233,24 @@
|
||||
border-radius: 15px;
|
||||
padding: 20px;
|
||||
transition: all 0.3s ease;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.idea-card.decided {
|
||||
background: rgba(0, 255, 0, 0.1);
|
||||
border-color: rgba(0, 255, 0, 0.4);
|
||||
}
|
||||
.idea-card.decided:hover {
|
||||
background: rgba(0, 255, 0, 0.1);
|
||||
border-color: rgba(0, 255, 0, 0.4);
|
||||
}
|
||||
|
||||
.decided-badge {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.idea-card h3 {
|
||||
margin-bottom: 20px; /* pushes the next form‐group down */
|
||||
@ -537,7 +549,7 @@
|
||||
<div id="tourInfo" class="tour-info"></div>
|
||||
|
||||
<!-- Add Idea Section -->
|
||||
<div class="glass-card">
|
||||
<div id="addIdeaCard" class="glass-card">
|
||||
<h3>Add New Idea</h3>
|
||||
<form id="addIdeaForm">
|
||||
<div class="form-group">
|
||||
@ -806,6 +818,8 @@
|
||||
|
||||
// Render ideas
|
||||
function renderIdeas() {
|
||||
const decidedIdea = currentTour.ideas.find(i => i.decided);
|
||||
document.getElementById("addIdeaCard").classList.toggle("hidden", !!decidedIdea);
|
||||
sortIdeasByVotes();
|
||||
if (currentView === 'cards') {
|
||||
renderCardsView();
|
||||
@ -824,6 +838,7 @@
|
||||
const card = document.createElement('div');
|
||||
card.className = 'idea-card';
|
||||
if (idea.decided) card.classList.add('decided');
|
||||
const badgeHTML = idea.decided ? '<span class="decided-badge">✅</span>' : '';
|
||||
|
||||
let timeBadge = "";
|
||||
if (idea.start_time && idea.end_time) {
|
||||
@ -866,10 +881,11 @@
|
||||
timeBadge = `<span class="date-badge">🕒 Ends ${e}</span>`;
|
||||
}
|
||||
|
||||
card.innerHTML = `
|
||||
<h3 class="idea-title">${idea.name}</h3>
|
||||
${timeBadge}
|
||||
<p class="idea-description" style="margin-top: 8px;">${linkify(idea.description)}</p>
|
||||
card.innerHTML = `
|
||||
${badgeHTML}
|
||||
<h3 class="idea-title">${idea.name}</h3>
|
||||
${timeBadge}
|
||||
<p class="idea-description" style="margin-top: 8px;">${linkify(idea.description)}</p>
|
||||
<div class="vote-section">
|
||||
<span class="vote-count">👍 ${idea.voters.length} votes</span>
|
||||
${decidedIdea ? '' : `<button class="btn btn-secondary btn-small" onclick="voteForIdea('${idea.id}')">Vote</button>`}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user