diff options
| author | Christian Weiske <cweiske@cweiske.de> | 2012-03-27 21:44:13 +0200 |
|---|---|---|
| committer | Christian Weiske <cweiske@cweiske.de> | 2012-03-27 21:44:13 +0200 |
| commit | 271df87bc8c768167889902c455d3c7dfc0f155b (patch) | |
| tree | c1ee1c68f35d8ee769c2611619bb7f4217c2e2d6 | |
| parent | 907069eb20e289851641b0383e9e13a91008bc33 (diff) | |
| download | phorkie-271df87bc8c768167889902c455d3c7dfc0f155b.tar.gz phorkie-271df87bc8c768167889902c455d3c7dfc0f155b.zip | |
use twitter bootstrap for layouting
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | data/config.default.php | 1 | ||||
| -rw-r--r-- | data/config.php.dist | 3 | ||||
| -rw-r--r-- | data/templates/base.htm | 42 | ||||
| -rw-r--r-- | data/templates/display.htm | 31 | ||||
| -rw-r--r-- | data/templates/list.htm | 14 | ||||
| -rw-r--r-- | www/phorkie.css | 28 | ||||
| -rw-r--r-- | www/www-header.php | 1 |
8 files changed, 100 insertions, 21 deletions
@@ -1,2 +1,3 @@ README.html repos +data/config.php diff --git a/data/config.default.php b/data/config.default.php index ec68622..ab5c474 100644 --- a/data/config.default.php +++ b/data/config.default.php @@ -2,5 +2,6 @@ $GLOBALS['phorkie']['cfg'] = array( 'repos' => __DIR__ . '/../repos/', 'tpl' => __DIR__ . '/templates/', + 'css' => 'http://twitter.github.com/bootstrap/assets/css/bootstrap.css', ); ?>
\ No newline at end of file diff --git a/data/config.php.dist b/data/config.php.dist index e69de29..b213e85 100644 --- a/data/config.php.dist +++ b/data/config.php.dist @@ -0,0 +1,3 @@ +<?php +//$GLOBALS['phorkie']['cfg']['repos'] = '/var/data/phorkie/'; +?> diff --git a/data/templates/base.htm b/data/templates/base.htm index d0c3cee..aaf61da 100644 --- a/data/templates/base.htm +++ b/data/templates/base.htm @@ -1,17 +1,43 @@ <!DOCTYPE html> <html> <head> + <link rel="stylesheet" href="{{css}}"/> <link rel="stylesheet" href="phorkie.css" /> <title>{% block title %}{% endblock %} - Phorkie</title> </head> <body> - <nav> - <ul> - <a href="/">New paste</a> - <a href="/list">List all</a> - <a href="/search">Search</a> - </ul> - </nav> - <article>{% block content %}{% endblock %}</article> + <div class="navbar"> + <div class="navbar-inner"> + <div class="container"> + <a class="brand" href="/"> + Phorkie + </a> + <ul class="nav"> + <li> + <a href="/">New paste</a> + </li> + <li> + <a href="/list">List all</a> + </li> + <li> + <form class="navbar-search pull-left" action="/search" method="get"> + <input type="text" class="search-query" name="q" placeholder="Search"/> + </form> + </li> + </ul> + </div> + </div> + </div> + + <div class="container-fluid"> + <div class="row"> + <div class="span9"> + {% block content %}{% endblock %} + </div> + <div class="span3"> + {% block sidebar %}{% endblock %} + </div> + </div> + </div> </body> </html>
\ No newline at end of file diff --git a/data/templates/display.htm b/data/templates/display.htm index afdc75c..cabff59 100644 --- a/data/templates/display.htm +++ b/data/templates/display.htm @@ -3,17 +3,28 @@ {% block content %} <h1>{{repo.getDescription}}</h1> -<ul class="links"> - <li><a href="{{repo.getLink('edit')}}">edit</a></li> - <li><a href="{{repo.getLink('fork')}}">fork</a></li> -</ul> +<div class="row-fluid"> + <div class="span6"> + <a class="btn" href="{{repo.getLink('edit')}}"><i class="icon-edit"></i> edit</a> + </div> + <div class="span6" style="text-align: right"> + <a class="btn" href="{{repo.getLink('fork')}}"><i class="icon-share"></i> fork</a> + </div> +</div> + {% for file in repo.getFiles %} -<div> - <h2 id="{{file.getFilename}}">{{file.getFilename}}<a class="anchorlink" href="#{{file.getFilename}}"></a></h2> - <p> - <a href="{{file.getLink('raw')}}">raw</a> - </p> - {{file.getHighlightedContent|raw}} +<div class="file"> + <div class="header"> + <a class="btn btn-mini" href="{{file.getLink('raw')}}" style="float: right;">raw</a> + <h3 id="{{file.getFilename}}">{{file.getFilename}}<a class="anchorlink" href="#{{file.getFilename}}"></a></h3> + </div> + <div class="code"> + {{file.getHighlightedContent|raw}} + </div> </div> {% endfor %} {% endblock %} + +{% block sidebar %} +sidebar FIXME +{% endblock %}
\ No newline at end of file diff --git a/data/templates/list.htm b/data/templates/list.htm index 5142a7b..ea71bd6 100644 --- a/data/templates/list.htm +++ b/data/templates/list.htm @@ -12,13 +12,21 @@ </ul> <ul class="pager"> {% if links.prev %} - <li class="prev"> - <a href="{{links.prev}}">prev</a> + <li class="previous"> + <a href="{{links.prev}}">← prev</a> + </li> + {% else %} + <li class="previous disabled"> + <a href="#">← prev</a> </li> {% endif %} {% if links.next %} <li class="next"> - <a href="{{links.next}}">next</a> + <a href="{{links.next}}">next →</a> + </li> + {% else %} + <li class="next disabled"> + <a href="#">next →</a> </li> {% endif %} </ul> diff --git a/www/phorkie.css b/www/phorkie.css index d6d1173..fe41780 100644 --- a/www/phorkie.css +++ b/www/phorkie.css @@ -1,4 +1,9 @@ /* show IDs for anchors */ +a.anchorlink:before { + font-size: smaller; + content: '_'; + color: transparent; +} h1[id]:hover a.anchorlink:before, h2[id]:hover a.anchorlink:before, h3[id]:hover a.anchorlink:before, @@ -14,3 +19,26 @@ a.anchorlink { margin-left: 0.5em; font-size: smaller; } +.navbar .brand { + /*float: right;*/ + color: yellow; + text-shadow: 0 1px 0 rgba(255, 255, 255, .1), 0 0 30px rgba(255, 255, 255, .125); +} + +.file { + margin-top: 2em; + +} +.file .header { + padding: 1.0ex; + margin-bottom: 1em; + background-color: whiteSmoke; + border: 1px solid #EEE; + border: 1px solid rgba(0, 0, 0, 0.05); + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.file .code { + margin-left: 2em; +}
\ No newline at end of file diff --git a/www/www-header.php b/www/www-header.php index 5b2fa56..01214d7 100644 --- a/www/www-header.php +++ b/www/www-header.php @@ -45,6 +45,7 @@ $twig = new \Twig_Environment( function render($tplname, $vars) { + $vars['css'] = $GLOBALS['phorkie']['cfg']['css']; $template = $GLOBALS['twig']->loadTemplate($tplname . '.htm'); echo $template->render($vars); } |
