def system_sites(errormsg=None): user = auth.is_logged_in(request) permission = auth.is_sys_admin(user) return listing(request, None, Site.select(), 'all_sites', 'manage_sites', user=user)
def system_site_index(): from core.models import Site from core.libs.bottle import template sites = Site.select() tpl = ''' <p>This is the local web server for an installation of {}. <p><a href='{}'>Open the site dashboard</a> <hr/> <p>You can also preview sites and blogs available on this server: <ul>'''.format(PRODUCT_NAME, BASE_PATH) + ''' % for site in sites: <li>{{site.name}}</li> % if site.blogs.count()>0: <ul> % for blog in site.blogs: % if blog.pages.published.count()>0: <li><a href="/?_={{blog.id}}">{{blog.name}}</a></li> % else: <li>{{blog.name}} [No published pages on this blog]</li> % end % end </ul> % end %end </ul><hr/> ''' return template(tpl, sites=sites)
def system_site_index(): from core.models import Site sites = Site.select() tpl = ''' <p>This is the local web server for an installation of {}. <p><a href='{}'>Open the site dashboard</a> <hr/> <p>You can also preview sites and blogs available on this server: <ul>'''.format(PRODUCT_NAME, BASE_PATH) + ''' % for site in sites: <li>{{site.name}}</li> % if site.blogs.count()>0: <ul> % for blog in site.blogs: % if blog.published_pages().count()>0: <li><a href="/?_={{blog.id}}">{{blog.name}}</a></li> % else: <li>{{blog.name}} [No published pages on this blog]</li> % end % end </ul> % end %end </ul><hr/> ''' return template(tpl, sites=sites)