Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/citations/eprint/default.tx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<span>
<: $item.render_value( 'creators_name' ) | mark_raw :> (<: $item.render_value( 'date' ) :>) <em><: $item.render_value( 'title' ) | magicstop :></em>

<: if $item.value( 'publication' ) { :> <: $item.render_value( 'publication' ) :><: if $item.value( 'volume' ) { :>, <: $item.render_value( 'volume' ) } :><: if $item.value( 'number' ) { :> (<: $item.render_value( 'number' ) :>)<: } :>.<: } :>
</span>
42 changes: 42 additions & 0 deletions lib/citations/eprint/summary_page.tx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<div>
: include 'eprint/default.tx';

<ul>
: for documents( $item ) -> $doc {
: if $doc.is_public() {
<li><a href="<: $doc.url() :>"><img src="<: $doc.thumbnail_url() :>" /> <: $doc.render_value( 'content' ) :> <: human_filesize( doc_size( $doc ) ) :></a></li>
: }
: }
</ul>

<h2><: $repo.phrase( 'eprint_fieldname_abstract' ) :></h2>
<div><: $item.value( 'abstract' ) :></div>

<table style="margin-bottom: 1em; margin-top: 1em;" cellpadding="3">
: for $flags['summary_page_metadata'] -> $fieldname {
: if $item.value( $fieldname ) {
<tr>
<th align="right"><: $repo.phrase( 'eprint_fieldname_' ~ $fieldname ) :></th>
<td valign="top"><: $item.render_value( $fieldname ) | mark_raw :></td>
</tr>
: }
: }
<tr>
<th align="right">URI:</th>
<td valign="top"><a href="<: $item.uri() :>"><: $item.uri() :></a></td>
</tr>
</table>

:if $flags['preview'] != 1 {
<h2><: $repo.phrase( 'summary_page:actions' ) :></h2>
<table class="ep_summary_page_actions">
: for $actions -> $action {
<tr>
<td><: $action['screen'].render_action_icon( $action ) | mark_raw :></td>
<td><: $repo.phrase( 'Plugin/' ~ replace( $action['screen_id'], '::', '/' ) ~ ':title' ) :> </td>
</tr>
: }
</table>
: }

</div>
27 changes: 26 additions & 1 deletion lib/defaultcfg/cfg.d/eprint_render.pl
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
in_commentary_thread => $eprint->in_thread( $commentary_field ),
preview => $preview,
};
print STDERR "preview = " . $flags->{preview}, "\n";
my %fragments = ();

# Put in a message describing how this document has other versions
Expand Down Expand Up @@ -125,8 +126,32 @@
}

foreach my $key ( keys %fragments ) { $fragments{$key} = [ $fragments{$key}, "XHTML" ]; }

$flags->{summary_page_metadata} = $repository->config( 'summary_page_metadata' );

# Enumerate all the actions for an eprint
my $screen_processor = EPrints::ScreenProcessor->new(
session => $repository,
screenid => "Error",
);

my $screen = $screen_processor->screen;
$screen->properties_from;

my @actions = $screen->list_items( 'eprint_summary_page_actions', filter => 0 );
my $keyfield = $eprint->{dataset}->get_key_field();
$screen_processor->{$keyfield->get_name()} = $eprint->get_id;
foreach my $action ( @actions )
{
$action->{hidden} = [$keyfield->get_name()];
}


my $page = $eprint->render_citation( "summary_page", %fragments, flags=>$flags );
my $page = $eprint->render_citation( "summary_page",
%fragments,
flags => $flags,
actions => \@actions,
);

my $title = $eprint->render_citation("brief");

Expand Down
22 changes: 22 additions & 0 deletions lib/templates/common/help.tx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

<div class="ep_summary_box" id="ep_review_instructions">
<div class="ep_summary_box_title">
<div class="ep_no_js">
Help
</div>

<div class="ep_only_js" id="ep_review_instructions_colbar" style="display: none">
<a class="ep_box_collapse_link" href="#" onclick="EPJS_blur(event); EPJS_toggleSlideScroll('ep_review_instructions_content',true,'ep_review_instructions');EPJS_toggle('ep_review_instructions_colbar',true);EPJS_toggle('ep_review_instructions_bar',false);return false"><img alt="-" border="0" src="/style/images/minus.png" /> Help</a>
</div>

<div class="ep_only_js" id="ep_review_instructions_bar">
<a class="ep_box_collapse_link" href="#" onclick="EPJS_blur(event); EPJS_toggleSlideScroll('ep_review_instructions_content',false,'ep_review_instructions');EPJS_toggle('ep_review_instructions_colbar',false);EPJS_toggle('ep_review_instructions_bar',true);return false"><img alt="+" border="0" src="/style/images/help.gif" /> Help</a>
</div>
</div>

<div class="ep_summary_box_body" id="ep_review_instructions_content" style="display: none">
<div id="ep_review_instructions_content_inner">
<: $repo.html_phrase( $phrase_id ) | mark_raw :>
</div>
</div>
</div>
132 changes: 132 additions & 0 deletions lib/templates/common/paginated_table.tx
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@

:# Querystring param whitelist for link building
: my $whitelist = [ 'screen', $basename ~ '_page_size', $basename ~ '_order' ];

: block table_header -> {

:# Search results
<div class="ep_search_results">
<table border="0" cellpadding="4" cellspacing="0" class="ep_columns">
<tr class="header_plain">
: my $new_sort_dir = $sort_dir == '-' ? '' : '-';
: for $columns -> $column {
<th class="ep_columns_title" style="padding:0px">
: if ( $column == $sort_col ) {
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<a href="<: link_self( $repo, $whitelist, $basename ~ '_order' => $new_sort_dir ~ $column ) :>" style="display:block;padding:4px"><: $repo.phrase( 'eprint_fieldname_' ~ $column ) :></a>
</td>

<td style="width:22px; text-align: right">
<a href="<: link_self( $repo, $whitelist, $basename ~ '_order' => $new_sort_dir ~ $column ) :>"><: if ( $sort_dir == '-' ) { :><img alt="Down" border="0" src="/style/images/sorting_down_arrow.gif" style="border:0px;padding:4px" /><: } else { :><img alt="Up" border="0" src="/style/images/sorting_up_arrow.gif" style="border:0px;padding:4px" /><: } :></a>
</td>
</tr>
</table>
: }
: else
: {
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<a href="<: link_self( $repo, $whitelist, $basename ~ '_order' => $new_sort_dir ~ $column ) :>" style="display:block;padding:4px"><: $repo.phrase( 'eprint_fieldname_' ~ $column ) :></a>
</td>
</tr>
</table>
: }
</th>
: }
<th class="ep_columns_title ep_columns_title_last" style="padding:0px" />
</tr>
: }
: block results -> {}

: block table_footer -> {
:# Table modification (move left/right, delete)
<tr>
: for $columns -> $column {
<td class="ep_columns_alter">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
: if ( $~column.is_first ) {
<td align="left" width="14"><img alt="" src="/style/images/noicon.png" /></td>
: } else {
<td align="left" width="14">
<form accept-charset="utf-8" action="/cgi/users/home" enctype="multipart/form-data" method="post">
<input id="screen" name="screen" type="hidden" value="Items" /><input id="colid" name="colid" type="hidden" value="<: $~column :>" /><input alt="&lt;" name="_action_col_left" src="/style/images/left.png" title="Move Left" type="image" value="Move Left" />
</form>
</td>
: }

<td align="center" width="100%">
<form accept-charset="utf-8" action="/cgi/users/home" enctype="multipart/form-data" method="post">
<input id="screen" name="screen" type="hidden" value="Items" /><input id="colid" name="colid" type="hidden" value="<: $~column :>" /><input alt="X" name="_action_remove_col" onclick="if( window.event ) { window.event.cancelBubble = true; } return confirm( &quot;Really remove this column from the display?&quot;);" src="/style/images/delete.png" title="Remove Column" type="image" value="Remove Column" />
</form>
</td>

: if ( $~column.is_last ) {
<td align="right" width="14"><img alt="" src="/style/images/noicon.png" /></td>
: } else {
<td align="right" width="14">
<form accept-charset="utf-8" action="/cgi/users/home" enctype="multipart/form-data" method="post">
<input id="screen" name="screen" type="hidden" value="Items" /><input id="colid" name="colid" type="hidden" value="<: $~column :>" /><input alt="&gt;" name="_action_col_right" src="/style/images/right.png" title="Move Right" type="image" value="Move Right" />
</form>
</td>
: }
</tr>
</table>
</td>
: }
<td class="ep_columns_alter ep_columns_alter_last" />
</tr>
</table>
</div>

<div class="ep_search_controls_bottom">
<div>Displaying results <span class="ep_search_number"><: $offset + 1 :></span> to
<span class="ep_search_number"><: ( ( $offset + $pagesize ) > $total ) ? $total : ( $offset + $pagesize ) :></span> of
<span class="ep_search_number"><: $total :></span>.

Show <a href="<: link_self( $repo, $whitelist, $basename ~ '_page_size' => 10 ) :>">10</a>,
<a href="<: link_self( $repo, $whitelist, $basename ~ '_page_size' => 25 ) :>">25</a> or
<a href="<: link_self( $repo, $whitelist, $basename ~ '_page_size' => 100 ) :>">100</a> or results per page.

: if ( $pages > 1 ) {
<a href="<: link_self( $repo, $whitelist, $basename ~ '_page_size' => $total ) :>">Show All</a><br>


: if ( $current_page > 1 ) {
<span class="ep_search_control"><a href="<: link_self( $repo, $whitelist, $basename ~ '__offset' => ( $offset - $pagesize ) ) :>">Previous</a></span> |
: }

: for [1 .. $pages] -> $i {
<span class="ep_search_control">
: if ( $~i == ( $current_page - 1 ) ) {
<strong><: $current_page :></strong>
: } else {
<a href="<: link_self( $repo, $whitelist, $basename ~ '__offset' => ( $pagesize * ( $i - 1 ) ) ) :>"><: $i :></a>
: }
</span> |
: }

: if ( $current_page != $pages ) {
<span class="ep_search_control"><a href="<: link_self( $repo, $whitelist, $basename ~ '__offset' => ( $offset + $pagesize ) ) :>">Next</a></span>
: }
: }
</div>
</div>

: }


<div class="ep_columns_add">
<form accept-charset="utf-8" action="/cgi/users/home" enctype="multipart/form-data" method="post">
<input id="screen" name="screen" type="hidden" value="Items" />
<select id="col" name="col" size="1">
: for $extra_cols.kv() -> $col {
<option value="<: $col.value :>"><: $col.key :></option>
: }
</select>
<input class="ep_form_action_button" name="_action_add_col" type="submit" value="Add Column" />
</form>
</div>
99 changes: 99 additions & 0 deletions lib/templates/default.tx
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title><: $title_textonly ? $title_textonly : $title :> - <: $archive_name :></title>
<link rel="icon" href="<: $repo.config( 'rel_path' ) :>/favicon.ico" type="image/x-icon"/>
<link rel="shortcut icon" href="<: $repo.config( 'rel_path' ) :>/favicon.ico" type="image/x-icon"/>
<: $head | mark_raw :>
</head>

<body>
<: $pagetop :>
<div class="ep_tm_header ep_noprint">
<div class="ep_tm_site_logo">
<a href="<: $repo.config( 'frontpage' ) :>" title="<: $repo.phrase( 'archive_name' ) :>">
<img alt="<: $repo.phrase( 'archive_name' ) :>" src="<: $repo.config( 'rel_path' ) :><: $repo.config( 'site_logo' ) :>"/>
</a>
</div>
<ul class="ep_tm_menu">
<li>
<a href="<: $repo.config( 'http_url' ) :>">
<: $repo.phrase( 'template/navigation:home' ) :>
</a>
</li>
<li>
<a href="<: $repo.config( 'http_url' ) :>/information.html">
<: $repo.phrase( 'template/navigation:about' ) :>
</a>
</li>
<li>
<a href="<: $repo.config( 'http_url' ) :>/view/" class="ep_tm_menu_browse">
<: $repo.phrase( 'template/navigation:browse' ) :>
</a>
<ul id="ep_tm_menu_browse" style="display:none;">
<li>
<a href="<: $repo.config( 'http_url' ) :>/view/year/">
<: $repo.phrase( 'bin/generate_views:indextitleprefix' ) :>
<: $repo.phrase( 'viewname_eprint_year' ) :>
</a>
</li>
<li>
<a href="<: $repo.config( 'http_url' ) :>/view/subjects/">
<: $repo.phrase( 'bin/generate_views:indextitleprefix' ) :>
<: $repo.phrase( 'viewname_eprint_subjects' ) :>
</a>
</li>
<li>
<a href="<: $repo.config( 'http_url' ) :>/view/divisions/">
<: $repo.phrase( 'bin/generate_views:indextitleprefix' ) :>
<: $repo.phrase( 'viewname_eprint_divisions' ) :>
</a>
</li>
<li>
<a href="<: $repo.config( 'http_url' ) :>/view/creators/">
<: $repo.phrase( 'bin/generate_views:indextitleprefix' ) :>
<: $repo.phrase( 'viewname_eprint_creators' ) :>
</a>
</li>
</ul>
</li>
</ul>
<table class="ep_tm_searchbar">
<tr>
<td>
<: $login_status | mark_raw :>
</td>
<td style="white-space: nowrap">
<: $languages :>
<form method="get" accept-charset="utf-8" action="<: $repo.config( 'http_cgiurl' ) :>/search" style="display:inline">
<input class="ep_tm_searchbarbox" size="20" type="text" name="q"/>
<input class="ep_tm_searchbarbutton" value="<: $repo.phrase( 'lib/searchexpression:action_search' ) :>" type="submit" name="_action_search"/>
<input type="hidden" name="_action_search" value="Search"/>
<input type="hidden" name="_order" value="bytitle"/>
<input type="hidden" name="basic_srchtype" value="ALL"/>
<input type="hidden" name="_satisfyall" value="ALL"/>
</form>
</td>
</tr>
</table>
</div>
<div>
<div class="ep_tm_page_content">

<h1 class="ep_tm_pagetitle"><: $title | mark_raw :></h1>

<: $page | mark_raw :>
</div>
</div>

<div class="ep_tm_footer ep_noprint">
<div class="ep_tm_eprints_logo">
<a href="http://eprints.org/software/">
<img alt="EPrints Logo" src="<: $repo.config( 'rel_path' ) :>/images/eprintslogo.gif"/>
</a>
</div>
<: $repo.html_phrase( "template:about_eprints" ) | mark_raw :>
</div>
</body>
</html>
Loading