Added character list. Fixed TempHP
This commit is contained in:
8
rpg-docs/client/views/characterList/characterList.css
Normal file
8
rpg-docs/client/views/characterList/characterList.css
Normal file
@@ -0,0 +1,8 @@
|
||||
.characterCards {
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
.characterCard{
|
||||
width: 272px;
|
||||
margin: 4px;
|
||||
}
|
||||
27
rpg-docs/client/views/characterList/characterList.html
Normal file
27
rpg-docs/client/views/characterList/characterList.html
Normal file
@@ -0,0 +1,27 @@
|
||||
<template name="characterList">
|
||||
<core-toolbar class="blue-grey white-text">
|
||||
<core-icon-button icon="menu" core-drawer-toggle></core-icon-button>
|
||||
<div flex>
|
||||
Characters
|
||||
</div>
|
||||
</core-toolbar>
|
||||
<div class="scroll-y" fit>
|
||||
<div layout horizontal class="characterCards">
|
||||
{{# each characters}}
|
||||
{{#with characterDetails}}
|
||||
{{#containerCardHelper this}}{{alignment}} {{gender}} {{race}}{{/containerCardHelper}}
|
||||
{{/with}}
|
||||
{{/each}}
|
||||
</div>
|
||||
{{> gridPadding class="characterCard" num=12}}
|
||||
<div class="fab-buffer"></div>
|
||||
<paper-fab id="addCharacter"
|
||||
class="floatyButton"
|
||||
icon="add"
|
||||
title="Add"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
aria-label="Add"
|
||||
hero-id="main"></paper-fab>
|
||||
</div>
|
||||
</template>
|
||||
23
rpg-docs/client/views/characterList/characterList.js
Normal file
23
rpg-docs/client/views/characterList/characterList.js
Normal file
@@ -0,0 +1,23 @@
|
||||
Template.characterList.helpers({
|
||||
characterDetails: function(){
|
||||
var char = Characters.findOne(this._id, {fields: {name: 1, gender: 1, alignment: 1, race:1, color: 1}})
|
||||
char.title = char.name;
|
||||
char.field = "base"
|
||||
char.class = "characterCard"
|
||||
return char;
|
||||
}
|
||||
});
|
||||
|
||||
Template.characterList.events({
|
||||
"tap .characterCard": function(event, instance){
|
||||
console.log(this);
|
||||
Router.go("characterSheet", {_id: this._id});
|
||||
},
|
||||
"tap #addCharacter": function (event, template) {
|
||||
Characters.insert({owner: Meteor.userId()});
|
||||
},
|
||||
"tap #deleteChar": function(event, template){
|
||||
console.log("deleting", this);
|
||||
Characters.remove(this._id);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user