IEEE.org     |     IEEE Xplore Digital Library     |     IEEE Standards     |     IEEE Spectrum     |     More Sites

Commit c851e7b2 authored by Amy Rose's avatar Amy Rose
Browse files

update project API to use slug instead of PID

parent 5b95b958
Pipeline #829 passed with stage
in 3 minutes and 43 seconds
......@@ -71,6 +71,6 @@ subnav:
</div>
<!-- </Errors> -->
<script>
const MYSTIC_PID = "{{ page.mystic-pid }}";
const PROJECT_SLUG = "{{ page.slug }}";
fetch_data();
</script>
......@@ -4,7 +4,7 @@ layout: project
name: Sound Voltex
tldr: A 6-key + 2-knob game about applying effects to music
owner: dj TAKA
mystic-pid: a
slug: test1
---
## List of Services
......
......@@ -4,7 +4,7 @@ layout: project
name: beatmania IIDX
tldr: The genre-defining 7-key + turntable game
owner: L.E.D.
mystic-pid: b
slug: test2
---
## List of Services
......
......@@ -4,7 +4,7 @@ layout: project
name: pop'n music
tldr: The deceptively difficult 9-button color burger-smashing game
owner: wac
mystic-pid: c
slug: test3
---
## List of Services
......
......@@ -4,7 +4,7 @@ layout: project
name: Dance Dance Revolution
tldr: The ubiquitous 4-panel dance game that swept the world
owner: NAOKI
mystic-pid: d
slug: test4
---
## List of Services
......
......@@ -4,7 +4,7 @@ layout: project
name: jubeat
tldr: A 16-button musical whack-a-mole game on life support
owner: S-C-U
mystic-pid: e
slug: test5
---
## List of Services
......
......@@ -4,7 +4,7 @@ layout: project
name: GuitarFreaks & DrumMania
tldr: The games that Guitar Hero ripped off
owner: Yoshihiko Koezuka
mystic-pid: h
slug: test5
---
## List of Services
......
......@@ -4,10 +4,10 @@
const MYSTIC_URL = new URL("http://localhost:5000/");
const API_PREFIX = "/";
/* MYSTIC_PID set by project.html layout */
/* PROJECT_SLUG set by project.html layout */
function get_endpoint_url() {
const api_url = new URL(API_PREFIX, MYSTIC_URL);
const endpoint_url = new URL(`${MYSTIC_PID}.json`, api_url);
const endpoint_url = new URL(`${PROJECT_SLUG}.json`, api_url);
return endpoint_url;
}
......
......@@ -40,7 +40,7 @@ function handle_search(event) {
prev_search = search_text;
/* Only search if the query isn't empty */
if (search_text.length > 0) {
/* Apply search */
/* Search */
const searched_projects = PROJECTS_LIST.filter(project => {
project.search_valid = Object.entries(project)
.some(([field, value]) => {
......@@ -53,6 +53,7 @@ function handle_search(event) {
});
return project.search_valid;
});
/* Sort */
searched_projects.forEach(project => {
const scores = [];
Object.entries(SEARCHABLE_FIELDS)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment