fix issue #37 plus other ones related to theme assets and assets
This commit is contained in:
parent
083debc516
commit
bd992cc882
20
Gemfile.lock
20
Gemfile.lock
@ -1,6 +1,6 @@
|
||||
GIT
|
||||
remote: git://github.com/floehopper/mocha.git
|
||||
revision: 6f18b724c50a89a1fad954dc32a8a590dbb877ca
|
||||
revision: 2b4e868d1907859cd03f407078bd8b630f7d0dd6
|
||||
specs:
|
||||
mocha (0.9.12.20110213002255)
|
||||
|
||||
@ -42,8 +42,8 @@ GEM
|
||||
autotest (4.4.6)
|
||||
ZenTest (>= 4.4.1)
|
||||
bcrypt-ruby (2.1.4)
|
||||
bson (1.2.1)
|
||||
bson_ext (1.2.1)
|
||||
bson (1.2.2)
|
||||
bson_ext (1.2.2)
|
||||
builder (2.1.2)
|
||||
capybara (0.4.1.2)
|
||||
celerity (>= 0.7.9)
|
||||
@ -54,7 +54,7 @@ GEM
|
||||
rack-test (>= 0.5.4)
|
||||
selenium-webdriver (>= 0.0.27)
|
||||
xpath (~> 0.1.3)
|
||||
celerity (0.8.7)
|
||||
celerity (0.8.8)
|
||||
childprocess (0.1.7)
|
||||
ffi (~> 0.6.3)
|
||||
closure-compiler (1.0.0)
|
||||
@ -88,7 +88,7 @@ GEM
|
||||
diff-lcs (1.1.2)
|
||||
erubis (2.6.6)
|
||||
abstract (>= 1.0.0)
|
||||
excon (0.5.2)
|
||||
excon (0.5.4)
|
||||
factory_girl (1.3.3)
|
||||
factory_girl_rails (1.0.1)
|
||||
factory_girl (~> 1.3)
|
||||
@ -118,7 +118,7 @@ GEM
|
||||
json_pure (>= 1.2.0, < 1.5.0)
|
||||
launchy (~> 0.3.2)
|
||||
rest-client (>= 1.4.0, < 1.7.0)
|
||||
httparty (0.7.3)
|
||||
httparty (0.7.4)
|
||||
crack (= 0.1.8)
|
||||
i18n (0.5.0)
|
||||
inherited_resources (1.1.2)
|
||||
@ -129,7 +129,7 @@ GEM
|
||||
yui-compressor (>= 0.9.1)
|
||||
json (1.5.1)
|
||||
json_pure (1.4.6)
|
||||
kgio (2.3.0)
|
||||
kgio (2.3.2)
|
||||
launchy (0.3.7)
|
||||
configuration (>= 0.0.5)
|
||||
rake (>= 0.8.1)
|
||||
@ -153,8 +153,8 @@ GEM
|
||||
mime-types (1.16)
|
||||
mimemagic (0.1.8)
|
||||
mimetype-fu (0.1.2)
|
||||
mongo (1.2.1)
|
||||
bson (>= 1.2.1)
|
||||
mongo (1.2.2)
|
||||
bson (>= 1.2.2)
|
||||
mongoid (2.0.0.rc.7)
|
||||
activemodel (~> 3.0)
|
||||
mongo (~> 1.2)
|
||||
@ -224,7 +224,7 @@ GEM
|
||||
rubyzip (0.9.4)
|
||||
s3 (0.3.7)
|
||||
proxies
|
||||
selenium-webdriver (0.1.2)
|
||||
selenium-webdriver (0.1.3)
|
||||
childprocess (~> 0.1.5)
|
||||
ffi (~> 0.6.3)
|
||||
json_pure
|
||||
|
@ -26,7 +26,7 @@ class Asset
|
||||
|
||||
## methods ##
|
||||
|
||||
%w{image stylesheet javascript pdf video audio}.each do |type|
|
||||
%w{image stylesheet javascript pdf media}.each do |type|
|
||||
define_method("#{type}?") do
|
||||
self.content_type.to_s == type
|
||||
end
|
||||
|
@ -54,7 +54,7 @@ class AssetCollection
|
||||
end
|
||||
|
||||
def store_asset_positions!
|
||||
return if @assets_order.blank?
|
||||
return if @assets_order.nil?
|
||||
|
||||
ids = @assets_order.split(',').collect { |id| BSON::ObjectId(id) }
|
||||
|
||||
|
@ -39,7 +39,7 @@ class ThemeAsset
|
||||
|
||||
## methods ##
|
||||
|
||||
%w{movie image stylesheet javascript font}.each do |type|
|
||||
%w{media image stylesheet javascript font}.each do |type|
|
||||
define_method("#{type}?") do
|
||||
self.content_type.to_s == type
|
||||
end
|
||||
@ -116,7 +116,7 @@ class ThemeAsset
|
||||
self.folder = ActiveSupport::Inflector.transliterate(self.folder).gsub(/(\s)+/, '_').gsub(/^\//, '').gsub(/\/$/, '').downcase
|
||||
|
||||
# folder should begin by a root folder
|
||||
if (self.folder =~ /^(stylesheets|javascripts|images|media|fonts)/).nil?
|
||||
if (self.folder =~ /^(stylesheets|javascripts|images|medias|fonts)/).nil?
|
||||
self.folder = File.join(self.content_type.to_s.pluralize, self.folder)
|
||||
end
|
||||
end
|
||||
@ -132,7 +132,7 @@ class ThemeAsset
|
||||
def escape_shortcut_urls(text)
|
||||
return if text.blank?
|
||||
|
||||
text.gsub(/[("'](\/(stylesheets|javascripts|images|media)\/((.+)\/)*([a-z_\-0-9]+)\.[a-z]{2,3})[)"']/) do |path|
|
||||
text.gsub(/[("'](\/(stylesheets|javascripts|images|medias)\/((.+)\/)*([a-z_\-0-9]+)\.[a-z]{2,3})[)"']/) do |path|
|
||||
|
||||
sanitized_path = path.gsub(/[("')]/, '').gsub(/^\//, '')
|
||||
|
||||
|
@ -61,8 +61,7 @@ class AssetUploader < CarrierWave::Uploader::Base
|
||||
def self.content_types
|
||||
{
|
||||
:image => ['image/jpeg', 'image/pjpeg', 'image/gif', 'image/png', 'image/x-png', 'image/jpg', 'image/x-icon'],
|
||||
:video => [/^video/, 'application/x-shockwave-flash', 'application/x-swf'],
|
||||
:audio => [/^audio/, 'application/ogg', 'application/x-mp3'],
|
||||
:media => [/^video/, 'application/x-shockwave-flash', 'application/x-swf', /^audio/, 'application/ogg', 'application/x-mp3'],
|
||||
:pdf => ['application/pdf', 'application/x-pdf'],
|
||||
:stylesheet => ['text/css'],
|
||||
:javascript => ['text/javascript', 'text/js', 'application/x-javascript', 'application/javascript'],
|
||||
|
@ -42,10 +42,10 @@
|
||||
%ul.list.theme-assets
|
||||
= render :partial => 'asset', :collection => @assets[:fonts]
|
||||
|
||||
- if @assets[:media]
|
||||
- if @assets[:medias]
|
||||
%br
|
||||
|
||||
%h3!= t('.media')
|
||||
%h3!= t('.medias')
|
||||
%ul.list.theme-assets
|
||||
= render :partial => 'asset', :collection => @assets[:media]
|
||||
= render :partial => 'asset', :collection => @assets[:medias]
|
||||
|
||||
|
@ -10,6 +10,5 @@
|
||||
# end
|
||||
|
||||
ActiveSupport::Inflector.inflections do |inflect|
|
||||
inflect.irregular 'media', 'media'
|
||||
end
|
||||
|
||||
|
@ -172,7 +172,7 @@ en:
|
||||
css_and_js: Style and javascript
|
||||
fonts: Fonts
|
||||
images: Images
|
||||
media: Media
|
||||
medias: Medias
|
||||
no_items: "There are no files for now. Just click <a href=\"%{url}\">here</a> to create the first one."
|
||||
asset:
|
||||
updated_at: Updated at
|
||||
|
@ -171,7 +171,7 @@ fr:
|
||||
snippets: Snippets
|
||||
css_and_js: Style et javascript
|
||||
images: Images
|
||||
media: Media
|
||||
medias: Médias
|
||||
fonts: Polices
|
||||
no_items: "Il n'existe pas de fichiers. Vous pouvez commencer par créer un <a href='%{url}'>ici</a>."
|
||||
asset:
|
||||
|
@ -172,7 +172,7 @@ pt-BR:
|
||||
css_and_js: CSS e Javascript
|
||||
fonts: Fontes
|
||||
images: Imagens
|
||||
media: Mídia
|
||||
medias: Mídia
|
||||
no_items: "Ainda não existem arquivos. Clique <a href=\"%{url}\">aqui</a> para criar o primeiro."
|
||||
asset:
|
||||
updated_at: Atualizado em
|
||||
|
19
doc/TODO
19
doc/TODO
@ -1,13 +1,15 @@
|
||||
BOARD:
|
||||
|
||||
x moving to mongoid 2.0.0 rc.6
|
||||
x accepts_nested_attributes (javascript part)
|
||||
x check the theme uploader
|
||||
x release new version of CustomFields, ActsAsTree gems
|
||||
- duostack version
|
||||
- bugs
|
||||
- editable_elements slug becomes nil
|
||||
- pull requests #31 et #32
|
||||
- editable_elements: inheritable: false (Mattias)
|
||||
- 2 different sites on the same main domain (one in www, the other one in something else) (Raphael Costa)
|
||||
|
||||
BACKLOG:
|
||||
|
||||
- add metadata to sites
|
||||
|
||||
- validation for custom fields
|
||||
- new custom field types:
|
||||
- belongs_to => association
|
||||
@ -190,4 +192,9 @@ x notify accounts when new instance of models (opt): none, one or many accounts.
|
||||
x implementation
|
||||
x emails
|
||||
x tests
|
||||
x fix bug issue about (custom fields)
|
||||
x fix bug issue about (custom fields)
|
||||
x moving to mongoid 2.0.0 rc.6
|
||||
x accepts_nested_attributes (javascript part)
|
||||
x check the theme uploader
|
||||
x release new version of CustomFields, ActsAsTree gems
|
||||
x add metadata to sites
|
@ -10,7 +10,7 @@ module Locomotive
|
||||
}
|
||||
end
|
||||
|
||||
# Removees whitespace and quote charactets from the input
|
||||
# Removes whitespace and quote charactets from the input
|
||||
def sanitized_string(string)
|
||||
string.strip.gsub(/"/, '')
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user