@@ -1168,6 +1168,15 @@ def get_context_data(self, **kwargs):
11681168 ("math" , "Math & Numerics" ),
11691169 ("networking" , "Networking" ),
11701170 ]
1171+ context ["demo_combo_multi_tags" ] = [
1172+ ("algorithms" , "Algorithms" ),
1173+ ("containers" , "Containers" ),
1174+ ("io" , "I/O" ),
1175+ ("math" , "Math & Numerics" ),
1176+ ("networking" , "Networking" ),
1177+ ("testing" , "Testing" ),
1178+ ("concurrency" , "Concurrency" ),
1179+ ]
11711180 badge_img = f"{ settings .STATIC_URL } img/v3/badges"
11721181 context ["badge_icon_srcs" ] = [
11731182 f"{ badge_img } /badge-first-place.png" ,
@@ -1211,6 +1220,17 @@ def get_context_data(self, **kwargs):
12111220
12121221 context ["demo_badges_few" ] = context ["demo_badges" ][:3 ]
12131222
1223+ context ["post_filter_options" ] = [
1224+ {"label" : "All" , "value" : "all" },
1225+ {"label" : "News" , "value" : "news" },
1226+ {"label" : "Blog" , "value" : "blog" },
1227+ {"label" : "Links" , "value" : "links" },
1228+ {"label" : "Videos" , "value" : "videos" },
1229+ {"label" : "Discussions" , "value" : "discussions" },
1230+ {"label" : "Achievements" , "value" : "achievements" },
1231+ {"label" : "Issues" , "value" : "issues" },
1232+ ]
1233+
12141234 context ["demo_posts" ] = [
12151235 {
12161236 "title" : "A talk by Richard Thomson at the Utah C++ Programmers Group" ,
@@ -1266,6 +1286,94 @@ def get_context_data(self, **kwargs):
12661286 "flag_emoji" : "🇺🇸" ,
12671287 }
12681288
1289+ cpp_options = [
1290+ ("all" , "All" ),
1291+ ("cpp03" , "C++03" ),
1292+ ("cpp11" , "C++11" ),
1293+ ("cpp14" , "C++14" ),
1294+ ("cpp17" , "C++17" ),
1295+ ("cpp20" , "C++20" ),
1296+ ("cpp23" , "C++23" ),
1297+ ]
1298+ context ["library_filter_fields" ] = [
1299+ {
1300+ "type" : "dropdown" ,
1301+ "name" : "view" ,
1302+ "label" : "View" ,
1303+ "options" : [
1304+ ("list" , "List" ),
1305+ ("grid" , "Grid" ),
1306+ ("category" , "Category" ),
1307+ ("grading" , "Grading" ),
1308+ ],
1309+ "selected" : "list" ,
1310+ "width" : "narrow" ,
1311+ },
1312+ {
1313+ "type" : "dropdown" ,
1314+ "name" : "grading" ,
1315+ "label" : "Grading" ,
1316+ "options" : [
1317+ ("all" , "All" ),
1318+ ("flagship" , "Flagship" ),
1319+ ("core" , "Core" ),
1320+ ("deprecated" , "Deprecated" ),
1321+ ("legacy" , "Legacy" ),
1322+ ],
1323+ "selected" : "all" ,
1324+ "width" : "wide" ,
1325+ },
1326+ {
1327+ "type" : "dropdown" ,
1328+ "name" : "min_cpp" ,
1329+ "label" : "Min. C++ Version" ,
1330+ "options" : cpp_options ,
1331+ "selected" : "all" ,
1332+ "width" : "narrow" ,
1333+ },
1334+ {
1335+ "type" : "dropdown" ,
1336+ "name" : "max_cpp" ,
1337+ "label" : "Max. C++ Version" ,
1338+ "options" : cpp_options ,
1339+ "selected" : "all" ,
1340+ "width" : "narrow" ,
1341+ },
1342+ {
1343+ "type" : "combo_multi" ,
1344+ "name" : "category" ,
1345+ "label" : "Category" ,
1346+ "options" : [
1347+ ("algorithms" , "Algorithms" ),
1348+ ("asynchronous" , "Asynchronous" ),
1349+ ("awaitables" , "Awaitables" ),
1350+ ("containers" , "Containers" ),
1351+ ("coroutines" , "Coroutines" ),
1352+ ("correctness" , "Correctness" ),
1353+ # More dummy data to show scrollbar
1354+ ("data_processing" , "Data processing" ),
1355+ ("debugging" , "Debugging" ),
1356+ ("file_systems" , "File systems" ),
1357+ ("formatting" , "Formatting" ),
1358+ ("graphics" , "Graphics" ),
1359+ ],
1360+ "width" : "wide" ,
1361+ "placeholder" : "Search" ,
1362+ },
1363+ {
1364+ "type" : "dropdown" ,
1365+ "name" : "sort" ,
1366+ "label" : "Sort by" ,
1367+ "options" : [
1368+ ("alphabetical" , "Alphabetical" ),
1369+ ("popular" , "Most Popular" ),
1370+ ("updated" , "Recently Updated" ),
1371+ ("release" , "Release Date" ),
1372+ ],
1373+ "selected" : "alphabetical" ,
1374+ },
1375+ ]
1376+
12691377 context ["create_account_card_preview_url" ] = (
12701378 f"{ settings .STATIC_URL } img/checker.png"
12711379 )
0 commit comments