aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/api/new_requests.atom.builder
blob: bd5c2f90e3e1a19c2eba1eff4c700d4d50792622 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
atom_feed do |feed|
    feed.title("New requests made to #{@public_body.name}")
    feed.updated(@requests.first.updated_at)

    puts @requests.inspect
    for request in @requests
        feed.entry(request) do |entry|
            entry.updated(request.updated_at)
            entry.published(request.created_at)
            entry.title(request.title)
            entry.content(request.last_event_forming_initial_request.outgoing_message.body, :type => 'text')
            entry.author do |author|
                author.name(request.user_name)
                if !request.user.nil?
                    author.uri(main_url(user_url(request.user)))
                end
                author.email(request.incoming_email)
            end
        end
    end
end