diff --git a/rpg-docs/Model/Meta/ChangeLogs.js b/rpg-docs/Model/Meta/ChangeLogs.js new file mode 100644 index 00000000..e56842a1 --- /dev/null +++ b/rpg-docs/Model/Meta/ChangeLogs.js @@ -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"); + }, +}); diff --git a/rpg-docs/Routes/Routes.js b/rpg-docs/Routes/Routes.js index cc0c66f7..0c2a405d 100644 --- a/rpg-docs/Routes/Routes.js +++ b/rpg-docs/Routes/Routes.js @@ -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; + }, + }); }); diff --git a/rpg-docs/client/views/layout/layout.html b/rpg-docs/client/views/layout/layout.html index c8e5bb87..9fd72d17 100644 --- a/rpg-docs/client/views/layout/layout.html +++ b/rpg-docs/client/views/layout/layout.html @@ -14,6 +14,7 @@ {{> characterSideList}} + + + +
+ Change Log +
+
+
+ {{#each changeLogs}} + +

{{version}}

+
    + {{#each changes}} +
  • {{this}}
  • + {{/each}} +
+
+ {{/each}} +
+ \ No newline at end of file diff --git a/rpg-docs/server/publications/changeLog.js b/rpg-docs/server/publications/changeLog.js new file mode 100644 index 00000000..876fdf2c --- /dev/null +++ b/rpg-docs/server/publications/changeLog.js @@ -0,0 +1,3 @@ +Meteor.publish("changeLog", function(){ + return ChangeLogs.find(); +});