OSDN Git Service

- Fix plugin bug (add param "mode")
[feedblog/feedgenerator.git] / erbtemp / filemanager.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">
7             function switchsubmit(form, action, arg){
8                 document.getElementsByName("action").item(0).value = action;
9                 document.getElementsByName("arg").item(0).value = arg;
10                 document.getElementById(form).submit();
11             }
12             
13             function checkall(formid, flag){
14                 var form = document.getElementById(formid);
15                 for (i = 0; i < form.length; i++) {
16                     if (form.elements[i].type == "checkbox") {
17                         form.elements[i].checked = flag;
18                     }
19                 }
20             }
21         </script>
22     </head>
23     <body>
24         <div class="divstyle" style="width: <%= TABLEWIDTH %>px;">
25             <form id="fileform" action="<%= cgi.script_name %>" method="POST" enctype="multipart/form-data">
26                 <% unless session["info"] == "" %>
27                 <div class="divstyle" align="center" style="margin-bottom: 4px;">
28                     <%= session["info"] %>
29                 </div>
30                 <% end %>
31                 <% unless session["error"] == "" %>
32                 <div class="divstyle" align="center" style="color: #ff0000; margin-bottom: 4px;">
33                     <%= session["error"] %>
34                 </div>
35                 <% end %>
36                 <div class="divstyle" align="center">
37                     アップロードするファイルを選択してください。&nbsp;(アップロード上限サイズ : <%= (UPLOADLIMIT / 1024 / 1024 ) %>MB)
38                 </div>
39                 <br>
40                 <table align="center">
41                     <tbody>
42                         <tr>
43                             <td>
44                             </td>
45                             <td>
46                                 <input type="file" name="updata">
47                             </td>
48                         </tr>
49                         <tr>
50                             <td colspan="2" style="text-align: center;">
51                                 <input type="button" value="アップロード" onclick="javascript:switchsubmit('fileform', 'upload', '')">
52                             </td>
53                         </tr>
54                     </tbody>
55                 </table>
56                 <br>
57                 <div class="divstyle" align="center">
58                     現在のディレクトリ : <span style="font-weight: bold;">/<a href="javascript:switchsubmit('fileform', 'cd_abs', '0')">root</a>/<% session["relpath_list"].split("/").each_with_index { |rp, i| %><a href="javascript:switchsubmit('fileform', 'cd_abs', '<%= (i + 1) %>')"><%= rp %></a>/<% } %></span>&nbsp;[<a href="javascript:switchsubmit('fileform', 'refresh', '')">更新</a>]
59                 </div>
60                 <br>
61                 <input type="text" name="dirname">&nbsp;<input type="button" value="フォルダ作成" onclick="javascript:switchsubmit('fileform', 'mkdir', '')">
62                 <br>
63                 <br>
64                 <input type="button" value="全選択" onclick="checkall('fileform', true)">&nbsp;<input type="button" value="全解除" onclick="checkall('fileform', false)">&nbsp;<input type="button" value="マークしたファイルを削除" onclick="javascript:switchsubmit('fileform', 'delete', '')">
65                 <br>
66                 <br>
67                 <table align="center" style="width: 90%">
68                     <tbody>
69                         <tr>
70                             <td class="formnavi" style="text-align: center; padding: 2px;">
71                                 削除
72                             </td>
73                             <td class="formnavi" style="text-align: center; padding: 2px;">
74                                 ファイル名
75                             </td>
76                             <td class="formnavi" style="text-align: center; padding: 2px;">
77                                 ファイルタイプ
78                             </td>
79                             <td class="formnavi" style="text-align: center; padding: 2px;">
80                                 ファイルサイズ
81                             </td>
82                             <td class="formnavi" style="text-align: center; padding: 2px;">
83                                 最終更新時間
84                             </td>
85                         </tr>
86                         <% unless IMGPATH == session["pwd"] %>
87                         <tr>
88                             <td class="formnavi" style="text-align: center; padding: 2px;">
89                                 &nbsp;
90                             </td>
91                             <td class="forminput" style="text-align: center; padding: 2px;">
92                                 <span style="font-weight: bold;">[ <a href="javascript:switchsubmit('fileform', 'cd', '..')">Parent Directory</a>&nbsp;]</span>
93                             </td>
94                             <td class="forminput" style="text-align: center; padding: 2px;">
95                                 -
96                             </td>
97                             <td class="forminput" style="text-align: center; padding: 2px;">
98                                 -
99                             </td>
100                             <td class="forminput" style="text-align: center; padding: 2px;">
101                                 -
102                             </td>
103                         </tr>
104                         <% end %>
105                         <% session["filelist"].each do |fname| %>
106                         <% if session["fileinfo"][fname][:ftype] == "directory" %>
107                         <tr>
108                             <td class="formnavi" style="text-align: center; padding: 2px;">
109                                 <input type="checkbox" name="filename_<%= fname %>" value="delete">
110                             </td>
111                             <td class="forminput" style="text-align: center; padding: 2px;">
112                                 <span style="font-weight: bold;">[ <a href="javascript:switchsubmit('fileform', 'cd', '<%= fname %>')"><%= fname %></a>&nbsp;]</span>
113                             </td>
114                             <td class="forminput" style="text-align: center; padding: 2px;">
115                                 <%= session["fileinfo"][fname][:ftype] %>
116                             </td>
117                             <td class="forminput" style="text-align: center; padding: 2px;">
118                                 -
119                             </td>
120                             <td class="forminput" style="text-align: center; padding: 2px;">
121                                 <%= session["fileinfo"][fname][:ctime].strftime("%Y年%m月%d日 %H時%M分%S秒") %>
122                             </td>
123                         </tr>
124                         <% end %>
125                         <% end %>
126                         <% session["filelist"].each do |fname| %>
127                         <% if session["fileinfo"][fname][:ftype] == "file" %>
128                         <tr>
129                             <td class="formnavi" style="text-align: center; padding: 2px;">
130                                 <input type="checkbox" name="filename_<%= fname %>" value="delete">
131                             </td>
132                             <td class="forminput" style="text-align: center; padding: 2px;">
133                                 <a href="<%= session["pwd"] %><%= fname %>" target="_blank"><%= fname %></a>
134                             </td>
135                             <td class="forminput" style="text-align: center; padding: 2px;">
136                                 <%= session["fileinfo"][fname][:ftype] %>
137                             </td>
138                             <td class="forminput" style="text-align: center; padding: 2px;">
139                                 <%= session["fileinfo"][fname][:size] %>KB
140                             </td>
141                             <td class="forminput" style="text-align: center; padding: 2px;">
142                                 <%= session["fileinfo"][fname][:ctime].strftime("%Y年%m月%d日 %H時%M分%S秒") %>
143                             </td>
144                         </tr>
145                         <% end %>
146                         <% end %>
147                     </tbody>
148                 </table>
149                 <br>
150                 <input type="hidden" name="relpath_list" value="<%= session["relpath_list"] %>"><input type="hidden" name="mode" value="file"><input type="hidden" name="action" value=""><input type="hidden" name="arg" value="">
151             </form>
152         </div>
153         <br>
154         <div class="divstyle" style="border: none;">
155             <%= APPVERSION %>
156         </div>
157     </body>
158 </html>