changeset 14:d997ff96acf1

sync
author sergey
date Mon, 19 May 2014 18:34:16 +0400
parents a9ce584a7f3b
children 573a92d54f07
files dox_task.pl shared_view/errors/403.tt shared_view/errors/404.tt shared_view/errors/500.tt tests/test_scc.pl view/globals.tt view/layout/default/base.tt view/layout/default/index.tt view/layout/default/simple.tt view/layout/usermenu.tt
diffstat 10 files changed, 100 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/dox_task.pl	Mon May 19 04:34:28 2014 +0400
+++ b/dox_task.pl	Mon May 19 18:34:16 2014 +0400
@@ -3,18 +3,74 @@
 use config;
 use config::bootstrap;
 use strict;
-use IMPL::Config;
+use URI;
+
 
 use IMPL::require {
 	DoxygenTask => 'Benzin::Doxygen::MakedocTask',
-	DoxModel => 'Benzin::Doxygen::Model',
-	InlineFactory => 'IMPL::Object::InlineFactory'
+	HG => 'Benzin::SCC::Mercurial',
+	Config => 'IMPL::Config'
 };
 
-my $task = DoxygenTask->new(
-	%config::doxSource
+my @repos = (
+	{
+		doxyfile => '_doc/doxyfile',
+		src => 'https://hg.implab.org/pub/ImplabNet'
+	},
+	{
+		doxyfile => 'Doc/doxyfile',
+		src => 'https://hg.implab.org/private/Pallada.PoiskAvia'
+	}
 );
 
-$task->DoWork();
+my $base = Config->AppDir('mercurial-data');
+
+foreach my $desc (@repos) {
+	my $name = pop (@{[split /\//, $desc->{src}]});
+	print "processing: $name\n";  
+	my $dir = File::Spec->catdir($base,$name);
+	my $update;
+	if (-d $dir) {
+		
+		my $repo = HG->new($dir,\%config::hgSettings);
+		my $income = $repo->Income();
+		if (@$income) {
+			print "donwloading changes\n";
+			$repo->Pull(['-u']);
+			$update = 1;
+		}
+	} else {
+		print "clonning $name to $dir\n";
+		my $repo = HG->Clone($desc->{src},$dir,[],\%config::hgSettings);
+		$update = 1;
+	}
+	
+	if ($update) {
+		print "updating $name";
+		my $task = DoxygenTask->new(
+			doxyfile => File::Spec->catdir($dir,$desc->{doxyfile}),
+			makedoc => 1,
+			dataDirPath => Config->AppDir('doxygen-data', $name),
+			connection => $config::doxConnection  
+		);
+		
+		$task->DoWork();
+	} else {
+		print "$name is up to date\n";
+	}
+}
+
+#xmlDocPath => '/home/sergey/projects/Dusel/_doc/xml',
+#    collectionName => 'dusel',
+#    doxyfile => '/home/sergey/projects/Dusel/_doc/doxyfile',
+#    dataDirPath => File::Spec->catdir($base,'doxygen-data','dusel'),
+#    connection => $doxConnection,
+#    language => 'csharp'
+
+#my $task = DoxygenTask->new(
+#	%config::doxSource
+#);
+
+#$task->DoWork();
 
 print "completed\n";
\ No newline at end of file
--- a/shared_view/errors/403.tt	Mon May 19 04:34:28 2014 +0400
+++ b/shared_view/errors/403.tt	Mon May 19 18:34:16 2014 +0400
@@ -1,3 +1,4 @@
+[% document.layout = 'simple' %]
 <b>forbidden</b>
 <pre>
 $model
--- a/shared_view/errors/404.tt	Mon May 19 04:34:28 2014 +0400
+++ b/shared_view/errors/404.tt	Mon May 19 18:34:16 2014 +0400
@@ -1,3 +1,4 @@
+[% document.layout = 'simple' %]
 <b>Ресурс не найден</b>
 <pre>
 $model
--- a/shared_view/errors/500.tt	Mon May 19 04:34:28 2014 +0400
+++ b/shared_view/errors/500.tt	Mon May 19 18:34:16 2014 +0400
@@ -1,3 +1,4 @@
+[% document.layout = 'simple' %]
 <b>exception</b>
 <pre>
 $model
--- a/tests/test_scc.pl	Mon May 19 04:34:28 2014 +0400
+++ b/tests/test_scc.pl	Mon May 19 18:34:16 2014 +0400
@@ -15,10 +15,16 @@
 	\%config::hgSettings
 );
 
-foreach my $info (@{$repo->Income() || []}) {
-	print "$info->{number} : $info->{hash}\n";
-}
+$repo->name('ImplabNet');
+$repo->SaveConfig();
+
+print "repo: ", $repo->hgrc->val('paths','default')," name: " ,$repo->name, "\n";
 
 $repo->Pull('-u', '-r' => 20);
 
+print "LISTING\n";
+print "repo: ",$_->path, " " , $_->hgrc->val('paths','default','local'), "\n"
+	foreach @{HG->ListRepos('/tmp')};
+
+
 print "done\n";
\ No newline at end of file
--- a/view/globals.tt	Mon May 19 04:34:28 2014 +0400
+++ b/view/globals.tt	Mon May 19 18:34:16 2014 +0400
@@ -1,3 +1,4 @@
 [%
 	css = app.location.static.css.SetView('css');
+	adminRole = security.aliases.adminRole;
 %]
\ No newline at end of file
--- a/view/layout/default/base.tt	Mon May 19 04:34:28 2014 +0400
+++ b/view/layout/default/base.tt	Mon May 19 18:34:16 2014 +0400
@@ -18,18 +18,7 @@
 			id = 'main-menu'
 	)%]
 	[%
-		IF user.isNobody;
-			usermenu = [
-				{ title = 'Login', href= app.location.user.login(ref = location) }
-			];
-		ELSE;
-			usermenu = [
-				{ title = user.name },
-				{ title = 'Settings', href = app.location.user },
-				{ title = 'Logout', href = app.location.user.logout }
-			];
-		END;
-		render('menu', items = usermenu, class = 'menu-bar float-right', id = 'user-menu');
+		render('usermenu');
 	%]
 	<div style="clear: both"></div>
 </div>
--- a/view/layout/default/index.tt	Mon May 19 04:34:28 2014 +0400
+++ b/view/layout/default/index.tt	Mon May 19 18:34:16 2014 +0400
@@ -11,17 +11,6 @@
 </div>
 <div id="top-menu">
 	[%
-		IF user.isNobody;
-			usermenu = [
-				{ title = 'Login', href= app.location.user.login(ref = location) }
-			];
-		ELSE;
-			usermenu = [
-				{ title = user.name },
-				{ title = 'Settings', href = app.location.user },
-				{ title = 'Logout', href = app.location.user.logout }
-			];
-		END;
-		render('menu', items = usermenu, class = 'menu-bar float-right', id = 'user-menu');
+		render('usermenu')
 	%]
 </div>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/view/layout/default/simple.tt	Mon May 19 18:34:16 2014 +0400
@@ -0,0 +1,6 @@
+[%
+	document.css.push(css.global);
+%]
+<div id="page-content">
+	$content
+</div>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/view/layout/usermenu.tt	Mon May 19 18:34:16 2014 +0400
@@ -0,0 +1,17 @@
+[%
+	IF user.isNobody;
+		usermenu = [
+			{ title = 'Login', href= app.location.user.login(ref = location) }
+		];
+	ELSE;
+		usermenu = [
+			{ title = user.name },
+			{ title = 'Settings', href = app.location.user },
+			{ title = 'Logout', href = app.location.user.logout }
+		];
+		IF session.Satisfy(adminRole);
+			usermenu.push({title = 'Admin', href = app.location.admin });
+		END;
+	END;
+	render('menu', items = usermenu, class = 'menu-bar float-right', id = 'user-menu');
+%]
\ No newline at end of file