View | Details | Raw Unified | Return to bug 14272
Collapse All | Expand All

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt (-2 / +11 lines)
Lines 10-16 Link Here
10
10
11
<div class="main">
11
<div class="main">
12
    <ul class="breadcrumb">
12
    <ul class="breadcrumb">
13
        <li><a href="#">Home</a></li>
13
        <li><a href="/cgi-bin/koha/opac-main.pl">Home</a>
14
        [% IF ( news_type ) %]
15
            <span class="divider">&rsaquo;</span></li>
16
            <li><a href="#">
17
            [% SWITCH news_type    %]
18
                [% CASE 'news_item'    %]News item
19
            [% END %]
20
            </a>
21
        [% END %]
22
        </li>
14
    </ul>
23
    </ul>
15
24
16
    [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
25
    [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
Lines 43-49 Link Here
43
                [% SET newsdisp = ( Koha.Preference('NewsAuthorDisplay') ) %]
52
                [% SET newsdisp = ( Koha.Preference('NewsAuthorDisplay') ) %]
44
                [% FOREACH koha_new IN koha_news %]
53
                [% FOREACH koha_new IN koha_news %]
45
                    <div class="newsitem">
54
                    <div class="newsitem">
46
                        <a name="newsitem[% koha_new.idnew %]"></a><h4 class="newsheader">[% koha_new.title %]</h4>
55
                        <a name="newsitem[% koha_new.idnew %]" href="/cgi-bin/koha/opac-main.pl?news_id=[% koha_new.idnew %]"><h4 class="newsheader">[% koha_new.title %]</h4></a>
47
                        <div class="newsbody">[% koha_new.new %]</div>
56
                        <div class="newsbody">[% koha_new.new %]</div>
48
                        <div class="newsfooter">(published on [% koha_new.newdate %][% IF ( (newsdisp == 'opac' || newsdisp == 'both') && koha_new.borrowernumber ) %] by <span class="newsauthor_title">[% koha_new.author_title %] </span>[% koha_new.author_firstname %] [% koha_new.author_surname %][% END %])</div>
57
                        <div class="newsfooter">(published on [% koha_new.newdate %][% IF ( (newsdisp == 'opac' || newsdisp == 'both') && koha_new.borrowernumber ) %] by <span class="newsauthor_title">[% koha_new.author_title %] </span>[% koha_new.author_firstname %] [% koha_new.author_surname %][% END %])</div>
49
                    </div>
58
                    </div>
(-)a/opac/opac-main.pl (-3 / +12 lines)
Lines 51-64 my $homebranch; Link Here
51
if (C4::Context->userenv) {
51
if (C4::Context->userenv) {
52
    $homebranch = C4::Context->userenv->{'branch'};
52
    $homebranch = C4::Context->userenv->{'branch'};
53
}
53
}
54
my $all_koha_news   = &GetNewsToDisplay($news_lang,$homebranch);
54
55
my $koha_news_count = scalar @$all_koha_news;
55
my $news_id = $input->param('news_id');
56
my ($all_koha_news, $koha_news_count, $news_type);
57
if (defined $news_id && length $news_id) {
58
    $all_koha_news = &GetNewsToDisplay($news_lang, $homebranch, undef, $news_id);
59
    $koha_news_count = 1;
60
    $news_type = 'news_item';
61
} else {
62
    $all_koha_news = &GetNewsToDisplay($news_lang, $homebranch);
63
    $koha_news_count = scalar @$all_koha_news;
64
}
56
65
57
my $quote = GetDailyQuote();   # other options are to pass in an exact quote id or select a random quote each pass... see perldoc C4::Koha
66
my $quote = GetDailyQuote();   # other options are to pass in an exact quote id or select a random quote each pass... see perldoc C4::Koha
58
67
59
$template->param(
68
$template->param(
60
    koha_news           => $all_koha_news,
69
    koha_news           => $all_koha_news,
61
    koha_news_count     => $koha_news_count,
70
    koha_news_count     => $koha_news_count,
71
    news_type           => $news_type,
62
    display_daily_quote => C4::Context->preference('QuoteOfTheDay'),
72
    display_daily_quote => C4::Context->preference('QuoteOfTheDay'),
63
    daily_quote         => $quote,
73
    daily_quote         => $quote,
64
);
74
);
65
- 

Return to bug 14272