aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/track/_tracking_links.html.erb
blob: 5419ec605c9d45c98f79c6dae2467f4586e9cdc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<%
    if @user
        existing_track = TrackThing.find_existing(@user, track_thing)
    end
%>

<% if own_request %>
    <p><%= _('This is your own request, so you will be automatically emailed when new responses arrive.')%></p>
<% elsif existing_track %>
    <p><%= track_thing.params[:verb_on_page_already] %></p>
    <div class="feed_link feed_link_<%=location%>">
  <%= link_to _("Unsubscribe"), {:controller => 'track', :action => 'update', :track_id => existing_track.id, :track_medium => "delete", :r => request.fullpath}, :class => "link_button_green" %>
    </div>
<% elsif track_thing %>
    <div class="feed_link feed_link_<%=location%>">
     <% if defined? follower_count && follower_count > 0 %>
        <%= link_to _("I like this request"), do_track_path(track_thing), :class => "link_button_green" %>
     <% else %>
        <%= link_to _("Follow"), do_track_path(track_thing), :class => "link_button_green" %>
     <% end %>
    </div>

    <div class="feed_link feed_link_<%=location%>">
        <%= link_to image_tag('feed-16.png', :alt => "RSS icon"), do_track_path(track_thing, 'feed') %>
        <%= link_to (location == 'sidebar' ? _('RSS feed of updates') : _('RSS feed')),  do_track_path(track_thing, 'feed') %>
    </div>
<% end %>