{ "version": "1.0.0", "layout_name": "board/popular", "permissions": [], "extends": "_user_base", "meta": { "seo": { "enabled": true, "page_type": "boards", "extensions": [ { "type": "module", "id": "sirsoft-board" } ], "vars": { "site_name": "$core_settings:general.site_name" }, "priority": 0.6, "changefreq": "daily", "og": { "type": "website", "title": "$t:nav.popular_posts" } } }, "data_sources": [ { "id": "popularPosts", "label_key": "$t:editor.data_source.popularPosts", "type": "api", "endpoint": "/api/modules/sirsoft-board/boards/popular", "method": "GET", "params": { "period": "{{query.period ?? 'week'}}", "limit": 20 }, "auto_fetch": true, "auth_required": false, "refetchOnMount": true, "errorHandling": { "403": { "handler": "showErrorPage", "params": { "target": "content" } } } } ], "slots": { "content": [ { "type": "layout", "name": "Container", "props": { "className": "py-8" }, "children": [ { "type": "basic", "name": "Div", "props": { "className": "mb-6" }, "children": [ { "type": "basic", "name": "H1", "props": { "className": "text-2xl font-bold text-gray-900 dark:text-white flex items-center gap-2" }, "children": [ { "type": "basic", "name": "Icon", "props": { "name": "flame", "size": "lg", "className": "text-orange-500" } }, { "type": "basic", "name": "Span", "text": "$t:board.popular.title" } ] }, { "type": "basic", "name": "P", "props": { "className": "text-gray-600 dark:text-gray-400 mt-1" }, "text": "$t:board.popular.description" } ] }, { "type": "basic", "name": "Div", "props": { "className": "flex gap-2 mb-6" }, "children": [ { "type": "basic", "name": "Button", "props": { "className": "{{(query.period ?? 'week') === 'today' ? 'px-4 py-2 bg-gray-900 dark:bg-white text-white dark:text-gray-900 rounded-lg font-medium' : 'px-4 py-2 border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700'}}" }, "children": [ { "type": "basic", "name": "Icon", "props": { "name": "clock", "size": "sm", "className": "mr-1.5 inline" } }, { "type": "basic", "name": "Span", "text": "$t:board.popular.today" } ], "actions": [ { "type": "click", "handler": "navigate", "params": { "path": "/boards/popular?period=today" } } ] }, { "type": "basic", "name": "Button", "props": { "className": "{{(query.period ?? 'week') === 'week' ? 'px-4 py-2 bg-gray-900 dark:bg-white text-white dark:text-gray-900 rounded-lg font-medium' : 'px-4 py-2 border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700'}}" }, "children": [ { "type": "basic", "name": "Icon", "props": { "name": "calendar", "size": "sm", "className": "mr-1.5 inline" } }, { "type": "basic", "name": "Span", "text": "$t:board.popular.this_week" } ], "actions": [ { "type": "click", "handler": "navigate", "params": { "path": "/boards/popular?period=week" } } ] }, { "type": "basic", "name": "Button", "props": { "className": "{{(query.period ?? 'week') === 'month' ? 'px-4 py-2 bg-gray-900 dark:bg-white text-white dark:text-gray-900 rounded-lg font-medium' : 'px-4 py-2 border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700'}}" }, "children": [ { "type": "basic", "name": "Icon", "props": { "name": "calendar", "size": "sm", "className": "mr-1.5 inline" } }, { "type": "basic", "name": "Span", "text": "$t:board.popular.this_month" } ], "actions": [ { "type": "click", "handler": "navigate", "params": { "path": "/boards/popular?period=month" } } ] }, { "type": "basic", "name": "Button", "props": { "className": "{{(query.period ?? 'week') === 'year' ? 'px-4 py-2 bg-gray-900 dark:bg-white text-white dark:text-gray-900 rounded-lg font-medium' : 'px-4 py-2 border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700'}}" }, "children": [ { "type": "basic", "name": "Icon", "props": { "name": "calendar-alt", "size": "sm", "className": "mr-1.5 inline" } }, { "type": "basic", "name": "Span", "text": "$t:board.popular.year" } ], "actions": [ { "type": "click", "handler": "navigate", "params": { "path": "/boards/popular?period=year" } } ] } ] }, { "type": "basic", "name": "Div", "blur_until_loaded": { "enabled": true, "data_sources": "popularPosts" }, "props": { "className": "bg-white dark:bg-gray-800 rounded-lg shadow divide-y divide-gray-200 dark:divide-gray-700" }, "children": [ { "partial": "partials/board/popular/_popular_list.json" } ] } ] } ] } }