server/src/main/webapp/WEB-INF/templates/renkanIndex.html
author veltr
Fri, 15 Mar 2013 12:54:36 +0100
changeset 81 555a094e2000
parent 76 523f0647513e
child 87 6c810f746837
permissions -rw-r--r--
Changed CSS
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
51
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
<!doctype html>
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
     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
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
        <title>Renkan</title>
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
        <meta charset="utf-8"/>
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
        <link rel="shortcut icon" href="favicon.ico"/>
81
555a094e2000 Changed CSS
veltr
parents: 76
diff changeset
    11
        <script src="../../lib/jquery.min.js" th:src="@{/static/lib/jquery.min.js}" ></script>
555a094e2000 Changed CSS
veltr
parents: 76
diff changeset
    12
        <script src="../../lib/underscore-min.js" th:src="@{/static/lib/underscore-min.js}" ></script>
555a094e2000 Changed CSS
veltr
parents: 76
diff changeset
    13
        <script src="../../js/main.js" th:src="@{/static/js/main.js}" ></script>
51
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
81
555a094e2000 Changed CSS
veltr
parents: 76
diff changeset
    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
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
        <div id="wrapper">
81
555a094e2000 Changed CSS
veltr
parents: 76
diff changeset
    19
        	<h1 th:text="#{renkanIndex.renkan_spaces}">Renkan Spaces</h1>
51
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
            <div id="inner">
71
9af0874ce43f First version of space level.
ymh <ymh.work@gmail.com>
parents: 51
diff changeset
    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
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    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
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
                    <button type="submit">OK</button>
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    26
                </form>
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
            </div>
71
9af0874ce43f First version of space level.
ymh <ymh.work@gmail.com>
parents: 51
diff changeset
    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
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    30
            <table>
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    31
              <thead>
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    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
555a094e2000 Changed CSS
veltr
parents: 76
diff changeset
    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
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    37
                </tr>
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    38
              </thead>
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    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
9af0874ce43f First version of space level.
ymh <ymh.work@gmail.com>
parents: 51
diff changeset
    41
                  <th th:text="${space.title}">title</th>
9af0874ce43f First version of space level.
ymh <ymh.work@gmail.com>
parents: 51
diff changeset
    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
9af0874ce43f First version of space level.
ymh <ymh.work@gmail.com>
parents: 51
diff changeset
    44
                  <td><a href="#" th:href="@{'/s/'+${space.id}}" th:text="#{renkanIndex.space_open_link}">Open space</a></td>
51
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    45
                </tr>
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    46
              </tbody>
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    47
            </table>            
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    48
        </div>
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    49
        <script th:inline="javascript" >
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    50
        /*<![CDATA[*/
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    51
      
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    52
            function go2Title()
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    53
            {
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    54
                var renkantitle = $("#renkantitle").val();
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    55
                if(renkantitle.length == 0) {
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    56
                	var alert_message = /*[[#{renkanIndex.js.empty_name_error}]]*/"Please enter a title"; 
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    57
                	alert(alert_message);
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    58
                	return false;
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    59
                }
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    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
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    62
                	title: renkantitle,
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    63
                	description: "(empty description)",
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    64
                	uri: null
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    65
                };
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    66
                
71
9af0874ce43f First version of space level.
ymh <ymh.work@gmail.com>
parents: 51
diff changeset
    67
                var post_url = /*[[@{/rest/spaces/}]]*/"/rest/spaces/"; 
51
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    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
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    70
                    type: "POST",
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    71
                    dataType: "json",
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    72
                    contentType: "application/json; charset=UTF-8"                    
71
9af0874ce43f First version of space level.
ymh <ymh.work@gmail.com>
parents: 51
diff changeset
    73
                }).done(function(space){
9af0874ce43f First version of space level.
ymh <ymh.work@gmail.com>
parents: 51
diff changeset
    74
                	var template_url = /*[[@{'/s/<%=space_id%>'}]]*/"s/<%=space_id%>";
9af0874ce43f First version of space level.
ymh <ymh.work@gmail.com>
parents: 51
diff changeset
    75
                	window.location = _.template(template_url, {space_id: space.id});
51
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    76
                });
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    77
                
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    78
                //? window.location = "p/" + renkantitle : alert(/*[[#{renkanIndex.js.empty_name_error}]]*/"Please enter a name");
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    79
            }
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    80
 
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    81
        /*]]>*/
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    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
3247fccfbd3f update on renkan
ymh <ymh.work@gmail.com>
parents:
diff changeset
    84
</html>