Module: Zena::Use::Calendar::ZafuMethods

Defined in:
lib/zena/use/calendar.rb

Overview

ViewMethods

Instance Method Summary collapse

Instance Method Details

#r_calendarObject

Display calendar content



151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# File 'lib/zena/use/calendar.rb', line 151

def r_calendar
  # Should work like r_block (storage/rendering)
  display_calendar
  #if @context[:block] == self
  #  # called from self (storing template / rendering)
  #  if role = @params[:assign_as]
  #    assign_calendar(role)
  #  else
  #    display_calendar
  #  end
  #else
  #  # This is called first to prepare calendar
  #  if @params[:assign_as]
  #    fld = 'date'
  #    table_name = 'links'
  #  else
  #    fld = @params[:date] || 'event_at'
  #    if ['log_at', 'created_at', 'updated_at', 'event_at'].include?(fld) # TODO: use rubyless to learn type
  #      table_name = 'nodes'
  #    elsif fld == 'l_date'
  #      fld = 'date'
  #      table_name = 'links'
  #    else
  #      return parser_error("Invalid 'date' value for calendar (#{fld.inspect}).")
  #    end
  #  end
  #
  #  @date_scope = "TABLE_NAME[#{table_name}].#{fld} >= '\#{start_date.strftime('%Y-%m-%d')}' AND TABLE_NAME[#{table_name}].#{fld} <= '\#{end_date.strftime('%Y-%m-%d')}'"
  #
  #  new_dom_scope
  #
  #  # SAVED TEMPLATE
  #  template = expand_block(self, :block => self, :saved_template => true)
  #  out helper.save_erb_to_url(template, template_url)
  #
  #  # INLINE
  #  out expand_block(self, :block => self, :saved_template => false)
  #end
end