diff --git a/index.php b/index.php index 4ab93be..395d9b4 100644 --- a/index.php +++ b/index.php @@ -34,7 +34,7 @@ $view->getEnvironment()->addGlobal('irc_channel', $container->get('settings')['irc-channel']); $view->getEnvironment()->addGlobal('donation_link', $container->get('settings')['donation-link']); $view->getEnvironment()->addGlobal('backend_url', $container->get('settings')['backend-url']); - $view->getEnvironment()->addGlobal('gameshort', $container->get('settings')['gameshort']); + // $view->getEnvironment()->addGlobal('gameshort', $container->get('settings')['gameshort']); $view->getEnvironment()->addGlobal('debug', $container->get('settings')['debug']); $view->getEnvironment()->addGlobal('update_interval', $container->get('settings')['update-interval']); $view->getEnvironment()->addGlobal('registration', $container->get('settings')['registration']); diff --git a/scripts/browse-list.js b/scripts/browse-list.js index 2f3cc50..dd9f9e5 100644 --- a/scripts/browse-list.js +++ b/scripts/browse-list.js @@ -13,9 +13,9 @@ function fillBrowseList() { browseURL = "/api/browse/" + gameshort + "/featured?site=" + page + "&count=30"; } when(getJSON(backend + '/api/users/current'), - getJSON(backend + '/api/mods/' + gameshort), - getJSON(backend + browseURL)). - done(function(currentUser, mods, browse) { + getJSON(backend + '/api/mods/' + gameshort), + getJSON(backend + browseURL)). + done(function(currentUser, mods, browse) { app = new Vue({ el: '#site', data: { @@ -52,10 +52,10 @@ function updateBrowseList() { if (url == "/browse/featured") { browseURL = "/api/browse/" + gameshort + "/featured?site=" + page + "&count=30"; } - swhen(getJSON(backend + '/api/users/current'), - getJSON(backend + '/api/mods/' + gameshort), - getJSON(backend + browseURL)). - done(function(currentUser, mods, browse) { + when(getJSON(backend + '/api/users/current'), + getJSON(backend + '/api/mods/' + gameshort), + getJSON(backend + browseURL)). + done(function(currentUser, mods, browse) { app.$data.currentUser = currentUser.error ? null : currentUser.data; app.$data.mods = mods; app.$data.browse = browse; diff --git a/scripts/create.js b/scripts/create.js index e30ec50..f781262 100644 --- a/scripts/create.js +++ b/scripts/create.js @@ -1,7 +1,7 @@ function fillCreate() { when(getJSON(backend + '/api/users/current'), - getJSON(backend + '/api/games/' + gameshort + '/versions')). - done(function(currentUser, gameversions) { + getJSON(backend + '/api/games/' + gameshort + '/versions')). + done(function(currentUser, gameversions) { if (currentUser.error) { window.location.href = "{{ path_for('accounts.login') }}"; return; @@ -39,8 +39,8 @@ function fillCreate() { function updateCreate() { when(getJSON(backend + '/api/users/current'), - getJSON(backend + '/api/games/' + gameshort + '/versions')). - done(function(currentUser, gameversions) { + getJSON(backend + '/api/games/' + gameshort + '/versions')). + done(function(currentUser, gameversions) { if (currentUser.error) { window.location.href = "{{ path_for('accounts.login') }}"; return; @@ -119,7 +119,7 @@ function onSubmitClick() { createMod(name, gameshort, shortDescription, license, version, gameVersion, zipFile, function(i, id, data) { $('#progress').removeClass('active'); if (!data.error) { - window.location.href = `{{ path_for("mod.view", {"id": "${mod.id}", "name": "${mod.name}"}) }}`; + window.location.href = `{{ path_for("mod.view", {"gameshort": "${gameshort}", "id": "${mod.id}", "name": "${mod.name}"}) }}`; return; } else { $('#error-alert').removeClass('hidden'); diff --git a/scripts/index.js b/scripts/game.js similarity index 70% rename from scripts/index.js rename to scripts/game.js index e942409..58ad29c 100644 --- a/scripts/index.js +++ b/scripts/game.js @@ -1,9 +1,9 @@ -function fillIndex() { +function fillGame() { when(getJSON(backend + '/api/users/current'), - getJSON(backend + '/api/mods/' + gameshort), - getJSON(backend + '/api/users'), - getJSON(backend + '/api/browse/' + gameshort)). - done(function(currentUser, mods, users, browse) { + getJSON(backend + '/api/mods/' + gameshort), + getJSON(backend + '/api/users'), + getJSON(backend + '/api/browse/' + gameshort)). + done(function(currentUser, mods, users, browse) { app = new Vue({ el: '#site', data: { @@ -25,17 +25,17 @@ function fillIndex() { }, delimiters: ['${', '}'] }); - window.setInterval(updateIndex, update_interval); + window.setInterval(updateGame, update_interval); $.loadingBlockHide(); }); } -function updateIndex() { +function updateGame() { when(getJSON(backend + '/api/users/current'), - getJSON(backend + '/api/mods/' + gameshort), - getJSON(backend + '/api/users'), - getJSON(backend + '/api/browse/' + gameshort)) - done(function(currentUser, mods, users, browse) { + getJSON(backend + '/api/mods/' + gameshort), + getJSON(backend + '/api/users'), + getJSON(backend + '/api/browse/' + gameshort)) + done(function(currentUser, mods, users, browse) { app.$data.currentUser = currentUser.error ? null : currentUser.data; app.$data.mods = mods; app.$data.users = users; diff --git a/scripts/sdb.js b/scripts/sdb.js index cadaf28..afc84ce 100644 --- a/scripts/sdb.js +++ b/scripts/sdb.js @@ -148,11 +148,11 @@ function followMod(user, mod, callback) { window.location.href = "path_for('register')"; return; } - getJSON(backend + '/api/mods/' + gameshort + '/' + mod.id + '/follow', callback) + getJSON(backend + '/api/mods/' + mod.game_short + '/' + mod.id + '/follow', callback) } function unfollowMod(mod, callback) { - getJSON(backend + '/api/mods/' + gameshort + '/' + mod.id + '/unfollow', callback); + getJSON(backend + '/api/mods/' + mod.game_short + '/' + mod.id + '/unfollow', callback); } function hasPermission(permission, pub, params, callback) { @@ -267,7 +267,7 @@ function createMod(name, gameshort, shortDescription, license, version, gameVers } function updateMod(mod, version, gameVersion, notifyFollowers, isBeta, changelog, _zipFile, callback) { - postJSON(backend + '/api/mods/' + gameshort + '/' + mod.id + '/versions', { + postJSON(backend + '/api/mods/' + mod.game_short + '/' + mod.id + '/versions', { 'version': version, 'game-version': gameVersion, 'notify-followers': notifyFollowers, diff --git a/scripts/update.js b/scripts/update.js index 9589379..44d4ea7 100644 --- a/scripts/update.js +++ b/scripts/update.js @@ -109,7 +109,7 @@ function onSubmitClick(mod) { updateMod(mod, version, gameVersion, notifyFollowers, isBeta, changelog, zipFile, function(i, data) { $('#progress').removeClass('active'); if (!data.error) { - window.location.href = `{{ path_for("mod.view", {"id": "${mod.id}", "name": "${mod.name}"}) }}`;W + window.location.href = `{{ path_for("mod.view", {"gameshort": "${gameshort}", "id": "${mod.id}", "name": "${mod.name}"}) }}`;W return; } else { $('#error-alert').removeClass('hidden'); diff --git a/scripts/utils.js b/scripts/utils.js index 708c4c7..b3680c1 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -15,7 +15,7 @@ Vue.component('mod-box', {
These are the tools you can use to manage your mod listing. You can also - view your mod as if you were not logged + view your mod as if you were not logged in.
No changelog provided
-
+
Download
diff --git a/templates/update.html b/templates/update.html
index e5c0609..c418bf6 100644
--- a/templates/update.html
+++ b/templates/update.html
@@ -9,6 +9,7 @@
{% endblock %}
@@ -63,7 +64,7 @@ Zip File