mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-10-31 03:09:06 -04:00
18 lines
666 B
Ruby
18 lines
666 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Admin
|
|
# Every crop's job templates in one list, for crop wranglers to find the
|
|
# drafts waiting to be checked and published.
|
|
class JobTemplatesController < ApplicationController
|
|
before_action :authenticate_member!
|
|
before_action { authorize! :wrangle, Crop }
|
|
|
|
def index
|
|
@status = params[:status] if CropJobTemplate.statuses.key?(params[:status])
|
|
@templates = CropJobTemplate.joins(:crop).includes(:creator, :steps, crop: :parent).order('crops.name', :name)
|
|
@templates = @templates.where(status: @status) if @status
|
|
@templates = @templates.paginate(page: params[:page])
|
|
end
|
|
end
|
|
end
|