-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds petition button on organizations/show page, plus bug fix and sec…
…urity fix (#717)
- Loading branch information
1 parent
38164d6
commit 87139a2
Showing
6 changed files
with
86 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<% if current_user %> | ||
<% petition = current_user.petitions.where(organization_id: organization.id).last %> | ||
<% if member = Member.where(user: current_user, organization: organization).first %> | ||
<%= link_to t('users.user_rows.delete_membership'), | ||
member, | ||
method: :delete, | ||
data: { confirm: t('users.user_rows.sure_delete', organization_name: organization.name) }, | ||
class: 'btn btn-danger' %> | ||
<% elsif petition && !current_user.was_member?(petition) %> | ||
<span class="badge"><%= petition.status %></span> | ||
<% else %> | ||
<%= link_to t('petitions.apply'), | ||
petitions_path(user_id: current_user.id, organization_id: organization.id), | ||
method: :post, | ||
class: 'btn btn-default' %> | ||
<% end %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters