Skip to content

Commit

Permalink
Merge branch 'pr/issue_418_2nd_edition' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
phochste committed May 15, 2018
2 parents c1e9e35 + a8fbf26 commit 91076b4
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config/catmandu.local.yml-example
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ default_person_sort:
default_facets:
open_access:
terms:
field: 'file.open_access'
fields: ['oa']
size: 1
popular_science:
terms:
Expand Down
6 changes: 6 additions & 0 deletions config/store.yml
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,11 @@ search:
'=': true
'<>': true
field: 'main_file_link.open_access'
oa:
op:
'=': true
'<>': true
field: ['oa']
embargo:
op:
'=': true
Expand Down Expand Up @@ -1068,6 +1073,7 @@ search:
properties:
url: {type: string, analyzer: tag}
open_access: {type: byte}
oa: {type: byte}
alternative_id: {type: string, analyzer: tag, include_in_all: true}
defense_date: {type: date, index: no}
locked: {type: byte}
Expand Down
9 changes: 9 additions & 0 deletions fixes/index_publication.fix
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# add OA flag for open access publications

if any_match(file.*.access_level, open_access)
add_field(oa, 1)
end

if any_match(main_file_link.*.open_access, 1)
add_field(oa, 1)
end
2 changes: 1 addition & 1 deletion lib/LibreCat/App/Helper.pm
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ sub get_statistics {
my $reshits = librecat->searcher->search('publication',
{cql => ["status=public", "type=research_data"]});
my $oahits = librecat->searcher->search('publication',
{cql => ["status=public", "fulltext=1", "type<>research_data",]});
{cql => ["status=public", "oa=1", "type<>research_data",]});

return {
publications => $hits->{total},
Expand Down
4 changes: 2 additions & 2 deletions views/facets/open_access.tt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[%- FOREACH t IN facets.open_access.terms %]
[%- IF t.count < total %]
[%- NEXT UNLESS t.term %]
<a class="facet_[% tabmodus %][% menu %]" data-key="cql" data-param="fulltext" data-value="1" href="#" rel="nofollow"><span class="fa fa-chevron-right"></span>[% t.count %] [% h.loc("facets.fulltext") %]</a>
<a class="facet_[% tabmodus %][% menu %]" data-key="cql" data-param="oa" data-value="1" href="#" rel="nofollow"><span class="fa fa-chevron-right"></span>[% t.count %] [% h.loc("facets.fulltext") %]</a>
[%- ELSE %]
<div class="text-success margin-top1-2 margin-bottom1-2"><span class="fa fa-check"></span> <strong>[% h.loc("facets.all_fulltext") %]</strong></div>
[%- END %]
[%- END %]
[%- END %]
2 changes: 1 addition & 1 deletion views/index.tt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<div class="col-md-12">
<p class="h3"><span class="fa fa-check fa-1x"></span> <span class="statalign">[% stats.publications %]</span> <a href="[% uri_base %]/publication">[% h.loc("home.stats.publications") %]</a></p>
<p class="h3"><span class="fa fa-check fa-1x"></span> <span class="statalign">[% stats.researchdata %]</span> <a href="[% uri_base %]/data">[% h.loc("home.stats.data_publications") %]</a></p>
<p class="h3"><span class="fa fa-check fa-1x"></span> <span class="statalign">[% stats.oahits %]</span> <a href="[% uri_base %]/publication?cql=fulltext=1">[% h.loc("home.stats.oa_publications") %]</a></p>
<p class="h3"><span class="fa fa-check fa-1x"></span> <span class="statalign">[% stats.oahits %]</span> <a href="[% uri_base %]/publication?cql=oa=1">[% h.loc("home.stats.oa_publications") %]</a></p>
<p class="h3"><span class="fa fa-check fa-1x"></span> <span class="statalign">[% stats.projects %]</span> <a href="[% uri_base %]/project">[% h.loc("home.stats.projects") %]</a></p>
</div>
</div>
Expand Down

0 comments on commit 91076b4

Please sign in to comment.