Putting protection on some organisations, so that spammers have less access...

This commit is contained in:
echarp 2016-01-26 15:09:33 +01:00
parent 218cb67571
commit b14eec0488
3 changed files with 17 additions and 15 deletions

View File

@ -6,8 +6,8 @@ class OrgasController < ApplicationController
before_action :set_mailer_host before_action :set_mailer_host
before_action :authenticate_user!, only: [:edit, :update], before_action :authenticate_user!, only: [:edit, :update],
unless: :check_secret unless: :check_secret
before_action :authenticate_user!, only: [:validate, :accept, :cancel, before_action :authenticate_user!, except: [:index, :new, :create, :show,
:destroy] :edit, :update]
def index def index
@search = apply_scopes(Orga).moderated.includes(:kind, @search = apply_scopes(Orga).moderated.includes(:kind,

View File

@ -58,8 +58,9 @@
= link_to orga_path(orga, q: params[:q], page: params[:page]) do = link_to orga_path(orga, q: params[:q], page: params[:page]) do
%em.fa.fa-eye %em.fa.fa-eye
%td %td
= link_to edit_orga_path orga do - if orga.secret.nil? || user_signed_in?
%em.fa.fa-pencil = link_to edit_orga_path orga do
%em.fa.fa-pencil
%tfoot %tfoot
%tr %tr

View File

@ -44,18 +44,19 @@
%em.fa.fa-li.fa-dot-circle-o %em.fa.fa-li.fa-dot-circle-o
GeoJSON GeoJSON
%h1 - if @orga.secret.nil? || user_signed_in?
%em.fa.fa-wrench %h1
= t '.actions' %em.fa.fa-wrench
%h2 = t '.actions'
= link_to edit_orga_path @orga do
%em.fa.fa-lg.fa-pencil
= t '.edit'
- if user_signed_in?
%h2 %h2
= link_to cancel_orga_path @orga do = link_to edit_orga_path @orga do
%em.fa.fa-lg.fa-thumbs-down %em.fa.fa-lg.fa-pencil
= t '.cancel' = t '.edit'
- if user_signed_in?
%h2
= link_to cancel_orga_path @orga do
%em.fa.fa-lg.fa-thumbs-down
= t '.cancel'
%h3= t '.description' %h3= t '.description'
.description .description