app/lib/class_list_text.rb
# This is dangerous since it ignore authorizations rules,
# which are complicated for class lists depending on the time of the year.
This is dangerous since it ignore authorizations rules,
which are complicated for class lists depending on the time of the year.
This is dangerous since it ignore authorizations rules which are complicated for class lists depending on the time of the year .
def dangerously_render_as_text
    output = []
    output << "Class list: (#{@class_list.workspace_id}:#{@class_list.id})"
    output << '------------------------------------------------'
    output << "School: #{@class_list.school.name}"
    output << "Grade level (rising): #{@class_list.grade_level_next_year}"
    output << "Created by: #{@class_list.created_by_teacher_educator.full_name}"
    output << "Submitted to principal? #{@class_list.submitted}"
    output << "Revised by: #{@class_list.revised_by_principal_educator.try(:full_name) || 'not revised'}"
    output << "Last updated at: #{@class_list.updated_at}"
    output << ""
    output << ""
    output << 'Teaching team, plan and notes'
    output << '------------------------------------------------'
    output << "Classrooms created: #{@class_list.json['classroomsCount']}"
    output << "Teaching team:\n  #{authors_text(@class_list)}"
    output << ""
    output << "Teaching team's plan:\n#{@class_list.json['planText']}"
    output << ""
    output << "Notes to principal:\n#{@class_list.json['principalNoteText']}"
    output << ""
    output << ""
    output << "Teaching team's class lists:"
    output << '------------------------------------------------'
    output += lines_for_class_list_rosters(@class_list.json)
    output << "Principal's revised class lists:"
    output << '------------------------------------------------'
    output += lines_for_class_list_rosters(@class_list.principal_revisions_json)
    output << ""
    output << ""
    output.join("\n")
  end
def dangerously_render_as_text output = [ ] output << "Class list: (#{@class_list.workspace_id}:#{@class_list.id})" output << '------------------------------------------------' output << "School: #{@class_list.school.name}" output << "Grade level (rising): #{@class_list.grade_level_next_year}" output << "Created by: #{@class_list.created_by_teacher_educator.full_name}" output << "Submitted to principal? #{@class_list.submitted}" output << "Revised by: #{@class_list.revised_by_principal_educator.try(:full_name) || 'not revised'}" output << "Last updated at: #{@class_list.updated_at}" output << "" output << "" output << 'Teaching team, plan and notes' output << '------------------------------------------------' output << "Classrooms created: #{@class_list.json['classroomsCount']}" output << "Teaching team:\n  #{authors_text(@class_list)}" output << "" output << "Teaching team's plan:\n#{@class_list.json['planText']}" output << "" output << "Notes to principal:\n#{@class_list.json['principalNoteText']}" output << "" output << "" output << "Teaching team's class lists:" output << '------------------------------------------------' output += lines_for_class_list_rosters ( @class_list . json ) output << "Principal's revised class lists:" output << '------------------------------------------------' output += lines_for_class_list_rosters ( @class_list . principal_revisions_json ) output << "" output << "" output . join ( "\n" ) end
This is dangerous since it ignore authorizations rules,
which are complicated for class lists depending on the time of the year.
This is dangerous since it ignore authorizations rules which are complicated for class lists depending on the time of the year .