finishing work on update package

This commit is contained in:
Sacha Greif 2014-09-15 21:32:57 +09:00
parent 70026cfbce
commit e16a0b56c1
2 changed files with 9 additions and 4 deletions

View file

@ -4,7 +4,11 @@
<h3 class="update-version">{{version}}</h3>
<div class="update-content">
<h4 class="update-prompt">A new version of Telescope is available.</h4>
<p class="update-message">You have: {{currentVersion}}. Note: this message is only displayed to admins. <a href="http://telesc.pe/docs/updating" target="_blank">Update instructions</a>.</p>
<p class="update-message">
You have: {{currentVersion}}. Note: this message is only displayed to admins.
<a href="https://github.com/TelescopeJS/Telescope/blob/master/History.md" target="_blank">View changelog</a> |
<a href="http://telesc.pe/docs/updating" target="_blank">View update instructions</a>
</p>
</div>
</div>
{{/if}}

View file

@ -11,17 +11,18 @@ compareVersions = function (v1, v2) { // return true if v2 is newer than v1
Meteor.startup(function () {
if(Meteor.user() && isAdmin(Meteor.user())){
var url = 'http://localhost:3000/';
var url = 'http://version.telescopeapp.org/';
HTTP.get(url, {
data: {
params: {
currentVersion: telescopeVersion,
siteTitle: getSetting('title'),
siteUrl: getSiteUrl()
}
}, function (error, result) {
if(result){
// console.log(result);
var currentVersion = telescopeVersion;
var newVersion = "0.9.5";
var newVersion = result.content;
var message = "";
if (compareVersions(currentVersion, newVersion)){
Session.set('updateVersion', newVersion);