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



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

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

#file_chooser_action_textObject



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

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

#humanized_attachment_nameObject



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

def humanized_attachment_name
  card.attachment_name.to_s.humanize
end

#previewObject



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

def preview
  ""
end

#preview_editor_delete_textObject



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

def preview_editor_delete_text
  t :carrierwave_delete
end

#view: coreObject



102
103
104
105
106
# File 'platypus/tmp/set/gem-defaults/mod016-carrierwave/type/file.rb', line 102

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

#view: inputObject



108
109
110
111
112
113
114
# File 'platypus/tmp/set/gem-defaults/mod016-carrierwave/type/file.rb', line 108

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



116
117
118
# File 'platypus/tmp/set/gem-defaults/mod016-carrierwave/type/file.rb', line 116

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