docx xlsx and pptx file types fixed plus icon provided in edit form for files
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 885 B After Width: | Height: | Size: 885 B |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 800 B After Width: | Height: | Size: 800 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 225 KiB After Width: | Height: | Size: 225 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 847 B After Width: | Height: | Size: 847 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 765 B After Width: | Height: | Size: 765 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 220 KiB After Width: | Height: | Size: 220 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 875 B After Width: | Height: | Size: 875 B |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.6 KiB |
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 781 B After Width: | Height: | Size: 781 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 224 KiB After Width: | Height: | Size: 224 KiB |
|
@ -71,13 +71,21 @@
|
|||
</li>
|
||||
<li class="s_grid_row">
|
||||
<%= label_tag("", t("personal_book.author_type"), class: "s_grid_4 s_grid") %>
|
||||
<% @author_types.each do |author_type| %>
|
||||
<%= content_tag :label,:class => "s_grid_4 s_grid" do -%>
|
||||
<%= check_box_tag 'writing_book[book_author_type_ids][]', author_type.id, @personal_book.book_author_type_ids.include?(author_type.id)%>
|
||||
<%= author_type.title %>
|
||||
<%= hidden_field_tag 'writing_book[book_author_type_ids][]', '' %>
|
||||
|
||||
<div class="s_select_g s_grid s_grid_8 s_grid_h_1">
|
||||
|
||||
<ul>
|
||||
<% @author_types.each_with_index do |author_type, i| %>
|
||||
<li>
|
||||
<%= check_box_tag "writing_book[book_author_type_ids][]",
|
||||
author_type.id,
|
||||
@personal_book.book_author_type_ids.include?(author_type.id),
|
||||
id: "field-#{i}"
|
||||
%><%= label_tag("field-#{i}", author_type.title) %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<!-- <li class="s_grid_row">
|
||||
|
|
|
@ -4,7 +4,12 @@
|
|||
<% if form_file.new_record? %>
|
||||
<%= f.file_field :file, class: "s_grid_2", onchange:"var temp = o.filepathSplitter(this.value);temp=temp[temp.length - 1];this.parentNode.getElementsByTagName('label')[0].innerHTML = temp;var inputs = this.parentNode.parentNode.parentNode.getElementsByClassName('title_field');inputs[0].value = temp;inputs[1].value = temp;" %>
|
||||
<label></label>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= link_to(image_tag(check_file_type(form_file.file.url)),
|
||||
:class => "file",
|
||||
"target" => "_blank",
|
||||
"title" => form_file.title) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</td>
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
|
|
|
@ -4,7 +4,12 @@
|
|||
<% if form_file.new_record? %>
|
||||
<%= f.file_field :file, class: "s_grid_2", onchange:"var temp = o.filepathSplitter(this.value);temp=temp[temp.length - 1];this.parentNode.getElementsByTagName('label')[0].innerHTML = temp;var inputs = this.parentNode.parentNode.parentNode.getElementsByClassName('title_field');inputs[0].value = temp;inputs[1].value = temp;" %>
|
||||
<label></label>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= link_to(image_tag(check_file_type(form_file.file.url)),
|
||||
:class => "file",
|
||||
"target" => "_blank",
|
||||
"title" => form_file.title) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</td>
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
|
|
|
@ -76,7 +76,9 @@ module Panel::PersonalJournal::Desktop::JournalPagesHelper
|
|||
|
||||
def check_file_type file
|
||||
if not file.nil?
|
||||
file_type = MIME::Types.type_for(file).first.to_s.split("/")[1]
|
||||
x = file.split(/[\s\.]/)
|
||||
file_type = x[x.length - 1]
|
||||
file_type = file_type.downcase
|
||||
file_type = "/assets/ft-icons/#{file_type}/#{file_type}-sm-32_32.png"
|
||||
else
|
||||
file_type = ""
|
||||
|
|
|
@ -4,7 +4,12 @@
|
|||
<% if form_file.new_record? %>
|
||||
<%= f.file_field :file, class: "s_grid_2", onchange:"var temp = o.filepathSplitter(this.value);temp=temp[temp.length - 1];this.parentNode.getElementsByTagName('label')[0].innerHTML = temp;var inputs = this.parentNode.parentNode.parentNode.getElementsByClassName('title_field');inputs[0].value = temp;inputs[1].value = temp;" %>
|
||||
<label></label>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= link_to(image_tag(check_file_type(form_file.file.url)),
|
||||
:class => "file",
|
||||
"target" => "_blank",
|
||||
"title" => form_file.title) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</td>
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
|
|
|
@ -4,7 +4,12 @@
|
|||
<% if form_file.new_record? %>
|
||||
<%= f.file_field :file, class: "s_grid_2", onchange:"var temp = o.filepathSplitter(this.value);temp=temp[temp.length - 1];this.parentNode.getElementsByTagName('label')[0].innerHTML = temp;var inputs = this.parentNode.parentNode.parentNode.getElementsByClassName('title_field');inputs[0].value = temp;inputs[1].value = temp;" %>
|
||||
<label></label>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= link_to(image_tag(check_file_type(form_file.file.url)),
|
||||
:class => "file",
|
||||
"target" => "_blank",
|
||||
"title" => form_file.title) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</td>
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
|
|
|
@ -2,9 +2,14 @@
|
|||
<td>
|
||||
<div>
|
||||
<% if form_file.new_record? %>
|
||||
<%= f.file_field :file, class: "s_grid_2", onchange:"this.parentNode.getElementsByTagName('label')[0].innerHTML = this.value" %>
|
||||
<%= f.file_field :file, class: "s_grid_2", onchange:"var temp = o.filepathSplitter(this.value);temp=temp[temp.length - 1];this.parentNode.getElementsByTagName('label')[0].innerHTML = temp;var inputs = this.parentNode.parentNode.parentNode.getElementsByClassName('title_field');inputs[0].value = temp;inputs[1].value = temp;" %>
|
||||
<label></label>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= link_to(image_tag(check_file_type(form_file.file.url)),
|
||||
:class => "file",
|
||||
"target" => "_blank",
|
||||
"title" => form_file.title) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</td>
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
|
@ -13,7 +18,7 @@
|
|||
<td <%= style %> <%= data %>>
|
||||
<%= f.fields_for :file_title_translations do |f| %>
|
||||
<%= f.text_field locale,
|
||||
class: 's_grid_4',
|
||||
class: 's_grid_4 title_field',
|
||||
placeholder: I18nVariable.from_locale(locale),
|
||||
value: (form_file.file_title_translations[locale] rescue nil) %>
|
||||
<% end %>
|
||||
|
@ -31,10 +36,10 @@
|
|||
<td>
|
||||
<span class="action">
|
||||
<% if form_file.new_record? %>
|
||||
<a class="delete"><i class="icon-remove"></i></a>
|
||||
<a class="delete"><i class="icon-remove" style="cursor:pointer;"></i></a>
|
||||
<% else %>
|
||||
<%= f.hidden_field :id %>
|
||||
<a class="remove_existing_record"><i class="icon-remove"></i></a>
|
||||
<a class="remove_existing_record" style="cursor:pointer;"><i class="icon-remove"></i></a>
|
||||
<%= f.hidden_field :should_destroy, :value => nil, :class => 'should_destroy' %>
|
||||
<% end %>
|
||||
<%= form_file.file.file ? ( link_to '', form_file.file.url, {:class => 'icon-eye-open', :target => '_blank', :title => t(:view)} ) : '' %>
|
||||
|
|
|
@ -4,7 +4,12 @@
|
|||
<% if form_file.new_record? %>
|
||||
<%= f.file_field :file, class: "s_grid_2", onchange:"var temp = o.filepathSplitter(this.value);temp=temp[temp.length - 1];this.parentNode.getElementsByTagName('label')[0].innerHTML = temp;var inputs = this.parentNode.parentNode.parentNode.getElementsByClassName('title_field');inputs[0].value = temp;inputs[1].value = temp;" %>
|
||||
<label></label>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= link_to(image_tag(check_file_type(form_file.file.url)),
|
||||
:class => "file",
|
||||
"target" => "_blank",
|
||||
"title" => form_file.title) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</td>
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
|
|
|
@ -4,7 +4,12 @@
|
|||
<% if form_file.new_record? %>
|
||||
<%= f.file_field :file, class: "s_grid_2", onchange:"var temp = o.filepathSplitter(this.value);temp=temp[temp.length - 1];this.parentNode.getElementsByTagName('label')[0].innerHTML = temp;var inputs = this.parentNode.parentNode.parentNode.getElementsByClassName('title_field');inputs[0].value = temp;inputs[1].value = temp;" %>
|
||||
<label></label>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= link_to(image_tag(check_file_type(form_file.file.url)),
|
||||
:class => "file",
|
||||
"target" => "_blank",
|
||||
"title" => form_file.title) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</td>
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
|
|