class PersonalSelectedCoursesController < ApplicationController def index selected_courses = SelectedCourse.where(:is_hidden=>false).order_by(:year=>'desc').page(OrbitHelper.params[:page_no]).per(OrbitHelper.page_data_count) selected_courses_list = selected_courses.collect do |selected_course| member = selected_course.member_profile path = OrbitHelper.url_to_plugin_show(member.to_param, 'member') rescue '#' { "year" => selected_course.year, "course_title" => selected_course.course_title, "category" => (selected_course.course.course_category.title rescue ""), "semester" => (selected_course.course.course_semester.title rescue ""), "authors" => ("" + member.name + ""), "link_to_show" => OrbitHelper.url_to_show(selected_course.to_param) } end { "courses" => selected_courses_list, "extras" => { "widget-title" => t("module_name.personal_course"), "th_year" => t('personal_course.year'), "th_course_title" => t("personal_course.title"), "th_course_category" => t("personal_course.course_category"), "th_course_semester" => t("personal_course.course_semester"), "th_authors" => t('users.name') }, "total_pages" => selected_courses.total_pages } end def show params = OrbitHelper.params plugin = SelectedCourse.where(:is_hidden=>false).find_by(uid: params[:uid]) fields_to_show = [ "year", "selected_course_category", "course_title", "course_url", "course_objective", "course_student" # "selected_course_semester", # "selected_course_syllabus_file", # "selected_course_progress_file", # "selected_course_activity_file", # "selected_course_multimedia_file", # "selected_course_material_file", # "selected_course_supplement_file", # "selected_course_evaluation_file" ] {"plugin_datas"=>plugin.get_plugin_data(fields_to_show)} end end