OSDN Git Service

更新日付を記録するようにした
authorkonekoneko <jbh03215@hotmail.co.jp>
Tue, 13 Nov 2012 14:53:25 +0000 (23:53 +0900)
committerkonekoneko <jbh03215@hotmail.co.jp>
Tue, 13 Nov 2012 14:53:25 +0000 (23:53 +0900)
パスワードを変更できるようにした

init.sql
profile.js
public/profile/edit.ejs
public/profile/list.ejs

index bc45162..9b510c5 100644 (file)
--- a/init.sql
+++ b/init.sql
@@ -17,5 +17,6 @@ create table list(name VARCHAR(64) NOT NULL,
        race VARCHAR(64),
        look TEXT,
        password VARCHAR(16),
+       lastmodified DATETIME,
        etc TEXT,
        PRIMARY KEY(name));
index 1a4a937..170ce9b 100644 (file)
@@ -239,6 +239,7 @@ function ProfileCollection()
                        race:data.race,\r
                        look:data.look,\r
                        password:data.password,\r
+                       lastmodified:new Date(),\r
                        etc:data.etc\r
                };\r
                async.waterfall([\r
@@ -264,6 +265,8 @@ function ProfileCollection()
                        weight:data.weight,\r
                        race:data.race,\r
                        look:data.look,\r
+                       password:data.password,\r
+                       lastmodified:new Date(),\r
                        etc:data.etc\r
                };\r
                async.waterfall([\r
index c975cb7..eeba9f8 100644 (file)
                                <td><input type="text" value="<%= list[0].name %>" name="name"/></td>\r
                        </tr>\r
                        <tr>\r
+                               <td>パスワード</td>\r
+                               <td><input type="text" value="<%=list[0].password %>" name="password"/></td>\r
+                       </tr>\r
+                       <tr>\r
                                <td>年齢</td>\r
                                <td><input type="text" value="<%= list[0].age %>" name="age"/></td>\r
                        </tr>\r
index 6184b85..f7b063d 100644 (file)
        <tr>\r
                <th>名前</th>\r
                <th>年齢</th>\r
+               <th>更新日時</th>\r
        </tr>\r
 <% for(var i=0; i<list.length; i++) {%>\r
        <tr>\r
                <td><a href="profile/detail?name=<%= encodeURIComponent(list[i].name) %>"><%= list[i].name %></a></td>\r
                <td><%= list[i].age %></td>\r
+               <td><%= list[i].lastmodified %></td>\r
        </tr>\r
 <% } %>\r
 </table>\r