Permalink
Browse files

Back to hashbang urls

  • Loading branch information...
1 parent f35dd7f commit 6f4880ef4d44a9f1307b1622e7f13b926e1a4637 @st3fan committed Apr 5, 2013
Showing with 23 additions and 27 deletions.
  1. +1 −5 server.py
  2. +14 −14 static/index.html
  3. +8 −8 static/js/dashboard.js
View
@@ -1,11 +1,7 @@
from bottle import route, run, template, static_file
-@route('/static/<path:path>')
+@route('/<path:path>')
def callback(path):
return static_file(path, root="./static")
-@route('/<:re:.*>')
-def index():
- return static_file("index.html", root="./static")
-
run(host='0.0.0.0', port=8080, debug=True)
View
@@ -4,17 +4,17 @@
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Provided -->
- <script src="static/js/jquery-1.9.1.js"></script>
- <script src="static/js/angular.js"></script>
- <script src="static/js/underscore.js"></script>
- <script src="static/js/bootstrap.js"></script>
- <link rel="stylesheet" href="static/css/bootstrap.css">
+ <script src="js/jquery-1.9.1.js"></script>
+ <script src="js/angular.js"></script>
+ <script src="js/underscore.js"></script>
+ <script src="js/bootstrap.js"></script>
+ <link rel="stylesheet" href="css/bootstrap.css">
<!-- App -->
- <script src="static/js/dashboard.js"></script>
- <script src="static/js/dashboard/reviews.js"></script>
- <script src="static/js/dashboard/websecbugs.js"></script>
- <script src="static/js/dashboard/kickoff.js"></script>
- <link rel="stylesheet" href="static/css/dashboard.css">
+ <script src="js/dashboard.js"></script>
+ <script src="js/dashboard/reviews.js"></script>
+ <script src="js/dashboard/websecbugs.js"></script>
+ <script src="js/dashboard/kickoff.js"></script>
+ <link rel="stylesheet" href="css/dashboard.css">
</head>
<body ng-controller="DashboardController">
@@ -50,15 +50,15 @@ <h2 class="form-signin-heading">Please sign in</h2>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
- <a class="brand" href="#">Security Dashboard</a>
+ <a class="brand" ng-href="#!/">Security Dashboard</a>
<div class="nav-collapse collapse">
<p class="navbar-text pull-right">
{{username}} - <a href="#" class="navbar-link" ng-click="logout()">Logout</a>
</p>
<ul class="nav">
- <li class="{active: dashboard == 'websecbugs'}"><a ng-click="showDashboard('websecbugs')" href="#">WebSec Bugs</a></li>
- <li class="{active: dashboard == 'reviews'}"><a ng-click="showDashboard('reviews')" href="#">Reviews</a></li>
- <li class="{active: dashboard == 'kickoff'}"><a ng-click="showDashboard('kickoff')" href="#">Project Kickoff</a></li>
+ <li class="{active: dashboard == 'websecbugs'}"><a ng-href="#!/websecbugs">WebSec Bugs</a></li>
+ <li class="{active: dashboard == 'reviews'}"><a ng-href="#!/reviews">Reviews</a></li>
+ <li class="{active: dashboard == 'kickoff'}"><a ng-href="#!/kickoff">Project Kickoff</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
View
@@ -24,12 +24,12 @@ app.run(function($rootScope, sessionService, bugzillaService) {
});
app.config(function($routeProvider, $locationProvider) {
- $locationProvider.html5Mode(true).hashPrefix('!');
+ $locationProvider.hashPrefix('!');
$routeProvider
- .when("/", { templateUrl: "static/partials/index.html" })
- .when("/websecbugs", { templateUrl: "static/partials/websecbugs.html", controller: "WebSecBugsController" })
- .when("/reviews", { templateUrl: "static/partials/reviews.html", controller: "ReviewsController" })
- .when("/kickoff", { templateUrl: "static/partials/kickoff.html", controller: "KickoffController" });
+ .when("/", { templateUrl: "partials/index.html" })
+ .when("/websecbugs", { templateUrl: "partials/websecbugs.html", controller: "WebSecBugsController" })
+ .when("/reviews", { templateUrl: "partials/reviews.html", controller: "ReviewsController" })
+ .when("/kickoff", { templateUrl: "partials/kickoff.html", controller: "KickoffController" });
});
app.controller('SigninController', function($scope, $rootScope, $http, bugzillaService, preferencesService) {
@@ -81,13 +81,13 @@ app.controller('DashboardController', function($scope, $location, bugzillaServic
$scope.showDashboard = function (what) {
switch (what) {
case "websecbugs":
- $location.path("/websecbugs").replace();
+ $location.path("/index.html#!/websecbugs").replace();
break;
case "reviews":
- $location.path("/reviews").replace();
+ $location.path("/index.html#!/reviews").replace();
break;
case "kickoff":
- $location.path("/kickoff").replace();
+ $location.path("/index.html#!/kickoff").replace();
break;
}
$scope.dashboard = what;

0 comments on commit 6f4880e

Please sign in to comment.