| author | veltr |
| Fri, 15 Mar 2013 12:54:36 +0100 | |
| changeset 81 | 555a094e2000 |
| parent 76 | 523f0647513e |
| child 87 | 6c810f746837 |
| permissions | -rw-r--r-- |
| 51 | 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> |
| 51 | 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> |
|
| 51 | 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> |
| 51 | 18 |
<div id="wrapper"> |
| 81 | 19 |
<h1 th:text="#{renkanIndex.renkan_spaces}">Renkan Spaces</h1> |
| 51 | 20 |
<div id="inner"> |
| 71 | 21 |
<div id="button" onclick="go2Random()" class="translate" th:utext="#{renkanIndex.new_space}">New Space</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.space_exp}">Create a Space with the title</div> |
| 51 | 23 |
<form action="#" onsubmit="go2Title();return false;"> |
|
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
|
24 |
<input type="text" id="renkantitle" autofocus="autofocus"/> |
| 51 | 25 |
<button type="submit">OK</button> |
26 |
</form> |
|
27 |
</div> |
|
| 71 | 28 |
<h2 th:text="#{renkanIndex.space_list}">Space 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> |
| 51 | 30 |
<table> |
31 |
<thead> |
|
32 |
<tr> |
|
|
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
|
33 |
<th th:text="#{renkanIndex.space_name}">Name</th> |
|
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
|
34 |
<th th:text="#{renkanIndex.space_creation}">Creation</th> |
| 81 | 35 |
<th th:text="#{renkanIndex.space_proj_count}">Project count</th> |
|
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
|
36 |
<th th:text="#{renkanIndex.space_open}">Edit</th> |
| 51 | 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="space: ${page.content}"> |
| 71 | 41 |
<th th:text="${space.title}">title</th> |
42 |
<td th:text="${#dates.format(space.created, #messages.msg('date.format'))}">date</td> |
|
|
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
|
43 |
<td th:text="${#maps.containsKey(projectsCount, space.id)}? ${projectsCount[space.id]} : 0">nb. proj</td> |
| 71 | 44 |
<td><a href="#" th:href="@{'/s/'+${space.id}}" th:text="#{renkanIndex.space_open_link}">Open space</a></td> |
| 51 | 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 |
|
|
|
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
|
61 |
new_space = { |
| 51 | 62 |
title: renkantitle, |
63 |
description: "(empty description)", |
|
64 |
uri: null |
|
65 |
}; |
|
66 |
|
|
| 71 | 67 |
var post_url = /*[[@{/rest/spaces/}]]*/"/rest/spaces/"; |
| 51 | 68 |
$.ajax(post_url, { |
|
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
|
69 |
data:JSON.stringify(new_space), |
| 51 | 70 |
type: "POST", |
71 |
dataType: "json", |
|
72 |
contentType: "application/json; charset=UTF-8" |
|
| 71 | 73 |
}).done(function(space){ |
74 |
var template_url = /*[[@{'/s/<%=space_id%>'}]]*/"s/<%=space_id%>"; |
|
75 |
window.location = _.template(template_url, {space_id: space.id}); |
|
| 51 | 76 |
}); |
77 |
|
|
78 |
//? window.location = "p/" + renkantitle : alert(/*[[#{renkanIndex.js.empty_name_error}]]*/"Please enter a name"); |
|
79 |
} |
|
80 |
|
|
81 |
/*]]>*/ |
|
82 |
</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
|
83 |
</body> |
| 51 | 84 |
</html> |