Example #1
0
 def f(request):
     slug = 'katacontainers'
     filebrowser_site.directory = "uploads/%s/" % slug
     return path_exists(
         filebrowser_site,
         filebrowser_view(getattr(globals()['filebrowser_site'],
                                  f_name)))(request)
 def get_urls(self):
     # filebrowser urls (views)
     urlpatterns = [
         path('browse/',
              path_exists(self, filebrowser_view(self.browse)),
              name="fb_browse"),
         path('createdir/',
              path_exists(self, filebrowser_view(self.createdir)),
              name="fb_createdir"),
         path('upload/',
              path_exists(self, filebrowser_view(self.upload)),
              name="fb_upload"),
         path('delete_confirm/',
              file_exists(
                  self,
                  path_exists(self, filebrowser_view(self.delete_confirm))),
              name="fb_delete_confirm"),
         path('delete/',
              file_exists(self,
                          path_exists(self, filebrowser_view(self.delete))),
              name="fb_delete"),
         path('detail/',
              file_exists(self,
                          path_exists(self, filebrowser_view(self.detail))),
              name="fb_detail"),
         path('version/',
              file_exists(self,
                          path_exists(self,
                                      filebrowser_view(self.version))),
              name="fb_version"),
         path('upload_file/',
              staff_member_required(csrf_exempt(self._upload_file)),
              name="fb_do_upload"),
     ]
     return urlpatterns
    def get_urls(self):
        from django.conf.urls.defaults import patterns, url, include

        urlpatterns = patterns(
            "",
            # filebrowser urls (views)
            url(r"^browse/$", path_exists(self, self.filebrowser_view(self.browse)), name="fb_browse"),
            url(r"^createdir/", path_exists(self, self.filebrowser_view(self.createdir)), name="fb_createdir"),
            url(r"^upload/", path_exists(self, self.filebrowser_view(self.upload)), name="fb_upload"),
            url(
                r"^delete_confirm/$",
                file_exists(self, path_exists(self, self.filebrowser_view(self.delete_confirm))),
                name="fb_delete_confirm",
            ),
            url(
                r"^delete/$", file_exists(self, path_exists(self, self.filebrowser_view(self.delete))), name="fb_delete"
            ),
            url(
                r"^detail/$", file_exists(self, path_exists(self, self.filebrowser_view(self.detail))), name="fb_detail"
            ),
            url(
                r"^version/$",
                file_exists(self, path_exists(self, self.filebrowser_view(self.version))),
                name="fb_version",
            ),
            # non-views
            url(r"^upload_file/$", csrf_exempt(self._upload_file), name="fb_do_upload"),
        )

        return urlpatterns
Example #4
0
    def get_urls(self):
        "URLs for a filebrowser.site"
        try:
            from django.conf.urls import url, patterns
        except ImportError:
            # for Django version less then 1.4
            from django.conf.urls.defaults import url, patterns

        # filebrowser urls (views)
        urlpatterns = patterns(
            "",
            url(r"^browse/$", path_exists(self, filebrowser_view(self.browse)), name="fb_browse"),
            url(r"^createdir/", path_exists(self, filebrowser_view(self.createdir)), name="fb_createdir"),
            url(r"^upload/", path_exists(self, filebrowser_view(self.upload)), name="fb_upload"),
            url(
                r"^delete_confirm/$",
                file_exists(self, path_exists(self, filebrowser_view(self.delete_confirm))),
                name="fb_delete_confirm",
            ),
            url(r"^delete/$", file_exists(self, path_exists(self, filebrowser_view(self.delete))), name="fb_delete"),
            url(r"^detail/$", file_exists(self, path_exists(self, filebrowser_view(self.detail))), name="fb_detail"),
            url(r"^version/$", file_exists(self, path_exists(self, filebrowser_view(self.version))), name="fb_version"),
            url(r"^upload_file/$", staff_member_required(csrf_exempt(self._upload_file)), name="fb_do_upload"),
        )
        return urlpatterns
Example #5
0
    def get_urls(self):
        from django.conf.urls import url, include

        urlpatterns = [
            # filebrowser urls (views)
            url(r"^browse/$", path_exists(self, self.filebrowser_view(self.browse)), name="fb_browse"),
            url(r"^createdir/", path_exists(self, self.filebrowser_view(self.createdir)), name="fb_createdir"),
            url(r"^upload/", path_exists(self, self.filebrowser_view(self.upload)), name="fb_upload"),
            url(
                r"^delete_confirm/$",
                file_exists(self, path_exists(self, self.filebrowser_view(self.delete_confirm))),
                name="fb_delete_confirm",
            ),
            url(
                r"^delete/$", file_exists(self, path_exists(self, self.filebrowser_view(self.delete))), name="fb_delete"
            ),
            url(
                r"^detail/$", file_exists(self, path_exists(self, self.filebrowser_view(self.detail))), name="fb_detail"
            ),
            url(
                r"^version/$",
                file_exists(self, path_exists(self, self.filebrowser_view(self.version))),
                name="fb_version",
            ),
            # non-views
            # url(r'^upload_file/$', staff_member_required(csrf_exempt(self._upload_file)), name="fb_do_upload"),
            url(r"^upload_file/$", login_required(csrf_exempt(self._upload_file)), name="fb_do_upload"),
        ]

        return urlpatterns
    def get_urls(self):
        from django.conf.urls import patterns, url, include

        urlpatterns = super(CropFileBrowserSite, self).get_urls()

        urlpatterns += patterns('',
            url(r'^crop/$', file_exists(self, path_exists(self, filebrowser_view(self.crop))), name="fb_crop"),
        )

        return urlpatterns
Example #7
0
 def get_urls(self, *args, **kwargs):
     urlpatterns = super(CustomFileBrowserSite, self).get_urls(*args, **kwargs)
     urlpatterns[0] = url(
         r'^browse/$',
         force_create_dir(self, filebrowser_view(self.browse)),
         name="fb_browse"
     )
     urlpatterns[1] = url(
         r'^createdir/',
         path_exists(self, filebrowser_admin_view(self.createdir)),
         name="fb_createdir"
     )
     return urlpatterns
    def get_urls(self):
        "URLs for a filebrowser.site"
        from django.conf.urls import url, patterns

        # filebrowser urls (views)
        return [
            url(r'^browse/$', path_exists(self, filebrowser_view(self.browse)), name="fb_browse"),
            url(r'^createdir/', path_exists(self, filebrowser_view(self.createdir)), name="fb_createdir"),
            url(r'^upload/', path_exists(self, filebrowser_view(self.upload)), name="fb_upload"),
            url(r'^delete_confirm/$', file_exists(self, path_exists(self, filebrowser_view(self.delete_confirm))), name="fb_delete_confirm"),
            url(r'^delete/$', file_exists(self, path_exists(self, filebrowser_view(self.delete))), name="fb_delete"),
            url(r'^detail/$', file_exists(self, path_exists(self, filebrowser_view(self.detail))), name="fb_detail"),
            url(r'^version/$', file_exists(self, path_exists(self, filebrowser_view(self.version))), name="fb_version"),
            url(r'^upload_file/$', staff_member_required(csrf_exempt(self._upload_file)), name="fb_do_upload"),
        ]
Example #9
0
def filebrowser_browse(request):
    slug = 'katacontainers'
    filebrowser_site.directory = "uploads/%s/" % slug
    if get_path('', site=filebrowser_site) is None and \
            not os.path.exists(settings.MEDIA_ROOT + '/' + filebrowser_site.directory):
        dir = settings.MEDIA_ROOT + '/' + filebrowser_site.directory
        os.makedirs(dir)

    # Check and create folders named as modelname/fieldname
    url_dir = request.GET.get('dir', '')
    dir = settings.MEDIA_ROOT + '/' + filebrowser_site.directory + url_dir
    if get_path(url_dir,
                site=filebrowser_site) is None and not os.path.exists(dir):
        os.makedirs(dir)

    return path_exists(filebrowser_site,
                       filebrowser_view(filebrowser_site.browse))(request)
Example #10
0
def filebrowser_browse(request):
    slug = request.META['HTTP_HOST'].split('.')[0]
    filebrowser_site.directory = "uploads/%s/" % slug
    # Check and create folder named as the hotel id number

    if get_path('', site=filebrowser_site) is None and \
            not os.path.exists(settings.MEDIA_ROOT + '/' + filebrowser_site.directory):
        dir = settings.MEDIA_ROOT + '/' + filebrowser_site.directory
        os.makedirs(dir)

    # Check and create folders named as modelname/fieldname
    url_dir = request.GET.get('dir', '')
    dir = settings.MEDIA_ROOT + '/' + filebrowser_site.directory + url_dir
    if get_path(url_dir, site=filebrowser_site) is None and not os.path.exists(dir):
        os.makedirs(dir)

    return path_exists(filebrowser_site, filebrowser_view(filebrowser_site.browse))(request)
Example #11
0
    def get_urls(self):
        "URLs for a filebrowser.site"
        from django.conf.urls import url

        # filebrowser urls (views)
        urlpatterns = [
            url(r'^browse/$', path_exists(self, filebrowser_view(self.browse)), name="fb_browse"),
            url(r'^createdir/', path_exists(self, filebrowser_view(self.createdir)), name="fb_createdir"),
            url(r'^upload/', path_exists(self, filebrowser_view(self.upload)), name="fb_upload"),
            url(r'^delete_confirm/$', file_exists(self, path_exists(self, filebrowser_view(self.delete_confirm))), name="fb_delete_confirm"),
            url(r'^delete/$', file_exists(self, path_exists(self, filebrowser_view(self.delete))), name="fb_delete"),
            url(r'^detail/$', file_exists(self, path_exists(self, filebrowser_view(self.detail))), name="fb_detail"),
            url(r'^version/$', file_exists(self, path_exists(self, filebrowser_view(self.version))), name="fb_version"),
            url(r'^upload_file/$', staff_member_required(csrf_exempt(self._upload_file)), name="fb_do_upload"),
        ]
        return urlpatterns
Example #12
0
    def get_urls(self):
        from django.conf.urls.defaults import patterns, url, include    

        urlpatterns = patterns('',
    
            # filebrowser urls (views)
            url(r'^$', path_exists(self, self.filebrowser_view(self.home)), name="home"),
            url(r'^browse/$', path_exists(self, self.filebrowser_view(self.browse)), name="fb_browse"),
            url(r'^createdir/', path_exists(self, self.filebrowser_view(self.createdir)), name="fb_createdir"),
            url(r'^upload/', path_exists(self, self.filebrowser_view(self.upload)), name="fb_upload"),
            url(r'^delete_confirm/$', file_exists(self, path_exists(self, self.filebrowser_view(self.delete_confirm))), name="fb_delete_confirm"),
            url(r'^delete/$', file_exists(self, path_exists(self, self.filebrowser_view(self.delete))), name="fb_delete"),
            url(r'^detail/$', file_exists(self, path_exists(self, self.filebrowser_view(self.detail))), name="fb_detail"),
            url(r'^version/$', file_exists(self, path_exists(self, self.filebrowser_view(self.version))), name="fb_version"),
            # non-views
            url(r'^upload_file/$', staff_member_required(csrf_exempt(self._upload_file)), name="fb_do_upload"),
            
        )

        return urlpatterns
Example #13
0
def get_urls(self):
    "URLs for a filebrowser.site"
    try:
        from django.conf.urls import url, patterns
    except ImportError:
        # for Django version less then 1.4
        from django.conf.urls.defaults import url, patterns

    # filebrowser urls (views)
    urlpatterns = patterns(
        '',
        url(r'^browse/$',
            path_exists(self, filebrowser_view_override(self.browse)),
            name="fb_browse"),
        url(r'^createdir/',
            path_exists(self, filebrowser_view_override(self.createdir)),
            name="fb_createdir"),
        url(r'^upload/',
            path_exists(self, filebrowser_view_override(self.upload)),
            name="fb_upload"),
        url(r'^delete_confirm/$',
            file_exists(
                self,
                path_exists(self,
                            filebrowser_view_override(self.delete_confirm))),
            name="fb_delete_confirm"),
        url(r'^delete/$',
            file_exists(
                self, path_exists(self,
                                  filebrowser_view_override(self.delete))),
            name="fb_delete"),
        url(r'^detail/$',
            file_exists(
                self, path_exists(self,
                                  filebrowser_view_override(self.detail))),
            name="fb_detail"),
        url(r'^version/$',
            file_exists(
                self, path_exists(self,
                                  filebrowser_view_override(self.version))),
            name="fb_version"),
        url(r'^upload_file/$',
            csrf_exempt(self._upload_file),
            name="fb_do_upload"),
    )
    return urlpatterns
Example #14
0
    def get_urls(self):
        from django.conf.urls.defaults import patterns, url, include

        urlpatterns = patterns(
            '',

            # filebrowser urls (views)
            url(r'^browse/$',
                path_exists(self, self.filebrowser_view(self.browse)),
                name="fb_browse"),
            url(r'^createdir/',
                path_exists(self, self.filebrowser_view(self.createdir)),
                name="fb_createdir"),
            url(r'^upload/',
                path_exists(self, self.filebrowser_view(self.upload)),
                name="fb_upload"),
            url(r'^delete_confirm/$',
                file_exists(
                    self,
                    path_exists(self,
                                self.filebrowser_view(self.delete_confirm))),
                name="fb_delete_confirm"),
            url(r'^delete/$',
                file_exists(
                    self, path_exists(self,
                                      self.filebrowser_view(self.delete))),
                name="fb_delete"),
            url(r'^detail/$',
                file_exists(
                    self, path_exists(self,
                                      self.filebrowser_view(self.detail))),
                name="fb_detail"),
            url(r'^version/$',
                file_exists(
                    self, path_exists(self,
                                      self.filebrowser_view(self.version))),
                name="fb_version"),
            # non-views
            url(r'^upload_file/$',
                staff_member_required(csrf_exempt(self._upload_file)),
                name="fb_do_upload"),
        )

        return urlpatterns
Example #15
0
def get_urls(self):
    "URLs for a filebrowser.site"
    try:
        from django.conf.urls import url, patterns
    except ImportError:
        # for Django version less then 1.4
        from django.conf.urls.defaults import url, patterns

    # filebrowser urls (views)
    urlpatterns = patterns(
        '',
        url(r'^browse/$', path_exists(self, filebrowser_view_override(self.browse)), name="fb_browse"),
        url(r'^createdir/', path_exists(self, filebrowser_view_override(self.createdir)), name="fb_createdir"),
        url(r'^upload/', path_exists(self, filebrowser_view_override(self.upload)), name="fb_upload"),
        url(r'^delete_confirm/$', file_exists(self, path_exists(self, filebrowser_view_override(self.delete_confirm))), name="fb_delete_confirm"),
        url(r'^delete/$', file_exists(self, path_exists(self, filebrowser_view_override(self.delete))), name="fb_delete"),
        url(r'^detail/$', file_exists(self, path_exists(self, filebrowser_view_override(self.detail))), name="fb_detail"),
        url(r'^version/$', file_exists(self, path_exists(self, filebrowser_view_override(self.version))), name="fb_version"),
        url(r'^upload_file/$', csrf_exempt(self._upload_file), name="fb_do_upload"),
    )
    return urlpatterns
Example #16
0
 def f(request):
     slug = request.META['HTTP_HOST'].split('.')[0]
     filebrowser_site.directory = "uploads/%s/" % slug
     return path_exists(filebrowser_site, filebrowser_view(getattr(globals()['filebrowser_site'], f_name)))(request)