This commit is contained in:
James Vasile committed 2011-02-22 13:32:45 -05:00
commit 35071d7212
78 files changed
+5570

No files matched your search

@@ -0,0 +1,35 @@
import cherrypy
from modules.auth import require
from plugin_mount import PagePlugin
import cfg
class FileExplorer(PagePlugin):
def __init__(self, *args, **kwargs):
PagePlugin.__init__(self, *args, **kwargs)
self.register_page("sharing.explorer")
cfg.html_root.sharing.menu.add_item("File Explorer", "/sharing/explorer", 30)
@cherrypy.expose
@require()
def index(self):
main = """
<p>File explorer for users that also have shell accounts.</p> <p>Until
that is written (and it will be a while), we should install <a
href="http://www.mollify.org/demo.php">mollify</a> or <a
href="http://www.ajaxplorer.info/wordpress/demo/">ajaxplorer</a>, but
of which seem to have some support for playing media files in the
browser (as opposed to forcing users to download and play them
locally). The downsides to third-party explorers are: they're don't
fit within our theme system, they require separate login, and they're
written in php, which will make integrating them hard.</p>
<p>There are, of course, many other options for php-based file
explorers. These were the ones I saw that might do built-in media
players.</p>
<p>For python-friendly options, check out <a
href="http://blogfreakz.com/jquery/web-based-filemanager/">FileManager</a>.
It appears to be mostly javascript with some bindings to make it
python-friendly.</p>
"""
return self.fill_template(title="File Explorer", main=main, sidebar_right='')
+51
View File
@@ -0,0 +1,51 @@
import cherrypy
from gettext import gettext as _
from modules.auth import require
from plugin_mount import PagePlugin
import cfg
class Sharing(PagePlugin):
def __init__(self, *args, **kwargs):
PagePlugin.__init__(self, *args, **kwargs)
self.register_page("sharing")
self.menu = cfg.main_menu.add_item("Resource Sharing", "/sharing", 35)
self.menu.add_item("File Server", "/sharing/files", 10)
@cherrypy.expose
def index(self):
"""This isn't an internal redirect, because we need the url to
reflect that we've moved down into the submenu hierarchy.
Otherwise, it's hard to know which menu portion to make active
or expand or contract."""
raise cherrypy.HTTPRedirect('/sharing/files')
@cherrypy.expose
@require()
def files(self):
return self.fill_template(title="File Server", main='', sidebar_right=_("""
<h2>Freedom NAS</h2><p> The %s can make your spare hard drives accessible to your
local network, thus acting as a NAS server. We currently support
sharing files via NFS and SMB.
TODO: this is not true. We currently support no sharing.</p>
""" % cfg.box_name))
#TODO: move PrinterSharing to another file, as it should be an optional module (most people don't care about printer sharing)
class PrinterSharing(PagePlugin):
def __init__(self, *args, **kwargs):
PagePlugin.__init__(self, *args, **kwargs)
self.register_page("sharing.printer")
cfg.html_root.sharing.menu.add_item("Printer Sharing", "/sharing/printer", 35)
@cherrypy.expose
@require()
def index(self):
main = """
<p>TODO: Setup and install SAMBA</p>
<p>TODO: Setup and install CUPS</p>
"""
return self.fill_template(title="Printer Sharing", main=main, sidebar_right="""
<h2>Share Your Printer</h2><p> The %s can share your printer via Samba and CUPS.</p>
""" % cfg.box_name)