'no.png'
end
+ def visible?
+ self.link_method_name != :link_none
+ end
+
def render view, item, operators
link = self.__send__(@link_method_name, view, item, operators)
tag = self.__send__(@tag_method_name, view, item, operators)
unless tag.blank?
- link_to_unless link.blank?, tag, link
+ view.link_to_unless link.blank?, tag, link
end
end
end
def tag_column view, item, operators
- item.attributes[caption['name']]
+ item.attributes[@caption_conf['name']]
end
def tag_method view, item, operators
- item.__send__(caption['name']).to_s
+ item.__send__(@caption_conf['name']).to_s
end
def tag_else view, item, operators
'no caption'
end
+ def visible?
+ self.link_method_name != :link_none
+ end
+
def render view, item, operators
- unless caption_type == 'none'
- link = self.__send__(@link_method_name, view, item, operators)
- tag = self.__send__(@tag_method_name, view, item, operators)
- tag = 'no caption' if tag.blank?
- unless tag.blank?
- link_to_unless link.blank?, tag, link
- end
+ link = self.__send__(@link_method_name, view, item, operators)
+ tag = self.__send__(@tag_method_name, view, item, operators)
+ tag = 'no caption' if tag.blank?
+ unless tag.blank?
+ view.link_to_unless link.blank?, tag, link
end
end
view.render item.path_name + '/' + @summary_conf['name'], :item => item
end
+ def visible?
+ self.type_method != :type_none
+ end
+
def render view, item, operators
- self.__send__(@type_method, view, item)
+ self.__send__(@type_method, view, item, operators)
end
end
@icon_conf = icon_conf || {}
end
+ def visible?
+ true
+ end
+
def render view, item, operators
view.link_to view.icon_tag(item.class.to_s, :object => item, :size => 64),
view.polymorphic_path(item, :format => :prof)
@date_conf = date_conf || {}
end
+ def visible?
+ true
+ end
+
def render view, item, operators
view.distance_of_time_in_words_to_now item.updated_at
end
''
end
+ def visible?
+ self.type_method != :type_none
+ end
+
def render view, item, operators
self.__send__(@type_method, view, item, operators)
end
end
- attr :items, :file_items, :operators
- def initialize items, operators, symbol, caption, summary, icon, date, edit, manifest
+ attr :items, :file_items, :operators, :paginate, :symbol, :caption, :summary, :icon, :date, :edit
+ def initialize item_name, items, operators, paginate, symbol, caption, summary, icon, date, edit, manifest
+ @item_name = item_name
@items = items
+ @operators = operators
+ @paginate = paginate
+ @symbol = symbol
+ @caption = caption
+ @summary = summary
+ @icon = icon
+ @date = date
+ @edit = edit
@manifest = manifest
@file_items = @items.map {|item|
FileItem.new item, operators, symbol, caption, summary, icon, date, edit, manifest
}
end
+
+ def model_name
+ @item_name
+ end
+
+ def model
+ model_name.classify.constantize
+ end
+
end
+ attr :filer_manifest, :item_name, :manifest, :filer_conf,
+ :symbol, :caption, :summary, :icon, :date, :edit
def initialize filer_manifest
@filer_manifest = filer_manifest
@item_name = @filer_manifest.item_name
@edit = Edit.new @filer_manifest.edit
end
- def open items, operators
- Filer.new items, operators, @symbol, @caption, @summary, @icon, @date, @edit, @manifest
+ def open item_name, items, operators, paginate
+ Filer.new item_name, items, operators, paginate, @symbol, @caption, @summary, @icon, @date, @edit, @manifest
end
end