dms-tog_depot 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.md +0 -0
- data/MIT-LICENSE +19 -0
- data/README.markdown +78 -0
- data/Rakefile +22 -0
- data/app/controllers/depot/filefolders_controller.rb +10 -0
- data/app/controllers/depot/files_controller.rb +35 -0
- data/app/controllers/member/depot/filefolders_controller.rb +84 -0
- data/app/controllers/member/depot/files_controller.rb +102 -0
- data/app/helpers/depot/files_helper.rb +18 -0
- data/app/models/depot/file.rb +41 -0
- data/app/models/depot/filefolder.rb +21 -0
- data/app/models/tog/depot/version.rb +17 -0
- data/app/models/user.rb +4 -0
- data/app/views/depot/filefolders/show.html.erb +97 -0
- data/app/views/depot/files/_tag_cloud_file.html.erb +6 -0
- data/app/views/depot/files/by_tag.html.erb +113 -0
- data/app/views/depot/files/index.html.erb +111 -0
- data/app/views/depot/files/show.html.erb +69 -0
- data/app/views/member/depot/filefolders/edit.html.erb +22 -0
- data/app/views/member/depot/filefolders/new.html.erb +19 -0
- data/app/views/member/depot/filefolders/show.html.erb +121 -0
- data/app/views/member/depot/files/by_tag.html.erb +130 -0
- data/app/views/member/depot/files/edit.html.erb +27 -0
- data/app/views/member/depot/files/index.html.erb +132 -0
- data/app/views/member/depot/files/new.html.erb +24 -0
- data/app/views/member/depot/files/show.html.erb +79 -0
- data/config/routes.rb +32 -0
- data/db/migrate/001_create_files.rb +21 -0
- data/db/migrate/002_create_files_folder.rb +16 -0
- data/init.rb +14 -0
- data/public/images/1px.gif +0 -0
- data/public/images/privacity/admin.gif +0 -0
- data/public/images/privacity/community.gif +0 -0
- data/public/images/privacity/member.gif +0 -0
- data/public/images/privacity/public_domain.gif +0 -0
- data/public/images/tog-depot_arrow_dn.gif +0 -0
- data/public/images/tog-depot_arrow_dn_deact.gif +0 -0
- data/public/images/tog-depot_arrow_up.gif +0 -0
- data/public/images/tog-depot_arrow_up_deact.gif +0 -0
- data/public/images/tog-depot_file_dl.gif +0 -0
- data/public/images/tog-depot_iconfile_16px.gif +0 -0
- data/public/images/tog-depot_iconfile_32px.gif +0 -0
- data/public/images/tog-depot_iconfile_48px.gif +0 -0
- data/public/images/tog-depot_iconfolder_16px.gif +0 -0
- data/public/images/tog-depot_iconfolder_32px.gif +0 -0
- data/public/images/tog-depot_iconfolder_48px.gif +0 -0
- data/public/stylesheets/depot.css +52 -0
- data/test/factories.rb +17 -0
- data/test/functional/depot/filefolders_controller_test.rb +30 -0
- data/test/functional/depot/files_controller_test.rb +43 -0
- data/test/functional/member/depot/filefolders_controller_test.rb +15 -0
- data/test/functional/member/depot/files_controller_test.rb +107 -0
- data/test/test_helper.rb +26 -0
- data/test/unit/file_test.rb +8 -0
- data/test/unit/filefolder_test.rb +8 -0
- data/tog_depot.gemspec +81 -0
- metadata +155 -0
@@ -0,0 +1,19 @@
|
|
1
|
+
<div class="titleB"><img src="/tog_depot/images/tog-depot_iconfolder_48px.gif" border="0" /> Create new folder<br /><br /></div>
|
2
|
+
|
3
|
+
<%= error_messages_for :folder %>
|
4
|
+
<% form_for :folder, :url => member_depot_filefolders_path, :html => {:action => 'create', :method => "post", :id => "settings"} do |f| -%>
|
5
|
+
<fieldset>
|
6
|
+
<div class="fields">
|
7
|
+
<p>
|
8
|
+
<label for="folder_title">Title</label><%= f.text_field :title, :class=>"fieldbox wide" %></p>
|
9
|
+
<p><label for="folder_tag_list">Tags (separated with ,)</label><%= f.text_field :tag_list, :class=>"fieldbox wide" -%></p>
|
10
|
+
<p>
|
11
|
+
<label for="folder_state">Visibility</label>
|
12
|
+
<%= select_tag "state", options_for_select(Depot::Filefolder.states, :private) -%>
|
13
|
+
<p>
|
14
|
+
<label for="folder_description">Description</label><%= f.text_area :description, :class=>"fieldbox wide" %></p>
|
15
|
+
</div>
|
16
|
+
</fieldset>
|
17
|
+
<div class="actions"><%= link_to '<< Back to filelist', member_depot_files_path, :class => 'button mainaction' %>
|
18
|
+
<%= submit_tag 'Create folder', :class => 'button mainaction' %></div>
|
19
|
+
<% end -%>
|
@@ -0,0 +1,121 @@
|
|
1
|
+
<% include_stylesheet "/tog_depot/stylesheets/depot" %>
|
2
|
+
<% content_for :sidebar do %>
|
3
|
+
<ul class="tags">
|
4
|
+
<li class="l5">
|
5
|
+
<%= link_to 'Edit Folder', edit_member_depot_filefolder_url(@filefolder.id) %>
|
6
|
+
</li>
|
7
|
+
<li class="l5">
|
8
|
+
<%= link_to 'Delete Folder', member_depot_filefolder_url(@filefolder.id), :method => :delete %>
|
9
|
+
</li>
|
10
|
+
</ul>
|
11
|
+
<% end %>
|
12
|
+
|
13
|
+
<div class="portlet portletB">
|
14
|
+
<h1><img src="/tog_depot/images/tog-depot_iconfolder_48px.gif" border="0" alt="Member file"/> <%= @filefolder.title%></h1>
|
15
|
+
<b>Tags:</b>
|
16
|
+
<% tags = @filefolder.tag_list %>
|
17
|
+
<% if !tags.blank? %>
|
18
|
+
<% for tag in tags %>
|
19
|
+
<%= link_to tag, tag_member_depot_files_path(tag.to_sym) %>
|
20
|
+
<% end %>
|
21
|
+
<% else %>
|
22
|
+
No tags.
|
23
|
+
<% end %>
|
24
|
+
<br />
|
25
|
+
<b>Owner:</b> <%= @filefolder.user.login %><br />
|
26
|
+
<b>Created at:</b> <%= @filefolder.created_at %><br />
|
27
|
+
<b>Updated at:</b> <%= @filefolder.updated_at %><br>
|
28
|
+
<b>Visibility:</b> <%= @filefolder.state %><br>
|
29
|
+
<br />
|
30
|
+
<b>Description:</b> <%= @filefolder.description %><br>
|
31
|
+
<br />
|
32
|
+
|
33
|
+
<%= link_to 'Upload new file', new_member_depot_file_url, :class => 'button add' %><br /><br />
|
34
|
+
<h2 style="width:690px;"><span><%= @filefolder.title%> content</span></h2>
|
35
|
+
<table border="0" cellpadding="0" cellspacing="0">
|
36
|
+
<thead>
|
37
|
+
<tr bgcolor="#eeeeee">
|
38
|
+
<th><img src="/tog_depot/images/tog-depot_arrow_up_deact.gif" border="0" /><br /></th>
|
39
|
+
<th rowspan="2">Type</th>
|
40
|
+
<th><a href="<%= member_depot_files_order_path('title ASC') %>"><img src="/tog_depot/images/tog-depot_arrow_up.gif" border="0" /></a><br /></th>
|
41
|
+
<th rowspan="2">Filename</th>
|
42
|
+
<th><a href="<%= member_depot_files_order_path('created_at ASC') %>"><img src="/tog_depot/images/tog-depot_arrow_up.gif" border="0" /></a><br /></th>
|
43
|
+
<th rowspan="2">Release date</th>
|
44
|
+
<th><img src="/tog_depot/images/tog-depot_arrow_up_deact.gif" border="0" /><br /></th>
|
45
|
+
<th rowspan="2">Owner</th>
|
46
|
+
<th><img src="/tog_depot/images/tog-depot_arrow_up_deact.gif" border="0" /><br /></th>
|
47
|
+
<th rowspan="2">Times dl.</th>
|
48
|
+
<th><img src="/tog_depot/images/tog-depot_arrow_up_deact.gif" border="0" /><br /></th>
|
49
|
+
<th rowspan="2">In folder</th>
|
50
|
+
<th><a href="<%= member_depot_files_order_path('state ASC') %>"><img src="/tog_depot/images/tog-depot_arrow_up.gif" border="0" /></a><br /></th>
|
51
|
+
<th rowspan="2">Vis.</th>
|
52
|
+
</tr>
|
53
|
+
<tr bgcolor="#eeeeee">
|
54
|
+
<th bgcolor="#eeeeee"><img src="/tog_depot/images/tog-depot_arrow_dn_deact.gif" border="0" /></th>
|
55
|
+
<th bgcolor="#eeeeee"><a href="<%= member_depot_files_order_path('title DESC') %>"><img src="/tog_depot/images/tog-depot_arrow_dn.gif" border="0" /></a></th>
|
56
|
+
<th bgcolor="#eeeeee"><a href="<%= member_depot_files_order_path('created_at DESC') %>"><img src="/tog_depot/images/tog-depot_arrow_dn.gif" border="0" /></a></th>
|
57
|
+
<th bgcolor="#eeeeee"><img src="/tog_depot/images/tog-depot_arrow_dn_deact.gif" border="0" /></th>
|
58
|
+
<th bgcolor="#eeeeee"><img src="/tog_depot/images/tog-depot_arrow_dn_deact.gif" border="0" /></th>
|
59
|
+
<th bgcolor="#eeeeee"><img src="/tog_depot/images/tog-depot_arrow_dn_deact.gif" border="0" /></th>
|
60
|
+
<th bgcolor="#eeeeee"><a href="<%= member_depot_files_order_path('state DESC') %>"><img src="/tog_depot/images/tog-depot_arrow_dn.gif" border="0" /></a></th>
|
61
|
+
</tr>
|
62
|
+
</thead>
|
63
|
+
<tbody>
|
64
|
+
|
65
|
+
<% if @my_files.empty? %>
|
66
|
+
<tr><td colspan="14">There isn't any files yet.
|
67
|
+
</td>
|
68
|
+
</tr>
|
69
|
+
<% else %>
|
70
|
+
<% @my_files.each do |file| %>
|
71
|
+
<tr>
|
72
|
+
<td colspan="2"><img src="/tog_depot/images/1px.gif" border="0" height="4" width="5"/><br />
|
73
|
+
<div class="fileicon_32"><img src="/tog_depot/images/1px.gif" border="0" height="14" width="5"/><br /><%= file.filename.to_s.scan(/\.\w+$/) %></div>
|
74
|
+
</td>
|
75
|
+
<td colspan="2">
|
76
|
+
<h3><%= link_to file.title, member_depot_file_url(file.id) %></h3>
|
77
|
+
</td>
|
78
|
+
<td colspan="2"><%= file.created_at %></td>
|
79
|
+
<td colspan="2"><%= file.user.login %></td>
|
80
|
+
<td style="padding-right:20px;" align="right" colspan="2"><%= file.num_download %></td>
|
81
|
+
<td colspan="2">
|
82
|
+
<% if file.filefolder%>
|
83
|
+
<%= file.filefolder.title %>
|
84
|
+
<%end%>
|
85
|
+
</td>
|
86
|
+
<td colspan="2">
|
87
|
+
<% if file.state=='public'%>
|
88
|
+
<img src="/tog_depot/images/privacity/public_domain.gif" border="0" alt="Public file" title="Public file" />
|
89
|
+
<%else%>
|
90
|
+
<img src="/tog_depot/images/privacity/member.gif" border="0" alt="Member file" title="Member file"/>
|
91
|
+
<%end%>
|
92
|
+
</td>
|
93
|
+
</tr>
|
94
|
+
<tr><td class="brd_bt" colspan="2"></td><td class="end_list" colspan="12">
|
95
|
+
|
96
|
+
<% tags = file.tag_list %>
|
97
|
+
<b>Tags:</b>
|
98
|
+
<% if !tags.blank? %>
|
99
|
+
<% for tag in tags %>
|
100
|
+
<%= link_to tag, tag_member_depot_files_path(tag.to_sym) %>
|
101
|
+
<% end %>
|
102
|
+
<% else %>
|
103
|
+
No tags.
|
104
|
+
<% end %>
|
105
|
+
</td>
|
106
|
+
</tr>
|
107
|
+
<% end %>
|
108
|
+
<% end %>
|
109
|
+
</tbody>
|
110
|
+
</table>
|
111
|
+
|
112
|
+
|
113
|
+
<br>
|
114
|
+
<div class="info_results" style="width:688px;">
|
115
|
+
<div class="floater_R" style="float:right; padding-right:4px;">
|
116
|
+
<%= will_paginate @my_files %>
|
117
|
+
</div>
|
118
|
+
<br>
|
119
|
+
<div class="float_breaker" style="clear:both;"></div>
|
120
|
+
|
121
|
+
</div> <br><br><%= link_to '<< Back to filelist', member_depot_files_path %></div>
|
@@ -0,0 +1,130 @@
|
|
1
|
+
<% include_stylesheet "/tog_depot/stylesheets/depot" %>
|
2
|
+
<% content_for :sidebar do %>
|
3
|
+
|
4
|
+
<% end %>
|
5
|
+
|
6
|
+
|
7
|
+
<div class="portlet portletB">
|
8
|
+
<%= link_to 'Upload new file', new_member_depot_file_url, :class => 'button add' %>
|
9
|
+
<%= link_to 'Create new folder', new_member_depot_filefolder_url, :class => 'button add' %> <br /><br />
|
10
|
+
<h2 style="width:690px;"><span><%= current_user.login %>’s files marked as tag:<b> <%= params[:tag_name]%></b></span></h2>
|
11
|
+
|
12
|
+
<div class="portlet_content" >
|
13
|
+
<table border="0" cellpadding="0" cellspacing="0">
|
14
|
+
<thead>
|
15
|
+
<tr bgcolor="#eeeeee">
|
16
|
+
<th><img src="/tog_depot/images/tog-depot_arrow_up_deact.gif" border="0" /><br /></th>
|
17
|
+
<th rowspan="2">Type</th>
|
18
|
+
<th><a href="<%= member_depot_files_order_path('title ASC') %>"><img src="/tog_depot/images/tog-depot_arrow_up.gif" border="0" /></a><br /></th>
|
19
|
+
<th rowspan="2">Filename</th>
|
20
|
+
<th><a href="<%= member_depot_files_order_path('created_at ASC') %>"><img src="/tog_depot/images/tog-depot_arrow_up.gif" border="0" /></a><br /></th>
|
21
|
+
<th rowspan="2">Release date</th>
|
22
|
+
<th><img src="/tog_depot/images/tog-depot_arrow_up_deact.gif" border="0" /><br /></th>
|
23
|
+
<th rowspan="2">Owner</th>
|
24
|
+
<th><a href="<%= member_depot_files_order_path('num_download ASC') %>"><img src="/tog_depot/images/tog-depot_arrow_up.gif" border="0" /></a><br /></th>
|
25
|
+
<th rowspan="2">Times dl.</th>
|
26
|
+
<th><img src="/tog_depot/images/tog-depot_arrow_up_deact.gif" border="0" /><br /></th>
|
27
|
+
<th rowspan="2">In folder</th>
|
28
|
+
<th><a href="<%= member_depot_files_order_path('state ASC') %>"><img src="/tog_depot/images/tog-depot_arrow_up.gif" border="0" /></a><br /></th>
|
29
|
+
<th rowspan="2">Vis.</th>
|
30
|
+
</tr>
|
31
|
+
<tr bgcolor="#eeeeee">
|
32
|
+
<th bgcolor="#eeeeee"><img src="/tog_depot/images/tog-depot_arrow_dn_deact.gif" border="0" /></th>
|
33
|
+
<th bgcolor="#eeeeee"><a href="<%= member_depot_files_order_path('title DESC') %>"><img src="/tog_depot/images/tog-depot_arrow_dn.gif" border="0" /></a></th>
|
34
|
+
<th bgcolor="#eeeeee"><a href="<%= member_depot_files_order_path('created_at DESC') %>"><img src="/tog_depot/images/tog-depot_arrow_dn.gif" border="0" /></a></th>
|
35
|
+
<th bgcolor="#eeeeee"><img src="/tog_depot/images/tog-depot_arrow_dn_deact.gif" border="0" /></th>
|
36
|
+
<th bgcolor="#eeeeee"><img src="/tog_depot/images/tog-depot_arrow_dn.gif" border="0" /></th>
|
37
|
+
<th bgcolor="#eeeeee"><img src="/tog_depot/images/tog-depot_arrow_dn_deact.gif" border="0" /></th>
|
38
|
+
<th bgcolor="#eeeeee"><a href="<%= member_depot_files_order_path('state DESC') %>"><img src="/tog_depot/images/tog-depot_arrow_dn.gif" border="0" /></a></th>
|
39
|
+
</tr>
|
40
|
+
</thead>
|
41
|
+
<tbody>
|
42
|
+
|
43
|
+
<% @my_folders.each do |folder| %>
|
44
|
+
<tr>
|
45
|
+
|
46
|
+
<td colspan="2"><img src="/tog_depot/images/1px.gif" border="0" height="4" width="5"/><br />
|
47
|
+
<div class="foldericon_32"><img src="/tog_depot/images/tog-depot_iconfolder_32px.gif" border="0" /><br /></div>
|
48
|
+
</td>
|
49
|
+
<td colspan="2">
|
50
|
+
<h3><%= link_to folder.title, member_depot_filefolder_url(folder.id) %></h3>
|
51
|
+
</td>
|
52
|
+
<td colspan="2"><%= folder.created_at %></td>
|
53
|
+
<td colspan="2"><%= folder.user.login %></td>
|
54
|
+
<td style="padding-right:20px;" align="right" colspan="2"></td>
|
55
|
+
<td colspan="2"> </td>
|
56
|
+
<td colspan="2">
|
57
|
+
<% if folder.state=='public'%>
|
58
|
+
<img src="/tog_depot/images/privacity/public_domain.gif" border="0" alt="Public file" title="Public file" />
|
59
|
+
<%else%>
|
60
|
+
<img src="/tog_depot/images/privacity/member.gif" border="0" alt="Member file" title="Member file"/>
|
61
|
+
<%end%>
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
<tr><td class="brd_bt" colspan="2"></td><td class="end_list" colspan="12">
|
65
|
+
|
66
|
+
<% tags = folder.tag_list %>
|
67
|
+
<b>Tags:</b>
|
68
|
+
<% if !tags.blank? %>
|
69
|
+
<% for tag in tags %>
|
70
|
+
<%= link_to tag, tag_member_depot_files_path(tag.to_sym) %>
|
71
|
+
<% end %>
|
72
|
+
<% else %>
|
73
|
+
No tags.
|
74
|
+
<% end %>
|
75
|
+
</td>
|
76
|
+
</tr>
|
77
|
+
<% end %>
|
78
|
+
|
79
|
+
<% if @my_files.empty? %>
|
80
|
+
<tr><td colspan="14">There isn't any files yet.
|
81
|
+
</td>
|
82
|
+
</tr>
|
83
|
+
<% else %>
|
84
|
+
<% @my_files.each do |file| %>
|
85
|
+
<tr>
|
86
|
+
|
87
|
+
<td colspan="2"><img src="/tog_depot/images/1px.gif" border="0" height="4" width="5"/><br />
|
88
|
+
<div class="fileicon_32"><img src="/tog_depot/images/1px.gif" border="0" height="14" width="5"/><br /><%= file.filename.to_s.scan(/\.\w+$/) %></div>
|
89
|
+
</td>
|
90
|
+
<td colspan="2">
|
91
|
+
<h3><%= link_to file.title, member_depot_file_url(file.id) %></h3>
|
92
|
+
</td>
|
93
|
+
<td colspan="2"><%= file.created_at %></td>
|
94
|
+
<td colspan="2"><%= file.user.login %></td>
|
95
|
+
<td style="padding-right:20px;" align="right" colspan="2"><%= file.num_download %></td>
|
96
|
+
<td colspan="2">
|
97
|
+
<% if file.filefolder%>
|
98
|
+
<%= file.filefolder.title %>
|
99
|
+
<%end%>
|
100
|
+
</td>
|
101
|
+
<td colspan="2">
|
102
|
+
<% if file.state=='public'%>
|
103
|
+
<img src="/tog_depot/images/privacity/public_domain.gif" border="0" alt="Public file" title="Public file" />
|
104
|
+
<%else%>
|
105
|
+
<img src="/tog_depot/images/privacity/member.gif" border="0" alt="Member file" title="Member file"/>
|
106
|
+
<%end%>
|
107
|
+
</td>
|
108
|
+
</tr>
|
109
|
+
<tr><td class="brd_bt" colspan="2"></td><td class="end_list" colspan="12">
|
110
|
+
|
111
|
+
<% tags = file.tag_list %>
|
112
|
+
<b>Tags:</b>
|
113
|
+
<% if !tags.blank? %>
|
114
|
+
<% for tag in tags %>
|
115
|
+
<%= link_to tag, tag_member_depot_files_path(tag.to_sym) %>
|
116
|
+
<% end %>
|
117
|
+
<% else %>
|
118
|
+
No tags.
|
119
|
+
<% end %>
|
120
|
+
</td>
|
121
|
+
</tr>
|
122
|
+
<% end %>
|
123
|
+
<% end %>
|
124
|
+
</tbody>
|
125
|
+
</table>
|
126
|
+
|
127
|
+
</div><br />
|
128
|
+
<div class="info_results" style="width:688px;">
|
129
|
+
<div class="floater_R" style="float:right; padding-right:4px;"><%= will_paginate @my_files %></div><div class="float_breaker" style="clear:both;"></div></div>
|
130
|
+
</div>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<div class="titleB"><img src="/tog_depot/images/tog-depot_iconfile_48px.gif" border="0" /> Edit file</div><br /><br />
|
2
|
+
|
3
|
+
<%= error_messages_for :file %>
|
4
|
+
<% form_for :file, :url => member_depot_file_path(@file), :html => {:action => 'update', :id => "settings", :multipart => true, :method => "put"} do |f| -%>
|
5
|
+
|
6
|
+
<fieldset>
|
7
|
+
<div class="fields">
|
8
|
+
<p><label for="file_title">File title</label><%= f.text_field :title, :class=>"fieldbox wide" %></p>
|
9
|
+
<p><label for="file_state">Parent folder</label>
|
10
|
+
<%if @folders%>
|
11
|
+
<%= select (:file, :filefolder_id, @folders.collect {|p| [p.title,p.id]}, { :include_blank => true}) %>
|
12
|
+
<%else%>
|
13
|
+
<%= link_to 'Create new folder', new_member_depot_filefolder_url, :class => '' %> <br /><br />
|
14
|
+
<%end%>
|
15
|
+
</p>
|
16
|
+
<p><label for="file_tag_list">Tags (separated with ,)</label><%= f.text_field :tag_list, :class=>"fieldbox wide" -%></p>
|
17
|
+
<p><label for="file_state">Visibility</label>
|
18
|
+
<%= select_tag "state", options_for_select(Depot::File.states, @file.current_state) -%>
|
19
|
+
</p>
|
20
|
+
<p><label for="file_description">File description</label><%= f.text_area :description, :class=>"fieldbox wide" %></p>
|
21
|
+
<% fields_for :file do |img|%>
|
22
|
+
<p><label for="file_file">Select file</label><%= img.file_field :uploaded_data %></p>
|
23
|
+
<% end %>
|
24
|
+
</div>
|
25
|
+
</fieldset>
|
26
|
+
<div class="actions"><%= f.submit "Apply changes",:class=>"button mainaction" %></div>
|
27
|
+
<% end -%>
|
@@ -0,0 +1,132 @@
|
|
1
|
+
<% include_stylesheet "/tog_depot/stylesheets/depot" %>
|
2
|
+
<% content_for :sidebar do %>
|
3
|
+
|
4
|
+
<% end %>
|
5
|
+
|
6
|
+
|
7
|
+
<div class="portlet portletB">
|
8
|
+
<%= link_to 'Upload new file', new_member_depot_file_url, :class => 'button add' %>
|
9
|
+
<%= link_to 'Create new folder', new_member_depot_filefolder_url, :class => 'button add' %> <br /><br />
|
10
|
+
<h2 style="width:690px;"><span><%= current_user.login %>’s files - Disk cuota: <%= @tot_size %> Kb. / <%=@max_storage%> Kb (<%= @max_storage.to_i - @tot_size.to_i %> Kb Free)</span></h2>
|
11
|
+
|
12
|
+
<div class="portlet_content" >
|
13
|
+
<table border="0" cellpadding="0" cellspacing="0">
|
14
|
+
<thead>
|
15
|
+
<tr bgcolor="#eeeeee">
|
16
|
+
|
17
|
+
<th><img src="/tog_depot/images/tog-depot_arrow_up_deact.gif" border="0" /><br /></th>
|
18
|
+
<th rowspan="2">Type</th>
|
19
|
+
<th><a href="<%= member_depot_files_order_path('title ASC') %>"><img src="/tog_depot/images/tog-depot_arrow_up.gif" border="0" /></a><br /></th>
|
20
|
+
<th rowspan="2">Filename</th>
|
21
|
+
<th><a href="<%= member_depot_files_order_path('created_at ASC') %>"><img src="/tog_depot/images/tog-depot_arrow_up.gif" border="0" /></a><br /></th>
|
22
|
+
<th rowspan="2">Release date</th>
|
23
|
+
<th><img src="/tog_depot/images/tog-depot_arrow_up_deact.gif" border="0" /><br /></th>
|
24
|
+
<th rowspan="2">Owner</th>
|
25
|
+
<th><img src="/tog_depot/images/tog-depot_arrow_up_deact.gif" border="0" /><br /></th>
|
26
|
+
<th rowspan="2">Times dl.</th>
|
27
|
+
<th><img src="/tog_depot/images/tog-depot_arrow_up_deact.gif" border="0" /><br /></th>
|
28
|
+
<th rowspan="2">In folder</th>
|
29
|
+
<th><a href="<%= member_depot_files_order_path('state ASC') %>"><img src="/tog_depot/images/tog-depot_arrow_up.gif" border="0" /></a><br /></th>
|
30
|
+
<th rowspan="2">Vis.</th>
|
31
|
+
</tr>
|
32
|
+
<tr bgcolor="#eeeeee">
|
33
|
+
<th bgcolor="#eeeeee"><img src="/tog_depot/images/tog-depot_arrow_dn_deact.gif" border="0" /></th>
|
34
|
+
<th bgcolor="#eeeeee"><a href="<%= member_depot_files_order_path('title DESC') %>"><img src="/tog_depot/images/tog-depot_arrow_dn.gif" border="0" /></a></th>
|
35
|
+
<th bgcolor="#eeeeee"><a href="<%= member_depot_files_order_path('created_at DESC') %>"><img src="/tog_depot/images/tog-depot_arrow_dn.gif" border="0" /></a></th>
|
36
|
+
<th bgcolor="#eeeeee"><img src="/tog_depot/images/tog-depot_arrow_dn_deact.gif" border="0" /></th>
|
37
|
+
<th bgcolor="#eeeeee"><img src="/tog_depot/images/tog-depot_arrow_dn_deact.gif" border="0" /></th>
|
38
|
+
<th bgcolor="#eeeeee"><img src="/tog_depot/images/tog-depot_arrow_dn_deact.gif" border="0" /></th>
|
39
|
+
<th bgcolor="#eeeeee"><a href="<%= member_depot_files_order_path('state DESC') %>"><img src="/tog_depot/images/tog-depot_arrow_dn.gif" border="0" /></a></th>
|
40
|
+
</tr>
|
41
|
+
</thead>
|
42
|
+
<tbody>
|
43
|
+
|
44
|
+
<% @my_folders.each do |folder| %>
|
45
|
+
<tr>
|
46
|
+
|
47
|
+
<td colspan="2"><img src="/tog_depot/images/1px.gif" border="0" height="4" width="5"/><br />
|
48
|
+
<div class="foldericon_32"> <img src="/tog_depot/images/tog-depot_iconfolder_32px.gif" border="0" /><br />
|
49
|
+
</div>
|
50
|
+
</td>
|
51
|
+
<td colspan="2">
|
52
|
+
<h3><%= link_to folder.title, member_depot_filefolder_url(folder.id) %></h3>
|
53
|
+
</td>
|
54
|
+
<td colspan="2"><%= folder.created_at %></td>
|
55
|
+
<td colspan="2"><%= folder.user.login %></td>
|
56
|
+
<td style="padding-right:20px;" align="right" colspan="2"></td>
|
57
|
+
<td colspan="2"> </td>
|
58
|
+
<td colspan="2">
|
59
|
+
<% if folder.state=='public'%>
|
60
|
+
<img src="/tog_depot/images/privacity/public_domain.gif" border="0" alt="Public file" title="Public file" />
|
61
|
+
<%else%>
|
62
|
+
<img src="/tog_depot/images/privacity/member.gif" border="0" alt="Member file" title="Member file"/>
|
63
|
+
<%end%>
|
64
|
+
</td>
|
65
|
+
</tr>
|
66
|
+
<tr><td class="brd_bt" colspan="2"></td><td class="end_list" colspan="12">
|
67
|
+
|
68
|
+
<% tags = folder.tag_list %>
|
69
|
+
<b>Tags:</b>
|
70
|
+
<% if !tags.blank? %>
|
71
|
+
<% for tag in tags %>
|
72
|
+
<%= link_to tag, tag_member_depot_files_path(tag.to_sym) %>
|
73
|
+
<% end %>
|
74
|
+
<% else %>
|
75
|
+
No tags.
|
76
|
+
<% end %>
|
77
|
+
</td>
|
78
|
+
</tr>
|
79
|
+
<% end %>
|
80
|
+
|
81
|
+
<% if @my_files.empty? %>
|
82
|
+
<tr><td colspan="14">There isn't any files yet.
|
83
|
+
</td>
|
84
|
+
</tr>
|
85
|
+
<% else %>
|
86
|
+
<% @my_files.each do |file| %>
|
87
|
+
<tr>
|
88
|
+
|
89
|
+
<td colspan="2"><img src="/tog_depot/images/1px.gif" border="0" height="4" width="5"/><br />
|
90
|
+
<div class="fileicon_32"><img src="/tog_depot/images/1px.gif" border="0" height="14" width="5"/><br /><%= file.filename.to_s.scan(/\.\w+$/) %></div>
|
91
|
+
</td>
|
92
|
+
<td colspan="2">
|
93
|
+
<h3><%= link_to file.title, member_depot_file_url(file.id) %></h3>
|
94
|
+
</td>
|
95
|
+
<td colspan="2"><%= file.created_at %></td>
|
96
|
+
<td colspan="2"><%= file.user.login %></td>
|
97
|
+
<td style="padding-right:20px;" align="right" colspan="2"><%= file.num_download %></td>
|
98
|
+
<td colspan="2">
|
99
|
+
<% if file.filefolder%>
|
100
|
+
<%= file.filefolder.title %>
|
101
|
+
<%end%>
|
102
|
+
</td>
|
103
|
+
<td colspan="2">
|
104
|
+
<% if file.state=='public'%>
|
105
|
+
<img src="/tog_depot/images/privacity/public_domain.gif" border="0" alt="Public file" title="Public file" />
|
106
|
+
<%else%>
|
107
|
+
<img src="/tog_depot/images/privacity/member.gif" border="0" alt="Member file" title="Member file"/>
|
108
|
+
<%end%>
|
109
|
+
</td>
|
110
|
+
</tr>
|
111
|
+
<tr><td class="brd_bt" colspan="2"></td><td class="end_list" colspan="12">
|
112
|
+
|
113
|
+
<% tags = file.tag_list %>
|
114
|
+
<b>Tags:</b>
|
115
|
+
<% if !tags.blank? %>
|
116
|
+
<% for tag in tags %>
|
117
|
+
<%= link_to tag, tag_member_depot_files_path(tag.to_sym) %>
|
118
|
+
<% end %>
|
119
|
+
<% else %>
|
120
|
+
No tags.
|
121
|
+
<% end %>
|
122
|
+
</td>
|
123
|
+
</tr>
|
124
|
+
<% end %>
|
125
|
+
<% end %>
|
126
|
+
</tbody>
|
127
|
+
</table>
|
128
|
+
|
129
|
+
</div><br />
|
130
|
+
<div class="info_results" style="width:688px;">
|
131
|
+
<div class="floater_R" style="float:right; padding-right:4px;"><%= will_paginate @my_files %></div><div class="float_breaker" style="clear:both;"></div></div>
|
132
|
+
</div>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<div class="titleB"><img src="/tog_depot/images/tog-depot_iconfile_48px.gif" border="0" /> Upload new file</div>
|
2
|
+
<br /><br />
|
3
|
+
|
4
|
+
<%= error_messages_for :file %>
|
5
|
+
<% form_for :file, :url => member_depot_files_path, :html => {:action => 'create', :id => "settings", :multipart => true, :method => "post"} do |f| -%>
|
6
|
+
<div class="fields">
|
7
|
+
<p><label for="file_title">File title</label><%= f.text_field :title, :class=>"fieldbox wide" %></p>
|
8
|
+
<p><label for="file_state">Parent folder</label>
|
9
|
+
<%if @folders%>
|
10
|
+
<%= select (:file, :filefolder_id, @folders.collect {|p| [p.title,p.id]}, { :include_blank => true})%>
|
11
|
+
<%else%>
|
12
|
+
<%= link_to 'Create new folder', new_member_depot_filefolder_url, :class => '' %> <br /><br />
|
13
|
+
<%end%>
|
14
|
+
</p>
|
15
|
+
<p><label for="file_tag_list">Tags (separated with ,)</label><%= f.text_field :tag_list, :class=>"fieldbox wide" -%></p>
|
16
|
+
<p><label for="file_state">Visibility</label>
|
17
|
+
<%= select_tag "state", options_for_select(Depot::File.states, :private) -%></p>
|
18
|
+
<p><label for="file_description">File description</label><%= f.text_area :description, :class=>"fieldbox wide" %></p>
|
19
|
+
<p><label for="file_file">Select file</label><%= f.file_field :uploaded_data %></p>
|
20
|
+
</div>
|
21
|
+
</fieldset>
|
22
|
+
<div class="actions"><%= link_to '<< Back to filelist', member_depot_files_path, :class => 'button mainaction' %>
|
23
|
+
<%= submit_tag 'Create file', :class => 'button mainaction' %></div>
|
24
|
+
<% end -%>
|