svn: /pear2/sandbox/pear2.php.net/trunk/www/ css/file-browser.css templates/pear2/html/Main.tpl.php templates/pear2/html/ReleaseFileBrowser.tpl.php

From: Date: Mon, 05 Jul 2010 20:40:55 +0000
Subject: svn: /pear2/sandbox/pear2.php.net/trunk/www/ css/file-browser.css templates/pear2/html/Main.tpl.php templates/pear2/html/ReleaseFileBrowser.tpl.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-9559@lists.php.net to get a copy of this message
gauthierm Mon, 05 Jul 2010 20:40:55 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=301009 Log: Start styling up the release file browser. Changed paths: A pear2/sandbox/pear2.php.net/trunk/www/css/file-browser.css U pear2/sandbox/pear2.php.net/trunk/www/templates/pear2/html/Main.tpl.php A pear2/sandbox/pear2.php.net/trunk/www/templates/pear2/html/ReleaseFileBrowser.tpl.php Added: pear2/sandbox/pear2.php.net/trunk/www/css/file-browser.css =================================================================== --- pear2/sandbox/pear2.php.net/trunk/www/css/file-browser.css (rev 0) +++ pear2/sandbox/pear2.php.net/trunk/www/css/file-browser.css 2010-07-05 20:40:55 UTC (rev 301009) @@ -0,0 +1,41 @@ +.file-list { + width: 250px; + float: left; + margin-top: 0; +} + +.file-list ul ul li { + margin-left: 0.5em; +} + +.file-content { + font-family: "Consolas", "Monaco", "DejaVu Sans Mono", "Lucida Console", monospace; + font-size: 12px; + margin: 0 0 0 280px; + width: 620px; +} +.file-content .file-line-numbers { + float: left; + color: #888; + margin-bottom: 2em; +} + +.file-content .file-line-numbers div { + text-align: right; + margin: 0 1em 0 0; +} + +.file-content .file-lines { + overflow-x: auto; +} + +.file-content .file-lines div { + margin: 0; + font-size: 12px; + white-space: nowrap; +} + +.file-content .file-end { + margin-top: 1em; + color: #888; +} Modified: pear2/sandbox/pear2.php.net/trunk/www/templates/pear2/html/Main.tpl.php =================================================================== --- pear2/sandbox/pear2.php.net/trunk/www/templates/pear2/html/Main.tpl.php 2010-07-05 19:31:51 UTC (rev 301008) +++ pear2/sandbox/pear2.php.net/trunk/www/templates/pear2/html/Main.tpl.php 2010-07-05 20:40:55 UTC (rev 301009) @@ -13,6 +13,7 @@ <link rel="stylesheet" href="<?php echo PEAR2\SimpleChannelFrontend\Main::getURL(); ?>css/package.css" /> <link rel="stylesheet" href="<?php echo PEAR2\SimpleChannelFrontend\Main::getURL(); ?>css/package-list.css" /> <link rel="stylesheet" href="<?php echo PEAR2\SimpleChannelFrontend\Main::getURL(); ?>css/search.css" /> + <link rel="stylesheet" href="<?php echo PEAR2\SimpleChannelFrontend\Main::getURL(); ?>css/file-browser.css" /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script src="<?php echo PEAR2\SimpleChannelFrontend\Main::getURL(); ?>js/pearweb.js"></script> Added: pear2/sandbox/pear2.php.net/trunk/www/templates/pear2/html/ReleaseFileBrowser.tpl.php =================================================================== --- pear2/sandbox/pear2.php.net/trunk/www/templates/pear2/html/ReleaseFileBrowser.tpl.php (rev 0) +++ pear2/sandbox/pear2.php.net/trunk/www/templates/pear2/html/ReleaseFileBrowser.tpl.php 2010-07-05 20:40:55 UTC (rev 301009) @@ -0,0 +1,83 @@ +<?php + +// Set the page title +$parent->context->page_title = 'File Content - ' + . PEAR2\SimpleChannelFrontend\Main::$title; + +?> +<div class="file-list pearbox"> +<div class="pearbox-header"> +<h3>Files</h3> +</div> +<div class="pearbox-content"> +<?php + +$traverseFiles = function(\RecursiveIterator $node) use (&$traverseFiles, $context) +{ + echo '<ul>'; + foreach ($node as $file) { + echo '<li>'; + + $filename = basename($file); + + if ($node->hasChildren()) { + echo $filename; + echo '/'; + $traverseFiles($node->getChildren()); + } else { + $filePath = substr( + $file, + strpos($file, $context->options['release']) + + strlen($context->options['release']) + 1 + ); + echo '<a href="?view=filebrowser&amp;release='.$context->options['release'].'&amp;internal=' . $filePath . '">'; + echo $filename; + echo '</a>'; + } + + echo '</li>'; + } + echo '</ul>'; +}; + +$node = $context->getRaw('release'); +$traverseFiles($node); + +?> +</div> +</div> +<div class="file-content"> +<?php + +if (isset($context->internal_file)) { + echo '<div class="file-line-numbers">'; + $count = 0; + foreach ($context->internal_file as $line) { + $count++; + $class = ($count % 2 === 0) ? 'even' : 'odd'; + $line = str_replace(' ', '&nbsp;', $line); + echo '<div class=' . $class . '>' . $count . '</div>'; + } + echo '</div>'; +} + +if (isset($context->internal_file)) { + echo '<div class="file-lines">'; + $count = 0; + foreach ($context->internal_file as $line) { + $count++; + $class = ($count % 2 === 0) ? 'even' : 'odd'; + $line = str_replace(' ', '&nbsp;', $line); + $line = str_replace("\t", '&nbsp;&nbsp;&nbsp;&nbsp;', $line); + if (preg_match('/^\s+$/', $line) === 1) { + $line = '&nbsp;'; + } + echo '<div class=' . $class . '>' . $line . '</div>'; + } + echo '</div>'; +} + +echo '<div class="file-end">EOF</div>'; + +?> +</div> Property changes on: pear2/sandbox/pear2.php.net/trunk/www/templates/pear2/html/ReleaseFileBrowser.tpl.php ___________________________________________________________________ Added: svn:keywords + Id Rev Revision Added: svn:eol-style + native

« previous php.pear.core (#9559) next »