[Kimchi-devel] [PATCH 2/2 V5] Changes in sample plugin to fix and improve help

Rodrigo Trujillo rodrigo.trujillo at linux.vnet.ibm.com
Wed Oct 15 05:04:42 UTC 2014


This patch set changes the Sample plugin, adding a new tab, modifying
naming and other elements in order to show help pages properly.

Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo at linux.vnet.ibm.com>
---
 plugins/sample/sample.conf.in                      |  5 ++++
 plugins/sample/ui/config/tab-ext.xml               | 11 ++++++--
 plugins/sample/ui/pages/Makefile.am                |  2 +-
 .../sample/ui/pages/help/en_US/sample-tab1.html    |  1 +
 .../sample/ui/pages/help/en_US/sample-tab2.html    |  1 +
 plugins/sample/ui/pages/sample-tab1.html.tmpl      | 30 ++++++++++++++++++++++
 plugins/sample/ui/pages/sample-tab2.html.tmpl      | 30 ++++++++++++++++++++++
 plugins/sample/ui/pages/tab.html.tmpl              | 30 ----------------------
 8 files changed, 77 insertions(+), 33 deletions(-)
 create mode 100644 plugins/sample/ui/pages/help/en_US/sample-tab1.html
 create mode 100644 plugins/sample/ui/pages/help/en_US/sample-tab2.html
 create mode 100644 plugins/sample/ui/pages/sample-tab1.html.tmpl
 create mode 100644 plugins/sample/ui/pages/sample-tab2.html.tmpl
 delete mode 100644 plugins/sample/ui/pages/tab.html.tmpl

diff --git a/plugins/sample/sample.conf.in b/plugins/sample/sample.conf.in
index cf42467..ac7e27f 100644
--- a/plugins/sample/sample.conf.in
+++ b/plugins/sample/sample.conf.in
@@ -20,3 +20,8 @@ tools.kimchiauth.on = True
 
 [/circles]
 tools.kimchiauth.on = True
+
+[/help]
+tools.staticdir.on = True
+tools.nocache.on = True
+tools.staticdir.dir = kimchi.config.PluginPaths('sample').ui_dir + '/pages/help'
diff --git a/plugins/sample/ui/config/tab-ext.xml b/plugins/sample/ui/config/tab-ext.xml
index a1fb1c2..aff0d14 100644
--- a/plugins/sample/ui/config/tab-ext.xml
+++ b/plugins/sample/ui/config/tab-ext.xml
@@ -4,7 +4,14 @@
         <access role="admin" mode="admin"/>
         <access role="user" mode="none"/>
 
-        <title>SampleTab</title>
-        <path>plugins/sample/tab.html</path>
+        <title>SampleTab 1</title>
+        <path>plugins/sample/sample-tab1.html</path>
+    </tab>
+    <tab>
+        <access role="admin" mode="admin"/>
+        <access role="user" mode="none"/>
+
+        <title>SampleTab 2</title>
+        <path>plugins/sample/sample-tab2.html</path>
     </tab>
 </tabs-ext>
diff --git a/plugins/sample/ui/pages/Makefile.am b/plugins/sample/ui/pages/Makefile.am
index ca22446..3da95a2 100644
--- a/plugins/sample/ui/pages/Makefile.am
+++ b/plugins/sample/ui/pages/Makefile.am
@@ -17,4 +17,4 @@
 # License along with this library; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
-EXTRA_DIST = i18n.json.tmpl tab.html.tmpl
+EXTRA_DIST = i18n.json.tmpl sample-tab1.html.tmpl sample-tab2.html.tmpl
diff --git a/plugins/sample/ui/pages/help/en_US/sample-tab1.html b/plugins/sample/ui/pages/help/en_US/sample-tab1.html
new file mode 100644
index 0000000..70aa1c0
--- /dev/null
+++ b/plugins/sample/ui/pages/help/en_US/sample-tab1.html
@@ -0,0 +1 @@
+Help page for TAB 1 of Kimchi's Sample plugin.
diff --git a/plugins/sample/ui/pages/help/en_US/sample-tab2.html b/plugins/sample/ui/pages/help/en_US/sample-tab2.html
new file mode 100644
index 0000000..367318f
--- /dev/null
+++ b/plugins/sample/ui/pages/help/en_US/sample-tab2.html
@@ -0,0 +1 @@
+Help page for TAB 2 of Kimchi's Sample plugin.
diff --git a/plugins/sample/ui/pages/sample-tab1.html.tmpl b/plugins/sample/ui/pages/sample-tab1.html.tmpl
new file mode 100644
index 0000000..4354d81
--- /dev/null
+++ b/plugins/sample/ui/pages/sample-tab1.html.tmpl
@@ -0,0 +1,30 @@
+#*
+ * Project Kimchi
+ *
+ * Copyright IBM, Corp. 2014
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *#
+#unicode UTF-8
+<!DOCTYPE html>
+<html>
+<script type="text/javascript" src="plugins/sample/js/util.js"></script>
+<body>
+    <div id="samplebody"/>
+</body>
+<script>
+    sample.description(function(r){
+        \$("#samplebody").html("name: " + r.name + " version: " + r.version);
+    });
+</script>
+</html>
diff --git a/plugins/sample/ui/pages/sample-tab2.html.tmpl b/plugins/sample/ui/pages/sample-tab2.html.tmpl
new file mode 100644
index 0000000..4354d81
--- /dev/null
+++ b/plugins/sample/ui/pages/sample-tab2.html.tmpl
@@ -0,0 +1,30 @@
+#*
+ * Project Kimchi
+ *
+ * Copyright IBM, Corp. 2014
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *#
+#unicode UTF-8
+<!DOCTYPE html>
+<html>
+<script type="text/javascript" src="plugins/sample/js/util.js"></script>
+<body>
+    <div id="samplebody"/>
+</body>
+<script>
+    sample.description(function(r){
+        \$("#samplebody").html("name: " + r.name + " version: " + r.version);
+    });
+</script>
+</html>
diff --git a/plugins/sample/ui/pages/tab.html.tmpl b/plugins/sample/ui/pages/tab.html.tmpl
deleted file mode 100644
index 4354d81..0000000
--- a/plugins/sample/ui/pages/tab.html.tmpl
+++ /dev/null
@@ -1,30 +0,0 @@
-#*
- * Project Kimchi
- *
- * Copyright IBM, Corp. 2014
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *#
-#unicode UTF-8
-<!DOCTYPE html>
-<html>
-<script type="text/javascript" src="plugins/sample/js/util.js"></script>
-<body>
-    <div id="samplebody"/>
-</body>
-<script>
-    sample.description(function(r){
-        \$("#samplebody").html("name: " + r.name + " version: " + r.version);
-    });
-</script>
-</html>
-- 
1.9.3




More information about the Kimchi-devel mailing list