Renamed html to static, phase #2.

This commit is contained in:
Alexis Lahouze 2013-03-20 17:03:25 +01:00
parent 1cd4d02701
commit f50f553817
4 changed files with 13 additions and 9 deletions

View File

@ -16,11 +16,15 @@
""" """
from app import app from app import app
from static import *
from api.controller.entries import * from api.controller.entries import *
from api.controller.accounts import * from api.controller.accounts import *
from flask import url_for, redirect
@app.route('/')
def index():
return redirect(url_for('.static', filename='index.html'))
if __name__ == '__main__': if __name__ == '__main__':
app.run(debug=True) app.run(debug=True)

View File

@ -86,7 +86,7 @@ var AccountController = function($scope, $http, $rootScope) {
$scope.saveAccount = function(account, modalScope) { $scope.saveAccount = function(account, modalScope) {
// Ajax call to save the entry. // Ajax call to save the entry.
var type; var type;
var url = "api/accounts"; var url = "/api/accounts";
if(account.id) { if(account.id) {
url += "/" + account.id; url += "/" + account.id;
@ -109,7 +109,7 @@ var AccountController = function($scope, $http, $rootScope) {
// Function to remove of an entry. // Function to remove of an entry.
$scope.accountRemove = function(account, modalScope) { $scope.accountRemove = function(account, modalScope) {
$http.delete("api/accounts/" + account.id).success(function (data) { $http.delete("/api/accounts/" + account.id).success(function (data) {
message("success", "Save", data); message("success", "Save", data);
// Reload accounts to update solds. // Reload accounts to update solds.
@ -123,7 +123,7 @@ var AccountController = function($scope, $http, $rootScope) {
// Function to load accounts // Function to load accounts
$scope.loadAccounts = function() { $scope.loadAccounts = function() {
$http.get("api/accounts").success($scope.loadAccounts_success); $http.get("/api/accounts").success($scope.loadAccounts_success);
}; };
$scope.loadAccounts_success = function (data) { $scope.loadAccounts_success = function (data) {

View File

@ -89,7 +89,7 @@ var EntryController = function($scope, $http, $rootScope, $filter) {
$scope.savedItem = null; $scope.savedItem = null;
if(account && month) { if(account && month) {
$http.get("api/entries/" + account.id + "/" + month.year + "/" + month.month).success($scope.loadEntries_success); $http.get("/api/entries/" + account.id + "/" + month.year + "/" + month.month).success($scope.loadEntries_success);
} else { } else {
$scope.loadEntries_success(null); $scope.loadEntries_success(null);
} }
@ -245,7 +245,7 @@ var EntryController = function($scope, $http, $rootScope, $filter) {
// Prepare the Ajax call to save the entry. // Prepare the Ajax call to save the entry.
var type; var type;
var url = "api/entries"; var url = "/api/entries";
if(!$scope.isNew(entry)) { if(!$scope.isNew(entry)) {
url += "/" + entry.id; url += "/" + entry.id;
@ -266,7 +266,7 @@ var EntryController = function($scope, $http, $rootScope, $filter) {
$scope.removeEntry = function(entry, modalScope) { $scope.removeEntry = function(entry, modalScope) {
// Cancel current editing. // Cancel current editing.
if (!$scope.isNew(entry)) { if (!$scope.isNew(entry)) {
$http.delete("api/entries/" + entry.id).success(function (result) { $http.delete("/api/entries/" + entry.id).success(function (result) {
message("success", "Delete", result); message("success", "Delete", result);
// Send the "entry removed" event. // Send the "entry removed" event.

View File

@ -40,7 +40,7 @@ var MonthController = function($scope, $http, $rootScope) {
} }
if($scope.account) { if($scope.account) {
$http.get("api/accounts/" + $scope.account.id + "/months").success($scope.loadMonths_success); $http.get("/api/accounts/" + $scope.account.id + "/months").success($scope.loadMonths_success);
} else { } else {
$scope.$emit("monthsLoadedEvent", {account: null, month: null}); $scope.$emit("monthsLoadedEvent", {account: null, month: null});
} }