from django.views.generic.simple import direct_to_template
from django.conf import settings
--from django.http import HttpResponseRedirect
++from django.http import HttpResponseRedirect, HttpResponse
from django.contrib.auth.decorators import login_required
from explorer import forms, models
if request.method == 'POST':
form = forms.BookForm(request.POST)
if form.is_valid():
-- repo.add_file(path, form.cleaned_data['text'])
++ # save the changes to a local branch
++# repo.write_lock()
++ print request.user
++# repo.switch_to_branch(request.user.name)
++# repo.add_file(path, form.cleaned_data['text'])
# add references to comment
issues = _get_issues_for_file(path)
commit_message = _add_references(form.cleaned_data['commit_message'], issues)
print 'Commiting with: ' + commit_message
-- repo.commit(message=commit_message, user=form.cleaned_data['user'])
-- return HttpResponseRedirect(request.get_full_path())
++# repo.commit(message=commit_message, user=form.cleaned_data['user'])
++ return HttpResponse( json.dumps({'message': commit_message}) )
else:
form = forms.BookForm()
form.fields['text'].initial = repo.get_file(path).data()
body {
margin: 0;
-- font: 14px Helvetica, Verdana, sans-serif;
++ font: 10pt Helvetica, Verdana, sans-serif;
overflow: hidden;
}
#header {
position: relative;
-- padding: 2px 0.5em;
++ padding: 0.2em 0.5em;
background-color: #CDCDCD;
border-bottom: 1px solid black;
-- clear: both;
++ height: 1.8em;
++ line-height: 1.8em;
++ vertical-align: center;
}
#header #breadcrumbs {
--
}
--#header #login_info {
++#header-right-toolbar {
position: absolute;
right: 1em;
}
++#header button {
++ vertical-align: center;
++}
++
ul {
margin: 20px;
padding: 0;
#panels {
position: absolute;
-- bottom: 0px; left: 0px; right: 0px; top: 50px;
++ bottom: 0px; left: 0px; right: 0px; top: 1em;
}
.panel-wrap {
<title>{% block title %}Platforma Redakcyjna{% block subtitle %}{% endblock subtitle %}{% endblock title%}</title>
<link rel="stylesheet" href="/static/css/master.css" type="text/css" />
<script src="/static/js/jquery.js" type="text/javascript" charset="utf-8"></script>
-- <script src="/static/js/jquery.logging.js" type="text/javascript" charset="utf-8"></script>
++ <script src="/static/js/jquery.logging.js" type="text/javascript" charset="utf-8"></script>
{% block extrahead %}
{% endblock %}
</head>
<body id="{% block bodyid %}base{% endblock %}">
<div id="header">
-- <span id="breadcrumbs">{% block breadcrumbs %}Platforma Redakcyjna{% endblock breadcrumbs %}</span>
-- <span id="login_info">{% include "registration/head_login.html" %}</span>
++ <span id="breadcrumbs">{% block breadcrumbs %}Platforma Redakcyjna{% endblock breadcrumbs %}</span>
++ <span id="header-right-toolbar">
++ {% block header-toolbar %}{% endblock %}
++ <span id="login_info">{% include "registration/head_login.html" %}</span>
++ </span>
</div>
-- {% block maincontent %}
--
-- {% endblock %}
++ {% block maincontent %} {% endblock %}
</body>
</html>
<script src="/static/js/jquery.wtooltip.js" type="text/javascript" charset="utf-8"></script>
<script src="/static/js/jquery.hpanel.js" type="text/javascript" charset="utf-8"></script>
<script src="/static/js/panels.js" type="text/javascript" charset="utf-8"></script>
++ <script src="/static/js/save-commit.js" type="text/javascript" charset="utf-8"></script>
{% endblock extrahead %}
{% block breadcrumbs %}<a href="{% url file_list %}">Platforma Redakcyjna</a> ❯ plik {{ hash }}{% endblock breadcrumbs %}
++{% block header-toolbar %}
++ <button type="button" class="toolbar-button" id="toolbar-button-save">Zapisz</button>
++{% endblock %}
{% block maincontent %}
<div id="panels">
<div id="left-panel-wrap" class="panel-wrap">
<strong class="change-notification" style="display: none">Zmieniono!</strong>
</div>
<div id="left-panel-content" class="panel-content"></div>
-- <button class="panel-slider" id="slider01"> </button>
++ <button type="button" class="panel-slider" id="slider01"> </button>
</div>
<div id="right-panel-wrap" class="panel-wrap last-panel">
<div id="right-panel-toolbar" class="panel-toolbar">