file_share 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +3 -3
- data/VERSION +1 -1
- data/app/controllers/file_attachments_controller.rb +1 -1
- data/app/helpers/file_attachments_helper.rb +14 -1
- data/app/models/file_attachment.rb +6 -8
- data/app/views/file_attachments/_file_attachment.html.erb +5 -6
- data/app/views/file_attachments/_file_attachments.html.erb +26 -21
- data/app/views/file_attachments/_file_container_select.html.erb +0 -2
- data/app/views/file_attachments/_plupload_with_listing.html.erb +9 -7
- data/app/views/file_attachments/edit.html.erb +3 -1
- data/app/views/file_attachments/update.js.rjs +14 -5
- data/config/initializers/formtastic.rb +72 -0
- data/config/locales/en.yml +4 -0
- data/public/javascripts/file_share.js +0 -27
- data/public/javascripts/file_share_behaviors.js +44 -0
- data/public/stylesheets/formtastic.css +67 -60
- metadata +16 -15
data/Gemfile
CHANGED
@@ -7,10 +7,10 @@ gem 'sqlite3-ruby', :require => 'sqlite3'
|
|
7
7
|
gem "formtastic"
|
8
8
|
|
9
9
|
group :development, :test do
|
10
|
+
gem "acts_as_fu"
|
11
|
+
gem "capybara"
|
12
|
+
gem "cucumber-rails"
|
10
13
|
gem "engineer"
|
11
14
|
gem "rcov"
|
12
15
|
gem "rspec-rails"
|
13
|
-
gem "acts_as_fu"
|
14
|
-
gem "cucumber-rails"
|
15
|
-
gem "capybara"
|
16
16
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
@@ -97,7 +97,7 @@ class FileAttachmentsController < FileShare::ApplicationController
|
|
97
97
|
end
|
98
98
|
|
99
99
|
def update
|
100
|
-
|
100
|
+
@file_attachment = FileAttachment.find(params[:id])
|
101
101
|
respond_to do |format|
|
102
102
|
if @file_attachment.update_attributes(params[:file_attachment])
|
103
103
|
format.html do
|
@@ -1,9 +1,22 @@
|
|
1
1
|
module FileAttachmentsHelper
|
2
2
|
|
3
3
|
def description_display(file_attachment)
|
4
|
-
content_tag :p,
|
4
|
+
content_tag :p, {
|
5
|
+
:id => "file_attachment_#{file_attachment.id}_description",
|
6
|
+
:style => "max-width: 70%; float: right;",
|
7
|
+
:class => 'file_attachment_description'
|
8
|
+
} do
|
5
9
|
file_attachment.description
|
6
10
|
end
|
7
11
|
end
|
12
|
+
|
13
|
+
def name_display(file_attachment)
|
14
|
+
content_tag :p, {
|
15
|
+
:id => "file_attachment_#{file_attachment.id}_name",
|
16
|
+
:class => 'file_attachment_name'
|
17
|
+
} do
|
18
|
+
link_to(file_attachment.name, download_file_attachment_path(file_attachment.id))
|
19
|
+
end
|
20
|
+
end
|
8
21
|
|
9
22
|
end
|
@@ -83,12 +83,6 @@ class FileAttachment < ActiveRecord::Base
|
|
83
83
|
end
|
84
84
|
protected
|
85
85
|
public
|
86
|
-
def containers
|
87
|
-
return [] if attachables.count == 0
|
88
|
-
attachables.all.collect do |attachable|
|
89
|
-
attachable.container
|
90
|
-
end
|
91
|
-
end
|
92
86
|
def full_path
|
93
87
|
"#{FOLDER_ROOT}/#{filepath}"
|
94
88
|
end
|
@@ -96,9 +90,13 @@ class FileAttachment < ActiveRecord::Base
|
|
96
90
|
return true if File.exists?(full_path) && File.basename(full_path) != FOLDER
|
97
91
|
return false
|
98
92
|
end
|
93
|
+
def file_container
|
94
|
+
return nil unless attachable_type.present? && attachable_id.present?
|
95
|
+
"#{attachable_type}_#{attachable_id}"
|
96
|
+
end
|
99
97
|
def file_container=(container)
|
100
98
|
p = container.split("_")
|
101
|
-
self.attachable_type = p[0]
|
102
|
-
self.attachable_id = p[1]
|
99
|
+
self.attachable_type = p[0].blank? ? nil : p[0]
|
100
|
+
self.attachable_id = p[1].blank? ? nil : p[1]
|
103
101
|
end
|
104
102
|
end
|
@@ -1,12 +1,11 @@
|
|
1
1
|
<%= div_for(file_attachment) do %>
|
2
|
+
<span id="file_attachment_<%= file_attachment.id %>_file_container" class="file_attachment_file_container" style="display:none;"><%= file_attachment.file_container %></span>
|
2
3
|
<%= description_display(file_attachment) %>
|
3
|
-
<%=
|
4
|
-
<%= link_to(file_attachment.name, download_file_attachment_path(file_attachment.id)) %>
|
5
|
-
<% end %>
|
6
|
-
|
4
|
+
<%= name_display(file_attachment) %>
|
7
5
|
<%= content_tag :p, :style => "font-size: 11px;" do %>
|
8
|
-
|
9
|
-
|
6
|
+
<%= link_to "update", edit_file_attachment_path(file_attachment), {
|
7
|
+
:class => 'file_attachment_dynamic_form_link fake_button'
|
8
|
+
} %>
|
10
9
|
<%= link_to('delete', file_attachment_path(file_attachment.id), {
|
11
10
|
:method => :delete,
|
12
11
|
:confirm => "Did you mean to Delete #{file_attachment.name}?",
|
@@ -4,7 +4,7 @@
|
|
4
4
|
<h2>Orphaned Files</h2>
|
5
5
|
<%= render :partial => 'file_attachments/file_attachment', :collection => orphans %>
|
6
6
|
</div>
|
7
|
-
<div
|
7
|
+
<div class="span-8 last">
|
8
8
|
<h2>Attached Files</h2>
|
9
9
|
<% files.group_by(&:attachable).each do |attachable, attached_files| %>
|
10
10
|
<div id="<%= "#{attachable.class}_#{attachable.id}" %>">
|
@@ -15,7 +15,7 @@
|
|
15
15
|
</div>
|
16
16
|
<div style="clear:both;"></div>
|
17
17
|
<% else %>
|
18
|
-
<div
|
18
|
+
<div>
|
19
19
|
<% if files.present? || orphans.present? %>
|
20
20
|
<%= render :partial => 'file_attachments/file_attachment', :collection => files.present? ? files : orphans %>
|
21
21
|
<% end %>
|
@@ -24,17 +24,28 @@
|
|
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
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
27
|
+
<!-- <div id="blank_description_form" style="display: none; padding: 5px 0;"> -->
|
28
|
+
<form id="file_attachment_dynamic_form" class="formtastic" method="post" action="<%= file_attachments_path %>" style="display: none; padding: 5px 0;">
|
29
|
+
<div style="margin: 0pt; padding: 0pt; display: inline;">
|
30
|
+
<input type="hidden" value="put" name="_method" />
|
31
|
+
<input type="hidden" value="<%= form_authenticity_token %>" name="authenticity_token" />
|
32
|
+
</div>
|
33
|
+
<input type="text" id="file_attachment_name" name="file_attachment[name]" />
|
34
|
+
<% unless @file_containers.empty? %>
|
35
|
+
<select id="file_attachment_file_container" name="file_attachment[file_container]">
|
36
|
+
<%= render({
|
37
|
+
:partial => 'file_attachments/file_container_select',
|
38
|
+
:locals => {
|
39
|
+
:selected => "#{params[:attachable_type]}_#{params[:attachable_id]}"
|
40
|
+
}
|
41
|
+
}) %>
|
42
|
+
</select>
|
43
|
+
<% end %>
|
44
|
+
<textarea id="file_attachment_description" style="height: 70px; width: 69%" name="file_attachment[description]"></textarea>
|
45
|
+
<br />
|
46
|
+
<input type="submit" value="Update" /> | <a href="#" class="cancel_dynamic_form">Cancel</a>
|
47
|
+
</form>
|
48
|
+
<!-- </div> -->
|
38
49
|
|
39
50
|
<% content_for(:javascript) do %>
|
40
51
|
<script type="text/javascript">
|
@@ -45,15 +56,9 @@ jQuery.ajaxSetup({
|
|
45
56
|
});
|
46
57
|
|
47
58
|
jQuery(function($) {
|
48
|
-
$(
|
49
|
-
|
50
|
-
formContainer: 'blank_description_form',
|
51
|
-
actionPrefix: '/file_attachments',
|
52
|
-
targetIdName: 'file_attachment_id',
|
53
|
-
targetContentName: 'file_attachment[description]',
|
54
|
-
targetContentType: 'textarea'
|
59
|
+
$('#file_attachments').attach(DynamicForm, {
|
60
|
+
formElement: $('#file_attachment_dynamic_form')
|
55
61
|
});
|
56
|
-
$("#new_description").attach(Remote.Form);
|
57
62
|
});
|
58
63
|
</script>
|
59
64
|
<% end %>
|
@@ -1,4 +1,3 @@
|
|
1
|
-
<select id="file_container_select" name="file_attachment[file_container]">
|
2
1
|
<option value=""></option>
|
3
2
|
<% @file_containers.group_by(&:class).each do |klass, file_containers| %>
|
4
3
|
<optgroup label="<%= klass.to_s.pluralize %>">
|
@@ -11,4 +10,3 @@
|
|
11
10
|
}) %>
|
12
11
|
</optgroup>
|
13
12
|
<% end %>
|
14
|
-
</select>
|
@@ -118,13 +118,15 @@
|
|
118
118
|
</p>
|
119
119
|
|
120
120
|
<% if @file_containers.present? %>
|
121
|
-
<p>
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
:
|
126
|
-
|
127
|
-
|
121
|
+
<p>
|
122
|
+
<select id="file_container_select" name="file_attachment[file_container]">
|
123
|
+
<%= render({
|
124
|
+
:partial => 'file_attachments/file_container_select',
|
125
|
+
:locals => {
|
126
|
+
:selected => "#{params[:attachable_type]}_#{params[:attachable_id]}"
|
127
|
+
}
|
128
|
+
}) %>
|
129
|
+
</select>
|
128
130
|
</p>
|
129
131
|
<% elsif instance_variable_defined?("@#{controller_name.singularize}") %>
|
130
132
|
<% instance = instance_variable_get("@#{controller_name.singularize}") %>
|
@@ -1,13 +1,22 @@
|
|
1
|
+
id = @file_attachment.id
|
2
|
+
attachable_name = @file_attachment.attachable.present? ? @file_attachment.attachable.name : 'orphanage'
|
1
3
|
if @file_attachment.valid?
|
2
4
|
page << %Q{
|
3
|
-
$('#
|
4
|
-
$('#
|
5
|
-
$('#file_attachment_#{
|
5
|
+
var original_container = $('#file_attachment_#{id}_file_container').text();
|
6
|
+
$('#file_attachment_dynamic_form').hide();
|
7
|
+
$('#file_attachment_#{id}_file_container').text("#{escape_javascript(@file_attachment.file_container)}");
|
8
|
+
$('#file_attachment_#{id}_name a').text('#{escape_javascript(@file_attachment.name)}');
|
9
|
+
$('#file_attachment_#{id}_description').text('#{escape_javascript(@file_attachment.description)}');
|
10
|
+
$('#file_attachment_#{id}').effect('highlight', {
|
6
11
|
color: '#C3D9FF'
|
7
|
-
}, 2500)
|
12
|
+
}, 2500);
|
13
|
+
|
14
|
+
if( original_container !== $('#file_attachment_#{id}_file_container').text() ) {
|
15
|
+
$('<p style="background:#C3D9FF;"><em>Moved to #{attachable_name}</em></p>').insertBefore($('#file_attachment_#{id}_name'));
|
16
|
+
}
|
8
17
|
}
|
9
18
|
else
|
10
19
|
page << %Q{
|
11
|
-
alert("The file
|
20
|
+
alert("The file could not be updated.");
|
12
21
|
}
|
13
22
|
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# Set the default text field size when input is a string. Default is nil.
|
4
|
+
# Formtastic::SemanticFormBuilder.default_text_field_size = 50
|
5
|
+
|
6
|
+
# Set the default text area height when input is a text. Default is 20.
|
7
|
+
# Formtastic::SemanticFormBuilder.default_text_area_height = 5
|
8
|
+
|
9
|
+
# Set the default text area width when input is a text. Default is nil.
|
10
|
+
# Formtastic::SemanticFormBuilder.default_text_area_width = 50
|
11
|
+
|
12
|
+
# Should all fields be considered "required" by default?
|
13
|
+
# Rails 2 only, ignored by Rails 3 because it will never fall back to this default.
|
14
|
+
# Defaults to true.
|
15
|
+
# Formtastic::SemanticFormBuilder.all_fields_required_by_default = true
|
16
|
+
|
17
|
+
# Should select fields have a blank option/prompt by default?
|
18
|
+
# Defaults to true.
|
19
|
+
# Formtastic::SemanticFormBuilder.include_blank_for_select_by_default = true
|
20
|
+
|
21
|
+
# Set the string that will be appended to the labels/fieldsets which are required
|
22
|
+
# It accepts string or procs and the default is a localized version of
|
23
|
+
# '<abbr title="required">*</abbr>'. In other words, if you configure formtastic.required
|
24
|
+
# in your locale, it will replace the abbr title properly. But if you don't want to use
|
25
|
+
# abbr tag, you can simply give a string as below
|
26
|
+
# Formtastic::SemanticFormBuilder.required_string = "(required)"
|
27
|
+
|
28
|
+
# Set the string that will be appended to the labels/fieldsets which are optional
|
29
|
+
# Defaults to an empty string ("") and also accepts procs (see required_string above)
|
30
|
+
# Formtastic::SemanticFormBuilder.optional_string = "(optional)"
|
31
|
+
|
32
|
+
# Set the way inline errors will be displayed.
|
33
|
+
# Defaults to :sentence, valid options are :sentence, :list, :first and :none
|
34
|
+
# Formtastic::SemanticFormBuilder.inline_errors = :sentence
|
35
|
+
# Formtastic uses the following classes as default for hints, inline_errors and error list
|
36
|
+
|
37
|
+
# If you override the class here, please ensure to override it in your formtastic_changes.css stylesheet as well
|
38
|
+
# Formtastic::SemanticFormBuilder.default_hint_class = "inline-hints"
|
39
|
+
# Formtastic::SemanticFormBuilder.default_inline_error_class = "inline-errors"
|
40
|
+
# Formtastic::SemanticFormBuilder.default_error_list_class = "errors"
|
41
|
+
|
42
|
+
# Set the method to call on label text to transform or format it for human-friendly
|
43
|
+
# reading when formtastic is used without object. Defaults to :humanize.
|
44
|
+
# Formtastic::SemanticFormBuilder.label_str_method = :humanize
|
45
|
+
|
46
|
+
# Set the array of methods to try calling on parent objects in :select and :radio inputs
|
47
|
+
# for the text inside each @<option>@ tag or alongside each radio @<input>@. The first method
|
48
|
+
# that is found on the object will be used.
|
49
|
+
# Defaults to ["to_label", "display_name", "full_name", "name", "title", "username", "login", "value", "to_s"]
|
50
|
+
# Formtastic::SemanticFormBuilder.collection_label_methods = [
|
51
|
+
# "to_label", "display_name", "full_name", "name", "title", "username", "login", "value", "to_s"]
|
52
|
+
|
53
|
+
# Formtastic by default renders inside li tags the input, hints and then
|
54
|
+
# errors messages. Sometimes you want the hints to be rendered first than
|
55
|
+
# the input, in the following order: hints, input and errors. You can
|
56
|
+
# customize it doing just as below:
|
57
|
+
# Formtastic::SemanticFormBuilder.inline_order = [:input, :hints, :errors]
|
58
|
+
|
59
|
+
# Additionally, you can customize the order for specific types of inputs.
|
60
|
+
# This is configured on a type basis and if a type is not found it will
|
61
|
+
# fall back to the default order as defined by #inline_order
|
62
|
+
# Formtastic::SemanticFormBuilder.custom_inline_order[:checkbox] = [:errors, :hints, :input]
|
63
|
+
# Formtastic::SemanticFormBuilder.custom_inline_order[:select] = [:hints, :input, :errors]
|
64
|
+
|
65
|
+
# Specifies if labels/hints for input fields automatically be looked up using I18n.
|
66
|
+
# Default value: false. Overridden for specific fields by setting value to true,
|
67
|
+
# i.e. :label => true, or :hint => true (or opposite depending on initialized value)
|
68
|
+
Formtastic::SemanticFormBuilder.i18n_lookups_by_default = true
|
69
|
+
|
70
|
+
# You can add custom inputs or override parts of Formtastic by subclassing SemanticFormBuilder and
|
71
|
+
# specifying that class here. Defaults to SemanticFormBuilder.
|
72
|
+
# Formtastic::SemanticFormHelper.builder = MyCustomBuilder
|
data/config/locales/en.yml
CHANGED
@@ -33,30 +33,3 @@ $.fn.clearForm = function() {
|
|
33
33
|
this.selectedIndex = -1;
|
34
34
|
});
|
35
35
|
};
|
36
|
-
|
37
|
-
DynamicForm = $.klass({
|
38
|
-
initialize: function(options) {
|
39
|
-
this.formId = options.formId; // new_description
|
40
|
-
this.formContainer = options.formContainer; // blank_description_form
|
41
|
-
this.targetIdName = options.targetIdName; // file_attachment_id
|
42
|
-
this.targetContentName = options.targetContentName; // file_attachment[description]
|
43
|
-
this.targetContentType = options.targetContentType;
|
44
|
-
this.actionPrefix = options.actionPrefix; // /file_attachments
|
45
|
-
},
|
46
|
-
onclick: function(e) {
|
47
|
-
e.preventDefault();
|
48
|
-
|
49
|
-
var targetIdValue = this.element.attr(this.targetIdName);
|
50
|
-
var targetContentValue = this.element.attr(this.targetContentName);
|
51
|
-
|
52
|
-
$('#' + this.formId).attr("action", this.actionPrefix + "/" + targetIdValue);
|
53
|
-
|
54
|
-
$('#' + this.formId).clearForm();
|
55
|
-
|
56
|
-
$('#' + this.formContainer).insertBefore(this.element);
|
57
|
-
|
58
|
-
$(this.targetContentType + '[name='+ this.targetContentName +']').val(targetContentValue);
|
59
|
-
|
60
|
-
$('#' + this.formContainer).show();
|
61
|
-
}
|
62
|
-
});
|
@@ -129,3 +129,47 @@ ShowHideLink = $.klass({
|
|
129
129
|
return this.doNotStop;
|
130
130
|
}
|
131
131
|
});
|
132
|
+
|
133
|
+
/*
|
134
|
+
$('#file_attachments').attach(DynamicForm, {
|
135
|
+
formElement: $('#new_description')
|
136
|
+
});
|
137
|
+
*/
|
138
|
+
DynamicForm = $.klass({
|
139
|
+
initialize: function(options) {
|
140
|
+
this.formElement = options.formElement;
|
141
|
+
this.formElement.attach(Remote.Form);
|
142
|
+
this.resourceType = this.formElement.attr('id').replace('_dynamic_form', '');
|
143
|
+
this.resourceInputs = this.formElement.find(':input[id^="'+this.resourceType+'"]');
|
144
|
+
this.resourcePlural = this.element.attr('id');
|
145
|
+
},
|
146
|
+
onclick: $.delegate({
|
147
|
+
'.cancel_dynamic_form': function(clickedElement, event) {
|
148
|
+
event.preventDefault();
|
149
|
+
this.formElement.hide();
|
150
|
+
},
|
151
|
+
'.file_attachment_dynamic_form_link': function(clickedElement, event) {
|
152
|
+
event.preventDefault();
|
153
|
+
|
154
|
+
var resourceContainer = clickedElement.parents('.' + this.resourceType);
|
155
|
+
var resourceId = /\d+/.exec(resourceContainer.attr('id'))[0];
|
156
|
+
|
157
|
+
// append resourceId to current form action
|
158
|
+
this.formElement.attr("action", "/" + this.resourcePlural + "/" + resourceId);
|
159
|
+
|
160
|
+
// clear form input values
|
161
|
+
this.formElement.clearForm();
|
162
|
+
// move form to resource
|
163
|
+
this.formElement.insertBefore(clickedElement);
|
164
|
+
|
165
|
+
this.resourceInputs.each(function() {
|
166
|
+
// get resource attr names from form input ids
|
167
|
+
var resourceAttrContainer = resourceContainer.find('.'+this.id);
|
168
|
+
// get resource attr vals from w/in resource container
|
169
|
+
this.value = resourceAttrContainer.text();
|
170
|
+
});
|
171
|
+
|
172
|
+
this.formElement.show();
|
173
|
+
}
|
174
|
+
})
|
175
|
+
});
|
@@ -19,120 +19,127 @@ form.formtastic ol, form.formtastic ul { list-style:none; }
|
|
19
19
|
form.formtastic abbr, form.formtastic acronym { border:0; font-variant:normal; }
|
20
20
|
form.formtastic input, form.formtastic textarea, form.formtastic select { font-family:inherit; font-size:inherit; font-weight:inherit; }
|
21
21
|
form.formtastic input, form.formtastic textarea, form.formtastic select { font-size:100%; }
|
22
|
-
form.formtastic legend { color:#000; }
|
22
|
+
form.formtastic legend { white-space:normal; color:#000; }
|
23
|
+
|
24
|
+
|
25
|
+
/* SEMANTIC ERRORS
|
26
|
+
--------------------------------------------------------------------------------------------------*/
|
27
|
+
form.formtastic ul.errors { color:#cc0000; margin:0.5em 0 1.5em 25%; list-style:square; }
|
28
|
+
form.formtastic ul.errors li { padding:0; border:none; display:list-item; }
|
23
29
|
|
24
30
|
|
25
31
|
/* FIELDSETS & LISTS
|
26
32
|
--------------------------------------------------------------------------------------------------*/
|
27
|
-
form.formtastic fieldset { }
|
33
|
+
form.formtastic fieldset { overflow:auto; } /* clearing contained floats */
|
28
34
|
form.formtastic fieldset.inputs { }
|
29
35
|
form.formtastic fieldset.buttons { padding-left:25%; }
|
30
36
|
form.formtastic fieldset ol { }
|
31
37
|
form.formtastic fieldset.buttons li { float:left; padding-right:0.5em; }
|
32
38
|
|
33
|
-
/* clearfixing the fieldsets */
|
34
|
-
form.formtastic fieldset { display: inline-block; }
|
35
|
-
form.formtastic fieldset:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
|
36
|
-
html[xmlns] form.formtastic fieldset { display: block; }
|
37
|
-
* html form.formtastic fieldset { height: 1%; }
|
38
|
-
|
39
|
-
|
40
39
|
/* INPUT LIs
|
41
40
|
--------------------------------------------------------------------------------------------------*/
|
42
|
-
form.formtastic fieldset ol li { margin-
|
43
|
-
|
44
|
-
/* clearfixing the li's */
|
45
|
-
form.formtastic fieldset ol li { display: inline-block; }
|
46
|
-
form.formtastic fieldset ol li:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
|
47
|
-
html[xmlns] form.formtastic fieldset ol li { display: block; }
|
48
|
-
* html form.formtastic fieldset ol li { height: 1%; }
|
41
|
+
form.formtastic fieldset > ol > li { padding:0.5em 0; margin-top:-0.5em; margin-bottom:1em; } /* padding and negative margin juggling is for Firefox */
|
42
|
+
form.formtastic fieldset > ol > li { overflow:auto; } /* clearing contained floats */
|
49
43
|
|
50
|
-
form.formtastic fieldset ol li.required { }
|
51
|
-
form.formtastic fieldset ol li.optional { }
|
52
|
-
form.formtastic fieldset ol li.error { }
|
44
|
+
form.formtastic fieldset > ol > li.required { }
|
45
|
+
form.formtastic fieldset > ol > li.optional { }
|
46
|
+
form.formtastic fieldset > ol > li.error { }
|
53
47
|
|
54
48
|
|
55
49
|
/* LABELS
|
56
50
|
--------------------------------------------------------------------------------------------------*/
|
57
|
-
form.formtastic fieldset ol li label { display:block; width:25%; float:left; padding-top:.2em; }
|
58
|
-
form.formtastic fieldset ol li li label { line-height:100%; padding-top:0; }
|
59
|
-
form.formtastic fieldset ol li li label input { line-height:100%; vertical-align:middle; margin-top:-0.1em;}
|
51
|
+
form.formtastic fieldset > ol > li label { display:block; width:25%; float:left; padding-top:.2em; }
|
52
|
+
form.formtastic fieldset > ol > li > li label { line-height:100%; padding-top:0; }
|
53
|
+
form.formtastic fieldset > ol > li > li label input { line-height:100%; vertical-align:middle; margin-top:-0.1em;}
|
60
54
|
|
61
55
|
|
62
56
|
/* NESTED FIELDSETS AND LEGENDS (radio, check boxes and date/time inputs use nested fieldsets)
|
63
57
|
--------------------------------------------------------------------------------------------------*/
|
64
|
-
form.formtastic fieldset ol li fieldset { position:relative; }
|
65
|
-
form.formtastic fieldset ol li fieldset legend { position:absolute; width:
|
66
|
-
form.formtastic fieldset ol li fieldset legend span { position:absolute; }
|
67
|
-
form.formtastic fieldset ol li fieldset legend.label label { position:absolute; }
|
68
|
-
form.formtastic fieldset ol li fieldset ol { float:left; width:74%; margin:0; padding:0 0 0 25%; }
|
69
|
-
form.formtastic fieldset ol li fieldset ol li { padding:0; border:0; }
|
58
|
+
form.formtastic fieldset > ol > li fieldset { position:relative; }
|
59
|
+
form.formtastic fieldset > ol > li fieldset legend { position:absolute; width:95%; padding-top:0.1em; left: 0px; }
|
60
|
+
form.formtastic fieldset > ol > li fieldset legend span { position:absolute; }
|
61
|
+
form.formtastic fieldset > ol > li fieldset legend.label label { position:absolute; }
|
62
|
+
form.formtastic fieldset > ol > li fieldset ol { float:left; width:74%; margin:0; padding:0 0 0 25%; }
|
63
|
+
form.formtastic fieldset > ol > li fieldset ol li { padding:0; border:0; }
|
70
64
|
|
71
65
|
|
72
66
|
/* INLINE HINTS
|
73
67
|
--------------------------------------------------------------------------------------------------*/
|
74
|
-
form.formtastic fieldset ol li p.inline-hints { color:#666; margin:0.5em 0 0 25%; }
|
68
|
+
form.formtastic fieldset > ol > li p.inline-hints { color:#666; margin:0.5em 0 0 25%; }
|
75
69
|
|
76
70
|
|
77
71
|
/* INLINE ERRORS
|
78
72
|
--------------------------------------------------------------------------------------------------*/
|
79
|
-
form.formtastic fieldset ol li p.inline-errors { color:#cc0000; margin:0.5em 0 0 25%; }
|
80
|
-
form.formtastic fieldset ol li ul.errors { color:#cc0000; margin:0.5em 0 0 25%; list-style:square; }
|
81
|
-
form.formtastic fieldset ol li ul.errors li { padding:0; border:none; display:list-item; }
|
73
|
+
form.formtastic fieldset > ol > li p.inline-errors { color:#cc0000; margin:0.5em 0 0 25%; }
|
74
|
+
form.formtastic fieldset > ol > li ul.errors { color:#cc0000; margin:0.5em 0 0 25%; list-style:square; }
|
75
|
+
form.formtastic fieldset > ol > li ul.errors li { padding:0; border:none; display:list-item; }
|
82
76
|
|
83
77
|
|
84
|
-
/* STRING &
|
78
|
+
/* STRING, NUMERIC, PASSWORD, EMAIL, URL, PHONE & SEARCH OVERRIDES
|
85
79
|
--------------------------------------------------------------------------------------------------*/
|
86
|
-
form.formtastic fieldset ol li.string input
|
87
|
-
form.formtastic fieldset ol li.password input
|
88
|
-
form.formtastic fieldset ol li.numeric input
|
80
|
+
form.formtastic fieldset > ol > li.string input,
|
81
|
+
form.formtastic fieldset > ol > li.password input,
|
82
|
+
form.formtastic fieldset > ol > li.numeric input,
|
83
|
+
form.formtastic fieldset > ol > li.email input,
|
84
|
+
form.formtastic fieldset > ol > li.url input,
|
85
|
+
form.formtastic fieldset > ol > li.phone input,
|
86
|
+
form.formtastic fieldset > ol > li.search input { width:72%; }
|
87
|
+
|
88
|
+
form.formtastic fieldset > ol > li.string input[size],
|
89
|
+
form.formtastic fieldset > ol > li.password input[size],
|
90
|
+
form.formtastic fieldset > ol > li.numeric input[size],
|
91
|
+
form.formtastic fieldset > ol > li.email input[size],
|
92
|
+
form.formtastic fieldset > ol > li.url input[size],
|
93
|
+
form.formtastic fieldset > ol > li.phone input[size],
|
94
|
+
form.formtastic fieldset > ol > li.search input[size] { width:auto; max-width:72%; }
|
89
95
|
|
90
96
|
|
91
97
|
/* TEXTAREA OVERRIDES
|
92
98
|
--------------------------------------------------------------------------------------------------*/
|
93
|
-
form.formtastic fieldset ol li.text textarea { width:
|
99
|
+
form.formtastic fieldset > ol > li.text textarea { width:72%; }
|
100
|
+
form.formtastic fieldset > ol > li.text textarea[cols] { width:auto; max-width:72%; }
|
94
101
|
|
95
102
|
|
96
103
|
/* HIDDEN OVERRIDES
|
97
104
|
--------------------------------------------------------------------------------------------------*/
|
98
105
|
form.formtastic fieldset ol li.hidden { display:none; }
|
99
106
|
|
100
|
-
|
101
107
|
/* BOOLEAN OVERRIDES
|
102
108
|
--------------------------------------------------------------------------------------------------*/
|
103
|
-
form.formtastic fieldset ol li.boolean label { padding-left:25%; width:auto; }
|
104
|
-
form.formtastic fieldset ol li.boolean label input { margin:0 0.5em 0 0.2em; }
|
109
|
+
form.formtastic fieldset > ol > li.boolean label { padding-left:25%; width:auto; }
|
110
|
+
form.formtastic fieldset > ol > li.boolean label input { margin:0 0.5em 0 0.2em; }
|
105
111
|
|
106
112
|
|
107
113
|
/* RADIO OVERRIDES
|
108
114
|
--------------------------------------------------------------------------------------------------*/
|
109
|
-
form.formtastic fieldset ol li.radio { }
|
110
|
-
form.formtastic fieldset ol li.radio fieldset
|
111
|
-
form.formtastic fieldset ol li.radio fieldset ol
|
112
|
-
form.formtastic fieldset ol li.radio fieldset ol li
|
113
|
-
form.formtastic fieldset ol li.radio fieldset ol li label
|
115
|
+
form.formtastic fieldset > ol > li.radio { }
|
116
|
+
form.formtastic fieldset > ol > li.radio fieldset { overflow:visible; }
|
117
|
+
form.formtastic fieldset > ol > li.radio fieldset ol { margin-bottom:-0.5em; }
|
118
|
+
form.formtastic fieldset > ol > li.radio fieldset ol li { margin:0.1em 0 0.5em 0; overflow:visible; }
|
119
|
+
form.formtastic fieldset > ol > li.radio fieldset ol li label { float:none; width:100%; }
|
120
|
+
form.formtastic fieldset > ol > li.radio fieldset ol li label input { margin-right:0.2em; }
|
114
121
|
|
115
122
|
|
116
123
|
/* CHECK BOXES (COLLECTION) OVERRIDES
|
117
124
|
--------------------------------------------------------------------------------------------------*/
|
118
|
-
form.formtastic fieldset ol li.check_boxes { }
|
119
|
-
form.formtastic fieldset ol li.check_boxes fieldset
|
120
|
-
form.formtastic fieldset ol li.check_boxes fieldset ol
|
121
|
-
form.formtastic fieldset ol li.check_boxes fieldset ol li
|
122
|
-
form.formtastic fieldset ol li.check_boxes fieldset ol li label
|
123
|
-
|
125
|
+
form.formtastic fieldset > ol > li.check_boxes { }
|
126
|
+
form.formtastic fieldset > ol > li.check_boxes fieldset { overflow:visible; }
|
127
|
+
form.formtastic fieldset > ol > li.check_boxes fieldset ol { margin-bottom:-0.5em; }
|
128
|
+
form.formtastic fieldset > ol > li.check_boxes fieldset ol li { margin:0.1em 0 0.5em 0; overflow:visible; }
|
129
|
+
form.formtastic fieldset > ol > li.check_boxes fieldset ol li label { float:none; width:100%; }
|
130
|
+
form.formtastic fieldset > ol > li.check_boxes fieldset ol li label input { margin-right:0.2em; }
|
124
131
|
|
125
132
|
|
126
133
|
/* DATE & TIME OVERRIDES
|
127
134
|
--------------------------------------------------------------------------------------------------*/
|
128
|
-
form.formtastic fieldset ol li.date fieldset ol li,
|
129
|
-
form.formtastic fieldset ol li.time fieldset ol li,
|
130
|
-
form.formtastic fieldset ol li.datetime fieldset ol li { float:left; width:auto; margin:0 .3em 0 0; }
|
135
|
+
form.formtastic fieldset > ol > li.date fieldset ol li,
|
136
|
+
form.formtastic fieldset > ol > li.time fieldset ol li,
|
137
|
+
form.formtastic fieldset > ol > li.datetime fieldset ol li { float:left; width:auto; margin:0 .3em 0 0; }
|
131
138
|
|
132
|
-
form.formtastic fieldset ol li.date fieldset ol li label,
|
133
|
-
form.formtastic fieldset ol li.time fieldset ol li label,
|
134
|
-
form.formtastic fieldset ol li.datetime fieldset ol li label { display:none; }
|
139
|
+
form.formtastic fieldset > ol > li.date fieldset ol li label,
|
140
|
+
form.formtastic fieldset > ol > li.time fieldset ol li label,
|
141
|
+
form.formtastic fieldset > ol > li.datetime fieldset ol li label { display:none; }
|
135
142
|
|
136
|
-
form.formtastic fieldset ol li.date fieldset ol li label input,
|
137
|
-
form.formtastic fieldset ol li.time fieldset ol li label input,
|
138
|
-
form.formtastic fieldset ol li.datetime fieldset ol li label input { display:inline; margin:0; padding:0; }
|
143
|
+
form.formtastic fieldset > ol > li.date fieldset ol li label input,
|
144
|
+
form.formtastic fieldset > ol > li.time fieldset ol li label input,
|
145
|
+
form.formtastic fieldset > ol > li.datetime fieldset ol li label input { display:inline; margin:0; padding:0; }
|
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: 31
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 2
|
10
|
+
version: 0.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jason LaPier
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-12-
|
19
|
+
date: 2010-12-13 00:00:00 -08:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
- !ruby/object:Gem::Dependency
|
67
67
|
type: :development
|
68
68
|
prerelease: false
|
69
|
-
name:
|
69
|
+
name: acts_as_fu
|
70
70
|
version_requirements: &id004 !ruby/object:Gem::Requirement
|
71
71
|
none: false
|
72
72
|
requirements:
|
@@ -80,7 +80,7 @@ dependencies:
|
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
type: :development
|
82
82
|
prerelease: false
|
83
|
-
name:
|
83
|
+
name: capybara
|
84
84
|
version_requirements: &id005 !ruby/object:Gem::Requirement
|
85
85
|
none: false
|
86
86
|
requirements:
|
@@ -94,7 +94,7 @@ dependencies:
|
|
94
94
|
- !ruby/object:Gem::Dependency
|
95
95
|
type: :development
|
96
96
|
prerelease: false
|
97
|
-
name:
|
97
|
+
name: cucumber-rails
|
98
98
|
version_requirements: &id006 !ruby/object:Gem::Requirement
|
99
99
|
none: false
|
100
100
|
requirements:
|
@@ -108,7 +108,7 @@ dependencies:
|
|
108
108
|
- !ruby/object:Gem::Dependency
|
109
109
|
type: :development
|
110
110
|
prerelease: false
|
111
|
-
name:
|
111
|
+
name: engineer
|
112
112
|
version_requirements: &id007 !ruby/object:Gem::Requirement
|
113
113
|
none: false
|
114
114
|
requirements:
|
@@ -122,7 +122,7 @@ dependencies:
|
|
122
122
|
- !ruby/object:Gem::Dependency
|
123
123
|
type: :development
|
124
124
|
prerelease: false
|
125
|
-
name:
|
125
|
+
name: rcov
|
126
126
|
version_requirements: &id008 !ruby/object:Gem::Requirement
|
127
127
|
none: false
|
128
128
|
requirements:
|
@@ -136,7 +136,7 @@ dependencies:
|
|
136
136
|
- !ruby/object:Gem::Dependency
|
137
137
|
type: :development
|
138
138
|
prerelease: false
|
139
|
-
name:
|
139
|
+
name: rspec-rails
|
140
140
|
version_requirements: &id009 !ruby/object:Gem::Requirement
|
141
141
|
none: false
|
142
142
|
requirements:
|
@@ -194,7 +194,7 @@ dependencies:
|
|
194
194
|
- !ruby/object:Gem::Dependency
|
195
195
|
type: :development
|
196
196
|
prerelease: false
|
197
|
-
name:
|
197
|
+
name: acts_as_fu
|
198
198
|
version_requirements: &id013 !ruby/object:Gem::Requirement
|
199
199
|
none: false
|
200
200
|
requirements:
|
@@ -208,7 +208,7 @@ dependencies:
|
|
208
208
|
- !ruby/object:Gem::Dependency
|
209
209
|
type: :development
|
210
210
|
prerelease: false
|
211
|
-
name:
|
211
|
+
name: capybara
|
212
212
|
version_requirements: &id014 !ruby/object:Gem::Requirement
|
213
213
|
none: false
|
214
214
|
requirements:
|
@@ -222,7 +222,7 @@ dependencies:
|
|
222
222
|
- !ruby/object:Gem::Dependency
|
223
223
|
type: :development
|
224
224
|
prerelease: false
|
225
|
-
name:
|
225
|
+
name: cucumber-rails
|
226
226
|
version_requirements: &id015 !ruby/object:Gem::Requirement
|
227
227
|
none: false
|
228
228
|
requirements:
|
@@ -236,7 +236,7 @@ dependencies:
|
|
236
236
|
- !ruby/object:Gem::Dependency
|
237
237
|
type: :development
|
238
238
|
prerelease: false
|
239
|
-
name:
|
239
|
+
name: rcov
|
240
240
|
version_requirements: &id016 !ruby/object:Gem::Requirement
|
241
241
|
none: false
|
242
242
|
requirements:
|
@@ -250,7 +250,7 @@ dependencies:
|
|
250
250
|
- !ruby/object:Gem::Dependency
|
251
251
|
type: :development
|
252
252
|
prerelease: false
|
253
|
-
name:
|
253
|
+
name: rspec-rails
|
254
254
|
version_requirements: &id017 !ruby/object:Gem::Requirement
|
255
255
|
none: false
|
256
256
|
requirements:
|
@@ -307,6 +307,7 @@ files:
|
|
307
307
|
- config/environments/production.rb
|
308
308
|
- config/environments/test.rb
|
309
309
|
- config/initializers/backtrace_silencers.rb
|
310
|
+
- config/initializers/formtastic.rb
|
310
311
|
- config/initializers/inflections.rb
|
311
312
|
- config/initializers/mime_types.rb
|
312
313
|
- config/initializers/secret_token.rb
|