Module: Card::Set::Type::File::HtmlFormat

Extended by:
AbstractFormat
Included in:
Image::HtmlViews::HtmlFormat
Defined in:
platypus/tmp/set/gem-defaults/mod016-carrierwave/type/file.rb

Instance Method Summary collapse

Instance Method Details

#cached_upload_card_nameObject



150
151
152
# File 'platypus/tmp/set/gem-defaults/mod016-carrierwave/type/file.rb', line 150

def cached_upload_card_name
  Card::Env.params[:attachment_upload].gsub(/\[\w+\]$/, "[action_id_of_cached_upload]")
end

#file_chooser_action_textObject



137
138
139
140
# File 'platypus/tmp/set/gem-defaults/mod016-carrierwave/type/file.rb', line 137

def file_chooser_action_text
  action = card.new_card? ? "Add" : "Replace"
  "#{action} #{humanized_attachment_name}..."
end

#humanized_attachment_nameObject



142
143
144
# File 'platypus/tmp/set/gem-defaults/mod016-carrierwave/type/file.rb', line 142

def humanized_attachment_name
  card.attachment_name.to_s.humanize
end

#previewObject



146
147
148
# File 'platypus/tmp/set/gem-defaults/mod016-carrierwave/type/file.rb', line 146

def preview
  ""
end

#preview_editor_delete_textObject



154
155
156
# File 'platypus/tmp/set/gem-defaults/mod016-carrierwave/type/file.rb', line 154

def preview_editor_delete_text
  t :carrierwave_delete
end

#view: coreObject



119
120
121
122
123
# File 'platypus/tmp/set/gem-defaults/mod016-carrierwave/type/file.rb', line 119

view :core do
  handle_source do |source|
    haml :core, source: source
  end
end

#view: inputObject



125
126
127
128
129
130
131
# File 'platypus/tmp/set/gem-defaults/mod016-carrierwave/type/file.rb', line 125

view :input do
  if card.no_upload?
    text_field :content, class: "d0-card-content"
  else
    haml :file_chooser, action_text: file_chooser_action_text
  end
end

#view: preview_editorObject



133
134
135
# File 'platypus/tmp/set/gem-defaults/mod016-carrierwave/type/file.rb', line 133

view :preview_editor, unknown: true, cache: :never do
  haml :preview_editor
end