Commit 3bbc9890 authored by Alexandre Friquet's avatar Alexandre Friquet
Browse files

Unnecessary show page removed for club novel: refs #100.

parent f0d0b5ff
class ClubNovelsController < ApplicationController class ClubNovelsController < ApplicationController
before_action :authorize, except: [:index, :show] before_action :authorize, except: [:index]
def index def index
@title = Menu.find_by(uid: 'club_novels')&.title @title = Menu.find_by(uid: 'club_novels')&.title
@club_novels = ClubNovel.paginate(page: params[:page]) @club_novels = ClubNovel.paginate(page: params[:page])
end end
def show
@club_novel = ClubNovel.find(params[:id])
end
def new def new
@club_novel = ClubNovel.new @club_novel = ClubNovel.new
end end
...@@ -19,7 +15,7 @@ class ClubNovelsController < ApplicationController ...@@ -19,7 +15,7 @@ class ClubNovelsController < ApplicationController
sanitize_publication sanitize_publication
if @club_novel.save if @club_novel.save
flash[:notice] = 'Info club créée avec succès.' flash[:notice] = 'Info club créée avec succès.'
redirect_to @club_novel redirect_to club_novels_path
else else
render :new render :new
end end
...@@ -34,7 +30,7 @@ class ClubNovelsController < ApplicationController ...@@ -34,7 +30,7 @@ class ClubNovelsController < ApplicationController
sanitize_publication sanitize_publication
if @club_novel.update_attributes(club_novel_params) if @club_novel.update_attributes(club_novel_params)
flash[:notice] = 'Info club modifiée avec succès.' flash[:notice] = 'Info club modifiée avec succès.'
redirect_to @club_novel redirect_to club_novels_path
else else
render :edit render :edit
end end
......
...@@ -23,9 +23,12 @@ ...@@ -23,9 +23,12 @@
<%= custom_delete_link club_novel, :short, class: %w(tight) %> <%= custom_delete_link club_novel, :short, class: %w(tight) %>
</span> </span>
<% end -%> <% end -%>
<%= raw textilize_without_paragraph club_novel.title %> <%= raw textilize_without_paragraph club_novel.title %>
</h2> </h2>
<span>Publique :</span> <%= club_novel.public_label %>
<%= textilize raw club_novel.content %> <%= textilize raw club_novel.content %>
</li> </li>
<% end %> <% end %>
......
<%
# OLIGAA - Stands for "Outil en Ligne d'Information et de Gestion des Activités
# des Associations" which is an online tool for associations to manage news,
# actors and activities.
# Copyright (C) 2010-2018 Comité Départemental du Sport Adapté de la Gironde (CDSA
# 33) <contact@cdsa33.org>
#
# This file is part of OLIGAA.
#
# OLIGAA is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# OLIGAA is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
%>
<% title @club_novel.title %>
<article class="card-block">
<h1><%= yield :title %></h1>
<% if admin? %>
<p class="AdminCard-globalActions">
<%= custom_delete_link @club_novel, :short %>
<%= custom_edit_link edit_club_novel_path(@club_novel), :short %>
<%= custom_list_link club_novels_path %>
</p>
<p>
<span>Publique :</span> <%= @club_novel.public_label %>
</p>
<% end %>
<%= textilize raw @club_novel.content %>
</article>
...@@ -91,7 +91,7 @@ Rails.application.routes.draw do ...@@ -91,7 +91,7 @@ Rails.application.routes.draw do
patch :move_down patch :move_down
end end
end end
resources :club_novels resources :club_novels, except: :show
patch '/newsletter_items/:id/move_up' => 'newsletter_items#move_up', as: 'move_up_item' patch '/newsletter_items/:id/move_up' => 'newsletter_items#move_up', as: 'move_up_item'
patch '/newsletter_items/:id/move_down' => 'newsletter_items#move_down', as: 'move_down_item' patch '/newsletter_items/:id/move_down' => 'newsletter_items#move_down', as: 'move_down_item'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment