-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from scream4ik/master
several improvements
- Loading branch information
Showing
29 changed files
with
1,157 additions
and
717 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,4 @@ dist/ | |
django_media_manager.egg-info | ||
example/example/local_settings.py | ||
.DS_Store | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
default_app_config = "filebrowser.apps.FilebrowserAppConfig" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
from django.apps import AppConfig | ||
from django.views.decorators.cache import never_cache | ||
from django.core.urlresolvers import reverse | ||
from django.utils.translation import ugettext as _ | ||
|
||
from filebrowser.conf import fb_settings | ||
|
||
|
||
class FilebrowserAppConfig(AppConfig): | ||
name = 'filebrowser' | ||
|
||
def ready(self): | ||
from django.contrib import admin | ||
from django.contrib.admin import sites | ||
|
||
class FilebrowserAdminSite(admin.AdminSite): | ||
@never_cache | ||
def index(self, request, extra_context=None): | ||
resp = super(FilebrowserAdminSite, self).index(request, | ||
extra_context) | ||
app_dict = { | ||
'app_url': reverse('fb_browse'), | ||
'models': [ | ||
{ | ||
'admin_url': reverse('fb_browse'), | ||
'name': 'Browse', | ||
'add_url': None | ||
}, | ||
{ | ||
'admin_url': reverse('fb_mkdir'), | ||
'name': _('New Folder'), | ||
'add_url': None | ||
}, | ||
{ | ||
'admin_url': reverse('fb_upload'), | ||
'name': _('Upload'), | ||
'add_url': None | ||
} | ||
], | ||
'has_module_perms': True, | ||
'name': _('Filebrowser'), | ||
'app_label': 'filebrowser' | ||
} | ||
resp.context_data['app_list'].append(app_dict) | ||
return resp | ||
|
||
if fb_settings.SHOW_AT_ADMIN_PANEL: | ||
fb = FilebrowserAdminSite() | ||
admin.site = fb | ||
sites.site = fb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.