1
0
mirror of https://github.com/kihashi/stardew_community_checklist.git synced 2025-10-19 08:03:17 +00:00

Merge branch 'feature/#39-All-Seasons-Tab'

Closes #39.
This commit is contained in:
John Cleaver 2016-04-13 23:49:53 -04:00
commit f50eb5ea40
3 changed files with 19 additions and 1 deletions

View File

@ -1230,6 +1230,10 @@
}
],
"seasons": [
{
"id": "allseasons",
"name": "All Seasons"
},
{
"id": "spring",
"name": "Spring"

View File

@ -353,7 +353,7 @@
<h3 class="title">{{ getSeasonName(active_season) }}</h3>
<progress class="progress is-info" value="" max=""></progress>
<div class="columns is-multiline">
<template v-for="item in static.items | filterBy active_season in 'seasons'">
<template v-for="item in static.items | seasonFilter active_season">
<div class="column is-3 is-flex" v-if="!(hideCompleted && isCompleted(item))">
<div class="card is-fullwidth is-flex eq-line">
<header class="card-header">

14
main.js
View File

@ -176,3 +176,17 @@ Vue.filter('filterByArray', function(array1, array2){
}
});
});
Vue.filter('seasonFilter', function(items, season_id){
return items.filter(function(element){
if(season_id == "allseasons" && element.seasons.length > 3){
return true;
}
else if(element.seasons.length < 4 && element.seasons.indexOf(season_id) > -1){
return true;
}
else{
return false;
}
});
});