# HG changeset patch # User Vincent Tondellier # Date 1451340018 -3600 # Node ID dbbd323f86ae8701bd27966ff1602baf9d46a608 # Parent 41164ea18780100849e08cc624acfc005773d74e Move report templates diff -r 41164ea18780 -r dbbd323f86ae lib/CrashTest/Controller/CrashReports.pm --- a/lib/CrashTest/Controller/CrashReports.pm Mon Dec 28 21:42:10 2015 +0100 +++ b/lib/CrashTest/Controller/CrashReports.pm Mon Dec 28 23:00:18 2015 +0100 @@ -36,12 +36,12 @@ $self->stash(crashs => $results); $self->stash(pager => $pager); - $self->stash(extra_columns => []); + $self->stash(extra_columns => $self->app->config->{WebInterface}->{ExtraColumns}->{Index}); - $self->render("index"); + $self->render("reports/index"); } -sub report { +sub show { my ($self, $uuid) = @_; my $data = $self->app->crash_reports->get_processed_data($self->param('uuid')); diff -r 41164ea18780 -r dbbd323f86ae templates/index.atom.ep --- a/templates/index.atom.ep Mon Dec 28 21:42:10 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ - - - tag:crash,2012,<%= url_for('index')->to_abs =%> - - - Recent Crashs - <%= date_with_tz_from_db_utc(@$crashs[0]->{crash_time}) =%> - -% foreach my $crash(@$crashs) { - - tag:crash,2014:uuid::<%= $crash->{uuid} =%> - - <%= $crash->{p_name} =%> <%= $crash->{p_version} =%>: <%= $crash->{uuid} =%> - <%= date_with_tz_from_db_utc($crash->{crash_time}) =%> - <%= date_with_tz_from_db_utc($crash->{crash_time}) =%> - - - - - %= xml_escape_block begin - %= t h3 => date_from_db_utc($crash->{crash_time}) - %= t h3 => $crash->{p_name} . " version " . $crash->{p_version} - % end - - -% } - diff -r 41164ea18780 -r dbbd323f86ae templates/index.html.ep --- a/templates/index.html.ep Mon Dec 28 21:42:10 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -% title 'Latest crashs'; -% layout 'main'; -%= t table => (class => 'table table-striped table-hover table-bordered table-condensed') => begin - - - Product - Version - UUID - % foreach my $extra_col(@$extra_columns) { - %= t th => $extra_col->{name} - % } - Date - - -% foreach my $crash(@$crashs) { - %= t tr => begin - %= t td => $crash->{p_name} - %= t td => ($crash->{p_version} or "") - %= t td => (style => "font-family:monospace;") => begin - %= link_to $crash->{uuid} => url_for('report', uuid => $crash->{uuid}) - % end - % foreach my $extra_col(@$extra_columns) { - %= t td => $crash->{$extra_col->{id}} - % } - %= t td => date_from_db_utc($crash->{crash_time}) - % end -% } -% end - -% if($pager->first_page != $pager->last_page) { - %= bootstrap_pagination($pager->current_page, $pager->last_page); -% } diff -r 41164ea18780 -r dbbd323f86ae templates/reports/_list.html.ep --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/reports/_list.html.ep Mon Dec 28 23:00:18 2015 +0100 @@ -0,0 +1,30 @@ +%= t table => (class => 'table table-striped table-hover table-bordered table-condensed') => begin + + + Product + Version + UUID + % foreach my $extra_col(@$extra_columns) { + %= t th => $extra_col->{name} + % } + Date + + +% foreach my $crash(@$crashs) { + %= t tr => begin + %= t td => $crash->{p_name} + %= t td => ($crash->{p_version} or "") + %= t td => (style => "font-family:monospace;") => begin + %= link_to $crash->{uuid} => url_for('report', uuid => $crash->{uuid}) + % end + % foreach my $extra_col(@$extra_columns) { + %= t td => $crash->{$extra_col->{id}} + % } + %= t td => date_from_db_utc($crash->{crash_time}) + % end +% } +% end + +% if($pager->first_page != $pager->last_page) { + %= bootstrap_pagination($pager->current_page, $pager->last_page); +% } diff -r 41164ea18780 -r dbbd323f86ae templates/reports/index.atom.ep --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/reports/index.atom.ep Mon Dec 28 23:00:18 2015 +0100 @@ -0,0 +1,27 @@ + + + tag:crash,2012,<%= url_for('index')->to_abs =%> + + + Recent Crashs + <%= date_with_tz_from_db_utc(@$crashs[0]->{crash_time}) =%> + +% foreach my $crash(@$crashs) { + + tag:crash,2014:uuid::<%= $crash->{uuid} =%> + + <%= $crash->{p_name} =%> <%= $crash->{p_version} =%>: <%= $crash->{uuid} =%> + <%= date_with_tz_from_db_utc($crash->{crash_time}) =%> + <%= date_with_tz_from_db_utc($crash->{crash_time}) =%> + + + + + %= xml_escape_block begin + %= t h3 => date_from_db_utc($crash->{crash_time}) + %= t h3 => $crash->{p_name} . " version " . $crash->{p_version} + % end + + +% } + diff -r 41164ea18780 -r dbbd323f86ae templates/reports/index.html.ep --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/reports/index.html.ep Mon Dec 28 23:00:18 2015 +0100 @@ -0,0 +1,3 @@ +% title 'Latest crashs'; +% layout 'main'; +%= include('reports/_list', crashs => $crashs, extra_columns => $extra_columns, pager => $pager);