File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -130,6 +130,8 @@ def post_types
130130 @post_types = @category . top_level_post_types
131131 if @post_types . one?
132132 redirect_to new_category_post_path ( post_type : @post_types . first , category : @category )
133+ elsif @post_types . empty? && current_user &.admin?
134+ redirect_to edit_category_post_types_path ( @category , no_return : '1' )
133135 end
134136 end
135137
Original file line number Diff line number Diff line change 1- < p class ="has-font-size-caption ">
2- <%= link_to edit_category_path ( @category ) do %>
3- « Back to category edit
4- <% end %>
5- </ p >
1+ <%#
2+ View for managing allowed category post types
3+
4+ Parameters:
5+ params[:no_return] : whether to suppress the return link
6+ %>
7+
8+ <% unless params[:no_return] == '1' %>
9+ <p class ="has-font-size-caption ">
10+ <%= link_to edit_category_path ( @category ) do %>
11+ « Back to category edit
12+ <% end %>
13+ </ p >
14+ <% end %>
615< h1 > Allowed post types for <%= @category . name %> </ h1 >
716< p class ="has-font-size-caption ">
817 Only post types listed here are allowed to be posted in this category. Not all will be displayed as available options
You can’t perform that action at this time.
0 commit comments