aboutsummaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorColin Guthrie <colin.guthrie@tribalogic.net>2013-04-19 13:28:19 +0100
committerColin Guthrie <colin.guthrie@tribalogic.net>2013-04-21 19:57:43 +0100
commit20ca4e9e509a111f8de0069feeac54e3b31098ee (patch)
treecd1a27410c2fc470d270cf79cab021781d1931aa /data
parentba158e3ed03dec10e6654b0b0dd3710504bdf04d (diff)
downloadphorkie-20ca4e9e509a111f8de0069feeac54e3b31098ee.tar.gz
phorkie-20ca4e9e509a111f8de0069feeac54e3b31098ee.zip
Allow usage in a subdir of a host.
Diffstat (limited to 'data')
-rw-r--r--data/config.default.php1
-rw-r--r--data/config.php.dist1
-rw-r--r--data/templates/base.htm29
-rw-r--r--data/templates/display-sidebar-history.htm2
-rw-r--r--data/templates/exception.htm5
-rw-r--r--data/templates/forbidden.htm2
-rw-r--r--data/templates/fork-remote-multiple.htm2
-rw-r--r--data/templates/fork-remote-new.htm2
-rw-r--r--data/templates/login.htm6
-rw-r--r--data/templates/new.htm2
10 files changed, 28 insertions, 24 deletions
diff --git a/data/config.default.php b/data/config.default.php
index a589924..56ddc43 100644
--- a/data/config.default.php
+++ b/data/config.default.php
@@ -4,6 +4,7 @@ $GLOBALS['phorkie']['cfg'] = array(
'gitdir' => __DIR__ . '/../repos/git/',
'workdir' => __DIR__ . '/../repos/work/',
'tpl' => __DIR__ . '/templates/',
+ 'baseurl' => '/',
'css' => '',
'title' => 'phorkie',
'topbar' => '',
diff --git a/data/config.php.dist b/data/config.php.dist
index ced993f..77d2005 100644
--- a/data/config.php.dist
+++ b/data/config.php.dist
@@ -1,4 +1,5 @@
<?php
+//$GLOBALS['phorkie']['cfg']['baseurl'] = '/';
//$GLOBALS['phorkie']['cfg']['gitdir'] = '/var/cache/git/paste/git/';
//$GLOBALS['phorkie']['cfg']['workdir'] = '/var/cache/git/paste/work/';
//$GLOBALS['phorkie']['cfg']['git']['public'] = 'git://bogo/git/paste/';
diff --git a/data/templates/base.htm b/data/templates/base.htm
index 8738bb0..8074938 100644
--- a/data/templates/base.htm
+++ b/data/templates/base.htm
@@ -1,18 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html>
<html>
- <head>
+ <head>
+ <base href="{{baseurl}}" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <link rel="stylesheet" href="/css/bootstrap.min.css"/>
- <link rel="stylesheet" href="/css/font-awesome.css"/>
- <link rel="stylesheet" href="/css/phorkie.css"/>
+ <link rel="stylesheet" href="css/bootstrap.min.css"/>
+ <link rel="stylesheet" href="css/font-awesome.css"/>
+ <link rel="stylesheet" href="css/phorkie.css"/>
{% if css %}
<link rel="stylesheet" href="{{css}}"/>
{% endif %}
<title>{% block title %}{% endblock %} - {{title}}</title>
- <script src="/js/jquery.js"></script>
- <script src="/js/bootstrap.min.js"></script>
- <script src="/js/phorkie.js"></script>
+ <script src="js/jquery.js"></script>
+ <script src="js/bootstrap.min.js"></script>
+ <script src="js/phorkie.js"></script>
{% block meta %}{% endblock %}
</head>
<body>
@@ -22,17 +23,17 @@
<div class="container">
<ul class="nav">
<li>
- <a class="brand" href="/">{{title}}</a>
+ <a class="brand" href="{{baseurl}}">{{title}}</a>
</li>
<li>
- <a href="/new">New paste</a>
+ <a href="new">New paste</a>
</li>
<li>
- <a href="/list">List all</a>
+ <a href="list">List all</a>
</li>
{% if db.adapter %}
<li class="nav-collapse">
- <form class="span4 pull-right navbar-form" action="/search" method="get">
+ <form class="span4 pull-right navbar-form" action="search" method="get">
<input type="text" class="search-query" name="q" placeholder="Search" value="{{query}}"/>
</form>
</li>
@@ -41,7 +42,7 @@
<ul class="nav pull-right">
{% if identity %}
<li>
- <a href="/user">{{name}}</a>
+ <a href="user">{{name}}</a>
</li>
{% endif %}
{% if db.adapter %}
@@ -55,11 +56,11 @@
{% endif %}
{% if identity %}
<li>
- <a href="/login?logout">Logout</a>
+ <a href="login?logout">Logout</a>
</li>
{% else %}
<li>
- <a href="/login">Login</a>
+ <a href="login">Login</a>
</li>
{% endif %}
</ul>
diff --git a/data/templates/display-sidebar-history.htm b/data/templates/display-sidebar-history.htm
index eb844e4..6dda7e0 100644
--- a/data/templates/display-sidebar-history.htm
+++ b/data/templates/display-sidebar-history.htm
@@ -5,7 +5,7 @@
<li class="row-fluid {% if commit.hash == repo.hash or (repo.hash == '' and loop.first) %}active{%endif%}">
{% spaceless %}
{% for dot in commit.getDots %}
- <img src="/phorkie/dot-{{dot}}.png" alt="" style="padding-left:1px" width="4" height="4"/>
+ <img src="phorkie/dot-{{dot}}.png" alt="" style="padding-left:1px" width="4" height="4"/>
{% endfor %}
{% endspaceless %}
<a class="hash" href="{{repo.getLink('revision', commit.hash)}}">{{commit.hash|slice(0, 6)}}</a>
diff --git a/data/templates/exception.htm b/data/templates/exception.htm
index 91120f4..f4f5d32 100644
--- a/data/templates/exception.htm
+++ b/data/templates/exception.htm
@@ -1,7 +1,8 @@
<!DOCTYPE html>
<html>
- <head>
- <link rel="stylesheet" href="/css/phorkie.css" />
+ <head>
+ <base href="{{baseurl}}" />
+ <link rel="stylesheet" href="css/phorkie.css" />
<title>Error - phorkie</title>
<meta name="robots" content="noindex"/>
</head>
diff --git a/data/templates/forbidden.htm b/data/templates/forbidden.htm
index 76e728c..b32962c 100644
--- a/data/templates/forbidden.htm
+++ b/data/templates/forbidden.htm
@@ -21,7 +21,7 @@
</p>
{% else %}
<p>
- We're sorry; but you have to <a href="/login">log in</a> to access this page.
+ We're sorry; but you have to <a href="login">log in</a> to access this page.
</p>
{% endif %}
{% endblock %}
diff --git a/data/templates/fork-remote-multiple.htm b/data/templates/fork-remote-multiple.htm
index 8709f11..f00ef2d 100644
--- a/data/templates/fork-remote-multiple.htm
+++ b/data/templates/fork-remote-multiple.htm
@@ -1,4 +1,4 @@
-<form method="post" action="/fork-remote" enctype="multipart/form-data" class="well form-inline form-horizontal">
+<form method="post" action="fork-remote" enctype="multipart/form-data" class="well form-inline form-horizontal">
<input type="hidden" name="orig_url" value="{{remote_url}}" />
<div class="control-group">
<p>
diff --git a/data/templates/fork-remote-new.htm b/data/templates/fork-remote-new.htm
index 4dc3297..debafff 100644
--- a/data/templates/fork-remote-new.htm
+++ b/data/templates/fork-remote-new.htm
@@ -1,4 +1,4 @@
-<form method="post" action="/fork-remote" enctype="multipart/form-data" class="well form-horizontal">
+<form method="post" action="fork-remote" enctype="multipart/form-data" class="well form-horizontal">
<p>
<strong>Copy a paste from a remote server:</strong>
Just paste the website or git clone URL.
diff --git a/data/templates/login.htm b/data/templates/login.htm
index 70a1b69..c3ac9fd 100644
--- a/data/templates/login.htm
+++ b/data/templates/login.htm
@@ -9,15 +9,15 @@
<link rel="stylesheet" href="css/openid.css" />
-<form method="post" action="/login" id="openid_form">
+<form method="post" action="login" id="openid_form">
<fieldset>
<legend>Sign-in</legend>
<div id="openid_choice" style="display: block; ">
<p>Please choose your account provider</p>
<div id="openid_btns">
- <a title="Google" href="/login?openid_url=https://www.google.com/accounts/o8/id" class="google openid_large_btn"></a>
- <a title="Yahoo" href="/login?openid_url=http://yahoo.com/" class="yahoo openid_large_btn"></a>
+ <a title="Google" href="login?openid_url=https://www.google.com/accounts/o8/id" class="google openid_large_btn"></a>
+ <a title="Yahoo" href="login?openid_url=http://yahoo.com/" class="yahoo openid_large_btn"></a>
</div>
<div id="openid_input_area">
<p>or enter your OpenID URL.</p>
diff --git a/data/templates/new.htm b/data/templates/new.htm
index 88dade3..163b5a3 100644
--- a/data/templates/new.htm
+++ b/data/templates/new.htm
@@ -3,7 +3,7 @@
{% block content %}
<div class="content-padding-fix"></div>
-<form method="post" action="/new" enctype="multipart/form-data" class="form-horizontal">
+<form method="post" action="new" enctype="multipart/form-data" class="form-horizontal">
<div class="control-group">
<label class="control-label" for="description">Description</label>
<div class="controls">