Lines 71-77
Link Here
|
71 |
<h1 class="sr-only">Koha home</h1> |
71 |
<h1 class="sr-only">Koha home</h1> |
72 |
|
72 |
|
73 |
[% IF Koha.Preference( 'OpacNewsLibrarySelect' ) %] |
73 |
[% IF Koha.Preference( 'OpacNewsLibrarySelect' ) %] |
74 |
[% UNLESS news_item %] |
74 |
[% UNLESS news_id %] |
75 |
<form id="news-branch-select" class="form-inline" name="news-branch-select" method="get" action="/cgi-bin/koha/opac-main.pl"> |
75 |
<form id="news-branch-select" class="form-inline" name="news-branch-select" method="get" action="/cgi-bin/koha/opac-main.pl"> |
76 |
<legend class="sr-only">News</legend> |
76 |
<legend class="sr-only">News</legend> |
77 |
<label for="news-branch">Display news for: </label> |
77 |
<label for="news-branch">Display news for: </label> |
Lines 87-151
Link Here
|
87 |
[% END %] |
87 |
[% END %] |
88 |
[% END %] |
88 |
[% END %] |
89 |
|
89 |
|
90 |
[% IF koha_news.count %] |
90 |
[% IF news_id %] |
91 |
|
91 |
[% SET koha_news = AdditionalContents.get_news_id( idnew => news_id ) %] |
92 |
[% IF single_news_error %] |
92 |
[% ELSE %] |
93 |
|
93 |
[% SET koha_news = AdditionalContents.get( category => 'news', location => ['opac_only', 'staff_and_opac'], lang => lang, library => branchcode ) %] |
94 |
<div class="alert alert-error"> |
94 |
[% END %] |
95 |
This news item does not exist. |
95 |
[% IF koha_news.content.count %] |
96 |
</div> |
96 |
<div id="news" class="newscontainer"> |
97 |
|
97 |
[% SET show_author = Koha.Preference('NewsAuthorDisplay') == 'opac' || Koha.Preference('NewsAuthorDisplay') == 'both' %] |
98 |
[% ELSE %] |
98 |
[% FOREACH koha_new IN koha_news.content %] |
|
|
99 |
<div class="newsitem"> |
100 |
<h4 class="newsheader"> |
101 |
[% IF ( news_item ) %] |
102 |
[% koha_new.title | html %] |
103 |
[% ELSE %] |
104 |
<a name="newsitem[% koha_new.idnew | html %]" href="/cgi-bin/koha/opac-main.pl?news_id=[% koha_new.idnew | uri %]">[% koha_new.title | html %]</a> |
105 |
[% END %] |
106 |
</h4> |
107 |
<div class="newsbody">[% koha_new.content | $raw %]</div> |
108 |
<div class="newsfooter"> |
109 |
Published on [% koha_new.published_on | $KohaDates %] |
110 |
[% IF ( show_author && koha_new.author ) %] |
111 |
by <span class="newsauthor">[% INCLUDE 'patron-title.inc' patron=koha_new.author %]</span> |
112 |
[% END %] |
113 |
[% IF ( news_item ) %] |
114 |
• <a href="/cgi-bin/koha/opac-main.pl">Show all news</a> |
115 |
[% END %] |
116 |
</div> |
117 |
</div> |
118 |
[% END %] |
99 |
|
119 |
|
100 |
<div id="news" class="newscontainer"> |
120 |
[% UNLESS news_item %] |
101 |
[% SET show_author = Koha.Preference('NewsAuthorDisplay') == 'opac' || Koha.Preference('NewsAuthorDisplay') == 'both' %] |
121 |
<div id="rssnews-container"> |
102 |
[% FOREACH koha_new IN koha_news %] |
122 |
<!-- Logged in users have a branch code or it could be explicitly set --> |
103 |
<div class="newsitem"> |
123 |
<a href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-news-rss.pl?branchcode=[% branchcode | uri %]"> |
104 |
<h4 class="newsheader"> |
124 |
<i class="fa fa-rss" aria-hidden="true"></i> |
105 |
[% IF ( news_item ) %] |
125 |
[% IF Branches.all.size == 1 %] |
106 |
[% koha_new.title | html %] |
126 |
[% IF branchcode %] |
|
|
127 |
RSS feed for [% Branches.GetName( branchcode ) | html %] library news |
107 |
[% ELSE %] |
128 |
[% ELSE %] |
108 |
<a name="newsitem[% koha_new.idnew | html %]" href="/cgi-bin/koha/opac-main.pl?news_id=[% koha_new.idnew | uri %]">[% koha_new.title | html %]</a> |
129 |
RSS feed for library news |
109 |
[% END %] |
|
|
110 |
</h4> |
111 |
<div class="newsbody">[% koha_new.content | $raw %]</div> |
112 |
<div class="newsfooter"> |
113 |
Published on [% koha_new.published_on | $KohaDates %] |
114 |
[% IF ( show_author && koha_new.author ) %] |
115 |
by <span class="newsauthor">[% INCLUDE 'patron-title.inc' patron=koha_new.author %]</span> |
116 |
[% END %] |
117 |
[% IF ( news_item ) %] |
118 |
• <a href="/cgi-bin/koha/opac-main.pl">Show all news</a> |
119 |
[% END %] |
130 |
[% END %] |
120 |
</div> |
131 |
[% ELSE %] |
121 |
</div> |
132 |
[% IF branchcode %] |
122 |
[% END %] |
133 |
RSS feed for [% Branches.GetName( branchcode ) | html %] and system-wide library news |
123 |
|
|
|
124 |
[% UNLESS news_item %] |
125 |
<div id="rssnews-container"> |
126 |
<!-- Logged in users have a branch code or it could be explicitly set --> |
127 |
<a href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-news-rss.pl?branchcode=[% branchcode | uri %]"> |
128 |
<i class="fa fa-rss" aria-hidden="true"></i> |
129 |
[% IF Branches.all.size == 1 %] |
130 |
[% IF branchcode %] |
131 |
RSS feed for [% Branches.GetName( branchcode ) | html %] library news |
132 |
[% ELSE %] |
133 |
RSS feed for library news |
134 |
[% END %] |
135 |
[% ELSE %] |
134 |
[% ELSE %] |
136 |
[% IF branchcode %] |
135 |
RSS feed for system-wide library news |
137 |
RSS feed for [% Branches.GetName( branchcode ) | html %] and system-wide library news |
|
|
138 |
[% ELSE %] |
139 |
RSS feed for system-wide library news |
140 |
[% END %] |
141 |
[% END %] |
136 |
[% END %] |
142 |
</a> |
137 |
[% END %] |
143 |
</div> |
138 |
</a> |
144 |
[% END %] |
139 |
</div> |
145 |
</div> |
140 |
[% END %] |
146 |
|
141 |
</div> |
147 |
[% END # /IF single_news_error %] |
142 |
[% ELSIF news_id %] <!-- news_id but no koha_news.content --> |
148 |
|
143 |
<div class="alert alert-error"> |
|
|
144 |
This news item does not exist. |
145 |
</div> |
149 |
[% ELSE %] <!-- koha news --> |
146 |
[% ELSE %] <!-- koha news --> |
150 |
[% IF Koha.Preference( 'OpacNewsLibrarySelect' ) %] |
147 |
[% IF Koha.Preference( 'OpacNewsLibrarySelect' ) %] |
151 |
<div id="news" class="newscontainer"> |
148 |
<div id="news" class="newscontainer"> |