Skip to content

Commit

Permalink
Item11648: cleaning up template mess
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk@14355 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
MichaelDaum authored and MichaelDaum committed Mar 16, 2012
1 parent 3b0af10 commit 89cc927
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 104 deletions.
8 changes: 2 additions & 6 deletions NatEditPlugin/lib/Foswiki/Plugins/NatEditPlugin.pm
Expand Up @@ -116,9 +116,7 @@ s/\$link/<a href='\$url' accesskey='f' title='\$title'><span>\$acton<\/span><\/a
$theFormat =~ s/\$title/$actionTitle/g;
$theFormat =~ s/\$action/$actionText/g;
$theFormat =~ s/\$id/$action/g;
$theFormat =
Foswiki::Func::expandCommonVariables( $theFormat, $theTopic, $theWeb )
if escapeParameter($theFormat);
escapeParameter($theFormat);

return $theFormat;
}
Expand Down Expand Up @@ -310,9 +308,7 @@ sub handleNATFORMLIST {
$result =~ s/\$count/$index/g;
$result =~ s/\$web/$theWeb/g;
$result =~ s/\$topic/$theTopic/g;
$result =
Foswiki::Func::expandCommonVariables( $result, $theTopic, $theWeb )
if escapeParameter($result);
escapeParameter($result);

return $result;
}
Expand Down
91 changes: 26 additions & 65 deletions NatEditPlugin/templates/edit.natedit.tmpl
Expand Up @@ -23,23 +23,14 @@
%TMPL:DEF{"topictitle_dbcache"}%%GETTOPICTITLE{"%WEB%.%TOPIC%" encode="entity" hideautoinc="%hideautoinc%"}%%TMPL:END%
%TMPL:DEF{"sig_textareabuttons"}%%TMPL:END%

%TMPL:DEF{"content"}%%{
}%%TMPL:P{"contenttitle"}%%{
}%%TMPL:P{"messages"}%%{
}%%TMPL:P{"formstart"}%%{
}%%TMPL:P{"formattop"}%%{
}%%TMPL:P{"tabpane"}%%{
}%%TMPL:P{"bottomtopicactions"}%%{
}%%TMPL:P{"formend"}%%{
}%%TMPL:P{"dialogs"}%%{
}%%JQREQUIRE{"natedit, blockui, form, ui::autocomplete" warn="off"}%%{
%TMPL:DEF{"content"}%%TMPL:P{"contenttitle"}%%TMPL:P{"messages"}%%TMPL:P{"formstart"}%%TMPL:P{"formattop"}%%TMPL:P{"tabpane"}%%TMPL:P{"bottomtopicactions"}%%TMPL:P{"formend"}%%TMPL:P{"dialogs"}%%JQREQUIRE{
"natedit, blockui, form, ui::autocomplete" warn="off"
}%%ADDTOZONE{"head"
tag="NATEDIT::MATHMODEPLUGINENABLED"
text="<meta name='foswiki.MathModePluginEnabled' content='%IF{"context MathModePluginEnabled" then="true" else="false"}%' />"
}%%TMPL:END%

%TMPL:DEF{"formstart"}%%{
}%<div class="natEditContainer">
%TMPL:DEF{"formstart"}%<div class="natEditContainer">
<form id="EditForm" name="EditForm" action="%SCRIPTURLPATH{"save"}%/%WEB%/%TOPIC%" method="post" validate="%TMPL:P{"validationrules"}%">
<input type="submit" style="display:none" />
<input type="hidden" name="action_addform" value="" />
Expand All @@ -60,65 +51,41 @@
<input type="hidden" name="submitChangeForm" value="" />
<input type="hidden" name="formtemplate" value="%FORMTEMPLATE%" />
<input type="hidden" name="templatetopic" value="%TEMPLATETOPIC%" />
<input type="hidden" name="template" value="%URLPARAM{"template"}%" />
%{
}%%TMPL:END%
%TMPL:DEF{"textarea"}%%{
}%<textarea id="topic" class="foswikiTextarea foswikiWysiwygEdit natEditTextArea natedit {autoMaxExpand:true, minHeight:215}" wrap="virtual" name="text" rows="22" cols="70">%TEXT%</textarea>
%{
}%%TMPL:END%
<input type="hidden" name="template" value="%URLPARAM{"template"}%" />%TMPL:END%

%TMPL:DEF{"textarea"}%<textarea id="topic" class="foswikiTextarea foswikiWysiwygEdit natEditTextArea natedit {autoMaxExpand:true, minHeight:215}" wrap="virtual" name="text" rows="22" cols="70">%TEXT%</textarea>%TMPL:END%
%TMPL:DEF{"messages"}%<div id="natEditMessageContainer"></div>%TMPL:END%

%TMPL:DEF{"formend"}%%{
}%<input type="hidden" name="forcenewrevision" value="%URLPARAM{"forcenewrevision"}%" />
</form></div>
%{
}%%TMPL:END%
%TMPL:DEF{"formend"}%<input type="hidden" name="forcenewrevision" value="%URLPARAM{"forcenewrevision"}%" />
</form></div>%TMPL:END%

%TMPL:DEF{"help"}%%TMPL:P{"edithelp"}%%TMPL:END%
%TMPL:DEF{"pagehelp"}%
%TMPL:P{"help"}%
%TMPL:END%

%TMPL:DEF{"tabpane"}%%{
}%%TABPANE{automaxexpand="on" minheight="300" animate="on" select="%URLPARAM{"natedittab"}%"}%
%TMPL:P{"firsttab"}%%{
}%%TMPL:P{"formfields"}%%{
}%%TMPL:P{"settingstab"}%%{
}%%TMPL:P{context="SetVariablePluginEnabled" then="permissionstab"}%%{
}%%TMPL:P{"moretabs"}%%{
}%%TMPL:P{"helptab"}%%{
}%%ENDTABPANE%
%{
}%%TMPL:END%
%TMPL:DEF{"tabpane"}%%TABPANE{automaxexpand="on" minheight="300" animate="on" select="%URLPARAM{"natedittab"}%"}%
%TMPL:P{"firsttab"}%%TMPL:P{"formfields"}%%TMPL:P{"settingstab"}%%TMPL:P{context="SetVariablePluginEnabled" then="permissionstab"}%%TMPL:P{"moretabs"}%%TMPL:P{"helptab"}%%ENDTABPANE%%TMPL:END%

%TMPL:DEF{"formfields"}%%FORMFIELDS%%TMPL:END%

%TMPL:DEF{"topicmeta"}%%{
}%<div class="natEditTopicInfo"><literal>
%TMPL:DEF{"topicmeta"}%<div class="natEditTopicInfo"><literal>
<table>
<tr>
<th>Title:</th>
<td><input class="foswikiInputField" type="text" name="TopicTitle" size="75" value="%URLPARAM{"TopicTitle" default="%TMPL:P{"topictitle" hideautoinc="on"}%" encode="quote"}%" /></td>
</tr>
</table>
</literal></div>
%{
}%%TMPL:END%
%TMPL:DEF{"firsttab"}%%{
}%%TAB{"%MAKETEXT{"Text"}%" id="text"}%
%TMPL:P{"topicmeta"}%%{
}%%TMPL:P{"textarea"}%%{
}%%ENDTAB%
%{
}%%TMPL:END%
</literal></div>%TMPL:END%

%TMPL:DEF{"firsttab"}%%TAB{"%MAKETEXT{"Text"}%" id="text"}%
%TMPL:P{"topicmeta"}%%TMPL:P{"textarea"}%%ENDTAB%%TMPL:END%

%TMPL:DEF{"settingstab"}%%TAB{"%MAKETEXT{"Settings"}%" id="settings"}%%TMPL:P{"settings"}%%ENDTAB%%TMPL:END%

%TMPL:DEF{"settings"}%%{
}%%TMPL:P{"topicsettings"}%%{
}%%TMPL:P{"moresettings"}%%{
}%%{
}%%TMPL:END%
%TMPL:DEF{"topicsettings"}%%{
}%<h2 style='margin-top:0'>%MAKETEXT{"Topic settings"}%</h2>
%TMPL:DEF{"settings"}%%TMPL:P{"topicsettings"}%%TMPL:P{"moresettings"}%%TMPL:END%

%TMPL:DEF{"topicsettings"}%<h2 style='margin-top:0'>%MAKETEXT{"Topic settings"}%</h2>
<div class="foswikiFormSteps">
<div class="foswikiFormStep">
<table class="foswikiLayoutTable">
Expand All @@ -128,12 +95,10 @@
<input class="foswikiInputField jqUIAutocomplete" autocomplete="%SCRIPTURL{"view"}%/%SYSTEMWEB%/JQueryAjaxHelper?section=topic&contenttype=text/plain&skin=text&baseweb=%BASEWEB%" type="text" name="topicparent" id="topicparent" size="40" value="%TOPICPARENT%" />
</td>
</tr>
%TMPL:P{"moretopicsettings"}%%{
}% </table>
%TMPL:P{"moretopicsettings"}%</table>
</div>
</div>
%{
}%%TMPL:END%
</div>%TMPL:END%

%TMPL:DEF{"helptab"}%%TAB{"%MAKETEXT{"Help"}%"
id="help"
url="%SCRIPTURL{"view"}%/%IF{"defined NATEDIT_HELPTEXT" then="%NATEDIT_HELPTEXT%" else="%SYSTEMWEB%.NatEditHelpText"}%?skin=text;section=default"
Expand All @@ -146,9 +111,7 @@
else=""
}%%TMPL:END%

%{ ################################################################################ }%
%TMPL:DEF{"permissionstab"}%%{
}%%TAB{"%MAKETEXT{"Permissions"}%" id="permissions"}%
%TMPL:DEF{"permissionstab"}%%TAB{"%MAKETEXT{"Permissions"}%" id="permissions"}%
<noautolink>
<h2 style='margin-top:0'>%MAKETEXT{"Permissions"}%</h2>
<div class="foswikiFormSteps" id="permissionsForm">
Expand Down Expand Up @@ -235,6 +198,4 @@
</div>
</div>
</noautolink>
%ENDTAB%
%{
}%%TMPL:END%
%ENDTAB%%TMPL:END%
3 changes: 1 addition & 2 deletions NatEditPlugin/templates/editsection.natedit.tmpl
Expand Up @@ -13,5 +13,4 @@
%TMPL:P{"formatbottom"}%
%TMPL:P{"formend"}%
%POSTEXT%
%TMPL:P{"pagehelp"}%%{
}%%TMPL:END%
%TMPL:P{"pagehelp"}%%TMPL:END%
13 changes: 2 additions & 11 deletions NatEditPlugin/templates/edittoolbar.natedit.tmpl
@@ -1,14 +1,5 @@
%TMPL:DEF{"bottomtopicactions"}%%{
}%<div class="natEditBottomBar">
<ul>
%TMPL:P{"saveorrestorebutton"}%%{
}%%TMPL:P{"checkpointbutton"}%%{
}%%TMPL:P{"previewbutton"}%%{
}%%TMPL:P{"formbutton"}%%{
}%%TMPL:P{"changeform"}%%{
}%%TMPL:P{"cancelbutton"}%%{
}%%TMPL:P{"forcenewrevision"}%%{
}%</ul>
%TMPL:DEF{"bottomtopicactions"}%<div class="natEditBottomBar">
<ul>%TMPL:P{"saveorrestorebutton"}%%TMPL:P{"checkpointbutton"}%%TMPL:P{"previewbutton"}%%TMPL:P{"formbutton"}%%TMPL:P{"changeform"}%%TMPL:P{"cancelbutton"}%%TMPL:P{"forcenewrevision"}%</ul>
%CLEAR%
</div>
%TMPL:END%
Expand Down
18 changes: 6 additions & 12 deletions NatEditPlugin/templates/settings.natedit.tmpl
@@ -1,8 +1,7 @@
%TMPL:INCLUDE{"settings"}%
%TMPL:INCLUDE{"settingstoolbar"}%
%TMPL:DEF{"content"}%%{
}%%TMPL:P{"contenttitle"}%%{
}%<form id="EditForm" name="EditForm" method="post" action="%SCRIPTURLPATH{"manage"}%/%WEB%/%TOPIC%">

%TMPL:DEF{"content"}%%TMPL:P{"contenttitle"}%<form id="EditForm" name="EditForm" method="post" action="%SCRIPTURLPATH{"manage"}%/%WEB%/%TOPIC%">
<input type="submit" style="display:none" />
<input type="hidden" name="action_addform" value="" />
<input type="hidden" name="action_cancel" value="" />
Expand All @@ -12,16 +11,11 @@
<input type="hidden" name="action_save" value="" />
<input type="hidden" name="action" value="saveSettings" />
<input type="hidden" name="originalrev" value="%ORIGINALREV%" />
%JQREQUIRE{"focus, natedit"}%%{
}%%TABPANE%
%JQREQUIRE{"focus, natedit"}%%TABPANE%
%TAB{"%MAKETEXT{"Preferences"}%"}%
<textarea class="foswikiTextArea jqFocus" name="text" id="topic" wrap="virtual" rows="%EDITBOXHEIGHT%" cols="%EDITBOXWIDTH%" style="%EDITBOXSTYLE%">%TEXT%</textarea>
%ENDTAB%
%TMPL:P{"helptab"}%%{
}%%ENDTABPANE%
%TMPL:P{"bottomtopicactions"}%
%TMPL:P{"formend"}%%{
}%</form>
%{
}%%TMPL:END%
%TMPL:P{"helptab"}%%ENDTABPANE%
%TMPL:P{"bottomtopicactions"}%%TMPL:P{"formend"}%</form>%TMPL:END%

%TMPL:DEF{"helptab"}%%TAB{"%MAKETEXT{"Help"}%"}% %TMPL:P{"help"}% %ENDTAB%%TMPL:END%
11 changes: 3 additions & 8 deletions NatEditPlugin/templates/settingstoolbar.natedit.tmpl
@@ -1,10 +1,5 @@
%TMPL:INCLUDE{"edittoolbar"}%
%TMPL:DEF{"bottomtopicactions"}%%{
}%<div class="natEditBottomBar">
<ul>
%TMPL:P{"saveorrestorebutton"}%%{
}%%TMPL:P{"cancelbutton"}%%{
}%</ul>
%TMPL:DEF{"bottomtopicactions"}%<div class="natEditBottomBar">
<ul>%TMPL:P{"saveorrestorebutton"}%%TMPL:P{"cancelbutton"}%</ul>
%CLEAR%
</div>%{
}%%TMPL:END%
</div>%TMPL:END%

0 comments on commit 89cc927

Please sign in to comment.