Skip to content

Commit

Permalink
recent is now gone
Browse files Browse the repository at this point in the history
  • Loading branch information
robbi5 committed Jan 1, 2021
1 parent 0f9e792 commit 350f2e3
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 60 deletions.
11 changes: 4 additions & 7 deletions app/controllers/paper_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,10 @@ def viewer
end

def recent
@days = 14
@papers = Paper.where('published_at >= ?', Date.today - @days.days)
.includes(:body, :paper_originators)
.order(published_at: :desc, reference: :desc)
.page(params[:page])
@recent = @papers.to_a.group_by(&:published_at)
fresh_when last_modified: @papers.maximum(:updated_at), public: true
respond_to do |format|
format.atom
format.html { return render status: 410, body: nil }
end
end

def redirect_by_id
Expand Down
18 changes: 12 additions & 6 deletions app/views/paper/recent.atom.builder
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
atom_feed(language: 'de-DE', root_url: recent_url, url: feed_url_with_current_page(@papers)) do |feed|
paginated_feed(feed, @papers)
feed.title "kleineAnfragen: Anfragen der letzten #{@days} Tage"
feed.updated @papers.maximum(:updated_at)
atom_feed(language: 'de-DE', root_url: recent_url) do |feed|
down_date = Date.new(2020, 12, 31)
url = Rails.application.routes.url_helpers.obiturary_url

feed.title "kleineAnfragen: Anfragen der letzten Tage"
feed.updated down_date
feed.author { |author| author.name 'kleineAnfragen' }

@papers.each do |paper|
render(partial: 'paper', locals: { feed: feed, paper: paper })
feed.entry Paper.new, published: down_date, updated: down_date, url: url do |entry|
entry.title 'kleineAnfragen wurde abgeschaltet'
entry.author do |author|
author.name 'kleineAnfragen'
end
entry.summary ''
end
end
23 changes: 0 additions & 23 deletions app/views/paper/recent.html.erb

This file was deleted.

25 changes: 2 additions & 23 deletions app/views/site/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
<h3>Warum?</h3>
<p>In Antworten auf kleine Anfragen verstecken sich immer wieder interessante Details.</p>
<p>So konnte Zeit Online z.B. durch einer Reihe kleiner Anfragen, die die Grünen-Bundestagsfraktion an die Bundesregierung gerichtet hatte, eine <a href="http://www.zeit.de/mobilitaet/2014-09/deutsche-bahn-bruecken-zustand">interaktive Karte über den Zustand von Bahnbrücken</a> erstellen.</p>
</div>

<div class="col-sm-6">
<h2>Länder- und Parlamentsübersicht:</h2>
<div class="row bodies">
<div class="col-sm-5 col-sm-push-6">
Expand All @@ -42,27 +44,4 @@
</div>
</div>
</div>

<div class="col-sm-6">
<h2>Zuletzt veröffentlichte Anfragen</h2>
<ol class="paper-list paper-list--with-body">
<% @papers.each do |paper| %>
<li>
<p class="source-and-title">
<span class="source">
<%= link_to paper.body.state, paper.body, title: paper.body.name %>
<span class="label label-default"><%= link_to_paper paper.full_reference, paper %></span>
</span>
<%= link_to_paper paper.title, paper %>
</p>
<p class="meta">
Eingereicht von <%= paper.originators.collect(&:name).join(', ') %>
&mdash;
Veröffentlicht vor <%= relative_time_dativ(paper.published_at) %>
</p>
</li>
<% end %>
</ol>
<a class="btn btn-default recent-link" href="/recent">Mehr zuletzt veröffentlichte Anfragen&hellip;</a>
</div>
</div>
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
get 'info/datenschutz'
get 'info/mitmachen'
get 'info/spenden'
get 'info/stilllegung'
get 'info/stilllegung', as: :obiturary

get 'static/kleineanfragen.svg', to: redirect { ActionController::Base.helpers.asset_path('kleineanfragen.svg') }

Expand Down

0 comments on commit 350f2e3

Please sign in to comment.