commit d66d8e96854b10fbbb435a44abaa9ca61990c002 Author: Ryan McCabe rmccabe@redhat.com Date: Tue Mar 15 19:45:55 2011 -0400
Add newly created files needed for expert mode
luci/lib/ClusterConf/Smb.py | 20 ++++++++++++++++++++ luci/public/js/user_prefs.js | 7 +++++++ luci/templates/prefs.html | 25 +++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 0 deletions(-) --- diff --git a/luci/lib/ClusterConf/Smb.py b/luci/lib/ClusterConf/Smb.py new file mode 100644 index 0000000..da66d65 --- /dev/null +++ b/luci/lib/ClusterConf/Smb.py @@ -0,0 +1,20 @@ +# Copyright (C) 2006-2011 Red Hat, Inc. +# +# This program is free software; you can redistribute +# it and/or modify it under the terms of version 2 of the +# GNU General Public License as published by the +# Free Software Foundation. + +from BaseResource import BaseResource +from gettext import gettext as _ + +# Old samba resource + +TAG_NAME = 'smb' +RESOURCE_TYPE = _('Samba') + +class Smb(BaseResource): + def __init__(self): + BaseResource.__init__(self) + self.TAG_NAME = TAG_NAME + self.resource_type = RESOURCE_TYPE diff --git a/luci/public/js/user_prefs.js b/luci/public/js/user_prefs.js new file mode 100644 index 0000000..6f1bc18 --- /dev/null +++ b/luci/public/js/user_prefs.js @@ -0,0 +1,7 @@ +function update_user_mode(cb_obj) { + if ($(cb_obj).is(':checked')) { + $.cookie("expertMode", 1, {expires: 7}); + } else { + $.cookie("expertMode", 0, {expires: 7}); + } +} diff --git a/luci/templates/prefs.html b/luci/templates/prefs.html new file mode 100644 index 0000000..c7889d3 --- /dev/null +++ b/luci/templates/prefs.html @@ -0,0 +1,25 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" + xmlns:py="http://genshi.edgewall.org/" + xmlns:xi="http://www.w3.org/2001/XInclude%22%3E + +<xi:include href="master.html"/> + +<head> + <meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/> + <title>User Preferences</title> +</head> + +<body> + <script src="/js/jquery.cookie.js" type="text/javascript"></script> + <script src="/js/user_prefs.js" type="text/javascript"></script> + <div class="mainpage"> + <h2>User Preferences</h2> + <input type="checkbox" class="checkbox" name="expert_mode" + py:attrs="expertMode and {'checked':'checked'} or {}" + onclick="update_user_mode(this)"/> + <label class="choice">Enable "expert" mode</label> + </div> +</body> +</html>
luci-commits@lists.fedorahosted.org