diff --git a/app/models/parser.rb b/app/models/parser.rb index ca834ac8..734e11de 100644 --- a/app/models/parser.rb +++ b/app/models/parser.rb @@ -54,6 +54,24 @@ module Parser tag.attr[I18n.locale.to_s] rescue nil end end + c.define_tag 'css' do |tag| + assets = Asset.any_in(:filename => tag.attr['name'].split(',').map(&:strip)) + res = '' + assets.each do |asset| + res << " " if asset.data.file.content_type.eql?('text/css') + end + res + end + c.define_tag 'image' do |tag| + asset = Asset.find(tag.attr['id']) + if asset + res = "' + end + end end end diff --git a/app/views/admin/assets/index.html.erb b/app/views/admin/assets/index.html.erb index a3f77742..a5b721ab 100644 --- a/app/views/admin/assets/index.html.erb +++ b/app/views/admin/assets/index.html.erb @@ -8,6 +8,7 @@ + @@ -18,6 +19,7 @@ <% @assets.each do |asset| %> + diff --git a/config/locales/en.yml b/config/locales/en.yml index 750d7a2d..f7704334 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -50,6 +50,7 @@ en: file_name: Filename file_size: File size format: Format + id: ID is_published: Is published item: Item key: Key diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index e130d26a..63fe04c5 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -47,6 +47,7 @@ zh_tw: file_name: 檔名 file_size: 檔案大小 format: 格式 + id: ID is_published: 被出版 item: 項目 key: 關鍵
<%= t('admin.id') %> <%= t('admin.file_name') %> <%= t('admin.description') %> <%= t('admin.format') %>
<%= asset.id %> <%= link_to asset.filename, asset.data.url, :target => '_blank' %> <%= asset.description %> <%= asset.data.file.content_type %>