| author | veltr |
| Fri, 15 Mar 2013 12:54:36 +0100 | |
| changeset 81 | 555a094e2000 |
| parent 80 | 5295e118320b |
| child 86 | 0fe9045d25b7 |
| 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 |
|
| 81 | 15 |
<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
|
16 |
</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
|
17 |
<body> |
| 71 | 18 |
<div id="wrapper"> |
| 81 | 19 |
<h1><span th:text="#{renkanIndex.renkan_space}">Renkan Space</span>: <span th:text="${space.title}">Titre</span></h1> |
| 71 | 20 |
<div id="inner"> |
21 |
<div id="button" onclick="go2Random()" class="translate" th:utext="#{renkanIndex.new_renkan}">New Renkan</div> |
|
|
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
|
22 |
<div id="label" class="translate" th:text="#{renkanIndex.renkan_exp}">Create a Renkan with the title</div> |
| 71 | 23 |
<form action="#" onsubmit="go2Title();return false;"> |
24 |
<input type="text" id="renkantitle" autofocus="autofocus" x-webkit-speech="x-webkit-speech"/> |
|
25 |
<button type="submit">OK</button> |
|
26 |
</form> |
|
27 |
</div> |
|
28 |
<h2 th:text="#{renkanIndex.project_list}">Project list</h2> |
|
|
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
|
29 |
<div th:include="fragment/paginationFragment :: paginationFragment"></div> |
| 71 | 30 |
<table> |
31 |
<thead> |
|
32 |
<tr> |
|
| 80 | 33 |
<th th:text="#{renkanIndex.project_name}">Name</th> |
34 |
<th th:text="#{renkanIndex.project_creation}">Creation</th> |
|
35 |
<th th:text="#{renkanIndex.project_edit}">Edit</th> |
|
| 81 | 36 |
<th th:text="#{renkanIndex.project_render}">View</th> |
| 71 | 37 |
</tr> |
38 |
</thead> |
|
39 |
<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
|
40 |
<tr th:each="project: ${page}"> |
| 71 | 41 |
<th th:text="${project.title}">title</th> |
42 |
<td th:text="${#dates.format(project.created, #messages.msg('date.format'))}">date</td> |
|
| 81 | 43 |
<td><a href="#" th:href="@{'/p/'+${project.id}(cowebkey=${project.getKey(2)})}" th:text="#{renkanIndex.project_edit_link}">Edit project</a></td> |
44 |
<td><a href="#" th:href="@{'/p/pub/'+${project.id}(cowebkey=${project.getKey(1)})}" th:text="#{renkanIndex.project_render_link}">View project</a></td> |
|
| 71 | 45 |
</tr> |
46 |
</tbody> |
|
47 |
</table> |
|
48 |
</div> |
|
49 |
<script th:inline="javascript" > |
|
50 |
/*<![CDATA[*/ |
|
51 |
|
|
52 |
function go2Title() |
|
53 |
{ |
|
54 |
var renkantitle = $("#renkantitle").val(); |
|
55 |
if(renkantitle.length == 0) { |
|
56 |
var alert_message = /*[[#{renkanIndex.js.empty_name_error}]]*/"Please enter a title"; |
|
57 |
alert(alert_message); |
|
58 |
return false; |
|
59 |
} |
|
60 |
|
|
61 |
new_renkan = { |
|
62 |
title: renkantitle, |
|
63 |
description: "(empty description)", |
|
64 |
uri: null, |
|
65 |
space_id: /*[[${space.id}]]*/"_", |
|
66 |
}; |
|
67 |
|
|
68 |
var post_url = /*[[@{/rest/projects/}]]*/"/rest/projects/"; |
|
69 |
$.ajax(post_url, { |
|
70 |
data:JSON.stringify(new_renkan), |
|
71 |
type: "POST", |
|
72 |
dataType: "json", |
|
73 |
contentType: "application/json; charset=UTF-8" |
|
74 |
}).done(function(project){ |
|
75 |
var template_url = /*[[@{'/p/<%=project_id%>'(cowebkey='')}]]*/"p/<%=project_id%>?cowebkey=<%=project_key%>"; |
|
76 |
window.location = _.template(template_url+'<%=project_key%>', {project_id: project.id, project_key: project.key}); |
|
77 |
}); |
|
78 |
|
|
79 |
//? window.location = "p/" + renkantitle : alert(/*[[#{renkanIndex.js.empty_name_error}]]*/"Please enter a name"); |
|
80 |
} |
|
81 |
|
|
82 |
/*]]>*/ |
|
83 |
</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
|
84 |
</body> |
| 71 | 85 |
</html> |