Added a side list for characters
This commit is contained in:
11
rpg-docs/client/views/characterList/characterSideList.css
Normal file
11
rpg-docs/client/views/characterList/characterSideList.css
Normal file
@@ -0,0 +1,11 @@
|
||||
.singleLineItem {
|
||||
color: black;
|
||||
color: rgba(0, 0, 0, 0.870588);
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
height: 40px;
|
||||
overflow: hidden;
|
||||
padding: 12px 0 12px 0;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
10
rpg-docs/client/views/characterList/characterSideList.html
Normal file
10
rpg-docs/client/views/characterList/characterSideList.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<template name="characterSideList">
|
||||
{{#if characters.count}}
|
||||
<div class="list-subhead">Characters</div>
|
||||
<div>
|
||||
{{#each characters}}
|
||||
<div class="singleLineItem">{{name}}</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</template>
|
||||
25
rpg-docs/client/views/characterList/characterSideList.js
Normal file
25
rpg-docs/client/views/characterList/characterSideList.js
Normal file
@@ -0,0 +1,25 @@
|
||||
Template.characterSideList.onCreated(function() {
|
||||
this.subscribe("characterList");
|
||||
});
|
||||
|
||||
Template.characterSideList.helpers({
|
||||
characters: function() {
|
||||
var userId = Meteor.userId();
|
||||
return Characters.find(
|
||||
{
|
||||
$or: [
|
||||
{readers: userId},
|
||||
{writers: userId},
|
||||
{owner: userId},
|
||||
]
|
||||
},
|
||||
{fields: {name: 1}}
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
Template.characterSideList.events({
|
||||
"tap .singleLineItem": function(event, instance) {
|
||||
Router.go("characterSheet", {_id: this._id});
|
||||
}
|
||||
});
|
||||
@@ -1,5 +1,5 @@
|
||||
#accountSummary {
|
||||
padding-top: 32px;
|
||||
padding: 16px;
|
||||
min-height: 146px;
|
||||
background-image: url(/png/paper-dice-crown.png);
|
||||
background-repeat: no-repeat;
|
||||
@@ -11,3 +11,7 @@
|
||||
#mainContentSection {
|
||||
display: initial !important;
|
||||
}
|
||||
|
||||
#navPanel {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,9 @@
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
<paper-item id="charactersMenuButton">Characters</paper-item>
|
||||
<div id="navPanel">
|
||||
{{> characterSideList}}
|
||||
</div>
|
||||
</core-header-panel>
|
||||
<core-animated-pages main
|
||||
navigation
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Meteor.publish("characterList", function(userId){
|
||||
Meteor.publish("characterList", function(){
|
||||
var userId = this.userId;
|
||||
if (!userId) {
|
||||
this.ready();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user