Add Minimal UI Page for the Sample Plugin

Add minimal UI just enough to re-produce issue 342.

https://github.com/kimchi-project/kimchi/issues/342

Signed-off-by: Zhou Zheng Sheng <zhshzhou@linux.vnet.ibm.com>
Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
Update root.py to make Cheetah render the JSON template.

when the request are json files, set the Content-Type as
application/json.

Signed-off-by: Adam King <rak@linux.vnet.ibm.com>
Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
Update the i18n tmpl to produce JSON

Remove html tags from i18n as they are not valid
Correct object definition from acceptable JS to valid JSON replacing
' with " in attribute names.

Signed-off-by: Adam King <rak@linux.vnet.ibm.com>
Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com>

Conflicts:
	ui/pages/i18n.html.tmpl
Add JS API for fetching i18n JSON

Create an API for fetching the i18n JSON.
Use the API to load the kimchi UI strings.

API will need to be simplified after convincing CherryPy to respond to the reque
st for JSON.

Signed-off-by: Adam King <rak@linux.vnet.ibm.com>
Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
Issue #342: load i18n.html of the plugin

Apparently, in plugin code there is no way to insert new entries into
Kimchi ./ui/pages/i18n.json.tmpl, so every plugin should provide its own
i18n.json.tmpl.

each plugin provides a "plugins/plugin-name/ui/pages/i18n.json.tmpl",
and maps it to the URI "plugins/plugin-name/i18n.json". This is already
supported by the kimchi back-end. What we have to do is just to load
"plugins/plugin-name/i18n.json" in the front-end code.

Signed-off-by: Adam King <rak@linux.vnet.ibm.com>
Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
add an option to toggle the sample plugin

sample plugin is used to test as a plugin demo.

we disable it by default.

use this command to enable sample plugin
$ ./autogen.sh --enable-sample

Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
generate the translation files for plugins/sample

please use this command to generate the translation files for
plugins/sample
$ make -C plugins/sample/po/ update-po

Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
skip plugins test, when sample plugin is not enabled

The plugins tests base on the sample plugin.
So we should skip the tests when disable sample plugin

Also hack the auth by utils.patch_auth for some protected http API request.

Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
add some sample plugin generated files to .gitignore

let git ignore these generated files.

Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
update ui/pages/Makefile.am to let i18n.json.tmpl be added to the package.

replace *.html.tmpl to *.tmpl, then i18n.json.tmpl will be added to the package.

Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com>