Skip to content

Commit 318de48

Browse files
committed
fix(frontend): nested button → span in course cards + explicit SQL column aliases
1 parent 31d946d commit 318de48

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

frontend/index.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -266,12 +266,11 @@ <h2 class="text-xl font-bold text-gray-800 mb-1">iCourse Subscriber</h2>
266266
class="w-full text-left bg-white rounded-xl shadow-sm border border-gray-100 p-4 hover:shadow-md transition-shadow active:bg-gray-50">
267267
<div class="flex items-start justify-between gap-3">
268268
<div class="min-w-0 flex items-start gap-2">
269-
<button @click.stop="toggleStar(c.course_id)"
270-
class="flex-shrink-0 mt-0.5 text-lg leading-none"
269+
<span @click.stop="toggleStar(c.course_id)"
270+
class="flex-shrink-0 mt-0.5 text-lg leading-none cursor-pointer select-none"
271271
:class="isStarred(c.course_id) ? 'text-amber-400' : 'text-gray-300 hover:text-amber-400'"
272-
:title="isStarred(c.course_id) ? '取消置顶' : '置顶'">
273-
<span x-text="isStarred(c.course_id) ? '★' : '☆'"></span>
274-
</button>
272+
:title="isStarred(c.course_id) ? '取消置顶' : '置顶'"
273+
x-text="isStarred(c.course_id) ? '★' : '☆'"></span>
275274
<div class="min-w-0">
276275
<h3 class="font-semibold text-gray-800 truncate" x-text="c.title"></h3>
277276
<p class="text-sm text-gray-500 mt-0.5" x-text="c.teacher"></p>

frontend/js/db.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ function _queryAll(sql, params) {
9696

9797
function _getCourses() {
9898
return _queryAll(`
99-
SELECT c.course_id, c.title, c.teacher,
99+
SELECT c.course_id AS course_id, c.title AS title, c.teacher AS teacher,
100100
COUNT(CASE WHEN l.summary IS NOT NULL THEN 1 END) AS summary_count,
101101
COUNT(l.sub_id) AS total_count,
102102
MAX(l.processed_at) AS last_updated

0 commit comments

Comments
 (0)