Sha256: a9310187f3224fbdeb195338f7d75d76b76d63f40e15bb1e715a1a19f3abba64

Contents?: true

Size: 1.15 KB

Versions: 14

Compression:

Stored size: 1.15 KB

Contents

view :title do |args|
   super args.merge( title: 'Recent Changes' )
end

format :html do

  view :card_list do |args|
    search_vars[:item] ||= :change

    cards_by_day = Hash.new { |h, day| h[day] = [] }
    search_results.each do |card|
      begin
        stamp = card.updated_at
        day = Date.new(stamp.year, stamp.month, stamp.day)
      rescue =>e
        day = Date.today
        card.content = "(error getting date)"
      end
      cards_by_day[day] << card if card.followable?
    end

    paging = _optional_render :paging, args
    %{
      #{ paging }
      #{
        cards_by_day.keys.sort.reverse.map do |day|
          %{
            <h2>#{format_date(day, include_time = false) }</h2>
            <div class="search-result-list">
              #{
                 cards_by_day[day].map do |card|
                   %{
                     <div class="search-result-item item-#{ search_vars[:item] }">
                      #{ nest(card, view: search_vars[:item]) }
                    </div>
                   }
                 end * ' '
              }
            </div>
          }
        end * "\n"
      }
      #{ paging }
    }
  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
card-1.17.4 mod/05_standard/set/self/recent.rb
card-1.17.3 mod/05_standard/set/self/recent.rb
card-1.17.2 mod/05_standard/set/self/recent.rb
card-1.17.1 mod/05_standard/set/self/recent.rb
card-1.17.0 mod/05_standard/set/self/recent.rb
card-1.16.15 mod/05_standard/set/self/recent.rb
card-1.16.14 mod/05_standard/set/self/recent.rb
card-1.16.13 mod/05_standard/set/self/recent.rb
card-1.16.12 mod/05_standard/set/self/recent.rb
card-1.16.11 mod/05_standard/set/self/recent.rb
card-1.16.10 mod/05_standard/set/self/recent.rb
card-1.16.9 mod/05_standard/set/self/recent.rb
card-1.16.8 mod/05_standard/set/self/recent.rb
card-1.16.7 mod/05_standard/set/self/recent.rb