[Bps-public-commit] r16267 - in Pushmi/trunk: . Pushmi-Admin/etc Pushmi-Admin/lib/Pushmi/Admin/Model Pushmi-Admin/share/web/static/css
alexmv at bestpractical.com
alexmv at bestpractical.com
Fri Oct 10 12:44:21 EDT 2008
Author: alexmv
Date: Fri Oct 10 12:44:20 2008
New Revision: 16267
Modified:
Pushmi/trunk/ (props changed)
Pushmi/trunk/Pushmi-Admin/etc/config.yml
Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin.pm
Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/Model/Replica.pm
Pushmi/trunk/Pushmi-Admin/share/web/static/css/app.css
Log:
r38086 at kohr-ah: chmrr | 2008-10-10 12:42:06 -0400
* Support for styling the DAV views with the app's styles
* Write a simple index page; I wish this could be templated in T::D or something
Modified: Pushmi/trunk/Pushmi-Admin/etc/config.yml
==============================================================================
--- Pushmi/trunk/Pushmi-Admin/etc/config.yml (original)
+++ Pushmi/trunk/Pushmi-Admin/etc/config.yml Fri Oct 10 12:44:20 2008
@@ -40,6 +40,7 @@
- Jifty::View::Static::Handler
- Jifty::View::Declare::Handler
- Jifty::View::Mason::Handler
+ VendorConfig: %etc/vendor_config.yml%
Web:
BaseURL: http://localhost
DataDir: var/mason
@@ -60,5 +61,6 @@
pushmi_bin: /usr/bin/pushmi
apache:
root: http://localhost/
+ document_root: ~
bin: sudo /etc/init.d/apache2
conf: /etc/apache2/pushmi.conf
Modified: Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin.pm
==============================================================================
--- Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin.pm (original)
+++ Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin.pm Fri Oct 10 12:44:20 2008
@@ -4,6 +4,7 @@
package Pushmi::Admin;
use SVK::Util 'str2time';
+use File::Copy qw//;
sub start {
my $class = shift;
@@ -88,6 +89,7 @@
my $apache_version = '2.2'; # XXX: detect 2.0
+ # Write apache configuration files
my $path = Jifty->config->app("apache")->{conf};
open(APACHE, ">", $path) or die "Can't write apache configuration file $path: $!";
my $replicas = Pushmi::Admin::Model::ReplicaCollection->new;
@@ -101,6 +103,48 @@
}
close(APACHE);
+ # Write index file and updated css, XSLT
+ my $doc_root = Jifty->config->app("apache")->{document_root};
+ if ($doc_root and -e $doc_root and -d $doc_root) {
+ open(INDEX, ">", "$doc_root/index.html") or die "Can't write apache index file: $!";
+ print INDEX <<EOT;
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head title="Pushmi mirror">
+ <meta content="text/html; charset=utf-8" http-equiv="content-type" />
+ <meta content="all" name="robots" />
+ <title>Pushmi mirror</title>
+ <link rel="stylesheet" type="text/css" href="/pushmi.css" />
+</head>
+<body>
+ <div id="content">
+ <div class="roundbox" id="replica-list">
+ <h2>Local mirrors</h2>
+ <ul>
+EOT
+ print INDEX qq{ <li><a href="/@{[$_->dav_root]}">@{[$_->name]}</a></li>\n}
+ for @{$replicas->items_array_ref};
+ print INDEX <<EOT;
+ </ul>
+ </div>
+ </div>
+</body>
+</html>
+EOT
+ close INDEX;
+
+ # Current CSS
+ my ($ccjs) = Jifty->find_plugin('Jifty::Plugin::CompressedCSSandJS');
+ $ccjs->generate_css;
+ my $key = Jifty::CAS->key('ccjs', 'css-all');
+ open(CSS, ">", "$doc_root/pushmi.css") or die "Can't write CSS file: $!";
+ print CSS Jifty::CAS->retrieve('ccjs',$key)->content;
+ close CSS;
+
+ # Copy over XSLT
+ File::Copy::copy(Jifty::Util->absolute_path("etc/pushmi.xsl"), "$doc_root/pushmi.xsl");
+ }
+
my $hup = Jifty->config->app("apache")->{bin};
system("$hup restart >/dev/null");
}
Modified: Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/Model/Replica.pm
==============================================================================
--- Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/Model/Replica.pm (original)
+++ Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/Model/Replica.pm Fri Oct 10 12:44:20 2008
@@ -386,6 +386,7 @@
<Location /@{[$self->dav_root]}>
DAV svn
SVNPath @{[$self->svn_root]}
+ SVNIndexXSLT /pushmi.xsl
PerlSetEnv JIFTY_APP_ROOT @{[Jifty::Util->app_root]}
PerlSetVar SVNPath @{[$self->svn_root]}
@@ -408,6 +409,7 @@
<Location /@{[$self->dav_root]}>
DAV svn
SVNPath @{[$self->svn_root]}
+ SVNIndexXSLT /pushmi.xsl
PerlSetEnv JIFTY_APP_ROOT @{[Jifty::Util->app_root]}
PerlSetVar SVNPath @{[$self->svn_root]}
Modified: Pushmi/trunk/Pushmi-Admin/share/web/static/css/app.css
==============================================================================
--- Pushmi/trunk/Pushmi-Admin/share/web/static/css/app.css (original)
+++ Pushmi/trunk/Pushmi-Admin/share/web/static/css/app.css Fri Oct 10 12:44:20 2008
@@ -139,7 +139,7 @@
margin-top: 3em;
}
-.roundbox h2 {
+.roundbox h2, #svn .rev {
margin-left: 0;
padding-left: 0;
float: left;
@@ -152,7 +152,11 @@
border: 1px solid #334;
}
-.roundbox p {
+#svn .rev {
+ font-size: 120%;
+}
+
+.roundbox p, .roundbox ul {
clear: left;
}
@@ -338,3 +342,24 @@
.advanced_options .option.last {
border-bottom: none;
}
+
+/* SVN styles */
+
+#svn div.path {
+ clear: left;
+ margin-top: 1em;
+ padding: 0.2em 1em;
+ background: #334;
+}
+
+#svn div.dir,
+#svn div.updir,
+#svn div.file {
+ margin-top: 2px;
+ padding: 0.2em 2em;
+ background: #334;
+}
+
+#svn div.file{
+ background: #223;
+}
More information about the Bps-public-commit
mailing list