file_share 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/app/controllers/file_attachments_controller.rb +0 -6
- data/app/controllers/file_share/application_controller.rb +6 -0
- data/app/views/file_attachments/_file_attachment.html.erb +5 -1
- data/app/views/file_attachments/_file_attachments.html.erb +0 -2
- data/app/views/file_attachments/_upload_form.html.erb +1 -1
- data/app/views/file_attachments/edit.html.erb +6 -21
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3
|
@@ -3,8 +3,6 @@ class FileAttachmentsController < FileShare::ApplicationController
|
|
3
3
|
# before_filter :load_and_authorize_current_user, :except => [:index, :show, :download]
|
4
4
|
|
5
5
|
rescue_from Errno::ENOENT, :with => :file_not_found
|
6
|
-
|
7
|
-
helper_method :has_authorization?
|
8
6
|
|
9
7
|
private
|
10
8
|
def file_not_found(e)
|
@@ -31,10 +29,6 @@ class FileAttachmentsController < FileShare::ApplicationController
|
|
31
29
|
#end
|
32
30
|
#session[:return_to] = nil
|
33
31
|
end
|
34
|
-
def has_authorization?(*args)
|
35
|
-
# stub
|
36
|
-
true
|
37
|
-
end
|
38
32
|
def load_containers
|
39
33
|
@file_containers = FileContainer.all
|
40
34
|
end
|
@@ -1,5 +1,9 @@
|
|
1
1
|
<%= div_for(file_attachment) do %>
|
2
|
-
|
2
|
+
<%= content_tag :span, file_attachment.file_container, {
|
3
|
+
:id => "file_attachment_#{file_attachment.id}_file_container",
|
4
|
+
:class => "file_attachment_file_container",
|
5
|
+
:style => "display:none;"
|
6
|
+
} if has_authorization?(:update, file_attachment) %>
|
3
7
|
<%= description_display(file_attachment) %>
|
4
8
|
<%= name_display(file_attachment) %>
|
5
9
|
<%= content_tag :p, :style => "font-size: 11px;" do %>
|
@@ -24,7 +24,6 @@
|
|
24
24
|
</div>
|
25
25
|
|
26
26
|
<% if has_authorization?(:update, FileAttachment.new) %>
|
27
|
-
<!-- <div id="blank_description_form" style="display: none; padding: 5px 0;"> -->
|
28
27
|
<form id="file_attachment_dynamic_form" class="formtastic" method="post" action="<%= file_attachments_path %>" style="display: none; padding: 5px 0;">
|
29
28
|
<div style="margin: 0pt; padding: 0pt; display: inline;">
|
30
29
|
<input type="hidden" value="put" name="_method" />
|
@@ -45,7 +44,6 @@
|
|
45
44
|
<br />
|
46
45
|
<input type="submit" value="Update" /> | <a href="#" class="cancel_dynamic_form">Cancel</a>
|
47
46
|
</form>
|
48
|
-
<!-- </div> -->
|
49
47
|
|
50
48
|
<% content_for(:javascript) do %>
|
51
49
|
<script type="text/javascript">
|
@@ -1,17 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
<%
|
6
|
-
#else
|
7
|
-
%>
|
8
|
-
<!-- <p><%=
|
9
|
-
#link_to '< back', event_path(@file_attachment.event.id), :class => 'fake_button'
|
10
|
-
%>
|
11
|
-
</p> -->
|
12
|
-
<%
|
13
|
-
#end
|
14
|
-
%>
|
1
|
+
<%- back_path = @file_attachment.attachable_id.blank? ?
|
2
|
+
file_attachments_path : polymorphic_path(@file_attachment.attachable_id) -%>
|
3
|
+
<p><%= link_to '< back', back_path, :class => 'fake_button' %></p>
|
4
|
+
|
15
5
|
<%= content_tag :div do %>
|
16
6
|
<%= semantic_form_for @file_attachment do |form| %>
|
17
7
|
<%= form.inputs do %>
|
@@ -22,13 +12,8 @@
|
|
22
12
|
:selected => "#{@file_attachment.attachable_type}_#{@file_attachment.attachable_id}"
|
23
13
|
}
|
24
14
|
}) %>
|
25
|
-
<%=
|
26
|
-
#form.input :event, :hint => 'does this file belong somewhere else?'
|
27
|
-
%>
|
28
15
|
<%= form.input :description, :hint => "of file contents, purpose, etc" %>
|
29
16
|
<% end %>
|
30
|
-
<%= form.buttons
|
31
|
-
<%= form.commit_button%>
|
32
|
-
<% end %>
|
17
|
+
<%= form.buttons %>
|
33
18
|
<% end %>
|
34
|
-
<% end %>
|
19
|
+
<% end if has_authorization?(:update, @file_attachment) %>
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: file_share
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 3
|
10
|
+
version: 0.1.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jason LaPier
|