def document_gallery(request, directory):
try:
base_dir = os.path.join(settings.MEDIA_ROOT, settings.FILEBROWSER_DIRECTORY, directory)
- print base_dir
images = ['%s%s%s/%s' % (settings.MEDIA_URL, settings.FILEBROWSER_DIRECTORY, directory, f) for f in os.listdir(base_dir) if os.path.splitext(f)[1].lower() in ('.jpg', '.jpeg', '.png')]
return HttpResponse(json.dumps(images))
except (IndexError, OSError), e:
def open_page(self, title):
if title not in self:
- print 'whatever', list(self.all_pages())
raise DocumentNotFound()
try:
name: $('#document-name').html(),
text: metaComment + editor.getCode(),
revision: $('#document-revision').html(),
- author: 'annonymous',
+ author: $('#username').html() || 'annonymous',
comment: $('#komentarz').val()
};
<div id="header">
<div id="tools" style="float: right;">
{% if user.is_authenticated %}
- Zalogowany jako {{ user }} | <a href="{% url logout %}">Wyloguj</a> |
+ Zalogowany jako <span id="username">{{ user }}</span> | <a href="{% url logout %}">Wyloguj</a> |
{% else %}
<a href="{% url login %}?next={{ request.path }}">Zaloguj się</a> |
{% endif %}