Message ID | 20210919143444.1739-1-hofmann@leo-andres.de |
---|---|
State | Superseded |
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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4HC9Fl2WKWz3x1J for <patchwork@web04.haj.ipfire.org>; Sun, 19 Sep 2021 14:35:07 +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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4HC9Fh69Q6z4RC; Sun, 19 Sep 2021 14:35:04 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4HC9Fh4gqMz2yl8; Sun, 19 Sep 2021 14:35:04 +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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4HC9Fg0RlCz2xLY for <development@lists.ipfire.org>; Sun, 19 Sep 2021 14:35:02 +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 4HC9FY2fTKz11t for <development@lists.ipfire.org>; Sun, 19 Sep 2021 14:34:57 +0000 (UTC) Received: (qmail 13015 invoked from network); 19 Sep 2021 14:34:56 -0000 Received: from localhost (HELO localhost) (127.0.0.1) by arche.uberspace.de with SMTP; 19 Sep 2021 14:34:56 -0000 From: Leo-Andres Hofmann <hofmann@leo-andres.de> To: development@lists.ipfire.org Subject: [PATCH] webinterface: Add links to the configuration wiki Date: Sun, 19 Sep 2021 16:34:44 +0200 Message-Id: <20210919143444.1739-1-hofmann@leo-andres.de> X-Mailer: git-send-email 2.27.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ARC-Authentication-Results: i=1; mail01.ipfire.org; dkim=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; dmarc=none ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1632062097; a=rsa-sha256; cv=none; b=YZQbOZ3v5vrzDceKX1msr2NG0+Acp2AZO4SRHyZIZQppxdgo+LhxVscNC2nRV5La2s/V6A j2PK5FfWLSW18Y2EZkTile+fkjHmrgCnTiVXdmplVh0g3QLrx8ru/Z9n+MQ3UeDtrGgJd5 HpxyHKXDNdZslxYox7L4o3ihR2Qd7u2JdneM1lAuDu+b/b0y/ZFYuG4lDbpP+eqZhUb40a iQroiPeIisMZGj4ipzEKTfKQUVPNs87D1CPhYsDJ0+bgbCzMXJbVppNXRu9ygUEbjoiRRG Bi0rc+G3So2gXc1mCkhukoCrhwW/no/fwLRwGaKjXJU0ZkCAv8rPXTIuPoVK9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1632062097; 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=4gxsyTVsL8/GL3dmSbXgUFnIdypB2jbyiC2tKfYbdko=; b=beVRGoAdeB3pWiF9b6Qcze18DsKYamGZzYys8iu9DrF1+lD2xOVE18Zz2M0qpvFfSPCLVM DE2u+hL+DFrBq64KohPQvW2xKgwXDGTJL0msTLfwH7kDqG7VRr7RPn1QNV/zYc3ygYKv1d dERlzEENegjk6QbJYZAM/GaxPEXTfb2Apb+bVNuLKmoLjD1LhrmLdquY03LQ+CzOa3bEBf vMH1dX6yEbAwDjCZkWjNVy/gT0/9yZVOOhqCiK365vXtkwiU/r//SwUPCxz0wlaGBuaSYg fvHcxdl2ZgCQri2CE57dUcE8ckm6ykHwvCsTp4V/dIWuJzUGyofR1ePQ9ZHPtA== X-Spamd-Result: default: False [-1.66 / 11.00]; BAYES_HAM(-3.00)[99.99%]; MID_CONTAINS_FROM(1.00)[]; SPF_REPUTATION_HAM(-0.58)[-0.58072869931089]; R_MISSING_CHARSET(0.50)[]; MX_INVALID(0.50)[]; MIME_HTML_ONLY(0.20)[]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM(-0.07)[-0.072]; IP_REPUTATION_HAM(-0.01)[asn: 205766(0.00), country: DE(-0.01), ip: 185.26.156.147(0.00)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:205766, ipnet:185.26.156.0/24, country:DE]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:~]; ARC_NA(0.00)[]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1]; DMARC_NA(0.00)[leo-andres.de]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mail01.haj.ipfire.org Authentication-Results: mail01.ipfire.org; dkim=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; dmarc=none X-Rspamd-Queue-Id: 4HC9FY2fTKz11t 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 |
webinterface: Add links to the configuration wiki
|
|
Commit Message
Leo-Andres Hofmann
Sept. 19, 2021, 2:34 p.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>
---
Hi all,
This patch is not yet complete, but I would like to present the idea.
What do you think, would this get more people to read the wiki?
To test this, move the new file "manualpages" to /var/ipfire/main/ and CTRL+F5 reload the webif to refresh the CSS cache.
Still -to do- and where I could use some help:
Add "manualpages" file to the updater/installer - how, and should this file be read-only?
Collect and match all wiki pages to the CGIs.
Kind regards
Leo
config/cfgroot/general-functions.pl | 18 +++++++++++++++++-
config/cfgroot/manualpages | 3 +++
html/html/themes/ipfire/include/css/style.css | 13 +++++++++++++
html/html/themes/ipfire/include/functions.pl | 17 ++++++++++++++++-
4 files changed, 49 insertions(+), 2 deletions(-)
create mode 100644 config/cfgroot/manualpages
Comments
Good idea! More comments, possibly, after review and test. Acked-by: Bernhard Bitsch <bbitsch@ipfire.org> Am 19.09.2021 um 16:34 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> > --- > > Hi all, > > This patch is not yet complete, but I would like to present the idea. > What do you think, would this get more people to read the wiki? > > To test this, move the new file "manualpages" to /var/ipfire/main/ and CTRL+F5 reload the webif to refresh the CSS cache. > > Still -to do- and where I could use some help: > Add "manualpages" file to the updater/installer - how, and should this file be read-only? > Collect and match all wiki pages to the CGIs. > > Kind regards > Leo > > config/cfgroot/general-functions.pl | 18 +++++++++++++++++- > config/cfgroot/manualpages | 3 +++ > html/html/themes/ipfire/include/css/style.css | 13 +++++++++++++ > html/html/themes/ipfire/include/functions.pl | 17 ++++++++++++++++- > 4 files changed, 49 insertions(+), 2 deletions(-) > create mode 100644 config/cfgroot/manualpages > > diff --git a/config/cfgroot/general-functions.pl b/config/cfgroot/general-functions.pl > index de608e38b..54e23a535 100644 > --- a/config/cfgroot/general-functions.pl > +++ b/config/cfgroot/general-functions.pl > @@ -24,7 +24,9 @@ $|=1; # line buffering > $General::version = 'VERSION'; > $General::swroot = 'CONFIG_ROOT'; > $General::noipprefix = 'noipg-'; > -$General::adminmanualurl = 'http://wiki.ipfire.org'; > + > +# Base URL of the user manual > +my $usermanual_base_url = 'https://wiki.ipfire.org'; > > require "${General::swroot}/network-functions.pl"; > > @@ -1421,4 +1423,18 @@ sub running_on_gcp() { > return 0; > } > > +# Get user manual url for the specified configuration page, returns "" if no entry is configured > +sub get_usermanual_url() { > + my ($config_page) = @_; > + > + my %manual_pages = (); > + &readhash("${General::swroot}/main/manualpages", \%manual_pages); > + > + if($config_page && defined($manual_pages{$config_page})) { > + return $usermanual_base_url . '/' . $manual_pages{$config_page}; > + } > + > + return ""; > +} > + > 1; > diff --git a/config/cfgroot/manualpages b/config/cfgroot/manualpages > new file mode 100644 > index 000000000..02dac5be6 > --- /dev/null > +++ b/config/cfgroot/manualpages > @@ -0,0 +1,3 @@ > +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..d352a7d96 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 = &General::get_usermanual_url($scriptName); > +if($manual_url ne "") { > + 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 > ; > } >
Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org> Am 19.09.2021 um 16:34 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> > --- > > Hi all, > > This patch is not yet complete, but I would like to present the idea. > What do you think, would this get more people to read the wiki? > > To test this, move the new file "manualpages" to /var/ipfire/main/ and CTRL+F5 reload the webif to refresh the CSS cache. > > Still -to do- and where I could use some help: > Add "manualpages" file to the updater/installer - how, and should this file be read-only? > Collect and match all wiki pages to the CGIs. > > Kind regards > Leo > > config/cfgroot/general-functions.pl | 18 +++++++++++++++++- > config/cfgroot/manualpages | 3 +++ > html/html/themes/ipfire/include/css/style.css | 13 +++++++++++++ > html/html/themes/ipfire/include/functions.pl | 17 ++++++++++++++++- > 4 files changed, 49 insertions(+), 2 deletions(-) > create mode 100644 config/cfgroot/manualpages > > diff --git a/config/cfgroot/general-functions.pl b/config/cfgroot/general-functions.pl > index de608e38b..54e23a535 100644 > --- a/config/cfgroot/general-functions.pl > +++ b/config/cfgroot/general-functions.pl > @@ -24,7 +24,9 @@ $|=1; # line buffering > $General::version = 'VERSION'; > $General::swroot = 'CONFIG_ROOT'; > $General::noipprefix = 'noipg-'; > -$General::adminmanualurl = 'http://wiki.ipfire.org'; A quick search shows, that this object isn't used anymore. So it is okay, to delete it. > + > +# Base URL of the user manual > +my $usermanual_base_url = 'https://wiki.ipfire.org'; > > require "${General::swroot}/network-functions.pl"; > > @@ -1421,4 +1423,18 @@ sub running_on_gcp() { > return 0; > } > > +# Get user manual url for the specified configuration page, returns "" if no entry is configured > +sub get_usermanual_url() { > + my ($config_page) = @_; > + > + my %manual_pages = (); > + &readhash("${General::swroot}/main/manualpages", \%manual_pages); > + > + if($config_page && defined($manual_pages{$config_page})) { > + return $usermanual_base_url . '/' . $manual_pages{$config_page}; > + } > + > + return ""; > +} > + > 1; > diff --git a/config/cfgroot/manualpages b/config/cfgroot/manualpages > new file mode 100644 > index 000000000..02dac5be6 > --- /dev/null > +++ b/config/cfgroot/manualpages > @@ -0,0 +1,3 @@ > +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..d352a7d96 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 = &General::get_usermanual_url($scriptName); > +if($manual_url ne "") { > + 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 > ; > } >
Excellent! > What do you think, would this get more people to read the wiki? I think it would help! Anything that pushes more eyeballs to the wiki is very helpful! > Collect and match all wiki pages to the CGIs. I’d be happy to help with this. Is the new file "manualpages" a link to the wiki? Or a text file full of info? Or? And how is a new "manualpages" file installed into a Core Update? Jon > On Sep 19, 2021, at 9:34 AM, Leo-Andres Hofmann <hofmann@leo-andres.de> wrote: > > 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> > --- > > Hi all, > > This patch is not yet complete, but I would like to present the idea. > What do you think, would this get more people to read the wiki? > > To test this, move the new file "manualpages" to /var/ipfire/main/ and CTRL+F5 reload the webif to refresh the CSS cache. > > Still -to do- and where I could use some help: > Add "manualpages" file to the updater/installer - how, and should this file be read-only? > Collect and match all wiki pages to the CGIs. > > Kind regards > Leo > > config/cfgroot/general-functions.pl | 18 +++++++++++++++++- > config/cfgroot/manualpages | 3 +++ > html/html/themes/ipfire/include/css/style.css | 13 +++++++++++++ > html/html/themes/ipfire/include/functions.pl | 17 ++++++++++++++++- > 4 files changed, 49 insertions(+), 2 deletions(-) > create mode 100644 config/cfgroot/manualpages > > diff --git a/config/cfgroot/general-functions.pl b/config/cfgroot/general-functions.pl > index de608e38b..54e23a535 100644 > --- a/config/cfgroot/general-functions.pl > +++ b/config/cfgroot/general-functions.pl > @@ -24,7 +24,9 @@ $|=1; # line buffering > $General::version = 'VERSION'; > $General::swroot = 'CONFIG_ROOT'; > $General::noipprefix = 'noipg-'; > -$General::adminmanualurl = 'http://wiki.ipfire.org'; > + > +# Base URL of the user manual > +my $usermanual_base_url = 'https://wiki.ipfire.org'; > > require "${General::swroot}/network-functions.pl"; > > @@ -1421,4 +1423,18 @@ sub running_on_gcp() { > return 0; > } > > +# Get user manual url for the specified configuration page, returns "" if no entry is configured > +sub get_usermanual_url() { > + my ($config_page) = @_; > + > + my %manual_pages = (); > + &readhash("${General::swroot}/main/manualpages", \%manual_pages); > + > + if($config_page && defined($manual_pages{$config_page})) { > + return $usermanual_base_url . '/' . $manual_pages{$config_page}; > + } > + > + return ""; > +} > + > 1; > diff --git a/config/cfgroot/manualpages b/config/cfgroot/manualpages > new file mode 100644 > index 000000000..02dac5be6 > --- /dev/null > +++ b/config/cfgroot/manualpages > @@ -0,0 +1,3 @@ > +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..d352a7d96 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 = &General::get_usermanual_url($scriptName); > +if($manual_url ne "") { > + 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 > ; > } > -- > 2.27.0.windows.1 >
The enhancements function without problems for your examples. Two additional thoughts: - the manual_pages hash could be read global at the start of general-functions - is it possible to check the existence of the page? Doing the test manually, I've copied the last line of manualpages with an error. So I landed on the oops page. Tested-by: Bernhard Bitsch <bbitsch@ipfire.org> Am 19.09.2021 um 16:34 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> > --- > > Hi all, > > This patch is not yet complete, but I would like to present the idea. > What do you think, would this get more people to read the wiki? > > To test this, move the new file "manualpages" to /var/ipfire/main/ and CTRL+F5 reload the webif to refresh the CSS cache. > > Still -to do- and where I could use some help: > Add "manualpages" file to the updater/installer - how, and should this file be read-only? > Collect and match all wiki pages to the CGIs. > > Kind regards > Leo > > config/cfgroot/general-functions.pl | 18 +++++++++++++++++- > config/cfgroot/manualpages | 3 +++ > html/html/themes/ipfire/include/css/style.css | 13 +++++++++++++ > html/html/themes/ipfire/include/functions.pl | 17 ++++++++++++++++- > 4 files changed, 49 insertions(+), 2 deletions(-) > create mode 100644 config/cfgroot/manualpages > > diff --git a/config/cfgroot/general-functions.pl b/config/cfgroot/general-functions.pl > index de608e38b..54e23a535 100644 > --- a/config/cfgroot/general-functions.pl > +++ b/config/cfgroot/general-functions.pl > @@ -24,7 +24,9 @@ $|=1; # line buffering > $General::version = 'VERSION'; > $General::swroot = 'CONFIG_ROOT'; > $General::noipprefix = 'noipg-'; > -$General::adminmanualurl = 'http://wiki.ipfire.org'; > + > +# Base URL of the user manual > +my $usermanual_base_url = 'https://wiki.ipfire.org'; > > require "${General::swroot}/network-functions.pl"; > > @@ -1421,4 +1423,18 @@ sub running_on_gcp() { > return 0; > } > > +# Get user manual url for the specified configuration page, returns "" if no entry is configured > +sub get_usermanual_url() { > + my ($config_page) = @_; > + > + my %manual_pages = (); > + &readhash("${General::swroot}/main/manualpages", \%manual_pages); > + > + if($config_page && defined($manual_pages{$config_page})) { > + return $usermanual_base_url . '/' . $manual_pages{$config_page}; > + } > + > + return ""; > +} > + > 1; > diff --git a/config/cfgroot/manualpages b/config/cfgroot/manualpages > new file mode 100644 > index 000000000..02dac5be6 > --- /dev/null > +++ b/config/cfgroot/manualpages > @@ -0,0 +1,3 @@ > +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..d352a7d96 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 = &General::get_usermanual_url($scriptName); > +if($manual_url ne "") { > + 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 > ; > } >
Just another problem (description inline): Am 19.09.2021 um 16:34 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> > --- > > Hi all, > > This patch is not yet complete, but I would like to present the idea. > What do you think, would this get more people to read the wiki? > > To test this, move the new file "manualpages" to /var/ipfire/main/ and CTRL+F5 reload the webif to refresh the CSS cache. > > Still -to do- and where I could use some help: > Add "manualpages" file to the updater/installer - how, and should this file be read-only? > Collect and match all wiki pages to the CGIs. > > Kind regards > Leo > > config/cfgroot/general-functions.pl | 18 +++++++++++++++++- > config/cfgroot/manualpages | 3 +++ > html/html/themes/ipfire/include/css/style.css | 13 +++++++++++++ > html/html/themes/ipfire/include/functions.pl | 17 ++++++++++++++++- > 4 files changed, 49 insertions(+), 2 deletions(-) > create mode 100644 config/cfgroot/manualpages > > diff --git a/config/cfgroot/general-functions.pl b/config/cfgroot/general-functions.pl > index de608e38b..54e23a535 100644 > --- a/config/cfgroot/general-functions.pl > +++ b/config/cfgroot/general-functions.pl > @@ -24,7 +24,9 @@ $|=1; # line buffering > $General::version = 'VERSION'; > $General::swroot = 'CONFIG_ROOT'; > $General::noipprefix = 'noipg-'; > -$General::adminmanualurl = 'http://wiki.ipfire.org'; > + > +# Base URL of the user manual > +my $usermanual_base_url = 'https://wiki.ipfire.org'; > > require "${General::swroot}/network-functions.pl"; > > @@ -1421,4 +1423,18 @@ sub running_on_gcp() { > return 0; > } > > +# Get user manual url for the specified configuration page, returns "" if no entry is configured > +sub get_usermanual_url() { > + my ($config_page) = @_; > + > + my %manual_pages = (); > + &readhash("${General::swroot}/main/manualpages", \%manual_pages); > + > + if($config_page && defined($manual_pages{$config_page})) { > + return $usermanual_base_url . '/' . $manual_pages{$config_page}; > + } > + > + return ""; > +} > + > 1; > diff --git a/config/cfgroot/manualpages b/config/cfgroot/manualpages > new file mode 100644 > index 000000000..02dac5be6 > --- /dev/null > +++ b/config/cfgroot/manualpages > @@ -0,0 +1,3 @@ > +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..d352a7d96 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 = &General::get_usermanual_url($scriptName); > +if($manual_url ne "") { > + 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> $Lang::tr{'online help en'} translates to 'Onlinehilfe in Deutsch' for German WUI language. Other languages generate similiar texts, I suppose. Because our wiki is in english only the hint should read 'Onlinehilfe' ( the adequate term in the WUI language ) only. > +END > +; > +} > + > +print <<END > + </div> > END > ; > } >
Hi Bernhard, Thanks for trying this out on such short notice! 19. September 2021 21:30, "Bernhard Bitsch" <bbitsch@ipfire.org> schrieb: > The enhancements function without problems for your examples. > Two additional thoughts: > - the manual_pages hash could be read global at the start of general-functions Would this improve the page load time? The hash is only accessed once in the openpage() function. > - is it possible to check the existence of the page? Doing the test manually, I've copied the last > line of manualpages with an error. So I landed on the oops page. Good idea! But I think this should only be checked once by the build script e.g. "make manualpages", to avoid excess http requests to the Wiki. > > Tested-by: Bernhard Bitsch <bbitsch@ipfire.org> > > Am 19.09.2021 um 16:34 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> >> --- >> Hi all, >> This patch is not yet complete, but I would like to present the idea. >> What do you think, would this get more people to read the wiki? >> To test this, move the new file "manualpages" to /var/ipfire/main/ and CTRL+F5 reload the webif to >> refresh the CSS cache. >> Still -to do- and where I could use some help: >> Add "manualpages" file to the updater/installer - how, and should this file be read-only? >> Collect and match all wiki pages to the CGIs. >> Kind regards >> Leo >> config/cfgroot/general-functions.pl | 18 +++++++++++++++++- >> config/cfgroot/manualpages | 3 +++ >> html/html/themes/ipfire/include/css/style.css | 13 +++++++++++++ >> html/html/themes/ipfire/include/functions.pl | 17 ++++++++++++++++- >> 4 files changed, 49 insertions(+), 2 deletions(-) >> create mode 100644 config/cfgroot/manualpages >> diff --git a/config/cfgroot/general-functions.pl b/config/cfgroot/general-functions.pl >> index de608e38b..54e23a535 100644 >> --- a/config/cfgroot/general-functions.pl >> +++ b/config/cfgroot/general-functions.pl >> @@ -24,7 +24,9 @@ $|=1; # line buffering >> $General::version = 'VERSION'; >> $General::swroot = 'CONFIG_ROOT'; >> $General::noipprefix = 'noipg-'; >> -$General::adminmanualurl = 'http://wiki.ipfire.org'; >> + >> +# Base URL of the user manual >> +my $usermanual_base_url = 'https://wiki.ipfire.org'; >>> require "${General::swroot}/network-functions.pl"; >>> @@ -1421,4 +1423,18 @@ sub running_on_gcp() { >> return 0; >> } >>> +# Get user manual url for the specified configuration page, returns "" if no entry is configured >> +sub get_usermanual_url() { >> + my ($config_page) = @_; >> + >> + my %manual_pages = (); >> + &readhash("${General::swroot}/main/manualpages", \%manual_pages); >> + >> + if($config_page && defined($manual_pages{$config_page})) { >> + return $usermanual_base_url . '/' . $manual_pages{$config_page}; >> + } >> + >> + return ""; >> +} >> + >> 1; >> diff --git a/config/cfgroot/manualpages b/config/cfgroot/manualpages >> new file mode 100644 >> index 000000000..02dac5be6 >> --- /dev/null >> +++ b/config/cfgroot/manualpages >> @@ -0,0 +1,3 @@ >> +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..d352a7d96 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 = &General::get_usermanual_url($scriptName); >> +if($manual_url ne "") { >> + 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, hi *, Am 20.09.2021 um 10:05 schrieb hofmann@leo-andres.de: > Hi Bernhard, > > Thanks for trying this out on such short notice! > > 19. September 2021 21:30, "Bernhard Bitsch" <bbitsch@ipfire.org> schrieb: > >> The enhancements function without problems for your examples. >> Two additional thoughts: >> - the manual_pages hash could be read global at the start of general-functions > > Would this improve the page load time? > The hash is only accessed once in the openpage() function. > You're right ( for the moment? ). But the manualpages function could also be called at other places. >> - is it possible to check the existence of the page? Doing the test manually, I've copied the last >> line of manualpages with an error. So I landed on the oops page. > > Good idea! But I think this should only be checked once by the build script e.g. "make manualpages", to avoid excess http requests to the Wiki. > Agreed. There is also the problem, that wiki editing, building of IPFire and running of IPFire are independend processes. So the error can't be prevented, only minimized by the build time check. >> >> Tested-by: Bernhard Bitsch <bbitsch@ipfire.org> >> >> Am 19.09.2021 um 16:34 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> >>> --- >>> Hi all, >>> This patch is not yet complete, but I would like to present the idea. >>> What do you think, would this get more people to read the wiki? >>> To test this, move the new file "manualpages" to /var/ipfire/main/ and CTRL+F5 reload the webif to >>> refresh the CSS cache. >>> Still -to do- and where I could use some help: >>> Add "manualpages" file to the updater/installer - how, and should this file be read-only? >>> Collect and match all wiki pages to the CGIs. >>> Kind regards >>> Leo >>> config/cfgroot/general-functions.pl | 18 +++++++++++++++++- >>> config/cfgroot/manualpages | 3 +++ >>> html/html/themes/ipfire/include/css/style.css | 13 +++++++++++++ >>> html/html/themes/ipfire/include/functions.pl | 17 ++++++++++++++++- >>> 4 files changed, 49 insertions(+), 2 deletions(-) >>> create mode 100644 config/cfgroot/manualpages >>> diff --git a/config/cfgroot/general-functions.pl b/config/cfgroot/general-functions.pl >>> index de608e38b..54e23a535 100644 >>> --- a/config/cfgroot/general-functions.pl >>> +++ b/config/cfgroot/general-functions.pl >>> @@ -24,7 +24,9 @@ $|=1; # line buffering >>> $General::version = 'VERSION'; >>> $General::swroot = 'CONFIG_ROOT'; >>> $General::noipprefix = 'noipg-'; >>> -$General::adminmanualurl = 'http://wiki.ipfire.org'; >>> + >>> +# Base URL of the user manual >>> +my $usermanual_base_url = 'https://wiki.ipfire.org'; >>>> require "${General::swroot}/network-functions.pl"; >>>> @@ -1421,4 +1423,18 @@ sub running_on_gcp() { >>> return 0; >>> } >>>> +# Get user manual url for the specified configuration page, returns "" if no entry is configured >>> +sub get_usermanual_url() { >>> + my ($config_page) = @_; >>> + >>> + my %manual_pages = (); >>> + &readhash("${General::swroot}/main/manualpages", \%manual_pages); >>> + >>> + if($config_page && defined($manual_pages{$config_page})) { >>> + return $usermanual_base_url . '/' . $manual_pages{$config_page}; >>> + } >>> + >>> + return ""; >>> +} >>> + >>> 1; >>> diff --git a/config/cfgroot/manualpages b/config/cfgroot/manualpages >>> new file mode 100644 >>> index 000000000..02dac5be6 >>> --- /dev/null >>> +++ b/config/cfgroot/manualpages >>> @@ -0,0 +1,3 @@ >>> +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..d352a7d96 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 = &General::get_usermanual_url($scriptName); >>> +if($manual_url ne "") { >>> + 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 tried it out on my testbed vm system and it is working fine. I updated the manualpages file to include all the entries that are visible in my System menu - no wireless client option as I don't have that on my vm install. You just have to keep an eye out for changes in the url as I found for the fireinfo wiki page which is not under configuration/system so I got an oops couldn't find that page message but was able to quickly fix it. My manualpages file now looks like:- ------------------------ index=configuration/system/startpage pppsetup=configuration/system/dial qos=configuration/services/qos mail=configuration/system/mail_service remote=configuration/system/ssh backup=configuration/system/backup gui=configuration/system/userinterface fireinfo=fireinfo vulnerabilities=configuration/system/vulnerabilities shutdown=configuration/system/shutdown credits=configuration/system/credits ------------------------ Regards, Adolf. On 19/09/2021 16:34, Leo-Andres Hofmann wrote: > 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>------------------------ > --- > > Hi all, > > This patch is not yet complete, but I would like to present the idea. > What do you think, would this get more people to read the wiki? > > To test this, move the new file "manualpages" to /var/ipfire/main/ and CTRL+F5 reload the webif to refresh the CSS cache. > > Still -to do- and where I could use some help: > Add "manualpages" file to the updater/installer - how, and should this file be read-only? > Collect and match all wiki pages to the CGIs. > > Kind regards > Leo > > config/cfgroot/general-functions.pl | 18 +++++++++++++++++- > config/cfgroot/manualpages | 3 +++ > html/html/themes/ipfire/include/css/style.css | 13 +++++++++++++ > html/html/themes/ipfire/include/functions.pl | 17 ++++++++++++++++- > 4 files changed, 49 insertions(+), 2 deletions(-) > create mode 100644 config/cfgroot/manualpages > > diff --git a/config/cfgroot/general-functions.pl b/config/cfgroot/general-functions.pl > index de608e38b..54e23a535 100644 > --- a/config/cfgroot/general-functions.pl > +++ b/config/cfgroot/general-functions.pl > @@ -24,7 +24,9 @@ $|=1; # line buffering > $General::version = 'VERSION'; > $General::swroot = 'CONFIG_ROOT'; > $General::noipprefix = 'noipg-'; > -$General::adminmanualurl = 'http://wiki.ipfire.org'; > + > +# Base URL of the user manual > +my $usermanual_base_url = 'https://wiki.ipfire.org'; > > require "${General::swroot}/network-functions.pl"; > > @@ -1421,4 +1423,18 @@ sub running_on_gcp() { > return 0; > } > > +# Get user manual url for the specified configuration page, returns "" if no entry is configured > +sub get_usermanual_url() { > + my ($config_page) = @_; > + > + my %manual_pages = (); > + &readhash("${General::swroot}/main/manualpages", \%manual_pages); > + > + if($config_page && defined($manual_pages{$config_page})) { > + return $usermanual_base_url . '/' . $manual_pages{$config_page}; > + } > + > + return ""; > +} > + > 1; > diff --git a/config/cfgroot/manualpages b/config/cfgroot/manualpages > new file mode 100644 > index 000000000..02dac5be6 > --- /dev/null > +++ b/config/cfgroot/manualpages > @@ -0,0 +1,3 @@ > +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..d352a7d96 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 = &General::get_usermanual_url($scriptName); > +if($manual_url ne "") { > + 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, Am 19.09.2021 um 20:18 schrieb Jon Murphy: > Excellent! > >> What do you think, would this get more people to read the wiki? > I think it would help! Anything that pushes more eyeballs to the wiki is very helpful! I'm glad you like the idea too! > >> Collect and match all wiki pages to the CGIs. > > I’d be happy to help with this. Thank you! I'll get in touch when the file format is finalized. > > Is the new file "manualpages" a link to the wiki? Or a text file full of info? Or? It is a configuration file which links a wiki page to a CGI page: [name of the cgi]=/path/to/wikipage I'll document this better. > > And how is a new "manualpages" file installed into a Core Update? I don't know that either. So far I have only submitted code and let the maintainers do the rest :D > > > Jon Regards, Leo > >> On Sep 19, 2021, at 9:34 AM, Leo-Andres Hofmann <hofmann@leo-andres.de> wrote: >> >> 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> >> --- >> >> Hi all, >> >> This patch is not yet complete, but I would like to present the idea. >> What do you think, would this get more people to read the wiki? >> >> To test this, move the new file "manualpages" to /var/ipfire/main/ and CTRL+F5 reload the webif to refresh the CSS cache. >> >> Still -to do- and where I could use some help: >> Add "manualpages" file to the updater/installer - how, and should this file be read-only? >> Collect and match all wiki pages to the CGIs. >> >> Kind regards >> Leo >> >> config/cfgroot/general-functions.pl | 18 +++++++++++++++++- >> config/cfgroot/manualpages | 3 +++ >> html/html/themes/ipfire/include/css/style.css | 13 +++++++++++++ >> html/html/themes/ipfire/include/functions.pl | 17 ++++++++++++++++- >> 4 files changed, 49 insertions(+), 2 deletions(-) >> create mode 100644 config/cfgroot/manualpages >> >> diff --git a/config/cfgroot/general-functions.pl b/config/cfgroot/general-functions.pl >> index de608e38b..54e23a535 100644 >> --- a/config/cfgroot/general-functions.pl >> +++ b/config/cfgroot/general-functions.pl >> @@ -24,7 +24,9 @@ $|=1; # line buffering >> $General::version = 'VERSION'; >> $General::swroot = 'CONFIG_ROOT'; >> $General::noipprefix = 'noipg-'; >> -$General::adminmanualurl = 'http://wiki.ipfire.org'; >> + >> +# Base URL of the user manual >> +my $usermanual_base_url = 'https://wiki.ipfire.org'; >> >> require "${General::swroot}/network-functions.pl"; >> >> @@ -1421,4 +1423,18 @@ sub running_on_gcp() { >> return 0; >> } >> >> +# Get user manual url for the specified configuration page, returns "" if no entry is configured >> +sub get_usermanual_url() { >> + my ($config_page) = @_; >> + >> + my %manual_pages = (); >> + &readhash("${General::swroot}/main/manualpages", \%manual_pages); >> + >> + if($config_page && defined($manual_pages{$config_page})) { >> + return $usermanual_base_url . '/' . $manual_pages{$config_page}; >> + } >> + >> + return ""; >> +} >> + >> 1; >> diff --git a/config/cfgroot/manualpages b/config/cfgroot/manualpages >> new file mode 100644 >> index 000000000..02dac5be6 >> --- /dev/null >> +++ b/config/cfgroot/manualpages >> @@ -0,0 +1,3 @@ >> +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..d352a7d96 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 = &General::get_usermanual_url($scriptName); >> +if($manual_url ne "") { >> + 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 >> ; >> } >> -- >> 2.27.0.windows.1 >>
Hi Adolf, thank you for trying this and providing a new configuration file! This is great! Since you have also come across missing pages, I should realize Bernhard's idea and build a test script. I'll implement all suggestions and submit again soon :) Regards, Leo Am 20.09.2021 um 15:06 schrieb Adolf Belka: > Hi Leo, > > I tried it out on my testbed vm system and it is working fine. > > I updated the manualpages file to include all the entries that are visible in my System menu - no wireless client option as I don't have that on my vm install. You just have to keep an eye out for changes in the url as I found for the fireinfo wiki page which is not under configuration/system so I got an oops couldn't find that page message but was able to quickly fix it. > > My manualpages file now looks like:- > > ------------------------ > > index=configuration/system/startpage > pppsetup=configuration/system/dial > qos=configuration/services/qos > mail=configuration/system/mail_service > remote=configuration/system/ssh > backup=configuration/system/backup > gui=configuration/system/userinterface > fireinfo=fireinfo > vulnerabilities=configuration/system/vulnerabilities > shutdown=configuration/system/shutdown > credits=configuration/system/credits > > ------------------------ > > Regards, > > Adolf. > > On 19/09/2021 16:34, Leo-Andres Hofmann wrote: >> 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>------------------------ >> --- >> >> Hi all, >> >> This patch is not yet complete, but I would like to present the idea. >> What do you think, would this get more people to read the wiki? >> >> To test this, move the new file "manualpages" to /var/ipfire/main/ and CTRL+F5 reload the webif to refresh the CSS cache. >> >> Still -to do- and where I could use some help: >> Add "manualpages" file to the updater/installer - how, and should this file be read-only? >> Collect and match all wiki pages to the CGIs. >> >> Kind regards >> Leo >> >> config/cfgroot/general-functions.pl | 18 +++++++++++++++++- >> config/cfgroot/manualpages | 3 +++ >> html/html/themes/ipfire/include/css/style.css | 13 +++++++++++++ >> html/html/themes/ipfire/include/functions.pl | 17 ++++++++++++++++- >> 4 files changed, 49 insertions(+), 2 deletions(-) >> create mode 100644 config/cfgroot/manualpages >> >> diff --git a/config/cfgroot/general-functions.pl b/config/cfgroot/general-functions.pl >> index de608e38b..54e23a535 100644 >> --- a/config/cfgroot/general-functions.pl >> +++ b/config/cfgroot/general-functions.pl >> @@ -24,7 +24,9 @@ $|=1; # line buffering >> $General::version = 'VERSION'; >> $General::swroot = 'CONFIG_ROOT'; >> $General::noipprefix = 'noipg-'; >> -$General::adminmanualurl = 'http://wiki.ipfire.org'; >> + >> +# Base URL of the user manual >> +my $usermanual_base_url = 'https://wiki.ipfire.org'; >> require "${General::swroot}/network-functions.pl"; >> @@ -1421,4 +1423,18 @@ sub running_on_gcp() { >> return 0; >> } >> +# Get user manual url for the specified configuration page, returns "" if no entry is configured >> +sub get_usermanual_url() { >> + my ($config_page) = @_; >> + >> + my %manual_pages = (); >> + &readhash("${General::swroot}/main/manualpages", \%manual_pages); >> + >> + if($config_page && defined($manual_pages{$config_page})) { >> + return $usermanual_base_url . '/' . $manual_pages{$config_page}; >> + } >> + >> + return ""; >> +} >> + >> 1; >> diff --git a/config/cfgroot/manualpages b/config/cfgroot/manualpages >> new file mode 100644 >> index 000000000..02dac5be6 >> --- /dev/null >> +++ b/config/cfgroot/manualpages >> @@ -0,0 +1,3 @@ >> +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..d352a7d96 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 = &General::get_usermanual_url($scriptName); >> +if($manual_url ne "") { >> + 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/general-functions.pl b/config/cfgroot/general-functions.pl index de608e38b..54e23a535 100644 --- a/config/cfgroot/general-functions.pl +++ b/config/cfgroot/general-functions.pl @@ -24,7 +24,9 @@ $|=1; # line buffering $General::version = 'VERSION'; $General::swroot = 'CONFIG_ROOT'; $General::noipprefix = 'noipg-'; -$General::adminmanualurl = 'http://wiki.ipfire.org'; + +# Base URL of the user manual +my $usermanual_base_url = 'https://wiki.ipfire.org'; require "${General::swroot}/network-functions.pl"; @@ -1421,4 +1423,18 @@ sub running_on_gcp() { return 0; } +# Get user manual url for the specified configuration page, returns "" if no entry is configured +sub get_usermanual_url() { + my ($config_page) = @_; + + my %manual_pages = (); + &readhash("${General::swroot}/main/manualpages", \%manual_pages); + + if($config_page && defined($manual_pages{$config_page})) { + return $usermanual_base_url . '/' . $manual_pages{$config_page}; + } + + return ""; +} + 1; diff --git a/config/cfgroot/manualpages b/config/cfgroot/manualpages new file mode 100644 index 000000000..02dac5be6 --- /dev/null +++ b/config/cfgroot/manualpages @@ -0,0 +1,3 @@ +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..d352a7d96 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 = &General::get_usermanual_url($scriptName); +if($manual_url ne "") { + 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 ; }