Moved views out of private folder
This commit is contained in:
10
rpg-docs/client/views/characterList/characterList.css
Normal file
10
rpg-docs/client/views/characterList/characterList.css
Normal file
@@ -0,0 +1,10 @@
|
||||
.characterCards {
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
.characterCard{
|
||||
width: 272px;
|
||||
margin: 4px;
|
||||
min-width: 272px;
|
||||
flex-grow: 1;
|
||||
}
|
||||
39
rpg-docs/client/views/characterList/characterList.html
Normal file
39
rpg-docs/client/views/characterList/characterList.html
Normal file
@@ -0,0 +1,39 @@
|
||||
<template name="characterList">
|
||||
<app-toolbar class="app-grey white-text">
|
||||
<paper-icon-button icon="menu" drawer-toggle></paper-icon-button>
|
||||
<div flex>
|
||||
Characters
|
||||
</div>
|
||||
</app-toolbar>
|
||||
<div class="scroll-y" fit>
|
||||
{{#if currentUser}}
|
||||
{{#if characters.count}}
|
||||
<div layout horizontal wrap class="characterCards">
|
||||
{{# each characters}}
|
||||
{{#with characterDetails}}
|
||||
{{#containerCardHelper this}}{{alignment}} {{gender}} {{race}}{{/containerCardHelper}}
|
||||
{{/with}}
|
||||
{{/each}}
|
||||
{{> gridPadding class="characterCard" num=12}}
|
||||
</div>
|
||||
{{else}}
|
||||
<div layout vertical center center-justified class="padded">
|
||||
<div>You don't seem to have any characters :(</div>
|
||||
<paper-button class="addCharacter red-button" raised>Add Character</paper-button>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
<div layout vertical center center-justified class="padded">
|
||||
<div>You must sign in to view your characters</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="fab-buffer"></div>
|
||||
<paper-fab class="floatyButton addCharacter"
|
||||
icon="add"
|
||||
title="Add"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
aria-label="Add"
|
||||
hero-id="main"></paper-fab>
|
||||
</div>
|
||||
</template>
|
||||
24
rpg-docs/client/views/characterList/characterList.js
Normal file
24
rpg-docs/client/views/characterList/characterList.js
Normal file
@@ -0,0 +1,24 @@
|
||||
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){
|
||||
Router.go("characterSheet", {_id: this._id});
|
||||
},
|
||||
"tap .addCharacter": function(event, template) {
|
||||
GlobalUI.showDialog({
|
||||
heading: "New Character",
|
||||
template: "newCharacterDialog",
|
||||
});
|
||||
},
|
||||
});
|
||||
23
rpg-docs/client/views/characterList/characterSideList.css
Normal file
23
rpg-docs/client/views/characterList/characterSideList.css
Normal file
@@ -0,0 +1,23 @@
|
||||
.singleLineItem {
|
||||
color: black;
|
||||
color: rgba(0, 0, 0, 0.870588);
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
padding: 8px 0 8px 16px;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.singleLineItem iron-icon {
|
||||
height: 8px;
|
||||
margin-right: 8px;
|
||||
width: 8px;
|
||||
}
|
||||
|
||||
.singleLineItem div {
|
||||
text-overflow: ellipsis;
|
||||
/* Required for text-overflow to do anything */
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
15
rpg-docs/client/views/characterList/characterSideList.html
Normal file
15
rpg-docs/client/views/characterList/characterSideList.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<template name="characterSideList">
|
||||
<core-item icon="social:people" label="Characters"></core-item>
|
||||
{{#if characters.count}}
|
||||
<div>
|
||||
{{#each characters}}
|
||||
<a href={{pathFor route="characterSheet" data=this}}
|
||||
class="singleLineItem characterRepresentative"
|
||||
layout horizontal center>
|
||||
<iron-icon icon="image:brightness-1"></iron-icon>
|
||||
<div>{{name}}</div>
|
||||
</a>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</template>
|
||||
33
rpg-docs/client/views/characterList/characterSideList.js
Normal file
33
rpg-docs/client/views/characterList/characterSideList.js
Normal file
@@ -0,0 +1,33 @@
|
||||
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},
|
||||
sort: {name: 1},
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
Template.characterSideList.events({
|
||||
"tap .singleLineItem": function(event, instance) {
|
||||
//Router.go("characterSheet", {_id: this._id});
|
||||
$("core-drawer-panel").get(0).closeDrawer();
|
||||
},
|
||||
"tap core-item": function() {
|
||||
Router.go("characterList");
|
||||
$("core-drawer-panel").get(0).closeDrawer();
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user