Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix context buttons.

  • Loading branch information...
commit fef82fe970076f17f7fea5f69eb8e0c28e49f760 1 parent 94f95b4
@adiroiban adiroiban authored
View
8 .gitignore
@@ -1,7 +1 @@
-db/
-VERSION
-conf/
-htdocs/css/bootstrap*
-htdocs/img/*
-htdocs/js/*
-htpasswd
+build
View
44 Makefile
@@ -1,8 +1,42 @@
-PROJECT_NAME=test
+BUILD_FOLDER=build
+PROJECT_NAME=test-project
+BUILD_PROJECT=${BUILD_FOLDER}/${PROJECT_NAME}
+
run:
- tracd --port 8080 \
- --basic-auth="${PROJECT_NAME},${PWD}/htpasswd,realm" .
+ cp -r htdocs/* ${BUILD_PROJECT}/htdocs
+ cp -r templates/* ${BUILD_PROJECT}/templates
+ echo "Autenticate with: username/password"
+ ${BUILD_FOLDER}/bin/tracd --port 8080 \
+ --basic-auth="${PROJECT_NAME},${PWD}/${BUILD_FOLDER}/htpasswd,realm" \
+ ${BUILD_PROJECT}
+
+
+deps: clean
+ virtualenv ${BUILD_FOLDER}
+ @echo "Installing trac will take a while..."
+ ${BUILD_FOLDER}/bin/pip install trac
+ ${BUILD_FOLDER}/bin/trac-admin ${BUILD_PROJECT} \
+ initenv Test-Project sqlite:db/trac.db
+ htpasswd -b -c ${BUILD_FOLDER}/htpasswd username password
+ mkdir -p ${BUILD_PROJECT}/htdocs/css
+ mkdir -p ${BUILD_PROJECT}/htdocs/js
+ mkdir -p ${BUILD_PROJECT}/htdocs/img
+ wget -q \
+ http://twitter.github.com/bootstrap/assets/css/bootstrap.css\
+ -O ${BUILD_PROJECT}/htdocs/css/bootstrap.css
+ wget -q \
+ http://twitter.github.com/bootstrap/assets/css/bootstrap-responsive.css\
+ -O ${BUILD_PROJECT}/htdocs/css/bootstrap-responsive.css
+ wget -q \
+ http://twitter.github.com/bootstrap/assets/img/glyphicons-halflings.png\
+ -O ${BUILD_PROJECT}/htdocs/img/glyphicons-halflings.png
+ wget -q \
+ http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js\
+ -O ${BUILD_PROJECT}/htdocs/js/jquery.min.js
+ wget -q \
+ http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.0.3/bootstrap.min.js\
+ -O ${BUILD_PROJECT}/htdocs/js/bootstrap.min.js
-deps:
- sh ./get_deps.sh
+clean:
+ rm -rf ${BUILD_FOLDER}
View
14 README
@@ -10,7 +10,15 @@ This is far from being complete.
Screenshots:
http://adi.roiban.ro/articles/2012/2012-05-19-twitter-bootstrap-theme-for-trac.html
-The provided makefile will start the trac testing environment from the
-current folder and will load password from a 'passewd' file.
+The provided makefile can create a Python virtialenv for trac, create a demo
+trac project and start trac.
-To get external depedencies, run: make deps
+To create the testing/dev environment::
+
+ make deps
+
+To start Trac for testing:
+
+ make run
+
+Default username and password is: username/password.
View
37 get_deps.sh
@@ -1,37 +0,0 @@
-#!/bin/sh
-# Download dependencies.
-
-execute() {
- #Make sure $@ is called in quotes as otherwise it will not work.
- "$@"
- exit_code=$?
- if [ $exit_code -ne 0 ]; then
- echo "Fail:" $@
- exit 1
- fi
-}
-
-
-mkdir -p htdocs/css
-mkdir -p htdocs/js
-mkdir -p htdocs/img
-
-execute wget -q \
- http://twitter.github.com/bootstrap/assets/css/bootstrap.css\
- -O htdocs/css/bootstrap.css
-
-execute wget -q \
- http://twitter.github.com/bootstrap/assets/css/bootstrap-responsive.css\
- -O htdocs/css/bootstrap-responsive.css
-
-
-execute wget -q \
- http://twitter.github.com/bootstrap/assets/img/glyphicons-halflings.png\
- -O htdocs/img/glyphicons-halflings.png
-
-execute wget -q \
- http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js\
- -O htdocs/js/jquery.min.js
-execute wget -q \
- http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.0.3/bootstrap.min.js\
- -O htdocs/js/bootstrap.min.js
View
9 templates/theme.html
@@ -1,4 +1,5 @@
<?python
+from genshi.core import QName
first_metanav = chrome['nav']['metanav'][0]['label']
if hasattr(first_metanav, 'children'):
@@ -6,6 +7,8 @@
else:
user_menu_text = first_metanav
+for element in chrome['ctxtnav']:
+ element.attrib = element.attrib | [(QName('class'), 'btn')]
db = perm.env.get_db_cnx()
cursor = db.cursor()
@@ -107,12 +110,10 @@
<xi:include py:if="value_of('resourcepath_template')" href="${resourcepath_template}" />
<div id="ctxtnav" class="btn-group pull-right" py:if="chrome.ctxtnav">
- <button py:if="req.environ['PATH_INFO'].startswith('/wiki')" class="btn">
- <a href="${req.href(req.path_info)}?action=edit">
+ <a py:if="req.environ['PATH_INFO'].startswith('/wiki')" class="btn" href="${req.href(req.path_info)}?action=edit">
Edit page
</a>
- </button>
- <button py:for="i, elm in enumerate(chrome.ctxtnav)" class="btn">$elm</button>
+ <py:for each="i, elm in enumerate(chrome.ctxtnav)" class="btn">$elm</py:for>
</div>
<div id="warning" py:if="chrome.warnings" class="system-message">
Please sign in to comment.
Something went wrong with that request. Please try again.