OSDN Git Service

disable WYSIWYG mode in _FUCKIN IE!_
[feedblog/feedgenerator.git] / erbtemp / editentry.html.erb
1 <html>
2     <head>
3         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
4         <title><%= APPTITLE %></title>
5         <link rel="stylesheet" href="./erbtemp/stylesheet.css" type="text/css">
6         <script type="text/javascript" src="./jquery/jquery.js">
7         </script>
8         <script type="text/javascript" src="./wymeditor/jquery.wymeditor.min.js">
9         </script>
10         <script type="text/javascript">
11             if (window.ActiveXObject) {
12             } else {
13                 jQuery(function(){
14                     jQuery('#contenteditor').wymeditor({
15                         updateSelector: ".wymupdate",
16                         updateSelector: "input",
17                         iframeBasePath: "main_"
18                     });
19                 });
20             }
21             
22             function switchsubmit(form, action){
23                 document.getElementsByName("action").item(0).value = action;
24                 form.submit();
25             }
26         </script>
27     </head>
28     <body>
29         <br>
30         <%= menu %>
31         <br>
32         <div class="divstyle" style="width: <%= TABLEWIDTH %>px;">
33             <form action="<%= cgi.script_name %>" method="POST">
34                 <input type="hidden" name="target_filepath" value="<%= session["target_filepath"] %>"><% case params["action"]
35                 when "confirm" %>
36                 <input type="hidden" name="editid" value="<%= session["editid"] %>">
37                 <table align="center" style="width: <%= (TABLEWIDTH - 20) %>px;">
38                     <tbody>
39                         <tr>
40                             <td colspan="2" class="formheader">
41                                 ■ 入力内容を確認してください
42                             </td>
43                         </tr>
44                         <% db.transaction do
45                         entry = db["editentry"]
46                         entry.paramlist.each do |val| %>
47                         <tr style="display: <%= entry.display[val] %>;">
48                             <td class="formnavi" style="width: 140px;">
49                                 <%= entry.name[val] %>
50                             </td>
51                             <td class="forminput">
52                                 <input type="hidden" name="<%= val %>" value="<%= entry.send(val) %>"><% if val != "content" %><%= entry.send(val) %><% else %><%= entry.content_for_view %><% end %>
53                             </td>
54                         </tr><% end %>
55                         <% end %>
56                     </tbody>
57                 </table>
58                 <br>
59                 <input type="hidden" name="mode" value="editentry"><input type="hidden" name="action" value=""><input type="button" value="戻る" onclick="switchsubmit(this.form, 'back')"> <input type="button" value="確定" onclick="switchsubmit(this.form, 'exec')"><% when "exec" %>
60                 <table align="center" style="width: <%= (TABLEWIDTH - 20) %>px">
61                     <tbody>
62                         <tr>
63                             <td class="forminput" style="text-align: center;">
64                                 記事の編集が完了しました。
65                             </td>
66                         </tr>
67                     </tbody>
68                 </table>
69                 <br>
70                 <a href="<%= cgi.script_name %>">メニューに戻る</a>
71                 <% when "edit" %>
72                 <input type="hidden" name="editid" value="<%= session["editid"] %>">
73                 <table align="center" style="width: <%= (TABLEWIDTH - 20) %>px;">
74                     <tbody>
75                         <tr>
76                             <td colspan="2" class="formheader">
77                                 ■ 記事編集
78                                 <br>
79                             </td>
80                         </tr>
81                         <% db.transaction do
82                         entry = db["editentry"]
83                         entry.paramlist.each do |val| %>
84                         <tr style="display: <%= entry.display[val] %>;">
85                             <td class="formnavi" style="width: 140px;">
86                                 <%= entry.name[val] %>
87                             </td>
88                             <td class="forminput">
89                                 <% if val == "content" %>
90                                 <textarea name="<%= val %>" rows="10" style="width: 100%" id="contenteditor"><%= entry.content_for_generator %></textarea>
91                                 <% elsif val == "updated" %>
92                                 <input type="text" name="<%= val %>" value="<%= Time.now.iso8601 %>" style="width: 100%;"><% else %>
93                                 <input type="text" name="<%= val %>" value="<%= entry.send(val) %>" style="width: 100%;"><% end %>
94                             </td>
95                         </tr><% end %>
96                         <% end %>
97                     </tbody>
98                 </table>
99                 <br>
100                 <input type="hidden" name="mode" value="editentry"><input type="hidden" name="action" value="confirm"><input type="submit" value="確認"><% when "back" %>
101                 <input type="hidden" name="editid" value="<%= session["editid"] %>">
102                 <table align="center" style="width: <%= (TABLEWIDTH - 20) %>px;">
103                     <tbody>
104                         <tr>
105                             <td colspan="2" class="formheader">
106                                 ■ 記事内容
107                                 <br>
108                             </td>
109                         </tr>
110                         <% db.transaction do
111                         entry = db["editentry"]
112                         entry.paramlist.each do |val| %>
113                         <tr style="display: <%= entry.display[val] %>;">
114                             <td class="formnavi" style="width: 140px;">
115                                 <%= entry.name[val] %>
116                             </td>
117                             <td class="forminput">
118                                 <% if val == "content" %>
119                                 <textarea name="<%= val %>" rows="10" style="width: 100%" id="contenteditor"><%= entry.content_for_generator %></textarea>
120                                 <% else %>
121                                 <input type="text" name="<%= val %>" value="<%= entry.send(val) %>" style="width: 100%;"><% end %>
122                             </td>
123                         </tr><% end %>
124                         <% end %>
125                     </tbody>
126                 </table>
127                 <br>
128                 <input type="hidden" name="mode" value="editentry"><input type="hidden" name="action" value="confirm"><input type="submit" class="wymupdate" value="確認"><% else %>
129                 <% db.transaction do %>
130                 <table align="center" style="width: <%= (TABLEWIDTH - 20) %>px;">
131                     <tbody>
132                         <tr>
133                             <td class="formheader" colspan="3">
134                                 ■ 編集する記事を選択してください。
135                             </td>
136                         </tr>
137                         <tr>
138                             <td class="formheader">
139                                   
140                             </td>
141                             <td class="formheader" style="text-align: center;">
142                                 記事のタイトル
143                             </td>
144                             <td class="formheader" style="text-align: center;">
145                                 最終更新時間
146                             </td>
147                         </tr>
148                         <% db["entry"].each_with_index do |entry, i| %>
149                         <tr>
150                             <td class="forminput" style="width: 30px; text-align: center;">
151                                 <input type="radio" name="editid" value="<%= entry.send("entryid") %>">
152                             </td>
153                             <td class="forminput">
154                                 <%= entry.send("title") %>
155                             </td>
156                             <td class="forminput" style="width: 150px; text-align: center;">
157                                 <%= entry.send("published").gsub("+09:00", "").gsub("T", " ") %>
158                             </td>
159                         </tr>
160                         <% end %>
161                     </tbody>
162                 </table>
163                 <br>
164                 <% if db["entry"].length != 0 %>
165                 <input type="hidden" name="mode" value="editentry"><input type="hidden" name="action" value="edit"><input type="submit" value="編集"><% else %>
166                 編集対象となる記事が存在しません。
167                 <br>
168                 <br>
169                 <% end %>
170                 <% end %>
171                 <% end %>
172             </form>
173         </div>
174         <br>
175         <div class="divstyle" style="border: none;">
176             <%= APPVERSION %>
177         </div>
178     </body>
179 </html>