--- a/src/hdalab/templates/profile_home.html Fri Jul 18 12:57:31 2014 +0200
+++ b/src/hdalab/templates/profile_home.html Fri Jul 18 13:29:53 2014 +0200
@@ -29,7 +29,7 @@
<td>{% thumbnail r.image 100x100 as thumb %}<img src="{{ thumb.url }}" width="{{ thumb.width }}" height="{{ thumb.height }}" /></td>
<td>
<a title="Edit renkan" href="{% url 'renkan_edit' %}?rk_id={{ r.rk_id }}" class="renkan-basic-action"><span class="ui-icon ui-icon-pencil"></span></a>
- <a title="View renkan" href="#" class="renkan-basic-action"><span class="ui-icon ui-icon-eye"></span></a>
+ <a title="View renkan" href="{% url 'renkan_view' %}?rk_id={{ r.rk_id }}" class="renkan-basic-action"><span class="ui-icon ui-icon-eye"></span></a>
<a title="Copy renkan" href="{% url 'renkan_copy' rk_id=r.rk_id %}" class="renkan-basic-action" onclick="return confirm('{% trans "Are you sure you want to copy this renkan ?" %}');" ><span class="ui-icon ui-icon-copy"></span></a>
<a title="Remove renkan" href="{% url 'renkan_delete' rk_id=r.rk_id %}" class="renkan-basic-action" onclick="return confirm('{% trans "Are you sure you want to delete this renkan ? You cannot undo this action." %}');" ><span class="ui-icon ui-icon-trash"></span></a>
</td>
--- a/src/hdalab/templates/renkan_edit.html Fri Jul 18 12:57:31 2014 +0200
+++ b/src/hdalab/templates/renkan_edit.html Fri Jul 18 13:29:53 2014 +0200
@@ -33,7 +33,7 @@
<script src="{% static 'hdalab/lib/paper.js' %}"></script>
<script type="text/javascript">
var require = {
- baseUrl: "{% static 'hdalab/ntm/' %}"
+ baseUrl: "{% static 'hdalab/lib/' %}"
};
</script>
<script src="{% static 'hdalab/lib/require.js' %}"></script>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hdalab/templates/renkan_view.html Fri Jul 18 13:29:53 2014 +0200
@@ -0,0 +1,63 @@
+{% extends "base.html" %}
+{% load static %}
+
+{% block title %}{{block.super}} > {{datasheet.title}}{% endblock %}
+
+{% block css_import %}
+{{block.super}}
+ <link rel="stylesheet" type="text/css" href="{% static 'hdalab/css/additionnal_renkan.css' %}" />
+ <link rel="stylesheet" type="text/css" href="{% static 'hdalab/lib/renkan/css/renkan.css' %}" />
+ <style type="text/css">
+ .rnk-wrapper, .rnk-container{
+ width: 100%;
+ }
+ .rnk-container{
+ height: 100%;
+ width: 100%;
+ }
+ .rnk-wrapper{
+ height: 100%;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ }
+ </style>
+{% endblock %}
+
+{% block js_import %}
+{{block.super}}
+ <script src="{% static 'hdalab/lib/jquery.mousewheel.min.js' %}"></script>
+ <script src="{% static 'hdalab/lib/underscore-min.js' %}"></script>
+ <script src="{% static 'hdalab/lib/backbone.js' %}"></script>
+ <script src="{% static 'hdalab/lib/backbone-relational.js' %}"></script>
+ <script src="{% static 'hdalab/lib/paper.js' %}"></script>
+ <script type="text/javascript">
+ var require = {
+ baseUrl: "{% static 'hdalab/lib/' %}"
+ };
+ </script>
+ <script src="{% static 'hdalab/lib/require.js' %}"></script>
+ <script src="{% static 'hdalab/lib/renkan/renkan.js' %}"></script>
+ <script type="text/javascript">
+
+ function startRenkan(){
+ var _renkan = new Rkns.Renkan({
+ static_url : "{% static 'hdalab/lib/renkan/' %}",
+ editor_mode: false,
+ show_bins: false,
+ language: "fr"
+ });
+ Rkns.jsonIO(_renkan, {
+ url: "{% url 'renkan_get_put' %}" + window.location.search
+ });
+ };
+ </script>
+{% endblock %}
+
+{% block main_content %}
+<div class="rnk-wrapper">
+ <div class="rnk-container">
+ <div id="renkan"></div>
+ </div>
+</div>
+{% endblock %}
\ No newline at end of file
--- a/src/hdalab/urls.py Fri Jul 18 12:57:31 2014 +0200
+++ b/src/hdalab/urls.py Fri Jul 18 13:29:53 2014 +0200
@@ -33,6 +33,7 @@
url(r'^renkan/edit/$', RenkanEdit.as_view(), name='renkan_edit'),
url(r'^renkan/getput/$', RenkanGetPut.as_view(), name='renkan_get_put'),
+ url(r'^renkan/view/$', TemplateView.as_view(template_name="renkan_view.html"), name='renkan_view'),
url(r'^renkan/copy/(?P<rk_id>.*)$', RenkanCopy.as_view(), name='renkan_copy'),
url(r'^renkan/delete/(?P<rk_id>.*)$', RenkanDelete.as_view(), name='renkan_delete'),
url(r'^profile/$', ProfileHome.as_view(), name='profile_home'),
--- a/src/hdalab/views/renkan.py Fri Jul 18 12:57:31 2014 +0200
+++ b/src/hdalab/views/renkan.py Fri Jul 18 13:29:53 2014 +0200
@@ -177,6 +177,9 @@
if rk.owner!=request.user:
return HttpResponseBadRequest("You are not allowed to edit this renkan")
rk.content = request.body
+ data = json.loads(request.body)
+ if "title" in data:
+ rk.title = data["title"]
rk.save()
return HttpResponse("OK")