Add character names to the end of their URL's

Closes #21, makes links to characters human readable
This commit is contained in:
Stefan Zermatten
2017-07-13 13:14:04 +02:00
parent 089feae26f
commit 3227cd0934
9 changed files with 59 additions and 9 deletions

View File

@@ -11,7 +11,7 @@
{{#if characters.count}}
<div class="character-list layout horizontal wrap">
{{# each characters}}
<a class="character-card flex layout vertical end-justified" href="/character/{{_id}}">
<a class="character-card flex layout vertical end-justified" href="{{pathFor route="characterSheet" data=this}}">
<iron-image class="fit {{colorClass}}"
sizing="cover" preload fade src={{picture}}>
</iron-image>

View File

@@ -10,7 +10,15 @@ Template.characterList.helpers({
]
},
{
fields: {name: 1, picture: 1, color: 1, race: 1, alignment: 1, gender: 1},
fields: {
name: 1,
urlName: 1,
picture: 1,
color: 1,
race: 1,
alignment: 1,
gender: 1,
},
sort: {name: 1},
}
);

View File

@@ -14,7 +14,7 @@ Template.characterSideList.helpers({
]
},
{
fields: {name: 1},
fields: {name: 1, urlName: 1},
sort: {name: 1},
}
);