aboutsummaryrefslogtreecommitdiffstats
path: root/english/template/debian/navbar.wml
blob: 68f1f3780644a48f75d8c51be87c52e2ab711c0d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
#use wml::debian::common_translation
#use wml::debian::links.tags
#use wml::debian::stats_tags
#use wml::debian::common_tags

<div id="header">
  <div id="upperheader">
    <div id="logo">
    <a href="$(HOME)/" title="<gettext domain="templates">Debian Home</gettext>">\
      <img src="$(LOGOS:-$(HOME)/Pics)/openlogo-50.png" alt="<gettext domain="templates">Debian</gettext>" /></a>
    </div> <!-- end logo -->
    <div id="searchbox">
      <form name="p" method="get" action="https://search.debian.org/cgi-bin/omega">
      <p>
<perl>
my $ext = lc('$(CUR_ISO_LANG)');  $ext =~ s/-/_/;
print        '<input type="hidden" name="DB" value="'.$ext.'[CN:-cn:][TW:-tw:][HK:-hk:]" />';
</perl>
        <input name="P" value="" size="14" />
        <input type="submit" value="<search>" />
      </p>
      </form>
    </div>   <!-- end sitetools -->
  </div> <!-- end upperheader -->
  <!--UdmComment-->
  <div id="navbar">
    <p class="hidecss"><a href="#content"><skipquicknav/></a></p>
    <ul>
      <!-- Link to Debian's own Social Media resources -->
      <li><a href="https://bits.debian.org/" title="<gettext domain="homepage">Bits from Debian</gettext>"><gettext domain="homepage">Blog</gettext></a></li>
      <li><a href="https://micronews.debian.org" title="<gettext domain="homepage">Micronews from Debian</gettext>"><gettext domain="homepage">Micronews</gettext></a></li>
      <li><a href="https://planet.debian.org/" title="<gettext domain="homepage">The Planet of Debian</gettext>"><gettext domain="homepage">Planet</gettext></a></li>
    </ul>
  </div> <!-- end navbar -->
#
#############################################################
# Breadcrumbs
<when <not "$(MAINPAGE)">>
<when <not "$(PAGENAME)">>
<when <not "$(SUMMARY)">>
<perl>

# Handle links, and equivalent english/ directory tree (if the translated index is missing)
    my $eng_dir = '$(WML_SRC_DIRNAME)';
    $eng_dir =~ s,(.*)/webwml/\w*,$1/webwml/english,;
    my $relative_path = '.';

    my $breadcrumbs;
# If the current page is already the index, go one directory up
    if ( '$(WML_SRC_FILENAME)' eq 'index.wml' )
    {
        # Use only year for security/YYYY and vote/YYYY directories

        $relative_path = '..';
        $eng_dir =~ s,/[^/]*$,,;
    }

# Loop to get each directory index title
    # no breadcrumb for 404 page
    if ( '$(WML_SRC_FILENAME)' ne '404.wml' ) {
    while ( $eng_dir !~ m,webwml/english$, )
    {
        my $title;

# Open the index page to get its title
        # Some directories have no index
        if ( $eng_dir !~ m,ports/powerpc/inst$, and
             $eng_dir !~ m,users/\w*$, ) {
            open INDEX, "$relative_path/index.wml" or
            open INDEX, "$eng_dir/index.wml" or
            do {
                warn "couldn't open $relative_path/index.wml or $eng_dir/index.wml: $!\n";
# FIXME: This command should break the loop
                die;
            };

            # Use only year for security/YYYY and vote/YYYY directories
            if ( $eng_dir =~ m,security/(\d{4})$, or $eng_dir =~ m,vote/(\d{4})$, )
            { $title = $1 ; }

            # Use short name for l10n stats #616340
            elsif ( $eng_dir =~ m,international/l10n/po$, )
                { $title = 'PO' ; }
            elsif ( $eng_dir =~ m,international/l10n/po-debconf$, )
                { $title = 'PO Debconf' ; }
            elsif ( $eng_dir =~ m,international/l10n/po4a$, )
                { $title = 'po4a' ; }

            # Handle translated title in website stats
            elsif ( $eng_dir =~ m,website/stats$, )
                { $title = '<stats_title>' ; }

            # Normal case: use $(title)
            else {
                <protect pass=2>
                foreach (<INDEX>) {
                    $title = "$1" if ($_ =~ /^#use wml::.* title="(.*?)"/)
                }
                </protect>
            }
            close INDEX;

# Actually construct breadcrumbs
            $breadcrumbs = "<a href=\"$relative_path/\">$title</a>\n &#x2F; " . $breadcrumbs ;
        }

# Go one directory up
        $relative_path .= '/..';
        $eng_dir =~ s,/[^/]*$,,;
    }}

# Actually print breadcrumbs
    print '<p id="breadcrumbs">'.$breadcrumbs;

</perl>
$(title)</p>
</when>
#
# Handle DPN: use date and only year for News/weekly/YYYY directory
<when "$(SUMMARY)">
  <p id="breadcrumbs"><a href="$(HOME)/News/"><gettext domain="newsevents">Latest News</gettext></a>
    &#x2F; <a href="$(HOME)/News/weekly"><debianprojectnews/></a>
    &#x2F; <a href="../"><:=substr('$(PUBDATE)', 0, 4):></a>
    &#x2F; <:=&spokendate_noyear('$(PUBDATE)'):>
  </p>
</when>
</when>
# Handle other pages in DPN directory and subdirectories (year index, contributing, etc.)
<when "$(PAGENAME)">
  <p id="breadcrumbs"><a href="$(HOME)/News/"><gettext domain="newsevents">Latest News</gettext></a>
<perl>

# Pages in DPN directory
    if ( '$(WML_SRC_DIRNAME)' =~ m,News/weekly$, ) {
        if ( '$(WML_SRC_FILENAME)' eq 'index.wml' ) {
           print " &#x2F; <debianprojectnews/>" ;
        }
        else {
           print " &#x2F; <a href=\"$(HOME)/News/weekly\"><debianprojectnews/></a>" ;
           print " &#x2F; $(PAGENAME)" ;
       }
    }

# Pages in DPN subdirectories (use only year for News/weekly/YYYY directory)
    elsif ( '$(WML_SRC_DIRNAME)' =~ m,News/weekly/(\d{4})$, ) {
        print " &#x2F; <a href=\"$(HOME)/News/weekly\"><debianprojectnews/></a>" ;
        if ( '$(WML_SRC_FILENAME)' eq 'index.wml' ) {
            print " &#x2F; $1 " ;
        }
        else {
            print " &#x2F; <a href=\"$(HOME)/News/weekly/$1\">$1</a>" ;
            print " &#x2F; $(PAGENAME)" ;
        }
    }
</perl>
  </p>
</when>
</when>
<when "$(MAINPAGE)">
  <p id="breadcrumbs">&nbsp; </p>
</when>
</div> <!-- end header -->
<!--/UdmComment-->

© 2014-2024 Faster IT GmbH | imprint | privacy policy