| author | ymh <ymh.work@gmail.com> |
| Mon, 18 Mar 2013 02:23:37 +0100 | |
| changeset 97 | f7d611f50e58 |
| parent 90 | fa7d68b9d8b0 |
| child 99 | 1aa1cf8702e6 |
| permissions | -rw-r--r-- |
| 71 | 1 |
<!doctype html> |
2 |
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" > |
|
|
76
523f0647513e
add the count of project by spaces, add pagination, update libraries and add some more unit tests.
ymh <ymh.work@gmail.com>
parents:
71
diff
changeset
|
3 |
<head> |
| 71 | 4 |
<title>Renkan</title> |
5 |
||
6 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
|
7 |
<meta charset="utf-8"/> |
|
8 |
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/> |
|
9 |
||
10 |
<link rel="shortcut icon" href="favicon.ico"/> |
|
| 81 | 11 |
<script src="../../lib/jquery.min.js" th:src="@{/static/lib/jquery.min.js}" ></script> |
12 |
<script src="../../lib/underscore-min.js" th:src="@{/static/lib/underscore-min.js}" ></script> |
|
13 |
<script src="../../js/main.js" th:src="@{/static/js/main.js}" ></script> |
|
| 71 | 14 |
|
|
97
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
15 |
<link href="../../static/css/style.css" rel="stylesheet" th:href="@{/static/css/style.css}"/> |
| 81 | 16 |
<link href="../../static/css/index.css" rel="stylesheet" th:href="@{/static/css/index.css}"/> |
|
76
523f0647513e
add the count of project by spaces, add pagination, update libraries and add some more unit tests.
ymh <ymh.work@gmail.com>
parents:
71
diff
changeset
|
17 |
</head> |
|
523f0647513e
add the count of project by spaces, add pagination, update libraries and add some more unit tests.
ymh <ymh.work@gmail.com>
parents:
71
diff
changeset
|
18 |
<body> |
|
97
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
19 |
<div id="container"> |
| 71 | 20 |
<div id="wrapper"> |
|
97
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
21 |
<h1><span th:text="#{renkanIndex.renkan_space}"><a href="renkanIndex.html" th:href="@{'/'}" id="home-link">Renkan Space</a></span>: <span th:text="${space.title}">Titre</span></h1> |
| 71 | 22 |
<div id="inner"> |
| 87 | 23 |
<div id="label" class="translate" th:text="#{renkanIndex.renkan_exp}">Create a Renkan</div> |
| 71 | 24 |
<form action="#" onsubmit="go2Title();return false;"> |
25 |
<input type="text" id="renkantitle" autofocus="autofocus" x-webkit-speech="x-webkit-speech"/> |
|
26 |
<button type="submit">OK</button> |
|
27 |
</form> |
|
28 |
</div> |
|
29 |
<h2 th:text="#{renkanIndex.project_list}">Project list</h2> |
|
| 87 | 30 |
<div th:include="fragment/paginationFragment :: paginationFragment" class="pagination-container"> |
31 |
<div> |
|
32 |
<a href="#?p.page=1"><<</a> |
|
33 |
<a href="#?p.page=3"><</a> |
|
34 |
<span>...</span> |
|
35 |
<a href="#?p.page=2">2</a> |
|
36 |
<a href="#?p.page=3">3</a> |
|
37 |
<span>4</span> |
|
38 |
<a href="#?p.page=5">5</a> |
|
39 |
<a href="#?p.page=6">6</a> |
|
40 |
<span>...</span> |
|
41 |
<a href="#?p.page=5">></a> |
|
42 |
<a href="#?p.page=7">>></a> |
|
43 |
</div> |
|
44 |
</div> |
|
| 71 | 45 |
<table> |
46 |
<thead> |
|
47 |
<tr> |
|
| 80 | 48 |
<th th:text="#{renkanIndex.project_name}">Name</th> |
49 |
<th th:text="#{renkanIndex.project_creation}">Creation</th> |
|
50 |
<th th:text="#{renkanIndex.project_edit}">Edit</th> |
|
| 86 | 51 |
<th th:text="#{renkanIndex.project_copy}">Copy</th> |
52 |
<th th:text="#{renkanIndex.project_delete}">Del.</th> |
|
| 81 | 53 |
<th th:text="#{renkanIndex.project_render}">View</th> |
| 71 | 54 |
</tr> |
55 |
</thead> |
|
56 |
<tbody> |
|
|
76
523f0647513e
add the count of project by spaces, add pagination, update libraries and add some more unit tests.
ymh <ymh.work@gmail.com>
parents:
71
diff
changeset
|
57 |
<tr th:each="project: ${page}"> |
| 71 | 58 |
<th th:text="${project.title}">title</th> |
59 |
<td th:text="${#dates.format(project.created, #messages.msg('date.format'))}">date</td> |
|
| 81 | 60 |
<td><a href="#" th:href="@{'/p/'+${project.id}(cowebkey=${project.getKey(2)})}" th:text="#{renkanIndex.project_edit_link}">Edit project</a></td> |
| 86 | 61 |
<td><a href="#" th:text="#{renkanIndex.project_copy_link}" th:attr="data-project_id=${project.id}" class="copy_project">Copy project</a></td> |
62 |
<td><a href="#" th:text="#{renkanIndex.project_delete_link}" th:attr="data-project_id=${project.id},data-project_title=${project.title}" class="delete_project">Delete project</a></td> |
|
| 81 | 63 |
<td><a href="#" th:href="@{'/p/pub/'+${project.id}(cowebkey=${project.getKey(1)})}" th:text="#{renkanIndex.project_render_link}">View project</a></td> |
| 71 | 64 |
</tr> |
65 |
</tbody> |
|
66 |
</table> |
|
67 |
</div> |
|
|
97
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
68 |
<div id="footer" th:include="fragment/pageFragment :: footerFragment"> |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
69 |
<div id="version">© <span class="version-date">2013</span> <a href="http://www.iri.centrepompidou.fr" target="_blanck">IRI</a> - Version <span class="version-version">0.0</span></div> |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
70 |
</div> |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
71 |
</div> |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
72 |
<script th:inline="javascript" > |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
73 |
/*<![CDATA[*/ |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
74 |
|
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
75 |
function go2Title() |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
76 |
{ |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
77 |
var renkantitle = $("#renkantitle").val(); |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
78 |
if(renkantitle.length == 0) { |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
79 |
var alert_message = /*[[#{renkanIndex.js.empty_name_error}]]*/"Please enter a title"; |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
80 |
alert(alert_message); |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
81 |
return false; |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
82 |
} |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
83 |
|
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
84 |
new_renkan = { |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
85 |
title: renkantitle, |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
86 |
description: "(empty description)", |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
87 |
uri: null, |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
88 |
space_id: /*[[${space.id}]]*/"_", |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
89 |
}; |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
90 |
|
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
91 |
var post_url = /*[[@{/rest/projects/}]]*/"/rest/projects/"; |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
92 |
$.ajax(post_url, { |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
93 |
data:JSON.stringify(new_renkan), |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
94 |
type: "POST", |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
95 |
dataType: "json", |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
96 |
contentType: "application/json; charset=UTF-8" |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
97 |
}).done(function(project){ |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
98 |
window.location.reload(); |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
99 |
}); |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
100 |
|
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
101 |
} |
| 71 | 102 |
|
|
97
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
103 |
function copyProject(project_id) |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
104 |
{ |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
105 |
var post_url = /*[[@{/p/copy}]]*/"#"; |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
106 |
$.post(post_url, {"project_id": project_id}) |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
107 |
.done(function(p){ |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
108 |
window.location.reload(); |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
109 |
}); |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
110 |
} |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
111 |
|
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
112 |
function deleteProject(project_id, project_title) |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
113 |
{ |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
114 |
var message = /*[[#{renkanIndex.project_delete_confirm}]]*/"Delete project \"<%= title %>\""; |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
115 |
if(confirm(_.template(message, {title: project_title}))) { |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
116 |
var delete_url = /*[[@{/rest/projects}]]*/"#"; |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
117 |
$.ajax(delete_url+"/"+project_id, { |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
118 |
type: "DELETE" |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
119 |
}).done(function(){ |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
120 |
window.location.reload(); |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
121 |
}); |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
122 |
} |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
123 |
} |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
124 |
|
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
125 |
$(function(){ |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
126 |
$(".copy_project").click(function(event) { |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
127 |
copyProject($(event.target).data("project_id")); |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
128 |
}); |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
129 |
$(".delete_project").click(function(event) { |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
130 |
deleteProject($(event.target).data("project_id"), $(event.target).data("project_title")); |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
131 |
}); |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
132 |
}); |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
133 |
|
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
134 |
/*]]>*/ |
|
f7d611f50e58
add version str + improver css + new version
ymh <ymh.work@gmail.com>
parents:
90
diff
changeset
|
135 |
</script> |
|
76
523f0647513e
add the count of project by spaces, add pagination, update libraries and add some more unit tests.
ymh <ymh.work@gmail.com>
parents:
71
diff
changeset
|
136 |
</body> |
| 71 | 137 |
</html> |