Sha256: 5fa61894ff5def09ac11fe9057d16edf87792ee9c991a1194b8741cb6d535c87
Contents?: true
Size: 1.29 KB
Versions: 1
Compression:
Stored size: 1.29 KB
Contents
<%# Displays buttons to follow/revoke following on a given actor. Requires variables: - user (usually user) - actor (target actor) %> <p> <% if Federails::Client::FollowingPolicy.new(user, Federails::Following).create? %> <% follow = user.federails_actor.follows? actor %> <% if actor.entity == user %> <button type="button" role="button" disabled="disabled">That's you</button> <% elsif follow %> Already following (<%= follow.status %>) <%= button_to 'Cancel', federails.client_following_path(follow), method: :delete %> <% else %> <%= button_to "Follow #{actor.username}", federails.follow_client_followings_path, params: { account: actor.at_address }, method: :post %> <% end %> <% followed = actor.follows? user.federails_actor %> <% if followed %> <% if followed.pending? %> <%= actor.username %> wants to follow you. <%= button_to 'Accept request', federails.accept_client_following_path(followed), method: :put %> <% else %> <%= actor.username %> follows you. <%= button_to 'Revoke', federails.client_following_path(followed), method: :delete %> <% end %> <% end %> <% else %> <%= user.class.name %> is not configured to follow/be followed, or has no associated actor. <% end %> </p>
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
federails-0.4.0 | app/views/federails/client/followings/_follow_actions.html.erb |