summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2015-01-12 11:41:12 +0200
committerAlon Levy <alon@pobox.com>2015-01-12 11:42:31 +0200
commit2974f916df0614c892a94d3e0f192e10aa03b0b6 (patch)
tree6e37a43df327af8856fde74bc69251d83e6f171a
parentf6def5675506a35d8be6461411de4626fb71f29e (diff)
server/client: s/res/static/, drop dev_mode__resend_from_static
-rw-r--r--res/templates/index.html10
-rw-r--r--res/templates/login.html6
-rw-r--r--src/client/app.js2
-rw-r--r--src/server/rz_server.py22
4 files changed, 9 insertions, 31 deletions
diff --git a/res/templates/index.html b/res/templates/index.html
index cba394d6..13913ba2 100644
--- a/res/templates/index.html
+++ b/res/templates/index.html
@@ -2,11 +2,11 @@
<head>
<title>Rhizi Prototype </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <link href="/res/css/style.css" rel="stylesheet" type="text/css">
- <link rel="shortcut icon" href="/res/img/favicon2.ico" />
+ <link href="/static/css/style.css" rel="stylesheet" type="text/css">
+ <link rel="shortcut icon" href="/static/img/favicon2.ico" />
<script src="/static/local_config.js"></script>
- <script data-main='/static/app.js' src="/res/lib/require.js"></script>
+ <script data-main='/static/app.js' src="/static/lib/require.js"></script>
</head>
@@ -25,7 +25,7 @@
<span class="profile-initials">AN<!-- must be two letters because of css --></span>
<div class="profile-username">Welcome&nbsp;<span id="user_id">Anonymous</span>! <span id="logout-button" class="button">Logout</span></div>
</div>
- <img class="organization-logo" src="/res/img/CRI-logo.png">
+ <img class="organization-logo" src="/static/img/CRI-logo.png">
</div>
</div>
<div class="search-bar">
@@ -123,7 +123,7 @@
</div>
<div class="rhizi-logo"><a href="http://www.rhizi.org">
- <img src="/res/img/rhizi-logo.png"/></a>
+ <img src="/static/img/rhizi-logo.png"/></a>
</div>
</div>
diff --git a/res/templates/login.html b/res/templates/login.html
index 8ddde1b2..000395c2 100644
--- a/res/templates/login.html
+++ b/res/templates/login.html
@@ -2,7 +2,7 @@
<head>
<meta charset="UTF-8">
<title>Welcome to Rhizi</title>
-<link href="/res/css/style.css" rel="stylesheet" type="text/css">
+<link href="/static/css/style.css" rel="stylesheet" type="text/css">
<script src="/static/lib/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
function submit_login_form() {
@@ -28,7 +28,7 @@
<body class="login-background">
<div class="welcome-box">
- <img src="/res/img/logo-red.png" class="login-rhizi-logo">
+ <img src="/static/img/logo-red.png" class="login-rhizi-logo">
<div class="login-text">
<h1 class="login-header"> Welcome to Rhizi!</h1>
<h5>Rhizi is a collaborative knowledge editor.</h5>
@@ -52,7 +52,7 @@
{% if login_failed %}<b>Login Failed</b>{% endif %}
</div>
</div>
- <img src="res/img/hr-email-icon.png">
+ <img src="static/img/hr-email-icon.png">
<p class="login-text"><a href="mailto:dor.garbash@gmail.com">Send us an Email</a> about your experience, especially if you encountered any problem!</p>
diff --git a/src/client/app.js b/src/client/app.js
index 4d15f342..4bb762d5 100644
--- a/src/client/app.js
+++ b/src/client/app.js
@@ -1,5 +1,5 @@
(function() {
- var lib_path = '/res/lib/';
+ var lib_path = '/static/lib/';
var config = {
shim: {
'socketio': { exports: 'io' },
diff --git a/src/server/rz_server.py b/src/server/rz_server.py
index 64a85588..e8fec231 100644
--- a/src/server/rz_server.py
+++ b/src/server/rz_server.py
@@ -166,19 +166,6 @@ def init_rest_interface(cfg, flask_webapp):
redirector.func_name = 'redirector_%s' % path.replace('/', '_')
return (path, redirector, flask_args)
- def dev_mode__resend_from_static(static_url):
- """
- redirect static links while in dev mode:
- - /res/<path> -> <path>
- """
- static_folder = flask.current_app.static_folder
-
- new_req_path = None
- if request.path.startswith('/res/'):
- # turn absolute/res/... URLs to static-folder relative
- new_req_path = request.path.replace('/res/', '')
- return send_from_directory(static_folder, new_req_path)
-
def login_decorator(f):
"""
[!] security boundary: asserd logged-in user before executing REST api call
@@ -209,15 +196,6 @@ def init_rest_interface(cfg, flask_webapp):
rest_entry('/monitor/server-info', rz_api.monitor__server_info),
]
- if cfg.development_mode:
- dev_path_set = ['/static', '/res']
- rest_dev_entry_set = []
- for dev_path in dev_path_set:
- rest_dev_entry_set.append(rest_entry(dev_path + '/<path:static_url>',
- dev_mode__resend_from_static,
- {'methods': ['GET']}))
- rest_entry_set += rest_dev_entry_set
-
for re_entry in rest_entry_set:
rest_path, f, flask_args = re_entry