Permalink
Browse files

fixes

  • Loading branch information...
1 parent 4b2e7e8 commit f4d3ffe4dc15bc4a8f618a4556bfbba5a626645d @nicolasfranck nicolasfranck committed May 2, 2012
View
3 Build.PL
@@ -30,7 +30,8 @@ my $requires = {
'Image::ExifTool' => 0,
'enum' => 0,
'Time::Seconds' => 0,
- 'Template::Plugin::POSIX' => 0
+ 'Template::Plugin::POSIX' => 0,
+ 'File::MimeInfo' => 0
};
my $recommends = {
'Starman' => 0,
View
2 doc/scans.scheme
@@ -34,7 +34,7 @@ projects:
name: papyri
name_subproject: 1ste batch
description: 'dit is de 1ste batch van ..'
- date_start: 11-04-2012
+ datetime_start: 11-04-2012
query: BHSL.PAP
total: 203 (totale lijst van objecten, zoals resultatenlijst van de query aangeeft) -> gecached resultaat ('s nachts gegenereerd)
done: 0 (aantal objecten die in alle platformen gepubliceerd is) -> gecached resultaat ('s nachts gegeneerd)
View
2 doc/schema-scans.xml
@@ -507,7 +507,7 @@ Attributes of the DelimitedPayloadTokenFilterFactory :
<field name="project_name" type="lupetext" indexed="true" stored="true" />
<field name="project_name_subproject" type="lupetext" indexed="true" stored="true" />
<field name="project_description" type="lupetext" indexed="true" stored="true" />
- <field name="project_date_start" type="string" indexed="true" stored="true" />
+ <field name="project_datetime_start" type="string" indexed="true" stored="true" />
<field name="project_query" type="lupetext" indexed="true" stored="true" />
<field name="project_total" type="int" indexed="true" stored="true" />
<field name="project_done" type="int" indexed="true" stored="true" />
View
2 doc/schema.xml
@@ -504,7 +504,7 @@ Attributes of the DelimitedPayloadTokenFilterFactory :
<field name="project_name" type="lupetext" indexed="true" stored="true" />
<field name="project_name_subproject" type="lupetext" indexed="true" stored="true" />
<field name="project_description" type="lupetext" indexed="true" stored="true" />
- <field name="project_date_start" type="string" indexed="true" stored="true" />
+ <field name="project_datetime_start" type="string" indexed="true" stored="true" />
<field name="project_query" type="lupetext" indexed="true" stored="true" />
<field name="project_total" type="int" indexed="true" stored="true" />
<field name="project_done" type="int" indexed="true" stored="true" />
View
34 environments/development.yml
@@ -133,6 +133,9 @@ mounts:
processed:
windows: "I:\\"
samba: "smb://localhost/02_processed"
+ ready:
+ windows: "J:\\"
+ samba: "smb://localhost/01_ready"
status:
change:
all:
@@ -194,31 +197,30 @@ human_readable:
profiles:
NARA:
packages:
- - args: {}
- class: "Imaging::Test::Dir::scan"
+ - class: "Imaging::Test::Dir::scan"
+ args: {}
on_error: "stop"
- - args: {}
- class: "Imaging::Test::Dir::checkPermissions"
+ - class: "Imaging::Test::Dir::checkPermissions"
+ args: {}
on_error: "continue"
- - args:
- patterns:
- - '^\./'
- class: "Imaging::Test::Dir::hasNoFiles"
+ - class: "Imaging::Test::Dir::checkEmpty"
+ args: {}
on_error: "continue"
- - args: {}
- class: "Imaging::Test::Dir::checkEmpty"
+ - class: "Imaging::Test::Dir::checkFilePattern"
+ args:
+ pattern: "(txt|tif)$"
on_error: "continue"
- - args:
+ - class: "Imaging::Test::Dir::checkTIFF"
+ args:
valid_patterns:
- '^(?!manifest\.txt$)'
- class: "Imaging::Test::Dir::checkTIFF"
on_error: "continue"
- - args:
+ - class: "Imaging::Test::Dir::NARA::checkFilename"
+ args:
valid_patterns:
- '^(?!manifest\.txt$)'
- class: "Imaging::Test::Dir::NARA::checkFilename"
on_error: "continue"
- - args:
+ - class: "Imaging::Test::Dir::checkAleph"
+ args:
solr_args: *meercatindex
- class: "Imaging::Test::Dir::checkAleph"
on_error: "continue"
View
17 environments/production.yml
@@ -1,17 +0,0 @@
-# configuration file for production environment
-
-# only log warning and error messsages
-log: "warning"
-
-# log message to a file in logs/
-logger: "file"
-
-# don't consider warnings critical
-warnings: 0
-
-# hide errors
-show_errors: 0
-
-# cache route resolution for maximum performance
-route_cache: 1
-
View
15 lib/Imaging/Routes/logs.pm
@@ -37,8 +37,19 @@ any('/logs',sub {
start => $offset,
limit => $num
);
- if($sort && $sort =~ /^\w+\s(?:asc|desc)$/o){
- $opts{sort} = [$sort,"scan_id desc"];
+ if(is_string($sort)){
+ $opts{sort} = [ $sort ] if $sort =~ /^\w+\s(?:asc|desc)$/o;
+ }elsif(is_array_ref($sort)){
+ my $ok = 1;
+ foreach(@$sort){
+ if($_ !~ /^\w+\s(?:asc|desc)$/o){
+ $ok = 0;
+ last;
+ }
+ }
+ if($ok){
+ $opts{sort} = $sort;
+ }
}else{
$opts{sort} = ["datetime desc","scan_id desc"];
}
View
43 lib/Imaging/Routes/projects.pm
@@ -51,8 +51,27 @@ any('/projects',sub {
$params->{num} = $num;
my $offset = ($page - 1)*$num;
- my $projects = projects->slice($offset,$num)->to_array();
+ my $projects = projects->to_array();
+
+ if(is_string($params->{'sort'}) && $params->{'sort'} =~ /^(\w+)\s(?:asc|desc)$/o){
+ my($sort_key,$sort_dir)=($1,$2);
+ if(is_string($projects->[0]->{$sort_key})){
+ our($a,$b);
+ $projects = [ sort {
+ if(is_number($a->{$sort_key})){
+ return ( $a->{$sort_key} <=> $b->{$sort_key} );
+ }else{
+ return ( $a->{$sort_key} cmp $b->{$sort_key} );
+ }
+ } @$projects ];
+ }
+ if($sort_dir eq "desc"){
+ $projects = [reverse(@$projects)];
+ }
+ }
+ $projects = [splice(@$projects,$offset,$num)];
+
my $page_info = Data::Pageset->new({
'total_entries' => projects->count,
'entries_per_page' => $num,
@@ -74,7 +93,7 @@ any('/projects/add',sub{
if($params->{submit}){
#check empty string
- my @keys = qw(name name_subproject description date_start query);
+ my @keys = qw(name name_subproject description datetime_start query);
foreach my $key(@keys){
if(!is_string($params->{$key})){
push @errors,"$key is niet opgegeven";
@@ -94,7 +113,7 @@ any('/projects/add',sub{
}
#check format
my %check = (
- date_start => sub{
+ datetime_start => sub{
my $value = shift;
my($success,$error)=(1,undef);
try{
@@ -115,11 +134,15 @@ any('/projects/add',sub{
}
#insert
if(scalar(@errors)==0){
+ $params->{datetime_start} =~ /^(\d{2})-(\d{2})-(\d{4})$/o;
+ say to_dumper($params);
+ say "day:$1, month:$2, year:$3";
+ my $datetime = DateTime->new( day => int($1), month => int($2), year => int($3));
my $project = projects->add({
name => $params->{name},
name_subproject => $params->{name_subproject},
description => $params->{description},
- date_start => $params->{date_start},
+ datetime_start => $datetime->epoch,
datetime_last_modified => Time::HiRes::time,
query => $params->{query},
locked => 0,
@@ -153,7 +176,7 @@ any('/project/:_id/edit',sub{
if($params->{submit}){
if(!$project->{locked}){
#check empty string
- my @keys = qw(name name_subproject description date_start query);
+ my @keys = qw(name name_subproject description datetime_start query);
foreach my $key(@keys){
if(!is_string($params->{$key})){
push @errors,"$key is niet opgegeven";
@@ -173,13 +196,13 @@ any('/project/:_id/edit',sub{
}
#check format
my %check = (
- date_start => sub{
+ datetime_start => sub{
my $value = shift;
my($success,$error)=(1,undef);
try{
- DateTime::Format::Strptime::strptime("%d-%m-%Y",$value);
+ my $datetime = DateTime::Format::Strptime::strptime("%d-%m-%Y",$value);
+
}catch{
- say $_;
$success = 0;
$error = "startdatum is ongeldig (dag-maand-jaar)";
};
@@ -194,11 +217,13 @@ any('/project/:_id/edit',sub{
}
#insert
if(scalar(@errors)==0){
+ $params->{datetime_start} =~ /^(\d{2})-(\d{2})-(\d{4})$/o;
+ my $datetime = DateTime->new( day => int($1), month => int($2), year => int($3));
my $new = {
name => $params->{name},
name_subproject => $params->{name_subproject},
description => $params->{description},
- date_start => $params->{date_start},
+ datetime_start => $datetime->epoch,
datetime_last_modified => Time::HiRes::time,
query => $params->{query}
};
View
15 lib/Imaging/Routes/qa_control.pm
@@ -60,7 +60,20 @@ any('/qa_control',sub {
facet => "true",
"facet.field" => "status"
);
- $opts{sort} = $sort if $sort && $sort =~ /^\w+\s(?:asc|desc)$/o;
+ if(is_string($sort)){
+ $opts{sort} = [ $sort ] if $sort =~ /^\w+\s(?:asc|desc)$/o;
+ }elsif(is_array_ref($sort)){
+ my $ok = 1;
+ foreach(@$sort){
+ if($_ !~ /^\w+\s(?:asc|desc)$/o){
+ $ok = 0;
+ last;
+ }
+ }
+ if($ok){
+ $opts{sort} = $sort;
+ }
+ }
my @errors = ();
my($result);
try {
View
29 lib/Imaging/Routes/scans.pm
@@ -157,7 +157,20 @@ any('/scans',sub {
start => $offset,
limit => $num
);
- $opts{sort} = $sort if $sort && $sort =~ /^\w+\s(?:asc|desc)$/o;
+ if(is_string($sort)){
+ $opts{sort} = [ $sort ] if $sort =~ /^\w+\s(?:asc|desc)$/o;
+ }elsif(is_array_ref($sort)){
+ my $ok = 1;
+ foreach(@$sort){
+ if($_ !~ /^\w+\s(?:asc|desc)$/o){
+ $ok = 0;
+ last;
+ }
+ }
+ if($ok){
+ $opts{sort} = $sort;
+ }
+ }
my @errors = ();
my($result);
try {
@@ -199,6 +212,12 @@ any('/scans/view/:_id',sub {
if($scan->{project_id}){
$project = projects->get($scan->{project_id});
}
+ my $files = $scan->{files} || [];
+ our($a,$b);
+ $files = [sort {
+ $a->{name} cmp $b->{name};
+ } @$files];
+ $scan->{files} = $files;
template('scans/view',{
scan => $scan,
@@ -239,6 +258,14 @@ any('/scans/edit/:_id',sub{
scan2index($scan);
}
}
+
+ my $files = $scan->{files} || [];
+ our($a,$b);
+ $files = [sort {
+ $a->{name} cmp $b->{name};
+ } @$files];
+ $scan->{files} = $files;
+
#edit - end
template('scans/edit',{
scan => $scan,
View
2 lib/Imaging/Test/Dir.pm
@@ -7,6 +7,7 @@ use File::Find;
use File::Spec;
use Cwd qw(cwd getcwd fastcwd fastgetcwd chdir abs_path fast_abs_path realpath fast_realpath);
use Try::Tiny;
+use File::MimeInfo;
sub import {
Catmandu::Sane->import;
@@ -15,6 +16,7 @@ sub import {
File::Find->import;
Cwd->import(qw(cwd getcwd fastcwd fastgetcwd chdir abs_path fast_abs_path realpath fast_realpath));
Try::Tiny->import;
+ File::MimeInfo->import;
}
sub _load_file_info {
my $self = shift;
View
34 lib/Imaging/Test/Dir/checkFilePattern.pm
@@ -0,0 +1,34 @@
+package Imaging::Test::Dir::checkFilePattern;
+use Moo;
+
+has pattern => (
+ is => 'rw',
+ isa => sub {
+ rx($_[0]);
+ },
+ default => sub{
+ qr/.*/;
+ }
+);
+sub is_fatal {
+ 1;
+};
+sub test {
+ my $self = shift;
+ my $topdir = $self->dir();
+ my $file_info = $self->file_info();
+ my(@errors) = ();
+ my $pattern = $self->pattern;
+
+ foreach my $stats(@$file_info){
+ if($stats->{basename} !~ $pattern){
+ push @errors,"file $stats->{basename} has incorrect filename";
+ }
+ }
+
+ scalar(@errors) == 0,\@errors;
+}
+
+with qw(Imaging::Test::Dir);
+
+1;
View
2 lib/Imaging/Test/Dir/checkJPEG.pm
@@ -20,7 +20,7 @@ sub test {
if($exif->{Error}){
push @errors,$stats->{path}." is not an image";
}elsif(!(uc($exif->{FileType}) eq "JPEG" && $exif->{MIMEType} eq "image/jpeg")){
- push @errors,$stats->{path}." is not a jpeg (filetype found:".$exif->{FileType}.")";
+ push @errors,$stats->{path}." is not a jpeg (filetype found:".mimetype($stats->{path}).")";
}
}
scalar(@errors) == 0,\@errors;
View
2 lib/Imaging/Test/Dir/checkTIFF.pm
@@ -20,7 +20,7 @@ sub test {
if($exif->{Error}){
push @errors,$stats->{path}." is not an image";
}elsif(!(uc($exif->{FileType}) eq "TIFF" && $exif->{MIMEType} eq "image/tiff")){
- push @errors,$stats->{path}." is not a tiff (filetype found:".$exif->{FileType}.")";
+ push @errors,$stats->{path}." is not a tiff (filetype found:".mimetype($stats->{path}).")";
}
}
scalar(@errors) == 0,\@errors;
View
24 lib/Template/Plugin/SizePretty.pm
@@ -28,16 +28,20 @@ sub new {
sub size_pretty {
my $size = shift;
my @sizes = ();
- foreach my $currency(@$currencies){
- my $q = $size / $currency->{size};
- my $r = $size % $currency->{size};
- $size = $r;
- my $q_floored = floor($q);
- if($q_floored >= 1){
- push @sizes,"$q_floored ".$currency->{name}
- }
- }
- return join(' ',@sizes);
+ if($size > 0){
+ foreach my $currency(@$currencies){
+ my $q = $size / $currency->{size};
+ my $r = $size % $currency->{size};
+ $size = $r;
+ my $q_floored = floor($q);
+ if($q_floored >= 1){
+ push @sizes,"$q_floored ".$currency->{name}
+ }
+ }
+ return join(' ',@sizes);
+ }else{
+ return "0B";
+ }
}
__PACKAGE__;
View
7 perl/cron-register.pl
@@ -89,6 +89,11 @@ sub index_log {
%{ config->{store}->{'index_log'}->{options} }
)->bag();
}
+sub index_log {
+ state $index_log = Catmandu::Store::Solr->new(
+ %{ config->{store}->{'index_log'}->{options} }
+ )->bag();
+}
sub mount_conf {
state $mount_conf = do {
my $dir = dirname(__FILE__);
@@ -465,7 +470,7 @@ sub marc_datafield_array {
if($query !~ /^RUG01-/o){
$query =~ s/^RUG01-/rug01:/o;
}else{
- $query = "scan:$query";
+ $query = "location:$query";
}
my $res = meercat()->search($query,{rows=>1000});
$scan->{metadata} = [];
View
7 public/css/master.css
@@ -81,3 +81,10 @@ div.comment_info {
font-size:9pt;
color:#888888;
}
+th.sortable {
+ background-image: url("/images/bg.gif");
+ background-repeat: no-repeat;
+ background-position: center right;
+ padding-right:20px;
+}
+
View
BIN public/images/asc.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN public/images/bg.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN public/images/desc.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
38 views/logs.tt
@@ -1,30 +1,44 @@
-[% PROCESS inc/reload.tt %]
<h1>Laatste activiteiten</h1>
<div class="paging">
[% IF logs && logs.size > 0 %]
+ [% IF params.item("sort").list %]
+ [% sort = params.item("sort").list %]
+ [% ELSIF params.item("sort").size > 0 %]
+ [% sort = params.item("sort") %]
+ [% ELSE %]
+ [% sort = [] %]
+ [% END %]
+
+ [% sortlist = [] %]
+ [% FOREACH s IN sort %]
+ [% SET s = s | uri %]
+ [% sortlist.push("sort=" _ s) %]
+ [% END %]
+ [% sortlist = sortlist.join('&amp;') %]
+
[% IF page_info.first_page && ( page_info.first_page < page_info.current_page ) %]
- <a href="/logs?page=[% page_info.first_page %]&amp;num=[% params.num %]&amp;q=[% params.q | uri %]&amp;sort=[% params.item("sort") | uri %]">eerste</a>
+ <a href="/logs?page=[% page_info.first_page %]&amp;num=[% params.num %]&amp;q=[% params.q | uri %]&amp;[% sortlist %]">eerste</a>
[% END %]
[% IF page_info.previous_page %]
- <a href="/logs?page=[% page_info.previous_page %]&amp;num=[% params.num %]&amp;q=[% params.q | uri %]&amp;sort=[% params.item("sort") | uri %]" >vorige</a>
+ <a href="/logs?page=[% page_info.previous_page %]&amp;num=[% params.num %]&amp;q=[% params.q | uri %]&amp;[% sortlist %]" >vorige</a>
[% END %]
[% FOREACH page IN page_info.pages_in_set %]
[% IF page == page_info.current_page %]
<span class="current">[% page %]</span>
[% ELSE %]
- <a href="/logs?page=[% page %]&amp;num=[% params.num %]&amp;q=[% params.q | uri %]&amp;sort=[% params.item("sort") | uri %]">[% page %]</a>
+ <a href="/logs?page=[% page %]&amp;num=[% params.num %]&amp;q=[% params.q | uri %]&amp;[% sortlist %]">[% page %]</a>
[% END %]
[% END %]
[% IF page_info.next_page %]
- <a href="/logs?page=[% page_info.next_page %]&amp;num=[% params.num %]&amp;q=[% params.q | uri %]&amp;sort=[% params.item("sort") | uri %]" >volgende</a>
+ <a href="/logs?page=[% page_info.next_page %]&amp;num=[% params.num %]&amp;q=[% params.q | uri %]&amp;[% sortlist %]" >volgende</a>
[% END %]
[% IF page_info.last_page && ( page_info.last_page > page_info.current_page ) %]
- <a href="/logs?page=[% page_info.last_page %]&amp;num=[% params.num %]&amp;q=[% params.q | uri %]&amp;sort=[% params.item("sort") | uri %]">laatste</a>
+ <a href="/logs?page=[% page_info.last_page %]&amp;num=[% params.num %]&amp;q=[% params.q | uri %]&amp;[% sortlist %]">laatste</a>
[% END %]
(
[% page = params.page || 1 %]
@@ -36,12 +50,20 @@
<form method="GET" id="query-form">
<input type="text" name="q" id="q" value="[% params.q | html %]" size="50" />
<input type="submit" value="search" />
+ <select name="sort" id="sort" onchange="document.getElementById('query-form').submit();">
+ <option value="">--sorteer resultaten--</option>
+ [% FOREACH key IN ["datetime","owner","status","owner","user_name"] %]
+ <option value="[% key %] asc" [% IF sort.grep(key _ " asc").size > 0 %]selected="selected"[% END %]>[% key.replace("_"," ") %] oplopend</option>
+ <option value="[% key %] desc" [% IF sort.grep(key _ " desc").size > 0 %]selected="selected"[% END %]>[% key.replace("_"," ") %] aflopend</option>
+ [% END %]
+ </select>
+
[% SET numbers = [5,10,20,50,100] %]
<select name="num" id="num" onchange="document.getElementById('query-form').submit();">
<option value="">-- aantal per pagina --</option>
- [% FOREACH number IN numbers %]
+ [% FOREACH number IN numbers %]
<option value="[% number %]" [% IF params.num == number %]selected="selected"[% END %]>[% number %]</option>
- [% END %]
+ [% END %]
</select>
</form>
[% IF logs && logs.size > 0 %]
View
4 views/project/edit.tt
@@ -10,6 +10,8 @@
});
});
</script>
+[% USE date %]
+[% USE POSIX %]
<h1>Edit project</h1>
<form method="post" accept-charset="UTF-8">
<table id="form-project-add" class="right">
@@ -34,7 +36,7 @@
<tr>
<th>start project (dag-maand-jaar):</th>
<td>
- <input class="date" name="date_start" id="date_start" value="[% project.item("date_start") %]" />
+ <input class="date" name="datetime_start" id="datetime_start" value="[% date.format(POSIX.floor(project.datetime_start),format => '%d-%m-%Y') %]" />
</td>
</tr>
<tr>
View
2 views/projects.tt
@@ -53,7 +53,7 @@
<td>[% project.item("list").size || 0 %]</td>
<td>[% project.item("done") || 0 %]</td>
<td>[% date.format(POSIX.floor(project.datetime_last_modified),format => '%d-%m-%Y') %]</td>
- <td>[% project.date_start %]</td>
+ <td>[% date.format(POSIX.floor(project.datetime_start),format => '%d-%m-%Y') %]</td>
<td>
[% IF auth.can('projects','edit') %]
<a href="/project/[% project.item("_id") %]/edit">aanpassen</a>
View
2 views/projects/add.tt
@@ -34,7 +34,7 @@
<tr>
<th>start project (dag-maand-jaar):</th>
<td>
- <input class="date" name="date_start" id="date_start" value="[% params.item("date_start") %]" />
+ <input class="date" name="datetime_start" id="datetime_start" value="[% params.item("datetime_start") %]" />
</td>
</tr>
<tr>
View
20 views/qa_control.tt
@@ -1,31 +1,39 @@
-[% PROCESS inc/reload.tt %]
[% USE date %]
<h1>QA controle</h1>
<div class="paging">
[% IF scans && scans.size > 0 %]
+ [% IF params.item("sort") %]
+ [% sortlist = [] %]
+ [% FOREACH s IN params.item("sort").list %]
+ [% SET s = s | uri %]
+ [% sortlist.push("sort=" _ s) %]
+ [% END %]
+ [% sortlist = sortlist.join('&') %]
+ [% END %]
+
[% IF page_info.first_page && ( page_info.first_page < page_info.current_page ) %]
- <a href="/qa_control?page=[% page_info.first_page %]&amp;num=[% params.num %]&amp;q=[% params.q | uri %]&amp;sort=[% params.item("sort") | uri %]">eerste</a>
+ <a href="/qa_control?page=[% page_info.first_page %]&amp;num=[% params.num %]&amp;q=[% params.q | uri %]&amp;[% sortlist %]">eerste</a>
[% END %]
[% IF page_info.previous_page %]
- <a href="/qa_control?page=[% page_info.previous_page %]&amp;num=[% params.num %]&amp;q=[% params.q | uri %]&amp;sort=[% params.item("sort") | uri %]" >vorige</a>
+ <a href="/qa_control?page=[% page_info.previous_page %]&amp;num=[% params.num %]&amp;q=[% params.q | uri %]&amp;[% sortlist %]" >vorige</a>
[% END %]
[% FOREACH page IN page_info.pages_in_set %]
[% IF page == page_info.current_page %]
<span class="current">[% page %]</span>
[% ELSE %]
- <a href="/qa_control?page=[% page %]&amp;num=[% params.num %]&amp;q=[% params.q | uri %]&amp;sort=[% params.item("sort") | uri %]">[% page %]</a>
+ <a href="/qa_control?page=[% page %]&amp;num=[% params.num %]&amp;q=[% params.q | uri %]&amp;[% sortlist %]">[% page %]</a>
[% END %]
[% END %]
[% IF page_info.next_page %]
- <a href="/qa_control?page=[% page_info.next_page %]&amp;num=[% params.num %]&amp;q=[% params.q | uri %]&amp;sort=[% params.item("sort") | uri %]" >volgende</a>
+ <a href="/qa_control?page=[% page_info.next_page %]&amp;num=[% params.num %]&amp;q=[% params.q | uri %]&amp;[% sortlist %]" >volgende</a>
[% END %]
[% IF page_info.last_page && ( page_info.last_page > page_info.current_page ) %]
- <a href="/qa_control?page=[% page_info.last_page %]&amp;num=[% params.num %]&amp;q=[% params.q | uri %]&amp;sort=[% params.item("sort") | uri %]">laatste</a>
+ <a href="/qa_control?page=[% page_info.last_page %]&amp;num=[% params.num %]&amp;q=[% params.q | uri %]&amp;[% sortlist %]">laatste</a>
[% END %]
(
[% page = params.page || 1 %]
View
1 views/ready.tt
@@ -1,4 +1,3 @@
-[% PROCESS inc/reload.tt %]
<h1>Scandirectory Status - [% mount_conf.subdirectories.ready %]/[% user.login %]</h1>
[% IF directories && directories.size > 0 %]
<table id="table-ready" class="left">
View
22 views/ready/view.tt
@@ -1,6 +1,6 @@
-[% PROCESS inc/reload.tt %]
[% PROCESS inc/errors_messages.tt %]
[% USE date %]
+[% USE SizePretty %]
[% IF scan %]
<h1>[% scan.item("_id") %]</h1>
<table id="table-scan" class="left">
@@ -14,8 +14,15 @@
<th>files ([% scan.files.size || 0 %])</th>
<td>
<table style="width:100%">
+ [% dir_processed_windows = settings.mounts.directories.network_directories.ready.windows _ scan.item("_id") %]
+ [% dir_processed_samba = settings.mounts.directories.network_directories.ready.samba _ user.login _ "/" _ scan.item("_id") %]
[% FOREACH file IN scan.files %]
<tr>
+ <tr>
+ <th>naam</th>
+ <th>grootte</th>
+ <th>datum laatst gewijzigd</th>
+ </tr>
<!--
/mnt/data01/01_ready/geert/BHSL-PAP-000/BHSL-PAP-000_2012_0001_MA.tif
wordt BHSL-PAP-000_2012_0001_MA.tif,
@@ -24,7 +31,18 @@
/mnt/data01/01_ready/geert/BHSL-PAP-000/test/manifest.txt
wordt test/manifest.txt
-->
- <td>[% file.path.replace(scan.path _ "/","") %]</td>
+ <td>
+ [% link = "file://" _ dir_processed_windows _ "/" _ file.name %]
+ <a href="[% link %]">[% file.path.replace(scan.path _ "/","") %]</a>&nbsp;
+ [% link = dir_processed_samba _ "/" _ file.name %]
+ (<a href="[% link %]">via samba</a>)
+ </td>
+ <td>
+ [% file.size.size_pretty %]
+ </td>
+ <td>
+ [% date.format(file.mtime,'%d-%m-%Y %H:%M:%S') %]
+ </td>
</tr>
[% END %]
</table>
View
20 views/scans.tt
@@ -1,31 +1,39 @@
-[% PROCESS inc/reload.tt %]
[% USE date %]
<h1>Lijst van scanopdrachten</h1>
<div class="paging">
[% IF scans && scans.size > 0 %]
+ [% IF params.item("sort") %]
+ [% sortlist = [] %]
+ [% FOREACH s IN params.item("sort").list %]
+ [% SET s = s | uri %]
+ [% sortlist.push("sort=" _ s) %]
+ [% END %]
+ [% sortlist = sortlist.join('&') %]
+ [% END %]
+
[% IF page_info.first_page && ( page_info.first_page < page_info.current_page ) %]
- <a href="/scans?page=[% page_info.first_page %]&amp;num=[% params.num %]&amp;q=[% params.q | uri %]&amp;sort=[% params.item("sort") | uri %]">eerste</a>
+ <a href="/scans?page=[% page_info.first_page %]&amp;num=[% params.num %]&amp;q=[% params.q | uri %]&amp;[% sortlist %]">eerste</a>
[% END %]
[% IF page_info.previous_page %]
- <a href="/scans?page=[% page_info.previous_page %]&amp;num=[% params.num %]&amp;q=[% params.q | uri %]&amp;sort=[% params.item("sort") | uri %]" >vorige</a>
+ <a href="/scans?page=[% page_info.previous_page %]&amp;num=[% params.num %]&amp;q=[% params.q | uri %]&amp;[% sortlist %]" >vorige</a>
[% END %]
[% FOREACH page IN page_info.pages_in_set %]
[% IF page == page_info.current_page %]
<span class="current">[% page %]</span>
[% ELSE %]
- <a href="/scans?page=[% page %]&amp;num=[% params.num %]&amp;q=[% params.q | uri %]&amp;sort=[% params.item("sort") | uri %]">[% page %]</a>
+ <a href="/scans?page=[% page %]&amp;num=[% params.num %]&amp;q=[% params.q | uri %]&amp;[% sortlist %]">[% page %]</a>
[% END %]
[% END %]
[% IF page_info.next_page %]
- <a href="/scans?page=[% page_info.next_page %]&amp;num=[% params.num %]&amp;q=[% params.q | uri %]&amp;sort=[% params.item("sort") | uri %]" >volgende</a>
+ <a href="/scans?page=[% page_info.next_page %]&amp;num=[% params.num %]&amp;q=[% params.q | uri %]&amp;[% sortlist %]" >volgende</a>
[% END %]
[% IF page_info.last_page && ( page_info.last_page > page_info.current_page ) %]
- <a href="/scans?page=[% page_info.last_page %]&amp;num=[% params.num %]&amp;q=[% params.q | uri %]&amp;sort=[% params.item("sort") | uri %]">laatste</a>
+ <a href="/scans?page=[% page_info.last_page %]&amp;num=[% params.num %]&amp;q=[% params.q | uri %]&amp;[% sortlist %]">laatste</a>
[% END %]
(
[% page = params.page || 1 %]
View
2 views/scans/view.tt
@@ -2,7 +2,7 @@
[% USE date %]
[% USE POSIX %]
[% USE SizePretty %]
-[% IF scan %]
+[% IF scan %]
<h1>[% scan.item("_id") %]</h1>
[% IF scan.status == "registering" %]
<div class="error">

0 comments on commit f4d3ffe

Please sign in to comment.