mirror of
https://github.com/kihashi/stardew_community_checklist.git
synced 2025-10-19 08:03:17 +00:00
commit
2b22192238
20
index.html
20
index.html
@ -51,7 +51,7 @@
|
|||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<p>{{ item.source }}</p>
|
<p>{{ item.source }}</p>
|
||||||
<div class="button-area">
|
<div class="button-area">
|
||||||
<button v-for="bundle_id in item.bundles" class="btn btn-warning"><span class="glyphicon glyphicon-unchecked"></span>{{ static.bundles[bundle_id].name }}</button>
|
<button v-for="bundle_id in item.bundles" class="btn" v-bind:class="[user_data[item.id] ? btnChecked : btnUnchecked]" v-on:click="completeItem(item.id)"><span class="glyphicon" v-bind:class="[user_data[item.id] ? boxChecked : boxUnchecked]" ></span>{{ static.bundles[bundle_id].name }}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-footer">
|
<div class="panel-footer">
|
||||||
@ -93,8 +93,18 @@
|
|||||||
|
|
||||||
<div role="tabpanel" class="tab-pane" id="ab-list">
|
<div role="tabpanel" class="tab-pane" id="ab-list">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-3">
|
||||||
|
<form class="form-inline">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="search">Filter</label>
|
||||||
|
<input type="text" class="form-control" id="search" v-model="search_name" />
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="row row-eq-height">
|
<div class="row row-eq-height">
|
||||||
<template v-for="item in static.items | orderBy 'name'">
|
<template v-for="item in static.items | orderBy 'name' | filterBy search_name in 'name'">
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
@ -103,7 +113,7 @@
|
|||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<p>{{ item.source }}</p>
|
<p>{{ item.source }}</p>
|
||||||
<div class="button-area">
|
<div class="button-area">
|
||||||
<button v-for="bundle_id in item.bundles" class="btn btn-warning"><span class="glyphicon glyphicon-unchecked"></span>{{ static.bundles[bundle_id].name }}</button>
|
<button v-for="bundle_id in item.bundles" class="btn" v-bind:class="[user_data[item.id] ? btnChecked : btnUnchecked]" v-on:click="completeItem(item.id)"><span class="glyphicon" v-bind:class="[user_data[item.id] ? boxChecked : boxUnchecked]" ></span>{{ static.bundles[bundle_id].name }}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-footer">
|
<div class="panel-footer">
|
||||||
@ -157,7 +167,7 @@
|
|||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<p>{{ item.source }}</p>
|
<p>{{ item.source }}</p>
|
||||||
<div class="button-area">
|
<div class="button-area">
|
||||||
<button v-for="bundle_id in item.bundles" class="btn btn-warning"><span class="glyphicon glyphicon-unchecked"></span>{{ static.bundles[bundle_id].name }}</button>
|
<button v-for="bundle_id in item.bundles" class="btn" v-bind:class="[user_data[item.id] ? btnChecked : btnUnchecked]" v-on:click="completeItem(item.id)"><span class="glyphicon" v-bind:class="[user_data[item.id] ? boxChecked : boxUnchecked]" ></span>{{ static.bundles[bundle_id].name }}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-footer">
|
<div class="panel-footer">
|
||||||
@ -215,7 +225,7 @@
|
|||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<p>{{ item.source }}</p>
|
<p>{{ item.source }}</p>
|
||||||
<div class="button-area">
|
<div class="button-area">
|
||||||
<button v-for="bundle_id in item.bundles" class="btn btn-warning"><span class="glyphicon glyphicon-unchecked"></span>{{ static.bundles[bundle_id].name }}</button>
|
<button v-for="bundle_id in item.bundles" class="btn" v-bind:class="[user_data[item.id] ? btnChecked : btnUnchecked]" v-on:click="completeItem(item.id)"><span class="glyphicon" v-bind:class="[user_data[item.id] ? boxChecked : boxUnchecked]" ></span>{{ static.bundles[bundle_id].name }}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-footer">
|
<div class="panel-footer">
|
||||||
|
|||||||
4
main.css
4
main.css
@ -95,3 +95,7 @@
|
|||||||
.footer-text{
|
.footer-text{
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
form{
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|||||||
16
main.js
16
main.js
@ -3,10 +3,16 @@ var v = new Vue({
|
|||||||
data:{
|
data:{
|
||||||
debug: true,
|
debug: true,
|
||||||
static: null,
|
static: null,
|
||||||
user_data: []
|
user_data: [],
|
||||||
|
btnChecked: 'btn-success',
|
||||||
|
btnUnchecked: 'btn-warning',
|
||||||
|
boxChecked: 'glyphicon-check',
|
||||||
|
boxUnchecked: 'glyphicon-unchecked'
|
||||||
|
},
|
||||||
|
created: function(){
|
||||||
|
this.fetchData();
|
||||||
},
|
},
|
||||||
ready: function(){
|
ready: function(){
|
||||||
this.fetchData();
|
|
||||||
$('.list-group-item').on('click', function() {
|
$('.list-group-item').on('click', function() {
|
||||||
$('.glyphicon', this)
|
$('.glyphicon', this)
|
||||||
.toggleClass('glyphicon-chevron-right')
|
.toggleClass('glyphicon-chevron-right')
|
||||||
@ -18,8 +24,14 @@ var v = new Vue({
|
|||||||
this.$http.get('bundles.json', function(data, status, response){
|
this.$http.get('bundles.json', function(data, status, response){
|
||||||
if(status == 200){
|
if(status == 200){
|
||||||
this.static = data;
|
this.static = data;
|
||||||
|
for(var i = 0; i < this.static.items.length; i++){
|
||||||
|
this.user_data.push(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
completeItem: function(itemId){
|
||||||
|
this.user_data.$set(itemId, !this.user_data[itemId]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user