remove unused memberships controller/view
This commit is contained in:
parent
e883f4cfa7
commit
5ead67f88c
8 changed files with 0 additions and 140 deletions
|
@ -1,33 +0,0 @@
|
|||
class MembershipsController < ApplicationController
|
||||
before_filter :authenticate_membership_or_admin
|
||||
|
||||
def add_member
|
||||
user = User.find(params[:user_id])
|
||||
Membership.create(:group => @group, :user => user)
|
||||
redirect_to :action => 'reload', :id => @group
|
||||
end
|
||||
|
||||
def drop_member
|
||||
begin
|
||||
Membership.find(params[:membership_id]).destroy
|
||||
if User.find(@current_user.id).role_admin?
|
||||
redirect_to :action => 'reload', :id => @group
|
||||
else
|
||||
# If the user drops himself from admin group
|
||||
flash[:notice] = MESG_NO_ADMIN_ANYMORE
|
||||
render(:update) {|page| page.redirect_to :controller => "index"}
|
||||
end
|
||||
rescue => error
|
||||
flash[:error] = error.to_s
|
||||
redirect_to :action => 'reload', :id => @group
|
||||
end
|
||||
end
|
||||
|
||||
def reload
|
||||
render :update do |page|
|
||||
page.replace_html 'members', :partial => 'shared/memberships/current_members', :object => @group
|
||||
page.replace_html 'non_members', :partial => 'shared/memberships/non_members', :object => @group
|
||||
end
|
||||
end
|
||||
|
||||
end
|
|
@ -1,21 +0,0 @@
|
|||
<% if flash[:error] %>
|
||||
<h3 class="error" id="flashError" ><%= flash[:error] %></h3>
|
||||
<%= javascript_tag("new Effect.Highlight('flashError', {delay:0.8, duration:1});") -%>
|
||||
<% end %>
|
||||
|
||||
<% memberships = @group.memberships
|
||||
if memberships.size != 0 %>
|
||||
<ul style="">
|
||||
<% for membership in memberships %>
|
||||
<li style="margin-left:-15px">
|
||||
<b><%= membership.user.nick %></b> (<%=h membership.user.first_name + ' ' + membership.user.last_name %>)
|
||||
| <%= link_to_remote t('.drop'),
|
||||
:url => { :controller => '/memberships', :action => 'drop_member', :id => @group, :membership_id => membership },
|
||||
:before => "Element.show('loader')",
|
||||
:success => "Element.hide('loader')" %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% else %>
|
||||
<p><i><%= t('.no_members', group: @group.name) %></i></p>
|
||||
<% end %>
|
|
@ -1,23 +0,0 @@
|
|||
<h1><%=h t('.title', group: @group.name) %></h1>
|
||||
<p>
|
||||
<i><%= t('.desc', link: remote_link_to(t('.invite'), :url => new_invite_path(:id => @group))).html_safe %></i>
|
||||
</p>
|
||||
<div class="left_column" style="width:48%">
|
||||
<div class="box_title">
|
||||
<h2><%= t('.already_members') %></h2>
|
||||
</div>
|
||||
<div class="column_content" id="members">
|
||||
<%=render :partial => 'shared/memberships/current_members' %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="right_column" style="width:48%">
|
||||
<div class="box_title">
|
||||
<h2><%= t('.no_members_yet') %></h2>
|
||||
</div>
|
||||
<div class="column_content" id="non_members">
|
||||
<%= render :partial => 'shared/memberships/non_members' %>
|
||||
<%= remote_link_to(t('.invite_someone'), :url => new_invite_path(:id => @group)) %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="edit_box" style="display:none"></div>
|
|
@ -1,11 +0,0 @@
|
|||
<ul>
|
||||
<% for user in @group.non_members %>
|
||||
<li>
|
||||
<b><%= user.nick %></b> (<%=h user.first_name + ' ' + user.last_name %>)
|
||||
| <%= link_to_remote t('.add'),
|
||||
:url => { :controller => '/memberships', :action => 'add_member', :id => @group, :user_id => user },
|
||||
:before => "Element.show('loader')",
|
||||
:success => "Element.hide('loader')" %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
|
@ -1378,19 +1378,6 @@ de:
|
|||
homepage_title: Foodcoop Homepage besuchen
|
||||
logout: Abmelden
|
||||
profile: Profil
|
||||
memberships:
|
||||
current_members:
|
||||
drop: entfernen
|
||||
no_members: ! '%{group} hat keine Mitglieder.'
|
||||
members:
|
||||
already_members: Sind schon Mitglieder
|
||||
desc: Hier kannst Du Mitglieder der Gruppe verwalten oder ein neues Foodcoop-Mitglied in die Gruppe %{link}.
|
||||
invite: einladen
|
||||
invite_someone: Person einladen
|
||||
no_members_yet: Sind noch keine Mitglieder
|
||||
title: Mitglieder von %{group}
|
||||
non_members:
|
||||
add: hinzufügen
|
||||
open_orders:
|
||||
ending: Ende
|
||||
no_open_orders: Derzeit gibt es keine laufenden Bestellungen
|
||||
|
|
|
@ -1382,19 +1382,6 @@ en:
|
|||
homepage_title: Visit Foodcoop Homepage
|
||||
logout: Logout
|
||||
profile: Profile
|
||||
memberships:
|
||||
current_members:
|
||||
drop: remove
|
||||
no_members: ! '%{group} has no members.'
|
||||
members:
|
||||
already_members: Are already members
|
||||
desc: Here you can manage members of the group or invite a new Foodcoop-member to the group %{link}.
|
||||
invite: invite
|
||||
invite_someone: Invite someone
|
||||
no_members_yet: Are not members yet
|
||||
title: Members of %{group}
|
||||
non_members:
|
||||
add: add
|
||||
open_orders:
|
||||
ending: Ending
|
||||
no_open_orders: There are no current orders
|
||||
|
|
|
@ -1385,19 +1385,6 @@ fr:
|
|||
homepage_title: Vers la page d'accueil de la bouffecoop
|
||||
logout: Te déconnecter
|
||||
profile: Profil
|
||||
memberships:
|
||||
current_members:
|
||||
drop: désinscrire
|
||||
no_members: ! '%{group} n''a aucun membre pour le moment.'
|
||||
members:
|
||||
already_members: Sont déjà membre
|
||||
desc: Sur cette page, tu peux gérer les membres de l'équipe, et aussi %{link} un nouveau membre.
|
||||
invite: engrainer
|
||||
invite_someone: Inviter quelqu'unE
|
||||
no_members_yet: Ne sont pas encore membre
|
||||
title: Membre de %{group}
|
||||
non_members:
|
||||
add: ajouter
|
||||
open_orders:
|
||||
ending: Clôture le
|
||||
no_open_orders: Il n'y a aucune commande en cours en ce moment
|
||||
|
|
|
@ -1312,19 +1312,6 @@ nl:
|
|||
homepage_title: Foodcoop startpagina bezoeken
|
||||
logout: Uitloggen
|
||||
profile: Profiel
|
||||
memberships:
|
||||
current_members:
|
||||
drop: verwijderen
|
||||
no_members: ! '%{group} heeft geen leden.'
|
||||
members:
|
||||
already_members: Zijn al lid
|
||||
desc:
|
||||
invite: uitnodiging
|
||||
invite_someone: Iemand uitnodigen
|
||||
no_members_yet: Zijn nog geen lid
|
||||
title: Leden van %{group}
|
||||
non_members:
|
||||
add: toevoegen
|
||||
open_orders:
|
||||
ending: Einde
|
||||
no_open_orders: Er zijn momenteel geen lopende bestellingen.
|
||||
|
|
Loading…
Reference in a new issue