lolita-file-upload 0.4.12 → 0.4.13
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +2 -2
- data/VERSION +1 -1
- data/app/assets/images/lolita/tinymce_gallery.png +0 -0
- data/app/assets/images/lolita/upload/back.png +0 -0
- data/app/assets/images/lolita/upload/delete.png +0 -0
- data/app/assets/images/lolita/upload/edit.png +0 -0
- data/app/assets/images/lolita/upload/next.png +0 -0
- data/app/assets/images/lolita/upload/prev.png +0 -0
- data/app/assets/images/lolita/upload/save.png +0 -0
- data/app/controllers/lolita/uploads_controller.rb +11 -7
- data/app/models/lolita/upload/file.rb +1 -1
- data/app/views/components/lolita/configuration/field/string/text_gallery/_display.html.haml +20 -0
- data/app/views/components/lolita/configuration/tab/files/_cells.html.erb +2 -2
- data/app/views/components/lolita/configuration/tab/files/_destroy.js.erb +5 -2
- data/app/views/components/lolita/configuration/tab/files/_display.html.erb +6 -7
- data/app/views/components/lolita/configuration/tab/files/_edit.js.erb +1 -1
- data/app/views/components/lolita/configuration/tab/files/_form.html.erb +24 -7
- data/app/views/components/lolita/configuration/tab/files/_image.html.erb +29 -0
- data/app/views/components/lolita/configuration/tab/files/_list.html.erb +6 -14
- data/app/views/components/lolita/configuration/tab/files/_list.js.erb +2 -0
- data/app/views/components/lolita/configuration/tab/files/_update.js.erb +1 -1
- data/app/views/components/lolita/configuration/tab/files/_upload_script.html.erb +11 -7
- data/config/locales/en.yml +10 -1
- data/config/locales/lv.yml +10 -1
- data/lib/lolita-file-upload.rb +9 -0
- data/lib/lolita-file-upload/configuration/tab/files.rb +1 -0
- data/lib/lolita-file-upload/module.rb +1 -1
- data/lolita-file-upload.gemspec +15 -6
- data/vendor/assets/javascripts/lolita/upload/application_vendor.js +10 -0
- data/vendor/assets/stylesheets/lolita/upload/application_vendor.css +2 -1
- data/vendor/assets/stylesheets/lolita/upload/lolita_file_upload.css.scss +64 -0
- metadata +71 -22
- data/app/assets/images/lolita/upload/delete-picture.png +0 -0
data/Gemfile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
2
|
|
3
3
|
gem "lolita", "~>3.2.0.rc.6"
|
4
|
-
gem "carrierwave", "~> 0.
|
4
|
+
gem "carrierwave", "~> 0.6.0"
|
5
5
|
gem "mini_magick"
|
6
6
|
gem 'jquery-rails', '>= 1.0.12'
|
7
7
|
group :test do
|
@@ -11,7 +11,7 @@ group :test do
|
|
11
11
|
gem "sqlite3"
|
12
12
|
gem "rspec", "~> 2.6"
|
13
13
|
gem 'cover_me', '>= 1.0.0.rc6'
|
14
|
-
gem 'rails', "~> 3.
|
14
|
+
gem 'rails', "~> 3.2.0"
|
15
15
|
end
|
16
16
|
|
17
17
|
group :development do
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.13
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,32 +1,36 @@
|
|
1
1
|
class Lolita::UploadsController < ApplicationController
|
2
2
|
include Lolita::ControllerAdditions
|
3
3
|
before_filter :authenticate_lolita_user!
|
4
|
-
before_filter :set_tab, :only=>[:edit,:update,:destroy,:create]
|
4
|
+
before_filter :set_tab, :only=>[:index,:edit,:update,:destroy,:create]
|
5
5
|
before_filter :set_resource, :only=>[:create,:edit,:update,:destroy]
|
6
6
|
before_filter :set_file, :only=>[:edit,:update,:destroy,:create]
|
7
7
|
|
8
8
|
respond_to :js,:html
|
9
9
|
|
10
|
+
def index
|
11
|
+
render_component *@tab.build("",:list,:file=>@file)
|
12
|
+
end
|
13
|
+
|
10
14
|
def create
|
11
|
-
can?(:create,@file.class)
|
15
|
+
authorization_proxy.can?(:create,@file.class)
|
12
16
|
@file.send(:"#{@tab.uploader}=",params[:file])
|
13
17
|
@file.save!
|
14
|
-
render_component *@tab.build("",:
|
18
|
+
render_component *@tab.build("",:image,:file=>@file, :format => "html")
|
15
19
|
end
|
16
20
|
|
17
21
|
def edit
|
18
|
-
can?(:update,@file.class)
|
22
|
+
authorization_proxy.can?(:update,@file.class)
|
19
23
|
render_component *@tab.build("",:edit,:file=>@file)
|
20
24
|
end
|
21
25
|
|
22
26
|
def update
|
23
|
-
can?(:update,@file.class)
|
27
|
+
authorization_proxy.can?(:update,@file.class)
|
24
28
|
@file.update_attributes!(params[:file])
|
25
29
|
render_component *@tab.build("",:update,:file=>@file)
|
26
30
|
end
|
27
31
|
|
28
32
|
def destroy
|
29
|
-
can?(:destroy,@file.class)
|
33
|
+
authorization_proxy.can?(:destroy,@file.class)
|
30
34
|
@file.destroy
|
31
35
|
render_component *@tab.build("",:destroy,:file=>@file)
|
32
36
|
end
|
@@ -58,4 +62,4 @@ class Lolita::UploadsController < ApplicationController
|
|
58
62
|
def tab_by_association name
|
59
63
|
resource_class.lolita.tabs.detect{|tab| tab.type == :files && (tab.try(:association) && tab.association.name == name.to_sym)}
|
60
64
|
end
|
61
|
-
end
|
65
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
= current_form.text_area field.name, :rows=>(field.rows || 20), :"data-simple"=>field.simple
|
2
|
+
- if @textarea_component_include_tinymce_once.nil?
|
3
|
+
:javascript
|
4
|
+
$(function(){
|
5
|
+
load_tinymce({
|
6
|
+
theme_advanced_buttons1 : "bold,italic,underline,|,justifyleft,justifycenter,justifyright,|,formatselect,|,link,unlink,image,code,gallery",
|
7
|
+
setup : function(ed) {
|
8
|
+
// Add a custom button
|
9
|
+
ed.addButton('gallery', {
|
10
|
+
title : '#{t('lolita.tinymce.gallery')}',
|
11
|
+
image : '#{asset_path('lolita/tinymce_gallery.png')}',
|
12
|
+
onclick : function() {
|
13
|
+
$('#fixed-gallery button').css("top",$(window).height()/4-30);
|
14
|
+
$('#fixed-gallery').css("height",$(window).height()/4).toggle();
|
15
|
+
}
|
16
|
+
})
|
17
|
+
}
|
18
|
+
});
|
19
|
+
})
|
20
|
+
- @textarea_component_include_tinymce_once = "done"
|
@@ -7,6 +7,6 @@
|
|
7
7
|
<% end %>
|
8
8
|
</td>
|
9
9
|
<td style="margin-top: 3px; border-bottom: 2px solid #E1E1E1; width: 55px;text-align: center; font-size: 14px; padding: 7px 20px; vertical-align: middle;">
|
10
|
-
<%= link_to
|
10
|
+
<%= link_to image_tag("lolita/upload/edit.png"),send(:"edit_lolita_#{tab.dbi.klass.model_name.singular}_upload_path", "#{tab.dbi.klass.model_name.singular}_id" => (resource.nil? || resource.new_record?) ? 0 : resource.id, :association => tab.association.name, :id=>file.id),:remote=>true %>
|
11
11
|
<%= link_to image_tag("lolita/upload/delete-picture.png"),send(:"lolita_#{tab.dbi.klass.model_name.singular}_upload_path", "#{tab.dbi.klass.model_name.singular}_id" => (resource.nil? || resource.new_record?) ? 0 : resource.id, :association => tab.association.name, :id=>file.id),:method=>:delete,:remote=>true,:confirm=>"Are you sure?" %>
|
12
|
-
</td>
|
12
|
+
</td>
|
@@ -1,2 +1,5 @@
|
|
1
|
-
$("#upload_<%=tab.association.name%>
|
2
|
-
$("input.<%=tab.association.name%>-ids[value=<%=file.id%>]").remove()
|
1
|
+
$("#upload_<%=tab.association.name%>_item_<%=file.id%>").remove()
|
2
|
+
$("input.<%=tab.association.name%>-ids[value=<%=file.id%>]").remove()
|
3
|
+
//return to list
|
4
|
+
$("#<%= tab.association.name %>_form").show()
|
5
|
+
$("#<%= tab.association.name %>_form").siblings(".edit-file-form").remove()
|
@@ -2,13 +2,12 @@
|
|
2
2
|
model_name = tab.dbi.klass.model_name.plural.downcase
|
3
3
|
addon = model_name == model_name.singularize ? "_index" : ""
|
4
4
|
%>
|
5
|
-
<%= form_tag(send(:"create_upload_lolita_#{model_name}#{addon}_path", :association => tab.association.name),:method=>:post, :id=>"#{tab.association.name}_form") do %>
|
5
|
+
<%= form_tag(send(:"create_upload_lolita_#{model_name}#{addon}_path", :association => tab.association.name),:method=>:post, :id=>"#{tab.association.name}_form", :class=>"lolita-file-upload-form") do %>
|
6
6
|
<div id="file_upload_container_<%="#{tab.association.name}"%>">
|
7
|
-
Your
|
7
|
+
Your browser don't have HTML5 or Flash support.
|
8
8
|
</div>
|
9
|
+
<div class="filelist">
|
10
|
+
<%= render_component tab,:list %>
|
11
|
+
</div>
|
12
|
+
<%= render_component tab, :upload_script, :container => "file_upload_container_#{tab.association.name}"%>
|
9
13
|
<% end %>
|
10
|
-
<div id="filelist">
|
11
|
-
<%= render_component tab,:list %>
|
12
|
-
</div>
|
13
|
-
<%= render_component tab, :upload_script, :container => "file_upload_container_#{tab.association.name}"%>
|
14
|
-
<%= render_component :"lolita/configuration/tab", :fields, :tab=>tab %>
|
@@ -1 +1 @@
|
|
1
|
-
$("#upload_<%=tab.association.name%>
|
1
|
+
$("#upload_<%=tab.association.name%>_item_<%=file.id%>").closest(".lolita-file-upload-form").hide().after("<%=escape_javascript(render_component(*tab.build("",:form,:file=>file,:format=>"html")))%>");
|
@@ -1,7 +1,24 @@
|
|
1
|
-
<%= form_tag send(:"lolita_#{resource_class.model_name.singular}_upload_path", "#{resource_class.model_name.singular}_id" => resource.id, :association => tab.association.name, :id=>file.id),:method=>:put,:remote=>true,:id=>"edit_#{tab.association.name}_#{file.id}" do %>
|
2
|
-
|
3
|
-
|
4
|
-
<%=
|
5
|
-
<
|
6
|
-
|
7
|
-
|
1
|
+
<%= form_tag send(:"lolita_#{resource_class.model_name.singular}_upload_path", "#{resource_class.model_name.singular}_id" => resource.id, :association => tab.association.name, :id=>file.id),:method=>:put,:remote=>true,:id=>"edit_#{tab.association.name}_#{file.id}", :class => "edit-file-form" do %>
|
2
|
+
<div class="file-editor">
|
3
|
+
<% url = file.send(tab.uploader).normalized.blank? ? file.send(tab.uploader).url : file.send(tab.uploader).normalized.url %>
|
4
|
+
<%= image_tag url, :class => "editable-image" %>
|
5
|
+
<div class="fields">
|
6
|
+
<% tab.editable_fields.each do |name| %>
|
7
|
+
<%= label_tag "file[#{name}]", file.class.human_attribute_name(name) %>
|
8
|
+
<%= text_field_tag "file[#{name}]",file.send(name) %>
|
9
|
+
<br />
|
10
|
+
<% end %>
|
11
|
+
</div>
|
12
|
+
<div class="action-links">
|
13
|
+
<div class="navigation">
|
14
|
+
<%= link_to t("lolita.tabs.images.back"), send(:"lolita_#{tab.dbi.klass.model_name.singular}_uploads_path"), :remote => true, :class => "back" %>
|
15
|
+
<%#= link_to t("lolita.tabs.images.previous"), "#", :class => "previous" %>
|
16
|
+
<%#= link_to t("lolita.tabs.images.next"), "#", :class => "next" %>
|
17
|
+
</div>
|
18
|
+
<div class="actions">
|
19
|
+
<%= link_to t("lolita.tabs.images.delete"), send(:"lolita_#{tab.dbi.klass.model_name.singular}_upload_path", "#{tab.dbi.klass.model_name.singular}_id" => (resource.nil? || resource.new_record?) ? 0 : resource.id, :association => tab.association.name, :id=>file.id),:method=>:delete,:remote=>true,:confirm=>"Are you sure?", :class => "delete" %>
|
20
|
+
<%= link_to t("lolita.tabs.images.save"), "#", :class => "save" %>
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
<% end %>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<div class="file-item" id="upload_<%=tab.association.name%>_item_<%=file.id%>" data-<%=tab.association.name%>-id="<%=file.id%>">
|
2
|
+
<div class="window">
|
3
|
+
<% if file.send(tab.uploader).to_s =~ /(jpg|jpeg|png|gif)$/i %>
|
4
|
+
<% url = file.send(tab.uploader).normalized.blank? ? file.send(tab.uploader).url : file.send(tab.uploader).normalized.url %>
|
5
|
+
<%#= link_to image_tag(url, :style=>"width:300px; height 160px;"), url %>
|
6
|
+
<%= image_tag url %>
|
7
|
+
<% else %>
|
8
|
+
<%#= link_to file.send(tab.uploader).url, file.send(tab.uploader).url %>
|
9
|
+
<%= file.send(tab.uploader).url %>
|
10
|
+
<% end %>
|
11
|
+
<div class="links">
|
12
|
+
<%= link_to t("lolita.tabs.images.edit"),send(:"edit_lolita_#{tab.dbi.klass.model_name.singular}_upload_path", "#{tab.dbi.klass.model_name.singular}_id" => (resource.nil? || resource.new_record?) ? 0 : resource.id, :association => tab.association.name, :id=>file.id),:remote=>true, :class => "edit_link" %>
|
13
|
+
<%= link_to t("lolita.tabs.images.delete"),send(:"lolita_#{tab.dbi.klass.model_name.singular}_upload_path", "#{tab.dbi.klass.model_name.singular}_id" => (resource.nil? || resource.new_record?) ? 0 : resource.id, :association => tab.association.name, :id=>file.id),:method=>:delete,:remote=>true,:confirm=>"Are you sure?", :class => "delete_link" %>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
<p><%= File.basename(file.send(tab.uploader).url) %></p>
|
17
|
+
</div>
|
18
|
+
<script>
|
19
|
+
$('#fixed-gallery').append("<%=escape_javascript(render_component(*tab.build("",:file,:file=>file,:format=>"html")))%>");
|
20
|
+
<% if tab.association_type == :many
|
21
|
+
ids = "#{resource_name}[#{tab.association.name.to_s.singularize}_ids][]"
|
22
|
+
else
|
23
|
+
ids = "#{resource_name}[#{tab.association.name.to_s.singularize}_new]"
|
24
|
+
end %>
|
25
|
+
<% if resource && resource.new_record? && resource.errors.any? %>
|
26
|
+
$(".tabs form:first").append('<input type="hidden" class="<%=tab.association.name%>-ids" name="<%= ids %>" value="<%= file.id %>" />')
|
27
|
+
<% end %>
|
28
|
+
|
29
|
+
</script>
|
@@ -1,14 +1,6 @@
|
|
1
|
-
<
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
</thead>
|
8
|
-
<tbody>
|
9
|
-
<% files = tab.association_type == :one ? [resource.send(tab.association.name)].compact : resource.send(tab.association.name) %>
|
10
|
-
<% files.each do |file| %>
|
11
|
-
<%= render_component *tab.build("",:row,:file=>file,:value=>nil) %>
|
12
|
-
<% end %>
|
13
|
-
</tbody>
|
14
|
-
</table>
|
1
|
+
<div id="file_list_for_<%= tab.association.name %>" class="filelist-container">
|
2
|
+
<% files = tab.association_type == :one ? [resource.send(tab.association.name)].compact : resource.send(tab.association.name) %>
|
3
|
+
<% files.each do |file| %>
|
4
|
+
<%= render_component *tab.build("", :image, :file => file, :value => nil) %>
|
5
|
+
<% end %>
|
6
|
+
</div>
|
@@ -1 +1 @@
|
|
1
|
-
$("#
|
1
|
+
$("#edit_<%=tab.association.name%>_<%=file.id%>").replaceWith("<%=escape_javascript(render_component(*tab.build("",:form,:file=>file,:format=>"html")))%>")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<%= stylesheet_link_tag "lolita/upload/application_vendor.css" %>
|
2
2
|
<%= javascript_include_tag "lolita/upload/application_vendor.js" %>
|
3
|
-
<% unless
|
3
|
+
<% unless ::I18n.locale.to_s.downcase=="en" %>
|
4
4
|
<%= javascript_include_tag "lolita/upload/I18n/#{Lolita.locale}.js"%>
|
5
5
|
<% end %>
|
6
6
|
<script type="text/javascript">
|
@@ -24,13 +24,17 @@
|
|
24
24
|
],
|
25
25
|
<% end %>
|
26
26
|
multipart: true,
|
27
|
+
<% if tab.association_type == :one %>
|
28
|
+
max_file_count: 1,
|
29
|
+
multi_selection: false,
|
30
|
+
<% end %>
|
27
31
|
multipart_params: {
|
28
32
|
"authenticity_token" : '<%= form_authenticity_token %>',
|
29
33
|
<% if tab.association.options[:as] -%>
|
30
34
|
"<%="upload[#{tab.association.options[:as]}_type]"%>": "<%=resource.class%>",
|
31
35
|
"<%="upload[#{tab.association.options[:as]}_id]"%>": "<%=resource.new_record? ? 0 : resource.id%>"
|
32
36
|
<% else -%>
|
33
|
-
"<%="upload[#{
|
37
|
+
"<%="upload[#{tab.association.foreign_key}]"%>": "<%=resource.new_record? ? 0 : resource.id%>"
|
34
38
|
<% end -%>
|
35
39
|
},
|
36
40
|
headers:{
|
@@ -42,11 +46,11 @@
|
|
42
46
|
init:{
|
43
47
|
FileUploaded:function(uploader, file, info){
|
44
48
|
<% if tab.association_type == :many %>
|
45
|
-
$("#file_list_for_<%=tab.association.name
|
49
|
+
$("#file_list_for_<%=tab.association.name%>").append(info.response)
|
46
50
|
<% else %>
|
47
51
|
uploader.splice(0,10);
|
48
|
-
$("#file_list_for_<%=tab.association.name
|
49
|
-
$("#file_list_for_<%=tab.association.name
|
52
|
+
$("#file_list_for_<%=tab.association.name%>").html("")
|
53
|
+
$("#file_list_for_<%=tab.association.name%>").append(info.response)
|
50
54
|
<% end %>
|
51
55
|
|
52
56
|
<% if tab.association_type == :many %>
|
@@ -61,13 +65,13 @@
|
|
61
65
|
})
|
62
66
|
|
63
67
|
var new_ids=[]
|
64
|
-
$("#file_list_for_<%=tab.association.name%>
|
68
|
+
$("#file_list_for_<%=tab.association.name%> .file-item[data-<%=tab.association.name%>-id]").each(function(){
|
65
69
|
if($.inArray($(this).attr("data-<%=tab.association.name%>-id"),existing_ids)<0){
|
66
70
|
new_ids.push($(this).attr("data-<%=tab.association.name%>-id"))
|
67
71
|
}
|
68
72
|
})
|
69
73
|
for(var i in new_ids){
|
70
|
-
$("
|
74
|
+
$(".tabs form:first").append('<input type="hidden" class="<%=tab.association.name%>-ids" name="'+ids+'" value="'+new_ids[i]+'" />')
|
71
75
|
}
|
72
76
|
|
73
77
|
}
|
data/config/locales/en.yml
CHANGED
@@ -6,6 +6,13 @@ en:
|
|
6
6
|
tabs:
|
7
7
|
titles:
|
8
8
|
files: "Files"
|
9
|
+
images:
|
10
|
+
edit: "Edit"
|
11
|
+
delete: "Delete"
|
12
|
+
back: "Back"
|
13
|
+
previous: "Previous"
|
14
|
+
next: "Next"
|
15
|
+
save: "Save"
|
9
16
|
support:
|
10
17
|
bytes:
|
11
18
|
byte:
|
@@ -19,4 +26,6 @@ en:
|
|
19
26
|
other: megabytes
|
20
27
|
gigabyte:
|
21
28
|
one: gigabyte
|
22
|
-
other: gigabytes
|
29
|
+
other: gigabytes
|
30
|
+
tinymce:
|
31
|
+
gallery: Gallery
|
data/config/locales/lv.yml
CHANGED
@@ -5,4 +5,13 @@ lv:
|
|
5
5
|
"file too big": "fails par lielu (maksimums %{value} %{unit})"
|
6
6
|
tabs:
|
7
7
|
titles:
|
8
|
-
files: "Faili"
|
8
|
+
files: "Faili"
|
9
|
+
images:
|
10
|
+
edit: "Labot"
|
11
|
+
delete: "Dzēst"
|
12
|
+
back: "Atpakaļ"
|
13
|
+
previous: "Iepriekšējais"
|
14
|
+
next: "Nākamais"
|
15
|
+
save: "Saglabāt"
|
16
|
+
tinymce:
|
17
|
+
gallery: Galerija
|
data/lib/lolita-file-upload.rb
CHANGED
@@ -33,6 +33,15 @@ Lolita::Hooks.component(:"/lolita/configuration/tab/form").around do
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
+
Lolita::Hooks.component(:"/lolita/configuration/field/string/text/display").around do
|
37
|
+
field = self.component_locals[:field]
|
38
|
+
if field.dbi.klass.lolita.tabs.by_type(:files)
|
39
|
+
self.render_component "lolita/configuration/field/string/text_gallery", :display, :field => field
|
40
|
+
else
|
41
|
+
let_content
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
36
45
|
require 'lolita-file-upload/module'
|
37
46
|
|
38
47
|
if defined?(Rails)
|
data/lolita-file-upload.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
|
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["ITHouse", "Arturs Meisters"]
|
12
|
-
s.date = "
|
12
|
+
s.date = "2012-08-28"
|
13
13
|
s.description = "File upload gem for Lolita with with fulll integration - models, controller, views"
|
14
14
|
s.email = "support@ithouse.lv"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -24,11 +24,17 @@ Gem::Specification.new do |s|
|
|
24
24
|
"README.rdoc",
|
25
25
|
"Rakefile",
|
26
26
|
"VERSION",
|
27
|
-
"app/assets/images/lolita/
|
27
|
+
"app/assets/images/lolita/tinymce_gallery.png",
|
28
|
+
"app/assets/images/lolita/upload/back.png",
|
29
|
+
"app/assets/images/lolita/upload/delete.png",
|
28
30
|
"app/assets/images/lolita/upload/edit.png",
|
31
|
+
"app/assets/images/lolita/upload/next.png",
|
32
|
+
"app/assets/images/lolita/upload/prev.png",
|
33
|
+
"app/assets/images/lolita/upload/save.png",
|
29
34
|
"app/controllers/lolita/uploads_controller.rb",
|
30
35
|
"app/models/lolita/upload/file.rb",
|
31
36
|
"app/uploaders/file_uploader.rb",
|
37
|
+
"app/views/components/lolita/configuration/field/string/text_gallery/_display.html.haml",
|
32
38
|
"app/views/components/lolita/configuration/tab/files/_cells.html.erb",
|
33
39
|
"app/views/components/lolita/configuration/tab/files/_destroy.js.erb",
|
34
40
|
"app/views/components/lolita/configuration/tab/files/_display.html.erb",
|
@@ -36,7 +42,9 @@ Gem::Specification.new do |s|
|
|
36
42
|
"app/views/components/lolita/configuration/tab/files/_file.html.erb",
|
37
43
|
"app/views/components/lolita/configuration/tab/files/_fixed_gallery.html.haml",
|
38
44
|
"app/views/components/lolita/configuration/tab/files/_form.html.erb",
|
45
|
+
"app/views/components/lolita/configuration/tab/files/_image.html.erb",
|
39
46
|
"app/views/components/lolita/configuration/tab/files/_list.html.erb",
|
47
|
+
"app/views/components/lolita/configuration/tab/files/_list.js.erb",
|
40
48
|
"app/views/components/lolita/configuration/tab/files/_list_form.html.erb",
|
41
49
|
"app/views/components/lolita/configuration/tab/files/_row.html.erb",
|
42
50
|
"app/views/components/lolita/configuration/tab/files/_update.js.erb",
|
@@ -103,12 +111,13 @@ Gem::Specification.new do |s|
|
|
103
111
|
"vendor/assets/javascripts/lolita/upload/plupload.full.js",
|
104
112
|
"vendor/assets/stylesheets/lolita/upload/application_vendor.css",
|
105
113
|
"vendor/assets/stylesheets/lolita/upload/jquery.ui.plupload.css.erb",
|
114
|
+
"vendor/assets/stylesheets/lolita/upload/lolita_file_upload.css.scss",
|
106
115
|
"vendor/assets/stylesheets/lolita/upload/plupload.queue.css"
|
107
116
|
]
|
108
117
|
s.homepage = "http://github.com/ithouse/lolita-file-upload"
|
109
118
|
s.licenses = ["MIT"]
|
110
119
|
s.require_paths = ["lib"]
|
111
|
-
s.rubygems_version = "1.8.
|
120
|
+
s.rubygems_version = "1.8.24"
|
112
121
|
s.summary = "File upload gem for Lolita CMS"
|
113
122
|
|
114
123
|
if s.respond_to? :specification_version then
|
@@ -116,7 +125,7 @@ Gem::Specification.new do |s|
|
|
116
125
|
|
117
126
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
118
127
|
s.add_runtime_dependency(%q<lolita>, ["~> 3.2.0.rc.6"])
|
119
|
-
s.add_runtime_dependency(%q<carrierwave>, ["~> 0.
|
128
|
+
s.add_runtime_dependency(%q<carrierwave>, ["~> 0.6.0"])
|
120
129
|
s.add_runtime_dependency(%q<mini_magick>, [">= 0"])
|
121
130
|
s.add_runtime_dependency(%q<jquery-rails>, [">= 1.0.12"])
|
122
131
|
s.add_development_dependency(%q<cucumber>, ["~> 1.0"])
|
@@ -125,7 +134,7 @@ Gem::Specification.new do |s|
|
|
125
134
|
s.add_development_dependency(%q<jeweler>, ["~> 1.6"])
|
126
135
|
else
|
127
136
|
s.add_dependency(%q<lolita>, ["~> 3.2.0.rc.6"])
|
128
|
-
s.add_dependency(%q<carrierwave>, ["~> 0.
|
137
|
+
s.add_dependency(%q<carrierwave>, ["~> 0.6.0"])
|
129
138
|
s.add_dependency(%q<mini_magick>, [">= 0"])
|
130
139
|
s.add_dependency(%q<jquery-rails>, [">= 1.0.12"])
|
131
140
|
s.add_dependency(%q<cucumber>, ["~> 1.0"])
|
@@ -135,7 +144,7 @@ Gem::Specification.new do |s|
|
|
135
144
|
end
|
136
145
|
else
|
137
146
|
s.add_dependency(%q<lolita>, ["~> 3.2.0.rc.6"])
|
138
|
-
s.add_dependency(%q<carrierwave>, ["~> 0.
|
147
|
+
s.add_dependency(%q<carrierwave>, ["~> 0.6.0"])
|
139
148
|
s.add_dependency(%q<mini_magick>, [">= 0"])
|
140
149
|
s.add_dependency(%q<jquery-rails>, [">= 1.0.12"])
|
141
150
|
s.add_dependency(%q<cucumber>, ["~> 1.0"])
|
@@ -1,3 +1,13 @@
|
|
1
1
|
//= require jquery-ui
|
2
2
|
//= require lolita/upload/plupload.full
|
3
3
|
//= require lolita/upload/jquery.ui.plupload
|
4
|
+
//= require_self
|
5
|
+
|
6
|
+
// $("#filelist .file-item .window").height(function(index, height){
|
7
|
+
// return ($("#content").width() - 10) * 0.3;
|
8
|
+
// })
|
9
|
+
//
|
10
|
+
$(".file-editor .save").live("click", function() {
|
11
|
+
$(this).closest("form").submit();
|
12
|
+
return false;
|
13
|
+
})
|
@@ -0,0 +1,64 @@
|
|
1
|
+
#main #content .box .lolita-file-upload-form {padding: 20px 0 0 0;}
|
2
|
+
|
3
|
+
.filelist {padding: 6% 1% 6% 6%; overflow: hidden;}
|
4
|
+
.filelist .filelist-container {overflow: hidden;}
|
5
|
+
.filelist .file-item {
|
6
|
+
float: left;
|
7
|
+
width: 26%;
|
8
|
+
margin-right: 5%;
|
9
|
+
margin-bottom: 20px;
|
10
|
+
padding: 1%;
|
11
|
+
background-color: #e9e9e9;
|
12
|
+
border-radius: 4px;
|
13
|
+
-moz-border-radius: 4px;
|
14
|
+
-webkit-border-radius: 4px;
|
15
|
+
box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.25);
|
16
|
+
-moz-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.25);
|
17
|
+
-webkit-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.25);
|
18
|
+
}
|
19
|
+
.filelist .file-item .window {overflow: hidden; height: 200px; background: #f9f9f9; border: 3px solid #e9e9e9;
|
20
|
+
border-radius: 3px;
|
21
|
+
-moz-border-radius: 3px;
|
22
|
+
-webkit-border-radius: 3px;
|
23
|
+
position: relative;
|
24
|
+
}
|
25
|
+
.filelist .file-item .window:hover {border-color: #887bd4; height: 200px;}
|
26
|
+
.filelist .file-item .window .links {display: none; position: absolute; top: 80px; padding: 10px 0; text-align: center; width: 100%; background: #f6f6f6;}
|
27
|
+
.filelist .file-item .window .links .edit_link {margin-right: 10px; background: image-url("lolita/upload/edit.png") no-repeat left center; padding-left: 15px;}
|
28
|
+
.filelist .file-item .window .links .delete_link {background: image-url("lolita/upload/delete.png") no-repeat left center; padding-left: 15px;}
|
29
|
+
.filelist .file-item .window:hover .links {display: block;}
|
30
|
+
.filelist .file-item img {max-width: 100%;}
|
31
|
+
.filelist .file-item p {height: 40px; line-height: 20px; text-align: center; margin: 5px 0; color: #777;}
|
32
|
+
|
33
|
+
#main #content .box .edit-file-form {}
|
34
|
+
#main #content .box .edit-file-form .file-editor {
|
35
|
+
background: #e9e9e9;
|
36
|
+
padding: 20px 20px 10px 20px;
|
37
|
+
border-radius: 4px;
|
38
|
+
-moz-border-radius: 4px;
|
39
|
+
-webkit-border-radius: 4px;
|
40
|
+
box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.25);
|
41
|
+
-moz-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.25);
|
42
|
+
-webkit-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.25);
|
43
|
+
}
|
44
|
+
#main #content .box .edit-file-form .file-editor .editable-image {width: 35%; float: left;}
|
45
|
+
#main #content .box .edit-file-form .file-editor .fields {width: 60%; float: right;}
|
46
|
+
#main #content .box .edit-file-form .file-editor .fields label {width: 20%; display: inline-block;}
|
47
|
+
#main #content .box .edit-file-form .file-editor .fields input,
|
48
|
+
#main #content .box .edit-file-form .file-editor .fields textarea {width: 70%; border: 1px solid #cdcdcd; padding: 3px 10px; color: #494949;
|
49
|
+
border-radius: 4px;
|
50
|
+
-moz-border-radius: 4px;
|
51
|
+
-webkit-border-radius: 4px;
|
52
|
+
}
|
53
|
+
#main #content .box .edit-file-form .file-editor .action-links {clear: both; padding-top: 20px; overflow: hidden;}
|
54
|
+
#main #content .box .edit-file-form .file-editor .action-links .navigation {
|
55
|
+
float: left;
|
56
|
+
.back {margin-right: 15px; padding-left: 15px; background: image-url("lolita/upload/back.png") no-repeat left center;}
|
57
|
+
.previous {padding-left: 15px; margin-right: 10px; background: image-url("lolita/upload/prev.png") no-repeat left center}
|
58
|
+
.next {padding-right: 15px; background: image-url("lolita/upload/next.png") no-repeat right center}
|
59
|
+
}
|
60
|
+
#main #content .box .edit-file-form .file-editor .action-links .actions {
|
61
|
+
float: right;
|
62
|
+
.delete {padding-left: 15px; margin-right: 10px; background: image-url("lolita/upload/delete.png") no-repeat left center}
|
63
|
+
.save {padding-left: 15px; background: image-url("lolita/upload/save.png") no-repeat left center}
|
64
|
+
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lolita-file-upload
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.13
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,11 +10,11 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2012-08-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: lolita
|
17
|
-
requirement:
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
@@ -22,21 +22,31 @@ dependencies:
|
|
22
22
|
version: 3.2.0.rc.6
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements:
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ~>
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: 3.2.0.rc.6
|
26
31
|
- !ruby/object:Gem::Dependency
|
27
32
|
name: carrierwave
|
28
|
-
requirement:
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
29
34
|
none: false
|
30
35
|
requirements:
|
31
36
|
- - ~>
|
32
37
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
38
|
+
version: 0.6.0
|
34
39
|
type: :runtime
|
35
40
|
prerelease: false
|
36
|
-
version_requirements:
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ~>
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 0.6.0
|
37
47
|
- !ruby/object:Gem::Dependency
|
38
48
|
name: mini_magick
|
39
|
-
requirement:
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
40
50
|
none: false
|
41
51
|
requirements:
|
42
52
|
- - ! '>='
|
@@ -44,10 +54,15 @@ dependencies:
|
|
44
54
|
version: '0'
|
45
55
|
type: :runtime
|
46
56
|
prerelease: false
|
47
|
-
version_requirements:
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
48
63
|
- !ruby/object:Gem::Dependency
|
49
64
|
name: jquery-rails
|
50
|
-
requirement:
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
51
66
|
none: false
|
52
67
|
requirements:
|
53
68
|
- - ! '>='
|
@@ -55,10 +70,15 @@ dependencies:
|
|
55
70
|
version: 1.0.12
|
56
71
|
type: :runtime
|
57
72
|
prerelease: false
|
58
|
-
version_requirements:
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - ! '>='
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: 1.0.12
|
59
79
|
- !ruby/object:Gem::Dependency
|
60
80
|
name: cucumber
|
61
|
-
requirement:
|
81
|
+
requirement: !ruby/object:Gem::Requirement
|
62
82
|
none: false
|
63
83
|
requirements:
|
64
84
|
- - ~>
|
@@ -66,10 +86,15 @@ dependencies:
|
|
66
86
|
version: '1.0'
|
67
87
|
type: :development
|
68
88
|
prerelease: false
|
69
|
-
version_requirements:
|
89
|
+
version_requirements: !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
91
|
+
requirements:
|
92
|
+
- - ~>
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '1.0'
|
70
95
|
- !ruby/object:Gem::Dependency
|
71
96
|
name: cucumber-rails
|
72
|
-
requirement:
|
97
|
+
requirement: !ruby/object:Gem::Requirement
|
73
98
|
none: false
|
74
99
|
requirements:
|
75
100
|
- - ~>
|
@@ -77,10 +102,15 @@ dependencies:
|
|
77
102
|
version: '1.0'
|
78
103
|
type: :development
|
79
104
|
prerelease: false
|
80
|
-
version_requirements:
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
107
|
+
requirements:
|
108
|
+
- - ~>
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '1.0'
|
81
111
|
- !ruby/object:Gem::Dependency
|
82
112
|
name: bundler
|
83
|
-
requirement:
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
84
114
|
none: false
|
85
115
|
requirements:
|
86
116
|
- - ~>
|
@@ -88,10 +118,15 @@ dependencies:
|
|
88
118
|
version: '1.0'
|
89
119
|
type: :development
|
90
120
|
prerelease: false
|
91
|
-
version_requirements:
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
none: false
|
123
|
+
requirements:
|
124
|
+
- - ~>
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: '1.0'
|
92
127
|
- !ruby/object:Gem::Dependency
|
93
128
|
name: jeweler
|
94
|
-
requirement:
|
129
|
+
requirement: !ruby/object:Gem::Requirement
|
95
130
|
none: false
|
96
131
|
requirements:
|
97
132
|
- - ~>
|
@@ -99,7 +134,12 @@ dependencies:
|
|
99
134
|
version: '1.6'
|
100
135
|
type: :development
|
101
136
|
prerelease: false
|
102
|
-
version_requirements:
|
137
|
+
version_requirements: !ruby/object:Gem::Requirement
|
138
|
+
none: false
|
139
|
+
requirements:
|
140
|
+
- - ~>
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: '1.6'
|
103
143
|
description: File upload gem for Lolita with with fulll integration - models, controller,
|
104
144
|
views
|
105
145
|
email: support@ithouse.lv
|
@@ -116,11 +156,17 @@ files:
|
|
116
156
|
- README.rdoc
|
117
157
|
- Rakefile
|
118
158
|
- VERSION
|
119
|
-
- app/assets/images/lolita/
|
159
|
+
- app/assets/images/lolita/tinymce_gallery.png
|
160
|
+
- app/assets/images/lolita/upload/back.png
|
161
|
+
- app/assets/images/lolita/upload/delete.png
|
120
162
|
- app/assets/images/lolita/upload/edit.png
|
163
|
+
- app/assets/images/lolita/upload/next.png
|
164
|
+
- app/assets/images/lolita/upload/prev.png
|
165
|
+
- app/assets/images/lolita/upload/save.png
|
121
166
|
- app/controllers/lolita/uploads_controller.rb
|
122
167
|
- app/models/lolita/upload/file.rb
|
123
168
|
- app/uploaders/file_uploader.rb
|
169
|
+
- app/views/components/lolita/configuration/field/string/text_gallery/_display.html.haml
|
124
170
|
- app/views/components/lolita/configuration/tab/files/_cells.html.erb
|
125
171
|
- app/views/components/lolita/configuration/tab/files/_destroy.js.erb
|
126
172
|
- app/views/components/lolita/configuration/tab/files/_display.html.erb
|
@@ -128,7 +174,9 @@ files:
|
|
128
174
|
- app/views/components/lolita/configuration/tab/files/_file.html.erb
|
129
175
|
- app/views/components/lolita/configuration/tab/files/_fixed_gallery.html.haml
|
130
176
|
- app/views/components/lolita/configuration/tab/files/_form.html.erb
|
177
|
+
- app/views/components/lolita/configuration/tab/files/_image.html.erb
|
131
178
|
- app/views/components/lolita/configuration/tab/files/_list.html.erb
|
179
|
+
- app/views/components/lolita/configuration/tab/files/_list.js.erb
|
132
180
|
- app/views/components/lolita/configuration/tab/files/_list_form.html.erb
|
133
181
|
- app/views/components/lolita/configuration/tab/files/_row.html.erb
|
134
182
|
- app/views/components/lolita/configuration/tab/files/_update.js.erb
|
@@ -195,6 +243,7 @@ files:
|
|
195
243
|
- vendor/assets/javascripts/lolita/upload/plupload.full.js
|
196
244
|
- vendor/assets/stylesheets/lolita/upload/application_vendor.css
|
197
245
|
- vendor/assets/stylesheets/lolita/upload/jquery.ui.plupload.css.erb
|
246
|
+
- vendor/assets/stylesheets/lolita/upload/lolita_file_upload.css.scss
|
198
247
|
- vendor/assets/stylesheets/lolita/upload/plupload.queue.css
|
199
248
|
homepage: http://github.com/ithouse/lolita-file-upload
|
200
249
|
licenses:
|
@@ -211,7 +260,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
211
260
|
version: '0'
|
212
261
|
segments:
|
213
262
|
- 0
|
214
|
-
hash:
|
263
|
+
hash: 3399707713405550945
|
215
264
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
216
265
|
none: false
|
217
266
|
requirements:
|
@@ -220,7 +269,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
220
269
|
version: '0'
|
221
270
|
requirements: []
|
222
271
|
rubyforge_project:
|
223
|
-
rubygems_version: 1.8.
|
272
|
+
rubygems_version: 1.8.24
|
224
273
|
signing_key:
|
225
274
|
specification_version: 3
|
226
275
|
summary: File upload gem for Lolita CMS
|
Binary file
|