Skip to content

Commit

Permalink
Item14664: More ConfigWeb restructuring.
Browse files Browse the repository at this point in the history
 - Make the Config WebHome topic more useful.
  • Loading branch information
gac410 committed Mar 23, 2018
1 parent 49ee89c commit 3d715fd
Show file tree
Hide file tree
Showing 13 changed files with 46 additions and 52 deletions.
8 changes: 4 additions & 4 deletions TopicUserMappingContrib/data/System/GroupTemplate.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
%META:TOPICINFO{author="ProjectContributor" date="1489712653" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" date="1521767422" format="1.1" version="1"}%
%META:TOPICPARENT{name="WikiGroups"}%
%STARTSECTION{type="templateonly"}%
To modify this template, first copy it to %USERSWEB%.%TOPIC% web, and edit that
copy. If %USERSWEB%.%TOPIC% exists, it will automatically be used when
creating new groups.
To modify this template, first copy it to %CONFIGWEB%.%TOPIC% web, and edit that
copy. If %CONFIGWEB%.%TOPIC% exists, it will automatically be used when
creating new groups. You can remove this =templateonly= section from the modified template.
%ENDSECTION{type="templateonly"}%

%MAKETEXT{"Edit this topic to add a description to the [_1]" args="!%URLPARAM{"topic"}%"}%
Expand Down
6 changes: 3 additions & 3 deletions core/data/System/AdminToggle.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" date="1495729065" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" date="1521767422" format="1.1" version="1"}%
---+ Group Member Toggle

This topic implements a button that will turn Admin status on or off for the
Expand All @@ -25,10 +25,10 @@ user making the change instead of the anonymous !AdminUser.
_If you (<nop>%WIKINAME%) has permission to change the %USERSWEB%.AdminGroup topic, a button to add or remove yourself from the !AdminGroup will appear below:_
Be sure that you have explicit CHANGE authority on the !AdminGroup or removing yourself from the group will be permanent.

%STARTINCLUDE%%INCLUDE{"%USERSWEB%.GroupViewTemplate,%SYSTEMWEB%.GroupViewTemplate" section="manageself" groupname="AdminGroup"}%%STOPINCLUDE%
%STARTINCLUDE%%INCLUDE{"%CONFIGWEB%.GroupViewTemplate,%SYSTEMWEB%.GroupViewTemplate" section="manageself" groupname="AdminGroup"}%%STOPINCLUDE%

---+++ More enhancements

You can add this button to your custom sidebar for any group, by using the following include macro:
<verbatim>
%INCLUDE{"%USERSWEB%.GroupViewTemplate,%SYSTEMWEB%.GroupViewTemplate" section="manageself" groupname="AdminGroup"}%</verbatim>
%INCLUDE{"%CONFIGWEB%.GroupViewTemplate,%SYSTEMWEB%.GroupViewTemplate" section="manageself" groupname="AdminGroup"}%</verbatim>
7 changes: 0 additions & 7 deletions core/data/System/Config/WebAtom.txt

This file was deleted.

29 changes: 21 additions & 8 deletions core/data/System/Config/WebHome.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
%META:TOPICINFO{author="ProjectContributor" date="1521596899" format="1.1" version="1"}%
---+!! %MAKETEXT{"Welcome to the [_1] web" args="<nop>%WEB%"}%%IF{"$WEBSUMMARY != ''" then="
---++!! %WEBSUMMARY%"}%

---++ %MAKETEXT{"System Configuration Web"}%
%META:TOPICINFO{author="ProjectContributor" comment="" date="1521767422" format="1.1" version="1"}%
---+ %MAKETEXT{"System Configuration Web"}%

This web is used to store critical configuration related topics.

* Templates
* Any Skin Template topics placed in this web will prevent them from being overridden in individual webs.
---++ Configuration related topics

---+++ Site Configuration topics and tools
* [[%SCRIPTURLPATH{"configure"}%][<tt>bin/configure</tt> script]]
* %IF{"istopic '%LOCALSITEPREFS%'" then="[[%LOCALSITEPREFS%]]" else="[[%SCRIPTURLPATH{"edit" topic="%LOCALSITEPREFS%" templatetopic="%SYSTEMWEB%.SitePreferencesTemplate"}%][Create the %LOCALSITEPREFS%]] settings topic"}%
* [[%SYSTEMWEB%.%WIKIPREFSTOPIC%]] __read only__

---+++ Templates and Template Topics
Any Skin Template topics placed in this web will prevent them from being overridden in individual webs.

%SEARCH{"1" type="query" topic="*Template" nonoise="on" format=" * $topic$n"}%

---+++ Other topics
%SEARCH{"1"
type="query"
excludetopic="*Template,%LOCALSITEPREFS%,WebChanges,WebCreateNewTopic,WebIndex,WebTopicList,WebNotify,%TOPIC%,WebLeftBar,WebPreferences,WebSearch*"
nonoise="on"
format=" * $topic"
}%


---++ <nop>%WEB% Web Utilities
* WebTopicList - all topics in alphabetical order
* WebChanges - recent topic changes in this web
* WebNotify - subscribe to an e-mail alert sent when topics change
* WebRss, WebAtom - RSS and ATOM news feeds of topic changes %IF{"istopic '%STATISTICSTOPIC%'" then="
* WebPreferences - preferences of this web
6 changes: 3 additions & 3 deletions core/data/System/Config/WebLeftBar.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
%META:TOPICINFO{author="ProjectContributor" date="1521596899" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" date="1521767422" format="1.1" version="1"}%
%META:TOPICPARENT{name="WebHome"}%
%INCLUDE{"%IF{"context can_login" then="%SYSTEMWEB%.WebLeftBarLogin" else="<nop>"}%" warn="off"}%
* *%MAKETEXT{"Toolbox"}%*
* [[%SCRIPTURLPATH{"view"}%/%BASEWEB%/WebCreateNewTopic?topicparent=%BASETOPIC%][ %ICON{"newtopic"}% %MAKETEXT{"Create New Topic"}%]]
* [[WebTopicList][ %ICON{"index"}% %MAKETEXT{"Index"}%]]
* [[%BASEWEB%.WebSearch][ %ICON{"searchtopic"}% %MAKETEXT{"Search"}%]]
* [[WebChanges][ %ICON{"changes"}% %MAKETEXT{"Changes"}%]]
* [[WebNotify][ %ICON{"notify"}% %MAKETEXT{"Notifications"}%]]
* [[WebRss][ %ICON{"feed"}% %MAKETEXT{"RSS Feed"}%]]
* [[WebNotify][ %ICON{"notify"}% %MAKETEXT{"Notifications"}%]]%IF{"istopic 'WebRss'" then="
* [[WebRss][ %ICON{"feed"}% %MAKETEXT{"RSS Feed"}%]]"}%
* %IF{"istopic '%STATISTICSTOPIC%'" else=" $percntICON{\"statistics\"}$percnt $percntMAKETEXT{\"Statistics\"}$percnt" then="[[$percntSTATISTICSTOPIC$percnt][ $percntICON{\"statistics\"}$percnt $percntMAKETEXT{\"Statistics\"}$percnt]]"}%
* [[WebPreferences][ %ICON{"wrench"}% %MAKETEXT{"Preferences"}%]]

Expand Down
10 changes: 0 additions & 10 deletions core/data/System/Config/WebRss.txt

This file was deleted.

4 changes: 2 additions & 2 deletions core/data/System/DefaultWebStatistics.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%META:TOPICINFO{author="ProjectContributor" date="1420689155" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" date="1521767422" format="1.1" version="1"}%
%META:TOPICPARENT{name="WebHome"}%
---+ Statistics documentation
The following section - namely the help text and the statistics table headings - is included into each <nop>%STATISTICSTOPIC% topic. If you want to tailor the help text, copy the first section of this topic into [[%USERSWEB%.Default%STATISTICSTOPIC%]] so that your changes are not lost after upgrading Foswiki to a new release.
The following section - namely the help text and the statistics table headings - is included into each <nop>%STATISTICSTOPIC% topic. If you want to tailor the help text, copy the first section of this topic into [[%CONFIGWEB%.Default%STATISTICSTOPIC%]] so that your changes are not lost after upgrading Foswiki to a new release.

<!--
*Caution:* The =STOPINCLUDE= macro must be on the same line as the table headings for the statistics tables to render correctly.
Expand Down
4 changes: 2 additions & 2 deletions core/data/System/GroupViewTemplate.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
%META:TOPICINFO{author="ProjectContributor" date="1521596899" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" date="1521767422" format="1.1" version="1"}%
%{ NOTE: THIS IS A SKIN TEMPLATE, NOT A TOPIC TEMPLATE }%
%TMPL:INCLUDE{"view"}%

%TMPL:DEF{"content"}%<div class="foswikiTopicText">
%ADDTOZONE{"script" text="<script src='/pub/System/JavascriptFiles/strikeone.js'></script>"}%
---+!! %NOP%%TOPIC%
%IF{"'%USERSWEB%'='%WEB%'" else="<div class=\'foswikiAlert'>You are
%IF{"'%USERSWEB%'!='%WEB%' AND '%TOPIC%'~'*Group'" then="<div class=\'foswikiAlert'>You are
viewing an inactive Group topic. See the [[%USERSWEB%.%TOPIC%]] for the live version of this group.</div>"}%

%IF{
Expand Down
6 changes: 3 additions & 3 deletions core/data/System/SiteToolStatistics.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" date="1419139420" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" date="1521767422" format="1.1" version="1"}%
%META:TOPICPARENT{name="WebHome"}%
---+ Site Statistics
%TOC%
Expand Down Expand Up @@ -165,7 +165,7 @@ The template topic contains an =%<nop>INCLUDE%= for help text and table headings

To tailor the help text or column heading, copy [[%SYSTEMWEB%.Default%STATISTICSTOPIC%]] to [[%USERSWEB%.Default%STATISTICSTOPIC%]] and tailor as desired. This prevents your changes from being lost when Foswiki is updated.

To tailor the actual columns recorded and the order of the columns, copy [[%SYSTEMWEB%.WebStatisticsTemplate]] to [[%USERSWEB%.WebStatisticsTemplate]] and tailor as desired. Then remove the previous <nop>%STATISTICSTOPIC% and allow the statistics script to auto-create a new topic based upon the new template.
To tailor the actual columns recorded and the order of the columns, copy [[%SYSTEMWEB%.WebStatisticsTemplate]] to [[%CONFIGWEB%.WebStatisticsTemplate]] and tailor as desired. Then remove the previous <nop>%STATISTICSTOPIC% and allow the statistics script to auto-create a new topic based upon the new template.
Alternatively you can edit the <nop>%STATISTICSTOPIC% in each web.

Statistics are written into the <nop>%STATISTICSTOPIC% in the following order.
Expand All @@ -184,7 +184,7 @@ The =marker line= defines the order of the columns collected by the =statistics=
<nop>%STATISTICSTOPIC% topics can have access controls like other topics.

If you want to have these access settings copied to new <nop>%STATISTICSTOPIC% topics, follow these steps:
1 Copy topic !WebStatisticsTemplate from %SYSTEMWEB% web to %USERSWEB% web
1 Copy topic !WebStatisticsTemplate from %SYSTEMWEB% web to %CONFIGWEB% web
1 Edit the topic settings (via the "More" link) and write (if you want to restrict topics views to logged in users):
<pre>
* Set%NOP% DENYTOPICVIEW = WikiGuest
Expand Down
8 changes: 2 additions & 6 deletions core/data/System/WebStatisticsTemplate.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" date="1521596899" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" date="1521767422" format="1.1" version="1"}%
%META:TOPICPARENT{name="WebHome"}%
%IF{
"istopic '%USERSWEB%.Default%STATISTICSTOPIC%'"
then="$percentINCLUDE{$quot%CONFIGWEB%.Default%STATISTICSTOPIC%$quot}$percent"
else="$percentINCLUDE{$quot%SYSTEMWEB%.Default%STATISTICSTOPIC%$quot}$percent"
}%
%INCLUDE{"%CONFIGWEB%.Default%STATISTICSTOPIC%, %SYSTEMWEB%.Default%STATISTICSTOPIC%"}%
| <!--statDate--> | <!--statViews--> | <!--statSaves--> | <!--statUploads--> | <!--statTopViews--> | <!--statTopContributors--> |
3 changes: 2 additions & 1 deletion core/data/TestCases/WebStatistics.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
%META:TOPICINFO{author="scum" comment="" date="1520313953" format="1.1" reprev="2" version="2"}%
%META:TOPICINFO{author="scum" comment="" date="1521769927" format="1.1" reprev="2" version="2"}%
%META:TOPICPARENT{name="WebHome"}%
---++ Statistics for <nop>%WEB% Web

| *Month:* | *Topic <br /> views:* | *Topic <br /> saves:* | *File <br /> uploads:* | *Most popular <br /> topic views:* | *Top contributors for <br /> topic save and uploads:* |
| <!--statDate--> | <!--statViews--> | <!--statSaves--> | <!--statUploads--> | <!--statTopViews--> | <!--statTopContributors--> |
| Mar 2018 | 24 | 0 | 0 | &nbsp;&nbsp;1 [[TestCaseAutoSearch]]<br />&nbsp;&nbsp;1 [[TestCaseAutoRegionTags]]<br />&nbsp;&nbsp;1 [[TestCaseAutoTOC]]<br />&nbsp;&nbsp;1 [[TestCaseAutoTableInclude]]<br />&nbsp;&nbsp;1 [[TestCaseAutoTOCManual]]<br />&nbsp;&nbsp;1 [[TestCaseAutoMetaSearch]]<br />&nbsp;&nbsp;1 [[TestCaseAutoFormatting]]<br />&nbsp;&nbsp;1 [[TestCaseAutoIncludeSubWebTopic]]<br />&nbsp;&nbsp;1 [[TestCaseAutoCategoryTable1]]<br />&nbsp;&nbsp;1 [[TestCaseAutoInOutPre]]<br />&nbsp;&nbsp;1 [[TestCaseAutoFormattedSearchDetails]] | |

*Notes:*
* Do not edit this topic, it is updated automatically. (You can also [[%SCRIPTURL{"statistics"}%/%WEB%][force]] an update)
Expand Down
1 change: 1 addition & 0 deletions core/lib/Foswiki/Plurals.pm
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ sub singularForm {
return
unless ( $Foswiki::cfg{PluralToSingular}
or $web eq $Foswiki::cfg{UsersWebName}
or $web eq $Foswiki::cfg{ConfigsWebName}
or $web eq $Foswiki::cfg{SystemWebName} );
return unless ( $pluralForm =~ m/s$/ );

Expand Down
6 changes: 3 additions & 3 deletions core/lib/Foswiki/UI/Statistics.pm
Original file line number Diff line number Diff line change
Expand Up @@ -437,12 +437,12 @@ sub _processWeb {
my $statsTemplate = $statsTopic . 'Template';
if (
$session->topicExists(
$Foswiki::cfg{UsersWebName},
$Foswiki::cfg{ConfigWebName},
$statsTemplate
)
)
{
$statsTemplateWeb = $Foswiki::cfg{UsersWebName};
$statsTemplateWeb = $Foswiki::cfg{ConfigWebName};
}
elsif (
$session->topicExists(
Expand All @@ -468,7 +468,7 @@ sub _processWeb {
}
else {
_printMsg( $session,
"! Warning: Template topic $statsTemplate not found in $Foswiki::cfg{UsersWebName} or $Foswiki::cfg{SystemWebName}. Unable to generate statistics in $web web."
"! Warning: Template topic $statsTemplate not found in $Foswiki::cfg{ConfigWebName} or $Foswiki::cfg{SystemWebName}. Unable to generate statistics in $web web."
);
return $web;
}
Expand Down

0 comments on commit 3d715fd

Please sign in to comment.