Message ID | 20210928110906.1089-1-hofmann@leo-andres.de |
---|---|
State | Accepted |
Commit | b0323d194630ba0e91730dac58a3306fcc830ef7 |
Headers |
Return-Path: <development-bounces@lists.ipfire.org> Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4HJcGH1kPvz3xWd for <patchwork@web04.haj.ipfire.org>; Tue, 28 Sep 2021 11:09:27 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4HJcGF58X8z136; Tue, 28 Sep 2021 11:09:25 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4HJcGF4Jlqz2yXv; Tue, 28 Sep 2021 11:09:25 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4HJcGF0N9Kz2x9g for <development@lists.ipfire.org>; Tue, 28 Sep 2021 11:09:25 +0000 (UTC) Received: from arche.uberspace.de (arche.uberspace.de [185.26.156.147]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPS id 4HJcG756jwz11C for <development@lists.ipfire.org>; Tue, 28 Sep 2021 11:09:19 +0000 (UTC) Received: (qmail 16581 invoked from network); 28 Sep 2021 11:09:19 -0000 Received: from localhost (HELO localhost) (127.0.0.1) by arche.uberspace.de with SMTP; 28 Sep 2021 11:09:19 -0000 From: Leo-Andres Hofmann <hofmann@leo-andres.de> To: development@lists.ipfire.org Subject: [PATCH v2 1/3] webinterface: Add links to the configuration wiki Date: Tue, 28 Sep 2021 13:09:04 +0200 Message-Id: <20210928110906.1089-1-hofmann@leo-andres.de> X-Mailer: git-send-email 2.27.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1632827359; a=rsa-sha256; cv=none; b=EQoAqcgA1cWhtlNttzTdED4ycs858BwKwmosNcm7+ZJHLyz7Y8uIhnpzkJxJYvxacMyqr2 prUVc+KqX3t9CP4vJx5I48aiCHeb063hbojNlmQZOerhFQIqCmcL0h6VKLBvrhI50v5v04 LrvaK1hRER0NaG/O/41CEOW+xyg92qTkBuq9gCrI6K6nL9LZZai/PBOG8tlVCYGQAeJjrt h1JMY0pgTKIfOrC0AaN4xWW0z/eN+w7yGa4Cz5mlBgL3yxOav0ALmGYg8ta4SUJ4MfXl8s zLM+paWPMiaiiUOfL05CAiv02taUcclNa/4qlhiZJOyxOlUitONRHJnzwYwgBw== ARC-Authentication-Results: i=1; mail01.ipfire.org; dkim=none; dmarc=none; spf=pass (mail01.ipfire.org: domain of hofmann@leo-andres.de designates 185.26.156.147 as permitted sender) smtp.mailfrom=hofmann@leo-andres.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1632827359; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=VOIudF7NmiX1/++OtIeLU5nUS1mcPJmcrQMT/6UwIzQ=; b=mbY4q9hb6rT29cAQ71zgQ8bHQrR4ZKFGbfHF0R3kBQtafXZ05dvTF1HnLqqayXd2qL+Fzn V5uAdkJVh8/mIvy6N7h9ceeUBI/oB8MVHa1Q4oQ4zjsUXKl+Ug0T8jaUeXCIm/9VjHo3eF Aa+yyHCzjAiAOIN1onIZ9cipxthzvwpxK03+7JemucErHBS7I6ix3NLyjL0YlMAj5ELV9c ed1S3HNfhESdOM3r/R1fqSXD8yeRmkCq1bi1vvfpw8RX+oxVNyHoyEs0+bM33oAwviGpnz Z1guSF7zOCoUWgX3dYByHzyyJZXEIMCS5TEaaD+JkLCdM7y+pzSIUTyZZcHfIw== Authentication-Results: mail01.ipfire.org; dkim=none; dmarc=none; spf=pass (mail01.ipfire.org: domain of hofmann@leo-andres.de designates 185.26.156.147 as permitted sender) smtp.mailfrom=hofmann@leo-andres.de X-Rspamd-Server: mail01.haj.ipfire.org X-Spamd-Result: default: False [-1.90 / 11.00]; BAYES_HAM(-3.00)[99.99%]; MID_CONTAINS_FROM(1.00)[]; SPF_REPUTATION_HAM(-0.71)[-0.71438666590796]; MX_INVALID(0.50)[]; R_MISSING_CHARSET(0.50)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_HTML_ONLY(0.20)[]; NEURAL_HAM(-0.18)[-0.177]; IP_REPUTATION_HAM(-0.01)[asn: 205766(0.00), country: DE(-0.01), ip: 185.26.156.147(0.00)]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:~]; ASN(0.00)[asn:205766, ipnet:185.26.156.0/24, country:DE]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DMARC_NA(0.00)[leo-andres.de]; TO_DN_NONE(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Queue-Id: 4HJcG756jwz11C X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk <development.lists.ipfire.org> List-Unsubscribe: <https://lists.ipfire.org/mailman/options/development>, <mailto:development-request@lists.ipfire.org?subject=unsubscribe> List-Archive: <http://lists.ipfire.org/pipermail/development/> List-Post: <mailto:development@lists.ipfire.org> List-Help: <mailto:development-request@lists.ipfire.org?subject=help> List-Subscribe: <https://lists.ipfire.org/mailman/listinfo/development>, <mailto:development-request@lists.ipfire.org?subject=subscribe> Errors-To: development-bounces@lists.ipfire.org Sender: "Development" <development-bounces@lists.ipfire.org> |
Series |
[v2,1/3] webinterface: Add links to the configuration wiki
|
|
Commit Message
Leo-Andres Hofmann
Sept. 28, 2021, 11:09 a.m. UTC
This patch adds a little "help" icon to the page header.
If a manual entry exists for a configuration page, the icon
appears and offers a quick way to access the wiki.
Wiki pages can be configured in the "manualpages" file.
Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
---
config/cfgroot/header.pl | 20 +++++++++++++++++++
config/cfgroot/manualpages | 7 +++++++
html/html/themes/ipfire/include/css/style.css | 13 ++++++++++++
html/html/themes/ipfire/include/functions.pl | 17 +++++++++++++++-
4 files changed, 56 insertions(+), 1 deletion(-)
create mode 100644 config/cfgroot/manualpages
Comments
Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org> Tested-by: Bernhard Bitsch <bbitsch@ipfire.org> Am 28.09.2021 um 13:09 schrieb Leo-Andres Hofmann: > This patch adds a little "help" icon to the page header. > If a manual entry exists for a configuration page, the icon > appears and offers a quick way to access the wiki. > Wiki pages can be configured in the "manualpages" file. > > Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de> > --- > config/cfgroot/header.pl | 20 +++++++++++++++++++ > config/cfgroot/manualpages | 7 +++++++ > html/html/themes/ipfire/include/css/style.css | 13 ++++++++++++ > html/html/themes/ipfire/include/functions.pl | 17 +++++++++++++++- > 4 files changed, 56 insertions(+), 1 deletion(-) > create mode 100644 config/cfgroot/manualpages > > diff --git a/config/cfgroot/header.pl b/config/cfgroot/header.pl > index 79accbe8a..e97f90d67 100644 > --- a/config/cfgroot/header.pl > +++ b/config/cfgroot/header.pl > @@ -91,7 +91,11 @@ if ( -d "/var/ipfire/langs/${language}/" ) { > }; > }; > > +### Initialize user manual > +my %manualpages = (); > +&General::readhash("${General::swroot}/main/manualpages", \%manualpages); > > +### Load selected language and theme functions > require "${swroot}/langs/en.pl"; > require "${swroot}/langs/${language}.pl"; > eval `/bin/cat /srv/web/ipfire/html/themes/ipfire/include/functions.pl`; > @@ -553,3 +557,19 @@ sub colorize { > return $string; > } > } > + > +# Get user manual URL for the specified configuration page, returns empty if no entry is configured > +sub get_manualpage_url() { > + my ($cgi_page) = @_; > + > + # Ensure base url is configured > + return unless($manualpages{'BASE_URL'}); > + > + # Return URL > + if($cgi_page && defined($manualpages{$cgi_page})) { > + return "$manualpages{'BASE_URL'}/$manualpages{$cgi_page}"; > + } > + > + # No manual page configured, return nothing > + return; > +} > diff --git a/config/cfgroot/manualpages b/config/cfgroot/manualpages > new file mode 100644 > index 000000000..e5ab1a13c > --- /dev/null > +++ b/config/cfgroot/manualpages > @@ -0,0 +1,7 @@ > +# User manual base URL (without trailing slash) > +BASE_URL=https://wiki.ipfire.org > + > +# Assign manual page URL path to CGI file ([cgi basename]=[path/to/page]) > +index=configuration/system/startpage > +pppsetup=configuration/system/dial > +qos=configuration/services/qos > diff --git a/html/html/themes/ipfire/include/css/style.css b/html/html/themes/ipfire/include/css/style.css > index b92f476c4..661773675 100644 > --- a/html/html/themes/ipfire/include/css/style.css > +++ b/html/html/themes/ipfire/include/css/style.css > @@ -169,6 +169,19 @@ iframe { > margin-bottom: 1em; > } > > +#main_header > * { > + display: inline-block; > + vertical-align: baseline; > +} > + > +#main_header > span { > + margin-left: 0.8em; > +} > + > +#main_header img { > + padding: 0; > +} > + > #footer { > height: 2.5em; > margin-bottom: 1em; > diff --git a/html/html/themes/ipfire/include/functions.pl b/html/html/themes/ipfire/include/functions.pl > index 9f12bbe59..18931428e 100644 > --- a/html/html/themes/ipfire/include/functions.pl > +++ b/html/html/themes/ipfire/include/functions.pl > @@ -170,7 +170,22 @@ END > print <<END > <div class="bigbox fixed"> > <div id="main_inner" class="fixed"> > - <h1>$title</h1> > + <div id="main_header"> > + <h1>$title</h1> > +END > +; > + > +# Print user manual link > +my $manual_url = &Header::get_manualpage_url($scriptName); > +if($manual_url) { > + print <<END > + <span><a href="$manual_url" title="$Lang::tr{'online help en'}" target="_blank"><img src="/images/help-browser.png" alt="$Lang::tr{'online help en'}"></a></span> > +END > +; > +} > + > +print <<END > + </div> > END > ; > } >
Hi all, @Bernhard, Thank you again for testing this patch! @Jon, This is the file format of the manualpages configuration: [cgi basename]=[path/to/page] For example: > BASE_URL=https://wiki.ipfire.org > index=configuration/system/startpage Results in "index.cgi" linking to "https://wiki.ipfire.org/configuration/system/startpage". Please note that the path does not start with a slash, because the get_manualpage_url function always adds one between the base url and the path. Unfortunately, I couldn't figure out how to include all this in the installer and I need help with that. So I would suggest we wait until this has been approved and integrated. Regards, Leo Am 28.09.2021 um 14:55 schrieb Bernhard Bitsch: > Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org> > Tested-by: Bernhard Bitsch <bbitsch@ipfire.org> > > Am 28.09.2021 um 13:09 schrieb Leo-Andres Hofmann: >> This patch adds a little "help" icon to the page header. >> If a manual entry exists for a configuration page, the icon >> appears and offers a quick way to access the wiki. >> Wiki pages can be configured in the "manualpages" file. >> >> Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de> >> --- >> config/cfgroot/header.pl | 20 +++++++++++++++++++ >> config/cfgroot/manualpages | 7 +++++++ >> html/html/themes/ipfire/include/css/style.css | 13 ++++++++++++ >> html/html/themes/ipfire/include/functions.pl | 17 +++++++++++++++- >> 4 files changed, 56 insertions(+), 1 deletion(-) >> create mode 100644 config/cfgroot/manualpages >> >> diff --git a/config/cfgroot/header.pl b/config/cfgroot/header.pl >> index 79accbe8a..e97f90d67 100644 >> --- a/config/cfgroot/header.pl >> +++ b/config/cfgroot/header.pl >> @@ -91,7 +91,11 @@ if ( -d "/var/ipfire/langs/${language}/" ) { >> }; >> }; >> +### Initialize user manual >> +my %manualpages = (); >> +&General::readhash("${General::swroot}/main/manualpages", \%manualpages); >> +### Load selected language and theme functions >> require "${swroot}/langs/en.pl"; >> require "${swroot}/langs/${language}.pl"; >> eval `/bin/cat /srv/web/ipfire/html/themes/ipfire/include/functions.pl`; >> @@ -553,3 +557,19 @@ sub colorize { >> return $string; >> } >> } >> + >> +# Get user manual URL for the specified configuration page, returns empty if no entry is configured >> +sub get_manualpage_url() { >> + my ($cgi_page) = @_; >> + >> + # Ensure base url is configured >> + return unless($manualpages{'BASE_URL'}); >> + >> + # Return URL >> + if($cgi_page && defined($manualpages{$cgi_page})) { >> + return "$manualpages{'BASE_URL'}/$manualpages{$cgi_page}"; >> + } >> + >> + # No manual page configured, return nothing >> + return; >> +} >> diff --git a/config/cfgroot/manualpages b/config/cfgroot/manualpages >> new file mode 100644 >> index 000000000..e5ab1a13c >> --- /dev/null >> +++ b/config/cfgroot/manualpages >> @@ -0,0 +1,7 @@ >> +# User manual base URL (without trailing slash) >> +BASE_URL=https://wiki.ipfire.org >> + >> +# Assign manual page URL path to CGI file ([cgi basename]=[path/to/page]) >> +index=configuration/system/startpage >> +pppsetup=configuration/system/dial >> +qos=configuration/services/qos >> diff --git a/html/html/themes/ipfire/include/css/style.css b/html/html/themes/ipfire/include/css/style.css >> index b92f476c4..661773675 100644 >> --- a/html/html/themes/ipfire/include/css/style.css >> +++ b/html/html/themes/ipfire/include/css/style.css >> @@ -169,6 +169,19 @@ iframe { >> margin-bottom: 1em; >> } >> +#main_header > * { >> + display: inline-block; >> + vertical-align: baseline; >> +} >> + >> +#main_header > span { >> + margin-left: 0.8em; >> +} >> + >> +#main_header img { >> + padding: 0; >> +} >> + >> #footer { >> height: 2.5em; >> margin-bottom: 1em; >> diff --git a/html/html/themes/ipfire/include/functions.pl b/html/html/themes/ipfire/include/functions.pl >> index 9f12bbe59..18931428e 100644 >> --- a/html/html/themes/ipfire/include/functions.pl >> +++ b/html/html/themes/ipfire/include/functions.pl >> @@ -170,7 +170,22 @@ END >> print <<END >> <div class="bigbox fixed"> >> <div id="main_inner" class="fixed"> >> - <h1>$title</h1> >> + <div id="main_header"> >> + <h1>$title</h1> >> +END >> +; >> + >> +# Print user manual link >> +my $manual_url = &Header::get_manualpage_url($scriptName); >> +if($manual_url) { >> + print <<END >> + <span><a href="$manual_url" title="$Lang::tr{'online help en'}" target="_blank"><img src="/images/help-browser.png" alt="$Lang::tr{'online help en'}"></a></span> >> +END >> +; >> +} >> + >> +print <<END >> + </div> >> END >> ; >> } >>
Hi all, Am 04.10.2021 um 19:42 schrieb Leo Hofmann: > Hi all, > > @Bernhard, Thank you again for testing this patch! > > @Jon, This is the file format of the manualpages configuration: > > [cgi basename]=[path/to/page] > > For example: > > > BASE_URL=https://wiki.ipfire.org > > index=configuration/system/startpage > > Results in "index.cgi" linking to > "https://wiki.ipfire.org/configuration/system/startpage". > Please note that the path does not start with a slash, because the > get_manualpage_url function always adds one between the base url and the > path. > > Unfortunately, I couldn't figure out how to include all this in the > installer and I need help with that. Another part is the sampling of all help pages. Should this be done in several patches for different pages or by collecting the contributions by one person ( Leo? ), which submit one patch? ( I've applied the mechanism to other pages, yet. And are very satisfied with it! Great idea! ) Regards, Bernhard > So I would suggest we wait until this has been approved and integrated. > > Regards, > Leo > > Am 28.09.2021 um 14:55 schrieb Bernhard Bitsch: >> Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org> >> Tested-by: Bernhard Bitsch <bbitsch@ipfire.org> >> >> Am 28.09.2021 um 13:09 schrieb Leo-Andres Hofmann: >>> This patch adds a little "help" icon to the page header. >>> If a manual entry exists for a configuration page, the icon >>> appears and offers a quick way to access the wiki. >>> Wiki pages can be configured in the "manualpages" file. >>> >>> Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de> >>> --- >>> config/cfgroot/header.pl | 20 +++++++++++++++++++ >>> config/cfgroot/manualpages | 7 +++++++ >>> html/html/themes/ipfire/include/css/style.css | 13 ++++++++++++ >>> html/html/themes/ipfire/include/functions.pl | 17 +++++++++++++++- >>> 4 files changed, 56 insertions(+), 1 deletion(-) >>> create mode 100644 config/cfgroot/manualpages >>> >>> diff --git a/config/cfgroot/header.pl b/config/cfgroot/header.pl >>> index 79accbe8a..e97f90d67 100644 >>> --- a/config/cfgroot/header.pl >>> +++ b/config/cfgroot/header.pl >>> @@ -91,7 +91,11 @@ if ( -d "/var/ipfire/langs/${language}/" ) { >>> }; >>> }; >>> +### Initialize user manual >>> +my %manualpages = (); >>> +&General::readhash("${General::swroot}/main/manualpages", >>> \%manualpages); >>> +### Load selected language and theme functions >>> require "${swroot}/langs/en.pl"; >>> require "${swroot}/langs/${language}.pl"; >>> eval `/bin/cat >>> /srv/web/ipfire/html/themes/ipfire/include/functions.pl`; >>> @@ -553,3 +557,19 @@ sub colorize { >>> return $string; >>> } >>> } >>> + >>> +# Get user manual URL for the specified configuration page, returns >>> empty if no entry is configured >>> +sub get_manualpage_url() { >>> + my ($cgi_page) = @_; >>> + >>> + # Ensure base url is configured >>> + return unless($manualpages{'BASE_URL'}); >>> + >>> + # Return URL >>> + if($cgi_page && defined($manualpages{$cgi_page})) { >>> + return "$manualpages{'BASE_URL'}/$manualpages{$cgi_page}"; >>> + } >>> + >>> + # No manual page configured, return nothing >>> + return; >>> +} >>> diff --git a/config/cfgroot/manualpages b/config/cfgroot/manualpages >>> new file mode 100644 >>> index 000000000..e5ab1a13c >>> --- /dev/null >>> +++ b/config/cfgroot/manualpages >>> @@ -0,0 +1,7 @@ >>> +# User manual base URL (without trailing slash) >>> +BASE_URL=https://wiki.ipfire.org >>> + >>> +# Assign manual page URL path to CGI file ([cgi >>> basename]=[path/to/page]) >>> +index=configuration/system/startpage >>> +pppsetup=configuration/system/dial >>> +qos=configuration/services/qos >>> diff --git a/html/html/themes/ipfire/include/css/style.css >>> b/html/html/themes/ipfire/include/css/style.css >>> index b92f476c4..661773675 100644 >>> --- a/html/html/themes/ipfire/include/css/style.css >>> +++ b/html/html/themes/ipfire/include/css/style.css >>> @@ -169,6 +169,19 @@ iframe { >>> margin-bottom: 1em; >>> } >>> +#main_header > * { >>> + display: inline-block; >>> + vertical-align: baseline; >>> +} >>> + >>> +#main_header > span { >>> + margin-left: 0.8em; >>> +} >>> + >>> +#main_header img { >>> + padding: 0; >>> +} >>> + >>> #footer { >>> height: 2.5em; >>> margin-bottom: 1em; >>> diff --git a/html/html/themes/ipfire/include/functions.pl >>> b/html/html/themes/ipfire/include/functions.pl >>> index 9f12bbe59..18931428e 100644 >>> --- a/html/html/themes/ipfire/include/functions.pl >>> +++ b/html/html/themes/ipfire/include/functions.pl >>> @@ -170,7 +170,22 @@ END >>> print <<END >>> <div class="bigbox fixed"> >>> <div id="main_inner" class="fixed"> >>> - <h1>$title</h1> >>> + <div id="main_header"> >>> + <h1>$title</h1> >>> +END >>> +; >>> + >>> +# Print user manual link >>> +my $manual_url = &Header::get_manualpage_url($scriptName); >>> +if($manual_url) { >>> + print <<END >>> + <span><a href="$manual_url" title="$Lang::tr{'online >>> help en'}" target="_blank"><img src="/images/help-browser.png" >>> alt="$Lang::tr{'online help en'}"></a></span> >>> +END >>> +; >>> +} >>> + >>> +print <<END >>> + </div> >>> END >>> ; >>> } >>>
Here is a quick template to get started: I'll keep going tomorrow. Jon > On Oct 4, 2021, at 12:42 PM, Leo Hofmann <hofmann@leo-andres.de> wrote: > > Hi all, > > @Bernhard, Thank you again for testing this patch! > > @Jon, This is the file format of the manualpages configuration: > > [cgi basename]=[path/to/page] > > For example: > > > BASE_URL=https://wiki.ipfire.org > > index=configuration/system/startpage > > Results in "index.cgi" linking to "https://wiki.ipfire.org/configuration/system/startpage". > Please note that the path does not start with a slash, because the get_manualpage_url function always adds one between the base url and the path. > > Unfortunately, I couldn't figure out how to include all this in the installer and I need help with that. > So I would suggest we wait until this has been approved and integrated. > > Regards, > Leo > > Am 28.09.2021 um 14:55 schrieb Bernhard Bitsch: >> Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org> >> Tested-by: Bernhard Bitsch <bbitsch@ipfire.org> >> >> Am 28.09.2021 um 13:09 schrieb Leo-Andres Hofmann: >>> This patch adds a little "help" icon to the page header. >>> If a manual entry exists for a configuration page, the icon >>> appears and offers a quick way to access the wiki. >>> Wiki pages can be configured in the "manualpages" file. >>> >>> Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de> >>> --- >>> config/cfgroot/header.pl | 20 +++++++++++++++++++ >>> config/cfgroot/manualpages | 7 +++++++ >>> html/html/themes/ipfire/include/css/style.css | 13 ++++++++++++ >>> html/html/themes/ipfire/include/functions.pl | 17 +++++++++++++++- >>> 4 files changed, 56 insertions(+), 1 deletion(-) >>> create mode 100644 config/cfgroot/manualpages >>> >>> diff --git a/config/cfgroot/header.pl b/config/cfgroot/header.pl >>> index 79accbe8a..e97f90d67 100644 >>> --- a/config/cfgroot/header.pl >>> +++ b/config/cfgroot/header.pl >>> @@ -91,7 +91,11 @@ if ( -d "/var/ipfire/langs/${language}/" ) { >>> }; >>> }; >>> +### Initialize user manual >>> +my %manualpages = (); >>> +&General::readhash("${General::swroot}/main/manualpages", \%manualpages); >>> +### Load selected language and theme functions >>> require "${swroot}/langs/en.pl"; >>> require "${swroot}/langs/${language}.pl"; >>> eval `/bin/cat /srv/web/ipfire/html/themes/ipfire/include/functions.pl`; >>> @@ -553,3 +557,19 @@ sub colorize { >>> return $string; >>> } >>> } >>> + >>> +# Get user manual URL for the specified configuration page, returns empty if no entry is configured >>> +sub get_manualpage_url() { >>> + my ($cgi_page) = @_; >>> + >>> + # Ensure base url is configured >>> + return unless($manualpages{'BASE_URL'}); >>> + >>> + # Return URL >>> + if($cgi_page && defined($manualpages{$cgi_page})) { >>> + return "$manualpages{'BASE_URL'}/$manualpages{$cgi_page}"; >>> + } >>> + >>> + # No manual page configured, return nothing >>> + return; >>> +} >>> diff --git a/config/cfgroot/manualpages b/config/cfgroot/manualpages >>> new file mode 100644 >>> index 000000000..e5ab1a13c >>> --- /dev/null >>> +++ b/config/cfgroot/manualpages >>> @@ -0,0 +1,7 @@ >>> +# User manual base URL (without trailing slash) >>> +BASE_URL=https://wiki.ipfire.org >>> + >>> +# Assign manual page URL path to CGI file ([cgi basename]=[path/to/page]) >>> +index=configuration/system/startpage >>> +pppsetup=configuration/system/dial >>> +qos=configuration/services/qos >>> diff --git a/html/html/themes/ipfire/include/css/style.css b/html/html/themes/ipfire/include/css/style.css >>> index b92f476c4..661773675 100644 >>> --- a/html/html/themes/ipfire/include/css/style.css >>> +++ b/html/html/themes/ipfire/include/css/style.css >>> @@ -169,6 +169,19 @@ iframe { >>> margin-bottom: 1em; >>> } >>> +#main_header > * { >>> + display: inline-block; >>> + vertical-align: baseline; >>> +} >>> + >>> +#main_header > span { >>> + margin-left: 0.8em; >>> +} >>> + >>> +#main_header img { >>> + padding: 0; >>> +} >>> + >>> #footer { >>> height: 2.5em; >>> margin-bottom: 1em; >>> diff --git a/html/html/themes/ipfire/include/functions.pl b/html/html/themes/ipfire/include/functions.pl >>> index 9f12bbe59..18931428e 100644 >>> --- a/html/html/themes/ipfire/include/functions.pl >>> +++ b/html/html/themes/ipfire/include/functions.pl >>> @@ -170,7 +170,22 @@ END >>> print <<END >>> <div class="bigbox fixed"> >>> <div id="main_inner" class="fixed"> >>> - <h1>$title</h1> >>> + <div id="main_header"> >>> + <h1>$title</h1> >>> +END >>> +; >>> + >>> +# Print user manual link >>> +my $manual_url = &Header::get_manualpage_url($scriptName); >>> +if($manual_url) { >>> + print <<END >>> + <span><a href="$manual_url" title="$Lang::tr{'online help en'}" target="_blank"><img src="/images/help-browser.png" alt="$Lang::tr{'online help en'}"></a></span> >>> +END >>> +; >>> +} >>> + >>> +print <<END >>> + </div> >>> END >>> ; >>> } >>>
Hi, Am 04.10.2021 um 22:34 schrieb Bernhard Bitsch: > Hi all, > > Am 04.10.2021 um 19:42 schrieb Leo Hofmann: >> Hi all, >> >> @Bernhard, Thank you again for testing this patch! >> >> @Jon, This is the file format of the manualpages configuration: >> >> [cgi basename]=[path/to/page] >> >> For example: >> >> > BASE_URL=https://wiki.ipfire.org >> > index=configuration/system/startpage >> >> Results in "index.cgi" linking to "https://wiki.ipfire.org/configuration/system/startpage". >> Please note that the path does not start with a slash, because the get_manualpage_url function always adds one between the base url and the path. >> >> Unfortunately, I couldn't figure out how to include all this in the installer and I need help with that. > > Another part is the sampling of all help pages. > Should this be done in several patches for different pages or by collecting the contributions by one person ( Leo? ), which submit one patch? I suggest everyone sends their contribution as a patch so that git shows the correct author later on. But if that doesn't work, of course I'm happy to collect everything! > ( I've applied the mechanism to other pages, yet. And are very satisfied with it! Great idea! ) :) > > Regards, > Bernhard Regards, Leo > >> So I would suggest we wait until this has been approved and integrated. >> >> Regards, >> Leo >> >> Am 28.09.2021 um 14:55 schrieb Bernhard Bitsch: >>> Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org> >>> Tested-by: Bernhard Bitsch <bbitsch@ipfire.org> >>> >>> Am 28.09.2021 um 13:09 schrieb Leo-Andres Hofmann: >>>> This patch adds a little "help" icon to the page header. >>>> If a manual entry exists for a configuration page, the icon >>>> appears and offers a quick way to access the wiki. >>>> Wiki pages can be configured in the "manualpages" file. >>>> >>>> Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de> >>>> --- >>>> config/cfgroot/header.pl | 20 +++++++++++++++++++ >>>> config/cfgroot/manualpages | 7 +++++++ >>>> html/html/themes/ipfire/include/css/style.css | 13 ++++++++++++ >>>> html/html/themes/ipfire/include/functions.pl | 17 +++++++++++++++- >>>> 4 files changed, 56 insertions(+), 1 deletion(-) >>>> create mode 100644 config/cfgroot/manualpages >>>> >>>> diff --git a/config/cfgroot/header.pl b/config/cfgroot/header.pl >>>> index 79accbe8a..e97f90d67 100644 >>>> --- a/config/cfgroot/header.pl >>>> +++ b/config/cfgroot/header.pl >>>> @@ -91,7 +91,11 @@ if ( -d "/var/ipfire/langs/${language}/" ) { >>>> }; >>>> }; >>>> +### Initialize user manual >>>> +my %manualpages = (); >>>> +&General::readhash("${General::swroot}/main/manualpages", \%manualpages); >>>> +### Load selected language and theme functions >>>> require "${swroot}/langs/en.pl"; >>>> require "${swroot}/langs/${language}.pl"; >>>> eval `/bin/cat /srv/web/ipfire/html/themes/ipfire/include/functions.pl`; >>>> @@ -553,3 +557,19 @@ sub colorize { >>>> return $string; >>>> } >>>> } >>>> + >>>> +# Get user manual URL for the specified configuration page, returns empty if no entry is configured >>>> +sub get_manualpage_url() { >>>> + my ($cgi_page) = @_; >>>> + >>>> + # Ensure base url is configured >>>> + return unless($manualpages{'BASE_URL'}); >>>> + >>>> + # Return URL >>>> + if($cgi_page && defined($manualpages{$cgi_page})) { >>>> + return "$manualpages{'BASE_URL'}/$manualpages{$cgi_page}"; >>>> + } >>>> + >>>> + # No manual page configured, return nothing >>>> + return; >>>> +} >>>> diff --git a/config/cfgroot/manualpages b/config/cfgroot/manualpages >>>> new file mode 100644 >>>> index 000000000..e5ab1a13c >>>> --- /dev/null >>>> +++ b/config/cfgroot/manualpages >>>> @@ -0,0 +1,7 @@ >>>> +# User manual base URL (without trailing slash) >>>> +BASE_URL=https://wiki.ipfire.org >>>> + >>>> +# Assign manual page URL path to CGI file ([cgi basename]=[path/to/page]) >>>> +index=configuration/system/startpage >>>> +pppsetup=configuration/system/dial >>>> +qos=configuration/services/qos >>>> diff --git a/html/html/themes/ipfire/include/css/style.css b/html/html/themes/ipfire/include/css/style.css >>>> index b92f476c4..661773675 100644 >>>> --- a/html/html/themes/ipfire/include/css/style.css >>>> +++ b/html/html/themes/ipfire/include/css/style.css >>>> @@ -169,6 +169,19 @@ iframe { >>>> margin-bottom: 1em; >>>> } >>>> +#main_header > * { >>>> + display: inline-block; >>>> + vertical-align: baseline; >>>> +} >>>> + >>>> +#main_header > span { >>>> + margin-left: 0.8em; >>>> +} >>>> + >>>> +#main_header img { >>>> + padding: 0; >>>> +} >>>> + >>>> #footer { >>>> height: 2.5em; >>>> margin-bottom: 1em; >>>> diff --git a/html/html/themes/ipfire/include/functions.pl b/html/html/themes/ipfire/include/functions.pl >>>> index 9f12bbe59..18931428e 100644 >>>> --- a/html/html/themes/ipfire/include/functions.pl >>>> +++ b/html/html/themes/ipfire/include/functions.pl >>>> @@ -170,7 +170,22 @@ END >>>> print <<END >>>> <div class="bigbox fixed"> >>>> <div id="main_inner" class="fixed"> >>>> - <h1>$title</h1> >>>> + <div id="main_header"> >>>> + <h1>$title</h1> >>>> +END >>>> +; >>>> + >>>> +# Print user manual link >>>> +my $manual_url = &Header::get_manualpage_url($scriptName); >>>> +if($manual_url) { >>>> + print <<END >>>> + <span><a href="$manual_url" title="$Lang::tr{'online help en'}" target="_blank"><img src="/images/help-browser.png" alt="$Lang::tr{'online help en'}"></a></span> >>>> +END >>>> +; >>>> +} >>>> + >>>> +print <<END >>>> + </div> >>>> END >>>> ; >>>> } >>>>
Leo, This should be complete. But I don't know how to test. Jon > On Oct 4, 2021, at 10:40 PM, Jon Murphy <jcmurphy26@gmail.com> wrote: > > Here is a quick template to get started: > > <manualpages> > > > > I'll keep going tomorrow. > > > Jon > > > >> On Oct 4, 2021, at 12:42 PM, Leo Hofmann <hofmann@leo-andres.de> wrote: >> >> Hi all, >> >> @Bernhard, Thank you again for testing this patch! >> >> @Jon, This is the file format of the manualpages configuration: >> >> [cgi basename]=[path/to/page] >> >> For example: >> >>> BASE_URL=https://wiki.ipfire.org >>> index=configuration/system/startpage >> >> Results in "index.cgi" linking to "https://wiki.ipfire.org/configuration/system/startpage". >> Please note that the path does not start with a slash, because the get_manualpage_url function always adds one between the base url and the path. >> >> Unfortunately, I couldn't figure out how to include all this in the installer and I need help with that. >> So I would suggest we wait until this has been approved and integrated. >> >> Regards, >> Leo >> >> Am 28.09.2021 um 14:55 schrieb Bernhard Bitsch: >>> Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org> >>> Tested-by: Bernhard Bitsch <bbitsch@ipfire.org> >>> >>> Am 28.09.2021 um 13:09 schrieb Leo-Andres Hofmann: >>>> This patch adds a little "help" icon to the page header. >>>> If a manual entry exists for a configuration page, the icon >>>> appears and offers a quick way to access the wiki. >>>> Wiki pages can be configured in the "manualpages" file. >>>> >>>> Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de> >>>> --- >>>> config/cfgroot/header.pl | 20 +++++++++++++++++++ >>>> config/cfgroot/manualpages | 7 +++++++ >>>> html/html/themes/ipfire/include/css/style.css | 13 ++++++++++++ >>>> html/html/themes/ipfire/include/functions.pl | 17 +++++++++++++++- >>>> 4 files changed, 56 insertions(+), 1 deletion(-) >>>> create mode 100644 config/cfgroot/manualpages >>>> >>>> diff --git a/config/cfgroot/header.pl b/config/cfgroot/header.pl >>>> index 79accbe8a..e97f90d67 100644 >>>> --- a/config/cfgroot/header.pl >>>> +++ b/config/cfgroot/header.pl >>>> @@ -91,7 +91,11 @@ if ( -d "/var/ipfire/langs/${language}/" ) { >>>> }; >>>> }; >>>> +### Initialize user manual >>>> +my %manualpages = (); >>>> +&General::readhash("${General::swroot}/main/manualpages", \%manualpages); >>>> +### Load selected language and theme functions >>>> require "${swroot}/langs/en.pl"; >>>> require "${swroot}/langs/${language}.pl"; >>>> eval `/bin/cat /srv/web/ipfire/html/themes/ipfire/include/functions.pl`; >>>> @@ -553,3 +557,19 @@ sub colorize { >>>> return $string; >>>> } >>>> } >>>> + >>>> +# Get user manual URL for the specified configuration page, returns empty if no entry is configured >>>> +sub get_manualpage_url() { >>>> + my ($cgi_page) = @_; >>>> + >>>> + # Ensure base url is configured >>>> + return unless($manualpages{'BASE_URL'}); >>>> + >>>> + # Return URL >>>> + if($cgi_page && defined($manualpages{$cgi_page})) { >>>> + return "$manualpages{'BASE_URL'}/$manualpages{$cgi_page}"; >>>> + } >>>> + >>>> + # No manual page configured, return nothing >>>> + return; >>>> +} >>>> diff --git a/config/cfgroot/manualpages b/config/cfgroot/manualpages >>>> new file mode 100644 >>>> index 000000000..e5ab1a13c >>>> --- /dev/null >>>> +++ b/config/cfgroot/manualpages >>>> @@ -0,0 +1,7 @@ >>>> +# User manual base URL (without trailing slash) >>>> +BASE_URL=https://wiki.ipfire.org >>>> + >>>> +# Assign manual page URL path to CGI file ([cgi basename]=[path/to/page]) >>>> +index=configuration/system/startpage >>>> +pppsetup=configuration/system/dial >>>> +qos=configuration/services/qos >>>> diff --git a/html/html/themes/ipfire/include/css/style.css b/html/html/themes/ipfire/include/css/style.css >>>> index b92f476c4..661773675 100644 >>>> --- a/html/html/themes/ipfire/include/css/style.css >>>> +++ b/html/html/themes/ipfire/include/css/style.css >>>> @@ -169,6 +169,19 @@ iframe { >>>> margin-bottom: 1em; >>>> } >>>> +#main_header > * { >>>> + display: inline-block; >>>> + vertical-align: baseline; >>>> +} >>>> + >>>> +#main_header > span { >>>> + margin-left: 0.8em; >>>> +} >>>> + >>>> +#main_header img { >>>> + padding: 0; >>>> +} >>>> + >>>> #footer { >>>> height: 2.5em; >>>> margin-bottom: 1em; >>>> diff --git a/html/html/themes/ipfire/include/functions.pl b/html/html/themes/ipfire/include/functions.pl >>>> index 9f12bbe59..18931428e 100644 >>>> --- a/html/html/themes/ipfire/include/functions.pl >>>> +++ b/html/html/themes/ipfire/include/functions.pl >>>> @@ -170,7 +170,22 @@ END >>>> print <<END >>>> <div class="bigbox fixed"> >>>> <div id="main_inner" class="fixed"> >>>> - <h1>$title</h1> >>>> + <div id="main_header"> >>>> + <h1>$title</h1> >>>> +END >>>> +; >>>> + >>>> +# Print user manual link >>>> +my $manual_url = &Header::get_manualpage_url($scriptName); >>>> +if($manual_url) { >>>> + print <<END >>>> + <span><a href="$manual_url" title="$Lang::tr{'online help en'}" target="_blank"><img src="/images/help-browser.png" alt="$Lang::tr{'online help en'}"></a></span> >>>> +END >>>> +; >>>> +} >>>> + >>>> +print <<END >>>> + </div> >>>> END >>>> ; >>>> } >>>> >
Hi, I've just included the file into my system. There are no problems. So a new patch with this file can start the formal verification and test process. The original patch has some flaws ( function name, location in source ) I will comment in an extra answer. Regards, Bernhard Am 06.10.2021 um 05:18 schrieb Jon Murphy: > Leo, > > This should be complete. But I don't know how to test. > > Jon > > > > > >> On Oct 4, 2021, at 10:40 PM, Jon Murphy <jcmurphy26@gmail.com> wrote: >> >> Here is a quick template to get started: >> >> <manualpages> >> >> >> >> I'll keep going tomorrow. >> >> >> Jon >> >> >> >>> On Oct 4, 2021, at 12:42 PM, Leo Hofmann <hofmann@leo-andres.de> wrote: >>> >>> Hi all, >>> >>> @Bernhard, Thank you again for testing this patch! >>> >>> @Jon, This is the file format of the manualpages configuration: >>> >>> [cgi basename]=[path/to/page] >>> >>> For example: >>> >>>> BASE_URL=https://wiki.ipfire.org >>>> index=configuration/system/startpage >>> >>> Results in "index.cgi" linking to "https://wiki.ipfire.org/configuration/system/startpage". >>> Please note that the path does not start with a slash, because the get_manualpage_url function always adds one between the base url and the path. >>> >>> Unfortunately, I couldn't figure out how to include all this in the installer and I need help with that. >>> So I would suggest we wait until this has been approved and integrated. >>> >>> Regards, >>> Leo >>> >>> Am 28.09.2021 um 14:55 schrieb Bernhard Bitsch: >>>> Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org> >>>> Tested-by: Bernhard Bitsch <bbitsch@ipfire.org> >>>> >>>> Am 28.09.2021 um 13:09 schrieb Leo-Andres Hofmann: >>>>> This patch adds a little "help" icon to the page header. >>>>> If a manual entry exists for a configuration page, the icon >>>>> appears and offers a quick way to access the wiki. >>>>> Wiki pages can be configured in the "manualpages" file. >>>>> >>>>> Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de> >>>>> --- >>>>> config/cfgroot/header.pl | 20 +++++++++++++++++++ >>>>> config/cfgroot/manualpages | 7 +++++++ >>>>> html/html/themes/ipfire/include/css/style.css | 13 ++++++++++++ >>>>> html/html/themes/ipfire/include/functions.pl | 17 +++++++++++++++- >>>>> 4 files changed, 56 insertions(+), 1 deletion(-) >>>>> create mode 100644 config/cfgroot/manualpages >>>>> >>>>> diff --git a/config/cfgroot/header.pl b/config/cfgroot/header.pl >>>>> index 79accbe8a..e97f90d67 100644 >>>>> --- a/config/cfgroot/header.pl >>>>> +++ b/config/cfgroot/header.pl >>>>> @@ -91,7 +91,11 @@ if ( -d "/var/ipfire/langs/${language}/" ) { >>>>> }; >>>>> }; >>>>> +### Initialize user manual >>>>> +my %manualpages = (); >>>>> +&General::readhash("${General::swroot}/main/manualpages", \%manualpages); >>>>> +### Load selected language and theme functions >>>>> require "${swroot}/langs/en.pl"; >>>>> require "${swroot}/langs/${language}.pl"; >>>>> eval `/bin/cat /srv/web/ipfire/html/themes/ipfire/include/functions.pl`; >>>>> @@ -553,3 +557,19 @@ sub colorize { >>>>> return $string; >>>>> } >>>>> } >>>>> + >>>>> +# Get user manual URL for the specified configuration page, returns empty if no entry is configured >>>>> +sub get_manualpage_url() { >>>>> + my ($cgi_page) = @_; >>>>> + >>>>> + # Ensure base url is configured >>>>> + return unless($manualpages{'BASE_URL'}); >>>>> + >>>>> + # Return URL >>>>> + if($cgi_page && defined($manualpages{$cgi_page})) { >>>>> + return "$manualpages{'BASE_URL'}/$manualpages{$cgi_page}"; >>>>> + } >>>>> + >>>>> + # No manual page configured, return nothing >>>>> + return; >>>>> +} >>>>> diff --git a/config/cfgroot/manualpages b/config/cfgroot/manualpages >>>>> new file mode 100644 >>>>> index 000000000..e5ab1a13c >>>>> --- /dev/null >>>>> +++ b/config/cfgroot/manualpages >>>>> @@ -0,0 +1,7 @@ >>>>> +# User manual base URL (without trailing slash) >>>>> +BASE_URL=https://wiki.ipfire.org >>>>> + >>>>> +# Assign manual page URL path to CGI file ([cgi basename]=[path/to/page]) >>>>> +index=configuration/system/startpage >>>>> +pppsetup=configuration/system/dial >>>>> +qos=configuration/services/qos >>>>> diff --git a/html/html/themes/ipfire/include/css/style.css b/html/html/themes/ipfire/include/css/style.css >>>>> index b92f476c4..661773675 100644 >>>>> --- a/html/html/themes/ipfire/include/css/style.css >>>>> +++ b/html/html/themes/ipfire/include/css/style.css >>>>> @@ -169,6 +169,19 @@ iframe { >>>>> margin-bottom: 1em; >>>>> } >>>>> +#main_header > * { >>>>> + display: inline-block; >>>>> + vertical-align: baseline; >>>>> +} >>>>> + >>>>> +#main_header > span { >>>>> + margin-left: 0.8em; >>>>> +} >>>>> + >>>>> +#main_header img { >>>>> + padding: 0; >>>>> +} >>>>> + >>>>> #footer { >>>>> height: 2.5em; >>>>> margin-bottom: 1em; >>>>> diff --git a/html/html/themes/ipfire/include/functions.pl b/html/html/themes/ipfire/include/functions.pl >>>>> index 9f12bbe59..18931428e 100644 >>>>> --- a/html/html/themes/ipfire/include/functions.pl >>>>> +++ b/html/html/themes/ipfire/include/functions.pl >>>>> @@ -170,7 +170,22 @@ END >>>>> print <<END >>>>> <div class="bigbox fixed"> >>>>> <div id="main_inner" class="fixed"> >>>>> - <h1>$title</h1> >>>>> + <div id="main_header"> >>>>> + <h1>$title</h1> >>>>> +END >>>>> +; >>>>> + >>>>> +# Print user manual link >>>>> +my $manual_url = &Header::get_manualpage_url($scriptName); >>>>> +if($manual_url) { >>>>> + print <<END >>>>> + <span><a href="$manual_url" title="$Lang::tr{'online help en'}" target="_blank"><img src="/images/help-browser.png" alt="$Lang::tr{'online help en'}"></a></span> >>>>> +END >>>>> +; >>>>> +} >>>>> + >>>>> +print <<END >>>>> + </div> >>>>> END >>>>> ; >>>>> } >>>>> >> >
Hi Jon, I have just tested the file. Great job, it works flawlessly! Now I'm looking forward to more feedback and hope this will be integrated soon :) Best regards, Leo Am 06.10.2021 um 05:18 schrieb Jon Murphy: > Leo, > > This should be complete. But I don't know how to test. > > Jon > > > > >> On Oct 4, 2021, at 10:40 PM, Jon Murphy <jcmurphy26@gmail.com> wrote: >> >> Here is a quick template to get started: >> >> <manualpages> >> >> >> >> I'll keep going tomorrow. >> >> >> Jon >> >> >> >>> On Oct 4, 2021, at 12:42 PM, Leo Hofmann <hofmann@leo-andres.de> wrote: >>> >>> Hi all, >>> >>> @Bernhard, Thank you again for testing this patch! >>> >>> @Jon, This is the file format of the manualpages configuration: >>> >>> [cgi basename]=[path/to/page] >>> >>> For example: >>> >>>> BASE_URL=https://wiki.ipfire.org >>>> index=configuration/system/startpage >>> Results in "index.cgi" linking to "https://wiki.ipfire.org/configuration/system/startpage". >>> Please note that the path does not start with a slash, because the get_manualpage_url function always adds one between the base url and the path. >>> >>> Unfortunately, I couldn't figure out how to include all this in the installer and I need help with that. >>> So I would suggest we wait until this has been approved and integrated. >>> >>> Regards, >>> Leo >>> >>> Am 28.09.2021 um 14:55 schrieb Bernhard Bitsch: >>>> Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org> >>>> Tested-by: Bernhard Bitsch <bbitsch@ipfire.org> >>>> >>>> Am 28.09.2021 um 13:09 schrieb Leo-Andres Hofmann: >>>>> This patch adds a little "help" icon to the page header. >>>>> If a manual entry exists for a configuration page, the icon >>>>> appears and offers a quick way to access the wiki. >>>>> Wiki pages can be configured in the "manualpages" file. >>>>> >>>>> Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de> >>>>> --- >>>>> config/cfgroot/header.pl | 20 +++++++++++++++++++ >>>>> config/cfgroot/manualpages | 7 +++++++ >>>>> html/html/themes/ipfire/include/css/style.css | 13 ++++++++++++ >>>>> html/html/themes/ipfire/include/functions.pl | 17 +++++++++++++++- >>>>> 4 files changed, 56 insertions(+), 1 deletion(-) >>>>> create mode 100644 config/cfgroot/manualpages >>>>> >>>>> diff --git a/config/cfgroot/header.pl b/config/cfgroot/header.pl >>>>> index 79accbe8a..e97f90d67 100644 >>>>> --- a/config/cfgroot/header.pl >>>>> +++ b/config/cfgroot/header.pl >>>>> @@ -91,7 +91,11 @@ if ( -d "/var/ipfire/langs/${language}/" ) { >>>>> }; >>>>> }; >>>>> +### Initialize user manual >>>>> +my %manualpages = (); >>>>> +&General::readhash("${General::swroot}/main/manualpages", \%manualpages); >>>>> +### Load selected language and theme functions >>>>> require "${swroot}/langs/en.pl"; >>>>> require "${swroot}/langs/${language}.pl"; >>>>> eval `/bin/cat /srv/web/ipfire/html/themes/ipfire/include/functions.pl`; >>>>> @@ -553,3 +557,19 @@ sub colorize { >>>>> return $string; >>>>> } >>>>> } >>>>> + >>>>> +# Get user manual URL for the specified configuration page, returns empty if no entry is configured >>>>> +sub get_manualpage_url() { >>>>> + my ($cgi_page) = @_; >>>>> + >>>>> + # Ensure base url is configured >>>>> + return unless($manualpages{'BASE_URL'}); >>>>> + >>>>> + # Return URL >>>>> + if($cgi_page && defined($manualpages{$cgi_page})) { >>>>> + return "$manualpages{'BASE_URL'}/$manualpages{$cgi_page}"; >>>>> + } >>>>> + >>>>> + # No manual page configured, return nothing >>>>> + return; >>>>> +} >>>>> diff --git a/config/cfgroot/manualpages b/config/cfgroot/manualpages >>>>> new file mode 100644 >>>>> index 000000000..e5ab1a13c >>>>> --- /dev/null >>>>> +++ b/config/cfgroot/manualpages >>>>> @@ -0,0 +1,7 @@ >>>>> +# User manual base URL (without trailing slash) >>>>> +BASE_URL=https://wiki.ipfire.org >>>>> + >>>>> +# Assign manual page URL path to CGI file ([cgi basename]=[path/to/page]) >>>>> +index=configuration/system/startpage >>>>> +pppsetup=configuration/system/dial >>>>> +qos=configuration/services/qos >>>>> diff --git a/html/html/themes/ipfire/include/css/style.css b/html/html/themes/ipfire/include/css/style.css >>>>> index b92f476c4..661773675 100644 >>>>> --- a/html/html/themes/ipfire/include/css/style.css >>>>> +++ b/html/html/themes/ipfire/include/css/style.css >>>>> @@ -169,6 +169,19 @@ iframe { >>>>> margin-bottom: 1em; >>>>> } >>>>> +#main_header > * { >>>>> + display: inline-block; >>>>> + vertical-align: baseline; >>>>> +} >>>>> + >>>>> +#main_header > span { >>>>> + margin-left: 0.8em; >>>>> +} >>>>> + >>>>> +#main_header img { >>>>> + padding: 0; >>>>> +} >>>>> + >>>>> #footer { >>>>> height: 2.5em; >>>>> margin-bottom: 1em; >>>>> diff --git a/html/html/themes/ipfire/include/functions.pl b/html/html/themes/ipfire/include/functions.pl >>>>> index 9f12bbe59..18931428e 100644 >>>>> --- a/html/html/themes/ipfire/include/functions.pl >>>>> +++ b/html/html/themes/ipfire/include/functions.pl >>>>> @@ -170,7 +170,22 @@ END >>>>> print <<END >>>>> <div class="bigbox fixed"> >>>>> <div id="main_inner" class="fixed"> >>>>> - <h1>$title</h1> >>>>> + <div id="main_header"> >>>>> + <h1>$title</h1> >>>>> +END >>>>> +; >>>>> + >>>>> +# Print user manual link >>>>> +my $manual_url = &Header::get_manualpage_url($scriptName); >>>>> +if($manual_url) { >>>>> + print <<END >>>>> + <span><a href="$manual_url" title="$Lang::tr{'online help en'}" target="_blank"><img src="/images/help-browser.png" alt="$Lang::tr{'online help en'}"></a></span> >>>>> +END >>>>> +; >>>>> +} >>>>> + >>>>> +print <<END >>>>> + </div> >>>>> END >>>>> ; >>>>> } >>>>>
Hi Bernhard, Am 06.10.2021 um 11:23 schrieb Bernhard Bitsch: > Hi, > > I've just included the file into my system. > There are no problems. > So a new patch with this file can start the formal verification and test process. > > The original patch has some flaws ( function name, location in source ) I will comment in an extra answer. Have you had time to collect the issues yet? I'd like to continue working on them. Best regards, Leo > > Regards, > Bernhard > > Am 06.10.2021 um 05:18 schrieb Jon Murphy: >> Leo, >> >> This should be complete. But I don't know how to test. >> >> Jon >> >> >> >> >> >>> On Oct 4, 2021, at 10:40 PM, Jon Murphy <jcmurphy26@gmail.com> wrote: >>> >>> Here is a quick template to get started: >>> >>> <manualpages> >>> >>> >>> >>> I'll keep going tomorrow. >>> >>> >>> Jon >>> >>> >>> >>>> On Oct 4, 2021, at 12:42 PM, Leo Hofmann <hofmann@leo-andres.de> wrote: >>>> >>>> Hi all, >>>> >>>> @Bernhard, Thank you again for testing this patch! >>>> >>>> @Jon, This is the file format of the manualpages configuration: >>>> >>>> [cgi basename]=[path/to/page] >>>> >>>> For example: >>>> >>>>> BASE_URL=https://wiki.ipfire.org >>>>> index=configuration/system/startpage >>>> >>>> Results in "index.cgi" linking to "https://wiki.ipfire.org/configuration/system/startpage". >>>> Please note that the path does not start with a slash, because the get_manualpage_url function always adds one between the base url and the path. >>>> >>>> Unfortunately, I couldn't figure out how to include all this in the installer and I need help with that. >>>> So I would suggest we wait until this has been approved and integrated. >>>> >>>> Regards, >>>> Leo >>>> >>>> Am 28.09.2021 um 14:55 schrieb Bernhard Bitsch: >>>>> Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org> >>>>> Tested-by: Bernhard Bitsch <bbitsch@ipfire.org> >>>>> >>>>> Am 28.09.2021 um 13:09 schrieb Leo-Andres Hofmann: >>>>>> This patch adds a little "help" icon to the page header. >>>>>> If a manual entry exists for a configuration page, the icon >>>>>> appears and offers a quick way to access the wiki. >>>>>> Wiki pages can be configured in the "manualpages" file. >>>>>> >>>>>> Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de> >>>>>> --- >>>>>> config/cfgroot/header.pl | 20 +++++++++++++++++++ >>>>>> config/cfgroot/manualpages | 7 +++++++ >>>>>> html/html/themes/ipfire/include/css/style.css | 13 ++++++++++++ >>>>>> html/html/themes/ipfire/include/functions.pl | 17 +++++++++++++++- >>>>>> 4 files changed, 56 insertions(+), 1 deletion(-) >>>>>> create mode 100644 config/cfgroot/manualpages >>>>>> >>>>>> diff --git a/config/cfgroot/header.pl b/config/cfgroot/header.pl >>>>>> index 79accbe8a..e97f90d67 100644 >>>>>> --- a/config/cfgroot/header.pl >>>>>> +++ b/config/cfgroot/header.pl >>>>>> @@ -91,7 +91,11 @@ if ( -d "/var/ipfire/langs/${language}/" ) { >>>>>> }; >>>>>> }; >>>>>> +### Initialize user manual >>>>>> +my %manualpages = (); >>>>>> +&General::readhash("${General::swroot}/main/manualpages", \%manualpages); >>>>>> +### Load selected language and theme functions >>>>>> require "${swroot}/langs/en.pl"; >>>>>> require "${swroot}/langs/${language}.pl"; >>>>>> eval `/bin/cat /srv/web/ipfire/html/themes/ipfire/include/functions.pl`; >>>>>> @@ -553,3 +557,19 @@ sub colorize { >>>>>> return $string; >>>>>> } >>>>>> } >>>>>> + >>>>>> +# Get user manual URL for the specified configuration page, returns empty if no entry is configured >>>>>> +sub get_manualpage_url() { >>>>>> + my ($cgi_page) = @_; >>>>>> + >>>>>> + # Ensure base url is configured >>>>>> + return unless($manualpages{'BASE_URL'}); >>>>>> + >>>>>> + # Return URL >>>>>> + if($cgi_page && defined($manualpages{$cgi_page})) { >>>>>> + return "$manualpages{'BASE_URL'}/$manualpages{$cgi_page}"; >>>>>> + } >>>>>> + >>>>>> + # No manual page configured, return nothing >>>>>> + return; >>>>>> +} >>>>>> diff --git a/config/cfgroot/manualpages b/config/cfgroot/manualpages >>>>>> new file mode 100644 >>>>>> index 000000000..e5ab1a13c >>>>>> --- /dev/null >>>>>> +++ b/config/cfgroot/manualpages >>>>>> @@ -0,0 +1,7 @@ >>>>>> +# User manual base URL (without trailing slash) >>>>>> +BASE_URL=https://wiki.ipfire.org >>>>>> + >>>>>> +# Assign manual page URL path to CGI file ([cgi basename]=[path/to/page]) >>>>>> +index=configuration/system/startpage >>>>>> +pppsetup=configuration/system/dial >>>>>> +qos=configuration/services/qos >>>>>> diff --git a/html/html/themes/ipfire/include/css/style.css b/html/html/themes/ipfire/include/css/style.css >>>>>> index b92f476c4..661773675 100644 >>>>>> --- a/html/html/themes/ipfire/include/css/style.css >>>>>> +++ b/html/html/themes/ipfire/include/css/style.css >>>>>> @@ -169,6 +169,19 @@ iframe { >>>>>> margin-bottom: 1em; >>>>>> } >>>>>> +#main_header > * { >>>>>> + display: inline-block; >>>>>> + vertical-align: baseline; >>>>>> +} >>>>>> + >>>>>> +#main_header > span { >>>>>> + margin-left: 0.8em; >>>>>> +} >>>>>> + >>>>>> +#main_header img { >>>>>> + padding: 0; >>>>>> +} >>>>>> + >>>>>> #footer { >>>>>> height: 2.5em; >>>>>> margin-bottom: 1em; >>>>>> diff --git a/html/html/themes/ipfire/include/functions.pl b/html/html/themes/ipfire/include/functions.pl >>>>>> index 9f12bbe59..18931428e 100644 >>>>>> --- a/html/html/themes/ipfire/include/functions.pl >>>>>> +++ b/html/html/themes/ipfire/include/functions.pl >>>>>> @@ -170,7 +170,22 @@ END >>>>>> print <<END >>>>>> <div class="bigbox fixed"> >>>>>> <div id="main_inner" class="fixed"> >>>>>> - <h1>$title</h1> >>>>>> + <div id="main_header"> >>>>>> + <h1>$title</h1> >>>>>> +END >>>>>> +; >>>>>> + >>>>>> +# Print user manual link >>>>>> +my $manual_url = &Header::get_manualpage_url($scriptName); >>>>>> +if($manual_url) { >>>>>> + print <<END >>>>>> + <span><a href="$manual_url" title="$Lang::tr{'online help en'}" target="_blank"><img src="/images/help-browser.png" alt="$Lang::tr{'online help en'}"></a></span> >>>>>> +END >>>>>> +; >>>>>> +} >>>>>> + >>>>>> +print <<END >>>>>> + </div> >>>>>> END >>>>>> ; >>>>>> } >>>>>> >>> >>
Hello, I think the function is the place where it should be. Reviewed-by: Michael Tremer <michael.tremer@ipfire.org> -Michael > On 19 Oct 2021, at 21:27, Leo Hofmann <hofmann@leo-andres.de> wrote: > > Hi Bernhard, > > Am 06.10.2021 um 11:23 schrieb Bernhard Bitsch: >> Hi, >> >> I've just included the file into my system. >> There are no problems. >> So a new patch with this file can start the formal verification and test process. >> >> The original patch has some flaws ( function name, location in source ) I will comment in an extra answer. > > Have you had time to collect the issues yet? I'd like to continue working on them. > > Best regards, > Leo > >> >> Regards, >> Bernhard >> >> Am 06.10.2021 um 05:18 schrieb Jon Murphy: >>> Leo, >>> >>> This should be complete. But I don't know how to test. >>> >>> Jon >>> >>> >>> >>> >>> >>>> On Oct 4, 2021, at 10:40 PM, Jon Murphy <jcmurphy26@gmail.com> wrote: >>>> >>>> Here is a quick template to get started: >>>> >>>> <manualpages> >>>> >>>> >>>> >>>> I'll keep going tomorrow. >>>> >>>> >>>> Jon >>>> >>>> >>>> >>>>> On Oct 4, 2021, at 12:42 PM, Leo Hofmann <hofmann@leo-andres.de> wrote: >>>>> >>>>> Hi all, >>>>> >>>>> @Bernhard, Thank you again for testing this patch! >>>>> >>>>> @Jon, This is the file format of the manualpages configuration: >>>>> >>>>> [cgi basename]=[path/to/page] >>>>> >>>>> For example: >>>>> >>>>>> BASE_URL=https://wiki.ipfire.org >>>>>> index=configuration/system/startpage >>>>> >>>>> Results in "index.cgi" linking to "https://wiki.ipfire.org/configuration/system/startpage". >>>>> Please note that the path does not start with a slash, because the get_manualpage_url function always adds one between the base url and the path. >>>>> >>>>> Unfortunately, I couldn't figure out how to include all this in the installer and I need help with that. >>>>> So I would suggest we wait until this has been approved and integrated. >>>>> >>>>> Regards, >>>>> Leo >>>>> >>>>> Am 28.09.2021 um 14:55 schrieb Bernhard Bitsch: >>>>>> Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org> >>>>>> Tested-by: Bernhard Bitsch <bbitsch@ipfire.org> >>>>>> >>>>>> Am 28.09.2021 um 13:09 schrieb Leo-Andres Hofmann: >>>>>>> This patch adds a little "help" icon to the page header. >>>>>>> If a manual entry exists for a configuration page, the icon >>>>>>> appears and offers a quick way to access the wiki. >>>>>>> Wiki pages can be configured in the "manualpages" file. >>>>>>> >>>>>>> Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de> >>>>>>> --- >>>>>>> config/cfgroot/header.pl | 20 +++++++++++++++++++ >>>>>>> config/cfgroot/manualpages | 7 +++++++ >>>>>>> html/html/themes/ipfire/include/css/style.css | 13 ++++++++++++ >>>>>>> html/html/themes/ipfire/include/functions.pl | 17 +++++++++++++++- >>>>>>> 4 files changed, 56 insertions(+), 1 deletion(-) >>>>>>> create mode 100644 config/cfgroot/manualpages >>>>>>> >>>>>>> diff --git a/config/cfgroot/header.pl b/config/cfgroot/header.pl >>>>>>> index 79accbe8a..e97f90d67 100644 >>>>>>> --- a/config/cfgroot/header.pl >>>>>>> +++ b/config/cfgroot/header.pl >>>>>>> @@ -91,7 +91,11 @@ if ( -d "/var/ipfire/langs/${language}/" ) { >>>>>>> }; >>>>>>> }; >>>>>>> +### Initialize user manual >>>>>>> +my %manualpages = (); >>>>>>> +&General::readhash("${General::swroot}/main/manualpages", \%manualpages); >>>>>>> +### Load selected language and theme functions >>>>>>> require "${swroot}/langs/en.pl"; >>>>>>> require "${swroot}/langs/${language}.pl"; >>>>>>> eval `/bin/cat /srv/web/ipfire/html/themes/ipfire/include/functions.pl`; >>>>>>> @@ -553,3 +557,19 @@ sub colorize { >>>>>>> return $string; >>>>>>> } >>>>>>> } >>>>>>> + >>>>>>> +# Get user manual URL for the specified configuration page, returns empty if no entry is configured >>>>>>> +sub get_manualpage_url() { >>>>>>> + my ($cgi_page) = @_; >>>>>>> + >>>>>>> + # Ensure base url is configured >>>>>>> + return unless($manualpages{'BASE_URL'}); >>>>>>> + >>>>>>> + # Return URL >>>>>>> + if($cgi_page && defined($manualpages{$cgi_page})) { >>>>>>> + return "$manualpages{'BASE_URL'}/$manualpages{$cgi_page}"; >>>>>>> + } >>>>>>> + >>>>>>> + # No manual page configured, return nothing >>>>>>> + return; >>>>>>> +} >>>>>>> diff --git a/config/cfgroot/manualpages b/config/cfgroot/manualpages >>>>>>> new file mode 100644 >>>>>>> index 000000000..e5ab1a13c >>>>>>> --- /dev/null >>>>>>> +++ b/config/cfgroot/manualpages >>>>>>> @@ -0,0 +1,7 @@ >>>>>>> +# User manual base URL (without trailing slash) >>>>>>> +BASE_URL=https://wiki.ipfire.org >>>>>>> + >>>>>>> +# Assign manual page URL path to CGI file ([cgi basename]=[path/to/page]) >>>>>>> +index=configuration/system/startpage >>>>>>> +pppsetup=configuration/system/dial >>>>>>> +qos=configuration/services/qos >>>>>>> diff --git a/html/html/themes/ipfire/include/css/style.css b/html/html/themes/ipfire/include/css/style.css >>>>>>> index b92f476c4..661773675 100644 >>>>>>> --- a/html/html/themes/ipfire/include/css/style.css >>>>>>> +++ b/html/html/themes/ipfire/include/css/style.css >>>>>>> @@ -169,6 +169,19 @@ iframe { >>>>>>> margin-bottom: 1em; >>>>>>> } >>>>>>> +#main_header > * { >>>>>>> + display: inline-block; >>>>>>> + vertical-align: baseline; >>>>>>> +} >>>>>>> + >>>>>>> +#main_header > span { >>>>>>> + margin-left: 0.8em; >>>>>>> +} >>>>>>> + >>>>>>> +#main_header img { >>>>>>> + padding: 0; >>>>>>> +} >>>>>>> + >>>>>>> #footer { >>>>>>> height: 2.5em; >>>>>>> margin-bottom: 1em; >>>>>>> diff --git a/html/html/themes/ipfire/include/functions.pl b/html/html/themes/ipfire/include/functions.pl >>>>>>> index 9f12bbe59..18931428e 100644 >>>>>>> --- a/html/html/themes/ipfire/include/functions.pl >>>>>>> +++ b/html/html/themes/ipfire/include/functions.pl >>>>>>> @@ -170,7 +170,22 @@ END >>>>>>> print <<END >>>>>>> <div class="bigbox fixed"> >>>>>>> <div id="main_inner" class="fixed"> >>>>>>> - <h1>$title</h1> >>>>>>> + <div id="main_header"> >>>>>>> + <h1>$title</h1> >>>>>>> +END >>>>>>> +; >>>>>>> + >>>>>>> +# Print user manual link >>>>>>> +my $manual_url = &Header::get_manualpage_url($scriptName); >>>>>>> +if($manual_url) { >>>>>>> + print <<END >>>>>>> + <span><a href="$manual_url" title="$Lang::tr{'online help en'}" target="_blank"><img src="/images/help-browser.png" alt="$Lang::tr{'online help en'}"></a></span> >>>>>>> +END >>>>>>> +; >>>>>>> +} >>>>>>> + >>>>>>> +print <<END >>>>>>> + </div> >>>>>>> END >>>>>>> ; >>>>>>> } >>>>>>> >>>> >>>
Hello Jon,
I have just been notified by Patchwork that this feature has been accepted!
So now you could submit your completed manualpages file as a patch.
Do you want to do it yourself, or do you want me to check the file and submit it for you?
Best regards,
Leo
Am 06.10.2021 um 05:18 schrieb Jon Murphy:
Leo, This should be complete. But I don't know how to test. Jon
On Oct 4, 2021, at 10:40 PM, Jon Murphy <jcmurphy26@gmail.com> (mailto:jcmurphy26@gmail.com) wrote: Here is a quick template to get started: <manualpages> I'll keep going tomorrow. Jon
On Oct 4, 2021, at 12:42 PM, Leo Hofmann <hofmann@leo-andres.de> (mailto:hofmann@leo-andres.de) wrote: Hi all, @Bernhard, Thank you again for testing this patch! @Jon, This is the file format of the manualpages configuration: [cgi basename]=[path/to/page] For example:
BASE_URL=https://wiki.ipfire.org (https://wiki.ipfire.org) index=configuration/system/startpage
Results in "index.cgi" linking to "https://wiki.ipfire.org/configuration/system/startpage" (https://wiki.ipfire.org/configuration/system/startpage). Please note that the path does not start with a slash, because the get_manualpage_url function always adds one between the base url and the path. Unfortunately, I couldn't figure out how to include all this in the installer and I need help with that. So I would suggest we wait until this has been approved and integrated. Regards, Leo Am 28.09.2021 um 14:55 schrieb Bernhard Bitsch:
Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org> (mailto:bbitsch@ipfire.org) Tested-by: Bernhard Bitsch <bbitsch@ipfire.org> (mailto:bbitsch@ipfire.org) Am 28.09.2021 um 13:09 schrieb Leo-Andres Hofmann:
This patch adds a little "help" icon to the page header. If a manual entry exists for a configuration page, the icon appears and offers a quick way to access the wiki. Wiki pages can be configured in the "manualpages" file. Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de> (mailto:hofmann@leo-andres.de) --- config/cfgroot/header.pl | 20 +++++++++++++++++++ config/cfgroot/manualpages | 7 +++++++ html/html/themes/ipfire/include/css/style.css | 13 ++++++++++++ html/html/themes/ipfire/include/functions.pl | 17 +++++++++++++++- 4 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 config/cfgroot/manualpages diff --git a/config/cfgroot/header.pl b/config/cfgroot/header.pl index 79accbe8a..e97f90d67 100644 --- a/config/cfgroot/header.pl +++ b/config/cfgroot/header.pl @@ -91,7 +91,11 @@ if ( -d "/var/ipfire/langs/${language}/" ) { }; }; +### Initialize user manual +my %manualpages = (); +&General::readhash("${General::swroot}/main/manualpages", %manualpages); +### Load selected language and theme functions require "${swroot}/langs/en.pl"; require "${swroot}/langs/${language}.pl"; eval `/bin/cat /srv/web/ipfire/html/themes/ipfire/include/functions.pl`; @@ -553,3 +557,19 @@ sub colorize { return $string; } } + +# Get user manual URL for the specified configuration page, returns empty if no entry is configured +sub get_manualpage_url() { + my ($cgi_page) = @_; + + # Ensure base url is configured + return unless($manualpages{'BASE_URL'}); + + # Return URL + if($cgi_page && defined($manualpages{$cgi_page})) { + return "$manualpages{'BASE_URL'}/$manualpages{$cgi_page}"; + } + + # No manual page configured, return nothing + return; +} diff --git a/config/cfgroot/manualpages b/config/cfgroot/manualpages new file mode 100644 index 000000000..e5ab1a13c --- /dev/null +++ b/config/cfgroot/manualpages @@ -0,0 +1,7 @@ +# User manual base URL (without trailing slash) +BASE_URL=https://wiki.ipfire.org (https://wiki.ipfire.org) + +# Assign manual page URL path to CGI file ([cgi basename]=[path/to/page]) +index=configuration/system/startpage +pppsetup=configuration/system/dial +qos=configuration/services/qos diff --git a/html/html/themes/ipfire/include/css/style.css b/html/html/themes/ipfire/include/css/style.css index b92f476c4..661773675 100644 --- a/html/html/themes/ipfire/include/css/style.css +++ b/html/html/themes/ipfire/include/css/style.css @@ -169,6 +169,19 @@ iframe { margin-bottom: 1em; } +#main_header > * { + display: inline-block; + vertical-align: baseline; +} + +#main_header > span { + margin-left: 0.8em; +} + +#main_header img { + padding: 0; +} + #footer { height: 2.5em; margin-bottom: 1em; diff --git a/html/html/themes/ipfire/include/functions.pl b/html/html/themes/ipfire/include/functions.pl index 9f12bbe59..18931428e 100644 --- a/html/html/themes/ipfire/include/functions.pl +++ b/html/html/themes/ipfire/include/functions.pl @@ -170,7 +170,22 @@ END print <<END <div class="bigbox fixed"> <div id="main_inner" class="fixed"> - <h1>$title</h1> + <div id="main_header"> + <h1>$title</h1> +END +; + +# Print user manual link +my $manual_url = &Header::get_manualpage_url($scriptName); +if($manual_url) { + print <<END + <span><a href="$manual_url" title="$Lang::tr{'online help en'}" target="_blank"><img src="/images/help-browser.png" alt="$Lang::tr{'online help en'}"></a></span> +END +; +} + +print <<END + </div> END ; }
Hi Leo! > I have just been notified by Patchwork that this feature has been accepted! > Yay! Glad to hear it was accepted! > Do you want to do it yourself, or do you want me to check the file and submit it for you? > Yes, please do the submit for me. Best regards, Jon > On Dec 4, 2021, at 2:41 AM, hofmann@leo-andres.de wrote: > > Hello Jon, > I have just been notified by Patchwork that this feature has been accepted! > So now you could submit your completed manualpages file as a patch. > Do you want to do it yourself, or do you want me to check the file and submit it for you? > Best regards, > Leo > > Am 06.10.2021 um 05:18 schrieb Jon Murphy: >> Leo, This should be complete. But I don't know how to test. Jon >> >> >>> On Oct 4, 2021, at 10:40 PM, Jon Murphy <jcmurphy26@gmail.com> <mailto:jcmurphy26@gmail.com> wrote: Here is a quick template to get started: <manualpages> I'll keep going tomorrow. Jon >>>> On Oct 4, 2021, at 12:42 PM, Leo Hofmann <hofmann@leo-andres.de> <mailto:hofmann@leo-andres.de> wrote: Hi all, @Bernhard, Thank you again for testing this patch! @Jon, This is the file format of the manualpages configuration: [cgi basename]=[path/to/page] For example: >>>>> BASE_URL=https://wiki.ipfire.org <https://wiki.ipfire.org/> index=configuration/system/startpage >>>> Results in "index.cgi" linking to "https://wiki.ipfire.org/configuration/system/startpage" <https://wiki.ipfire.org/configuration/system/startpage>. Please note that the path does not start with a slash, because the get_manualpage_url function always adds one between the base url and the path. Unfortunately, I couldn't figure out how to include all this in the installer and I need help with that. So I would suggest we wait until this has been approved and integrated. Regards, Leo Am 28.09.2021 um 14:55 schrieb Bernhard Bitsch: >>>>> Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org> <mailto:bbitsch@ipfire.org> Tested-by: Bernhard Bitsch <bbitsch@ipfire.org> <mailto:bbitsch@ipfire.org> Am 28.09.2021 um 13:09 schrieb Leo-Andres Hofmann: >>>>>> This patch adds a little "help" icon to the page header. If a manual entry exists for a configuration page, the icon appears and offers a quick way to access the wiki. Wiki pages can be configured in the "manualpages" file. Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de> <mailto:hofmann@leo-andres.de> --- config/cfgroot/header.pl | 20 +++++++++++++++++++ config/cfgroot/manualpages | 7 +++++++ html/html/themes/ipfire/include/css/style.css | 13 ++++++++++++ html/html/themes/ipfire/include/functions.pl | 17 +++++++++++++++- 4 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 config/cfgroot/manualpages diff --git a/config/cfgroot/header.pl b/config/cfgroot/header.pl index 79accbe8a..e97f90d67 100644 --- a/config/cfgroot/header.pl +++ b/config/cfgroot/header.pl @@ -91,7 +91,11 @@ if ( -d "/var/ipfire/langs/${language}/" ) { }; }; +### Initialize user manual +my %manualpages = (); +&General::readhash("${General::swroot}/main/manualpages", \%manualpages); +### Load selected language and theme functions require "${swroot}/langs/en.pl"; require "${swroot}/langs/${language}.pl"; eval `/bin/cat /srv/web/ipfire/html/themes/ipfire/include/functions.pl`; @@ -553,3 +557,19 @@ sub colorize { return $string; } } + +# Get user manual URL for the specified configuration page, returns empty if no entry is configured +sub get_manualpage_url() { + my ($cgi_page) = @_; + + # Ensure base url is configured + return unless($manualpages{'BASE_URL'}); + + # Return URL + if($cgi_page && defined($manualpages{$cgi_page})) { + return "$manualpages{'BASE_URL'}/$manualpages{$cgi_page}"; + } + + # No manual page configured, return nothing + return; +} diff --git a/config/cfgroot/manualpages b/config/cfgroot/manualpages new file mode 100644 index 000000000..e5ab1a13c --- /dev/null +++ b/config/cfgroot/manualpages @@ -0,0 +1,7 @@ +# User manual base URL (without trailing slash) +BASE_URL=https://wiki.ipfire.org <https://wiki.ipfire.org/> + +# Assign manual page URL path to CGI file ([cgi basename]=[path/to/page]) +index=configuration/system/startpage +pppsetup=configuration/system/dial +qos=configuration/services/qos diff --git a/html/html/themes/ipfire/include/css/style.css b/html/html/themes/ipfire/include/css/style.css index b92f476c4..661773675 100644 --- a/html/html/themes/ipfire/include/css/style.css +++ b/html/html/themes/ipfire/include/css/style.css @@ -169,6 +169,19 @@ iframe { margin-bottom: 1em; } +#main_header > * { + display: inline-block; + vertical-align: baseline; +} + +#main_header > span { + margin-left: 0.8em; +} + +#main_header img { + padding: 0; +} + #footer { height: 2.5em; margin-bottom: 1em; diff --git a/html/html/themes/ipfire/include/functions.pl b/html/html/themes/ipfire/include/functions.pl index 9f12bbe59..18931428e 100644 --- a/html/html/themes/ipfire/include/functions.pl +++ b/html/html/themes/ipfire/include/functions.pl @@ -170,7 +170,22 @@ END print <<END <div class="bigbox fixed"> <div id="main_inner" class="fixed"> - <h1>$title</h1> + <div id="main_header"> + <h1>$title</h1> +END +; + +# Print user manual link +my $manual_url = &Header::get_manualpage_url($scriptName); +if($manual_url) { + print <<END + <span><a href="$manual_url" title="$Lang::tr{'online help en'}" target="_blank"><img src="/images/help-browser.png" alt="$Lang::tr{'online help en'}"></a></span> +END +; +} + +print <<END + </div> END ; } >>> >>
diff --git a/config/cfgroot/header.pl b/config/cfgroot/header.pl index 79accbe8a..e97f90d67 100644 --- a/config/cfgroot/header.pl +++ b/config/cfgroot/header.pl @@ -91,7 +91,11 @@ if ( -d "/var/ipfire/langs/${language}/" ) { }; }; +### Initialize user manual +my %manualpages = (); +&General::readhash("${General::swroot}/main/manualpages", \%manualpages); +### Load selected language and theme functions require "${swroot}/langs/en.pl"; require "${swroot}/langs/${language}.pl"; eval `/bin/cat /srv/web/ipfire/html/themes/ipfire/include/functions.pl`; @@ -553,3 +557,19 @@ sub colorize { return $string; } } + +# Get user manual URL for the specified configuration page, returns empty if no entry is configured +sub get_manualpage_url() { + my ($cgi_page) = @_; + + # Ensure base url is configured + return unless($manualpages{'BASE_URL'}); + + # Return URL + if($cgi_page && defined($manualpages{$cgi_page})) { + return "$manualpages{'BASE_URL'}/$manualpages{$cgi_page}"; + } + + # No manual page configured, return nothing + return; +} diff --git a/config/cfgroot/manualpages b/config/cfgroot/manualpages new file mode 100644 index 000000000..e5ab1a13c --- /dev/null +++ b/config/cfgroot/manualpages @@ -0,0 +1,7 @@ +# User manual base URL (without trailing slash) +BASE_URL=https://wiki.ipfire.org + +# Assign manual page URL path to CGI file ([cgi basename]=[path/to/page]) +index=configuration/system/startpage +pppsetup=configuration/system/dial +qos=configuration/services/qos diff --git a/html/html/themes/ipfire/include/css/style.css b/html/html/themes/ipfire/include/css/style.css index b92f476c4..661773675 100644 --- a/html/html/themes/ipfire/include/css/style.css +++ b/html/html/themes/ipfire/include/css/style.css @@ -169,6 +169,19 @@ iframe { margin-bottom: 1em; } +#main_header > * { + display: inline-block; + vertical-align: baseline; +} + +#main_header > span { + margin-left: 0.8em; +} + +#main_header img { + padding: 0; +} + #footer { height: 2.5em; margin-bottom: 1em; diff --git a/html/html/themes/ipfire/include/functions.pl b/html/html/themes/ipfire/include/functions.pl index 9f12bbe59..18931428e 100644 --- a/html/html/themes/ipfire/include/functions.pl +++ b/html/html/themes/ipfire/include/functions.pl @@ -170,7 +170,22 @@ END print <<END <div class="bigbox fixed"> <div id="main_inner" class="fixed"> - <h1>$title</h1> + <div id="main_header"> + <h1>$title</h1> +END +; + +# Print user manual link +my $manual_url = &Header::get_manualpage_url($scriptName); +if($manual_url) { + print <<END + <span><a href="$manual_url" title="$Lang::tr{'online help en'}" target="_blank"><img src="/images/help-browser.png" alt="$Lang::tr{'online help en'}"></a></span> +END +; +} + +print <<END + </div> END ; }