|
1 | 1 | class SeriesController < ApplicationController |
2 | 2 | before_action :check_user_status, only: [:new, :create, :edit, :update] |
3 | | - before_action :load_series, only: [:show, :edit, :remove_user_creatorship, :update, :manage, :destroy, :confirm_delete] |
4 | | - before_action :check_ownership, only: [:edit, :update, :manage, :destroy, :confirm_delete] |
| 3 | + before_action :load_series, only: [:show, :edit, :remove_user_creatorship, :update, :manage, :update_positions, :confirm_delete, :destroy] |
| 4 | + before_action :check_ownership, except: [:index, :show, :new, :create] |
5 | 5 | before_action :check_visibility, only: [:show] |
6 | 6 |
|
7 | 7 | def load_series |
@@ -42,14 +42,14 @@ def index |
42 | 42 | # GET /series/1 |
43 | 43 | # GET /series/1.xml |
44 | 44 | def show |
45 | | - @works = @series.works_in_order.posted.select(&:visible?).paginate(page: params[:page]) |
| 45 | + @works = @series.works_in_order.posted.includes(:pseuds).select(&:visible?).paginate(page: params[:page]) |
46 | 46 |
|
47 | 47 | # sets the page title with the data for the series |
48 | 48 | if @series.unrevealed? |
49 | 49 | @page_subtitle = t(".unrevealed_series") |
50 | 50 | else |
51 | 51 | @page_subtitle = get_page_subtitle(@series.fandoms.pluck(:name).join(t("support.array.words_connector")), |
52 | | - @series.anonymous? ? t(".anonymous") : @series.allpseuds.collect(&:byline).join(t("support.array.words_connector")), |
| 52 | + helpers.text_byline(@series), |
53 | 53 | @series.title) |
54 | 54 | end |
55 | 55 |
|
@@ -116,7 +116,6 @@ def update |
116 | 116 |
|
117 | 117 | def update_positions |
118 | 118 | if params[:serial_works] |
119 | | - @series = Series.find(params[:id]) |
120 | 119 | @series.reorder_list(params[:serial_works]) |
121 | 120 | flash[:notice] = ts("Series order has been successfully updated.") |
122 | 121 | elsif params[:serial] |
|
0 commit comments