From: zuber Date: Sat, 22 Aug 2009 22:08:52 +0000 (+0200) Subject: Merge branch 'master' of git@stigma.nowoczesnapolska.org.pl:platforma X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/275dc6c6f5c92630c9a1fca0f1830ba543cd18b7?ds=inline;hp=-c Merge branch 'master' of git@stigma.nowoczesnapolska.org.pl:platforma --- 275dc6c6f5c92630c9a1fca0f1830ba543cd18b7 diff --combined apps/explorer/views.py index 68fd1921,5134eed5..eeac7b65 --- a/apps/explorer/views.py +++ b/apps/explorer/views.py @@@ -3,8 -3,10 +3,10 @@@ import hg, urllib from django.utils import simplejson as json from django.views.generic.simple import direct_to_template + from django.conf import settings from django.http import HttpResponseRedirect + from django.contrib.auth.decorators import login_required from explorer import forms, models @@@ -39,30 -41,13 +41,30 @@@ def file_xml(request, path) }) -def file_html(request, path): - return direct_to_template(request, 'explorer/file_html.html', extra_context={ - 'object': html.transform(repo.get_file(path).data(), is_file=False), - 'hash': path, - 'image_folders_form': forms.ImageFoldersForm(), +# =============== +# = Panel views = +# =============== +def xmleditor_panel(request, path): + form = forms.BookForm() + text = repo.get_file(path).data() + + return direct_to_template(request, 'explorer/panels/xmleditor.html', extra_context={ + 'text': text, + }) + + +def gallery_panel(request, path): + return direct_to_template(request, 'explorer/panels/gallery.html', extra_context={ + 'form': forms.ImageFoldersForm(), }) - + + +def htmleditor_panel(request, path): + return direct_to_template(request, 'explorer/panels/htmleditor.html', extra_context={ + 'html': html.transform(repo.get_file(path).data(), is_file=False), + }) + + def folder_images(request, folder): return direct_to_template(request, 'explorer/folder_images.html', extra_context={ 'images': models.get_images_from_folder(folder), diff --combined project/static/css/master.css index 8b971142,e7dfb70b..5f567e00 --- a/project/static/css/master.css +++ b/project/static/css/master.css @@@ -4,10 -4,21 +4,21 @@@ body overflow: hidden; } - #breadcrumbs { - padding: 2px 10px; + #header { + position: relative; + padding: 2px 0.5em; background-color: #CDCDCD; - border-bottom: 1px solid #858585; + border-bottom: 1px solid black; + clear: both; + } + + #header #breadcrumbs { + + } + + #header #login_info { + position: absolute; + right: 1em; } ul { @@@ -74,40 -85,26 +85,40 @@@ label overflow-y: scroll; } -#whatever { - float: left; +/* ========== */ +/* = Panels = */ +/* ========== */ +.panel-wrap { + overflow: hidden; } -#images-wrap { -/* width: 0px;*/ - height: 480px; - overflow-y: scroll; - overflow-x: hidden; - background-color: #fff; +#left-panel-wrap { float: left; + width: 8px; } -#sidebar { - float: left; - width: 8px; + +/* Toolbars with select box to change panel contents*/ +.panel-toolbar { + height: 20px; + padding: 0 0 2px 0; + border-top: 1px solid #AAA; + border-bottom: 1px solid #AAA; + font-size: 12px; + line-height: 20px; + background-color: #DDD; + white-space: nowrap; overflow: hidden; } -#toggle-sidebar { +.panel-toolbar label { + display: block; + float: left; + margin: 0 10px 0 2px; +} + +/* Slider between panels */ +#slider { border-left: 1px solid #999; border-right: 1px solid #999; background-color: #DDD; @@@ -116,23 -113,36 +127,23 @@@ float: left; } -#toggle-sidebar:hover { +#slider:hover { background-color: #999; cursor: col-resize; } -#status-bar { - border-top: 1px solid #999; - background-color: #EEE; - padding: 2px 10px; -} - -.errorlist { - color: red; - margin: 0 20px 0 0; - padding: 0; - float: left; -} - -.errorlist:before { - content: ''; - clear: both; +/* ================= */ +/* = Gallery panel = */ +/* ================= */ +.images-wrap, .htmleditor { + overflow-x: hidden; + overflow-y: scroll; } -p { - margin: 0; -} -.image-box { - border-top: 1px solid #DDD; -} +/* ==================== */ +/* = XML Editor panel = */ +/* ==================== */ #toolbar { height: 48px; @@@ -205,3 -215,18 +216,18 @@@ color: #FFF; cursor: default; } + + + div.isection { + margin: 1em auto; + border: 1px solid black; + padding: 0.5em 2em; + background: #9f9ffa; + + width: 60%; + } + + div.isection p { + margin: 0.5em 1em; + } + diff --combined project/urls.py index cc433c05,d153f84d..1ba97d65 --- a/project/urls.py +++ b/project/urls.py @@@ -7,20 -7,20 +7,24 @@@ admin.autodiscover( urlpatterns = patterns('', - # Example: + # Explorer: url(r'^$', 'explorer.views.file_list', name='file_list'), url(r'^file/(?P[^/]+)/$', 'explorer.views.file_xml', name='file_xml'), - url(r'^html/(?P[^/]+)/$', 'explorer.views.file_html', name='file_html'), url(r'^images/(?P[^/]+)/$', 'explorer.views.folder_images', name='folder_image'), url(r'^images/$', 'explorer.views.folder_images', {'folder': '.'}, name='folder_image_ajax'), + # Editor panels + url(r'^editor/(?P[^/]+)/panels/xmleditor/$', 'explorer.views.xmleditor_panel', name='xmleditor_panel'), + url(r'^editor/(?P[^/]+)/panels/gallery/$', 'explorer.views.gallery_panel', name='gallery_panel'), + url(r'^editor/(?P[^/]+)/panels/htmleditor/$', 'explorer.views.htmleditor_panel', name='htmleditor_panel'), + # Admin panel url(r'^admin/doc/', include('django.contrib.admindocs.urls')), url(r'^admin/(.*)', admin.site.root), + + # Authorization + url(r'^accounts/login/$', 'django.contrib.auth.views.login', {'redirect_field_name': 'next_page'}), + url(r'^accounts/logout$', 'django.contrib.auth.views.logout', {'next_page': '/'}), # {'redirect_field_name': 'next_page'}), )