Added change log

This commit is contained in:
Stefan Zermatten
2015-05-12 10:10:15 +02:00
parent a539b0bc6c
commit 80ca7307ce
6 changed files with 73 additions and 3 deletions

View File

@@ -0,0 +1,27 @@
ChangeLogs = new Mongo.Collection("changeLogs");
Schemas.ChangeLog = new SimpleSchema({
version: {
type: String,
},
changes: {
type: [String],
},
});
ChangeLogs.attachSchema(Schemas.ChangeLog);
ChangeLogs.allow({
insert: function(userId, doc) {
var user = Meteor.users.findOne(userId);
if (user) return _.contains(user.roles, "admin");
},
update: function(userId, doc, fields, modifier) {
var user = Meteor.users.findOne(userId);
if (user) return _.contains(user.roles, "admin");
},
remove: function(userId, doc) {
var user = Meteor.users.findOne(userId);
if (user) return _.contains(user.roles, "admin");
},
});

View File

@@ -23,6 +23,9 @@ Router.plugin("dataNotFound", {notFoundTemplate: "notFound"});
Router.map(function() {
this.route("/", {
name: "home",
onAfterAction: function() {
document.title = appName;
},
});
this.route("characterList", {
@@ -74,7 +77,20 @@ Router.map(function() {
},
});
this.route("/loginButtons", {
name: "loginButtons",
})
this.route("/changelog", {
name: "changeLog",
waitOn: function() {
return [
Meteor.subscribe("changeLog"),
]
},
data: {
changeLogs: function() {
return ChangeLogs.find({}, {sort: {version: -1}});
}
},
onAfterAction: function() {
document.title = appName;
},
});
});

View File

@@ -14,6 +14,7 @@
<core-item id="homeNav" icon="home" label="Home"></core-item>
{{> characterSideList}}
<core-item id="feedback" icon="bug-report" label="Send Feedback"></core-item>
<core-item id="changeLog" icon="list" label="Change Log"></core-item>
</div>
</core-header-panel>
<core-animated-pages main

View File

@@ -34,4 +34,7 @@ Template.layout.events({
fullOnMobile: true,
});
},
"tap #changeLog": function(event, instance) {
Router.go("changeLog");
},
});

View File

@@ -0,0 +1,20 @@
<template name="changeLog">
<core-toolbar class="blue-grey white-text">
<core-icon-button icon="menu" core-drawer-toggle></core-icon-button>
<div flex>
Change Log
</div>
</core-toolbar>
<div class="changeLog scroll-y" fit>
{{#each changeLogs}}
<paper-shadow class="white padded" style="margin: 8px;">
<h2>{{version}}</h2>
<ul>
{{#each changes}}
<li>{{this}}</li>
{{/each}}
</ul>
</paper-shadow>
{{/each}}
</div>
</template>

View File

@@ -0,0 +1,3 @@
Meteor.publish("changeLog", function(){
return ChangeLogs.find();
});