-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
subscriptions.html.erb
68 lines (56 loc) · 3.93 KB
/
subscriptions.html.erb
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<div class="col-lg-3">
<p><b><%=raw translation('home.subscriptions.title') %></b> <%=raw translation('home.subscriptions.up_to_date_emails') %></p>
<hr />
<p>
<% if current_user.following("everything") %>
<a rel="tooltip" title="<%= t('home.subscriptions.click_unfollow') %>" class="btn btn-outline-secondary active" href="/unsubscribe/tag/everything" data-method="delete"><i class="fa fa-user-plus" aria-hidden="true"></i> <%= t('home.subscriptions.following') %> <b><%= t('home.subscriptions.research_notes') %></b></a>
<% else %>
<a href="/subscribe/tag/everything" class="btn btn-outline-secondary"><i class="fa fa-tag"></i> <%= t('home.subscriptions.subscribe_to') %> <b><%= t('home.subscriptions.all') %></b> <%= t('home.subscriptions.notes') %></a>
<% end %>
</p>
<p>
<i><%=raw translation('home.subscriptions.receive_mails') %></i>
</p>
<hr />
<a href="/settings" class="btn btn-outline-secondary" style="margin-bottom: 10px;"><i class="fa fa-bell"></i> Notification settings </a>
<p style="font-style: italic;"> Control how you get notifications. </p>
</div>
<div class="col-lg-9">
<h3><%=raw translation('home.subscriptions.manage_subscriptions') %> (<%= current_user.subscriptions.length %>)</h3>
<form class="navbar-form" action="/subscribe/tag">
<div class="form-group">
<div class="row">
<div class="col-md-7">
<input type="text" name="name" class="form-control" placeholder="<%= t('home.subscriptions.enter_tags') %>" data-provide="typeahead" data-source='["balloon-mapping","thermal-flashlight","spectrometer"]' autocomplete="off" required="required">
</div>
<div class="col-md-2 pl-md-1">
<button type="submit" class="btn btn-primary add-subscriptions"><i class="fa fa-plus fa fa-white"></i> <%= t('home.subscriptions.add') %></button>
</div>
</div>
</div>
</form>
<% if current_user.subscriptions.length == 0 %>
<p> You haven't subscribed to any topic yet </p>
<% else %>
<table class="table">
<tr><th><%=raw translation('home.subscriptions.tag') %></th><th><%=raw translation('home.subscriptions.options') %></th></tr>
<% current_user.subscriptions(:tag).each do |subscription| %>
<tr>
<td><a href="/tag/<%= subscription.tagname %>"><%= subscription.tagname %></a> <i style="color:#aaa;"> +<%= Tag.follower_count(subscription.tagname).to_i-1 %> other people</i></td>
<td><div class="btn-toolbar" style="margin:0;">
<div class="btn-group">
<!--
<a rel="tooltip" title="As it happens" class="btn btn-default btn-xs" href="javascript:void(0)"><i class="fa fa-envelope"></i> Email</a>
<a rel="tooltip" title="Once per day" class="btn btn-default btn-xs" href="javascript:void(0)"><i class="fa fa-list"></i> Digest</a>
-->
<script> input_<%= subscription.tid %> = '#share-<%= subscription.tid %>'</script>
<a class="btn btn-outline-secondary btn-sm" rel="popover" data-toggle="popover" data-placement="left" title="<%= t('home.subscriptions.share_subscription_link') %>" data-html="true" data-content="<div style='margin-top:10px;'><a style='padding-left:3px;' href='https://twitter.com/intent/tweet?text=🎈 Public Lab: Subscriptions&url=https://publiclab.org/subscriptions/tag/<%= subscription.tagname %>' class='twitter-share-button'>Tweet</a></div> <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src='//platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document,'script','twitter-wjs');</script>
<i class="fa fa-share"></i> <%= t('home.subscriptions.share') %></a>
<a class="btn btn-outline-secondary btn-sm" href="/unsubscribe/tag/<%= subscription.tagname %>" data-method="delete"><i class="fa fa-remove"></i> <%= t('home.subscriptions.unsubscribe') %></a>
</div>
</div></td>
</tr>
<% end %>
</table>
<% end %>
</div>