-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #526 fixing conflicts with master
- Loading branch information
Showing
80 changed files
with
3,591 additions
and
326 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--color | ||
--format documentation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,45 @@ | ||
ActiveAdmin.register AdminUser do | ||
permit_params :email, :password, :password_confirmation | ||
|
||
index do | ||
selectable_column | ||
id_column | ||
column :email | ||
column :current_sign_in_at | ||
column :sign_in_count | ||
column :created_at | ||
actions | ||
end | ||
menu parent: "Users", priority: 4 | ||
permit_params :email, :password, :password_confirmation | ||
|
||
# [Admin - Story 3.19] | ||
# creates table to show the attributes of the admins. | ||
# Parameters: none. | ||
# Returns: none. | ||
# Author: Mimi | ||
index do | ||
selectable_column | ||
id_column | ||
column :email | ||
column :current_sign_in_at | ||
column :sign_in_count | ||
column :created_at | ||
actions | ||
end | ||
|
||
filter :email | ||
filter :current_sign_in_at | ||
filter :sign_in_count | ||
filter :created_at | ||
# [Admin - Story 3.19] | ||
# It is used to filter the results by the specified attributes. | ||
# Parameters: none. | ||
# Returns: none. | ||
# Author: Mimi | ||
filter :email | ||
filter :current_sign_in_at | ||
filter :sign_in_count | ||
filter :created_at | ||
|
||
form do |f| | ||
f.inputs "Admin Details" do | ||
f.input :email | ||
f.input :password | ||
f.input :password_confirmation | ||
end | ||
f.actions | ||
end | ||
|
||
end | ||
# [Admin - Story 3.19] | ||
# creates a form for creating Admin | ||
# Parameters: none. | ||
# Returns: none. | ||
# Author: Mimi | ||
form do |f| | ||
f.inputs "Admin Details" do | ||
f.input :email | ||
f.input :password | ||
f.input :password_confirmation | ||
end | ||
f.actions | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
ActiveAdmin.register Assignment do | ||
|
||
menu parent: "Assignment", priority:1 | ||
permit_params :title, :description, :final_grade, :assignment_id, :owner_id, | ||
:owner_type, :created_at, :updated_at | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
ActiveAdmin.register AssignmentProblem do | ||
|
||
menu parent: "Problems", priority:2 | ||
permit_params :title, :description, :time_limit, :owner_id, :owner_type, :created_at, | ||
:updated_at, :assignment_id, :final_grade | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
ActiveAdmin.register Attempt do | ||
|
||
menu parent:"Problems", priority:6 | ||
permit_params :student_id, :problem_id, :failure, :success, :incomplete, :created_at | ||
:updated_at | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
ActiveAdmin.register Contest do | ||
|
||
menu parent: "Contest", priority:1 | ||
permit_params :title, :description, :incomplete, :start_time, :end_time, | ||
:course_id, :owner_type, :owner_id, :created_at, :updated_at | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ActiveAdmin.register ContestProgress do | ||
|
||
menu parent: "Contest", priority:2 | ||
permit_params :contest_id, :student_id, :cproblem_id, :status, :created_at, :updated_at | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
ActiveAdmin.register Course do | ||
|
||
menu parent: "Subject", priority:1 | ||
permit_params :name, :code, :year, :semester, :university, :description, :visible, :incomplete, | ||
:link, :created_at, :updated_at | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ActiveAdmin.register CourseStudent do | ||
|
||
menu parent: "Subject", priority:6 | ||
permit_params :share, :course_id, :student_id, :created_at, :updated_at | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ActiveAdmin.register Cproblem do | ||
|
||
menu parent: "Problems", priority:3 | ||
permit_params :title, :description, :time_limit, :owner_id, :owner_type, :created_at, :updated_at | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,53 @@ | ||
ActiveAdmin.register_page "Dashboard" do | ||
|
||
menu priority: 1, label: proc{ I18n.t("active_admin.dashboard") } | ||
|
||
content title: proc{ I18n.t("active_admin.dashboard") } do | ||
div class: "blank_slate_container", id: "dashboard_default_message" do | ||
span class: "blank_slate" do | ||
span I18n.t("active_admin.dashboard_welcome.welcome") | ||
small I18n.t("active_admin.dashboard_welcome.call_to_action") | ||
end | ||
end | ||
|
||
# Here is an example of a simple dashboard with columns and panels. | ||
# | ||
# columns do | ||
# column do | ||
# panel "Recent Posts" do | ||
# ul do | ||
# Post.recent(5).map do |post| | ||
# li link_to(post.title, admin_post_path(post)) | ||
# end | ||
# end | ||
# end | ||
# end | ||
|
||
# column do | ||
# panel "Info" do | ||
# para "Welcome to ActiveAdmin." | ||
# end | ||
# end | ||
# end | ||
end # content | ||
end | ||
# [Admin - Story 3.19] | ||
# It gets some informations of the last 4 Lecturers,TAs,Students that | ||
# have been added to the database. | ||
# Parameters: none. | ||
# Returns: | ||
# For a lecturer/TA, it returns name,email,university,degree. | ||
# For a student, it returns name,email.university,faculty,major. | ||
# Author: Mimi | ||
menu priority: 1, label: proc{ I18n.t("active_admin.dashboard") } | ||
content :title => proc{ I18n.t("active_admin.dashboard") } do | ||
columns do | ||
column do | ||
panel "Recent Lecturers" do | ||
table_for Lecturer.limit(4) do | ||
column("name"){|lecturer| (lecturer.name)} | ||
column("email"){|lecturer| link_to(lecturer.email,admin_lecturer_path(lecturer.id))} | ||
column("university"){|lecturer| (lecturer.university)} | ||
column("department"){|lecturer| (lecturer.department)} | ||
column("degree"){|lecturer| (lecturer.degree)} | ||
end | ||
end | ||
end | ||
end | ||
columns do | ||
column do | ||
panel "Recent TAs" do | ||
table_for TeachingAssistant.limit(4) do | ||
column("name"){|teaching_assistant| (teaching_assistant.name)} | ||
column("email"){|teaching_assistant| link_to(teaching_assistant.email,admin_teaching_assistant_path(teaching_assistant.id))} | ||
column("university"){|teaching_assistant| (teaching_assistant.university)} | ||
column("department"){|teaching_assistant| (teaching_assistant.department)} | ||
column("degree"){|teaching_assistant| (teaching_assistant.degree)} | ||
end | ||
end | ||
end | ||
end | ||
columns do | ||
column do | ||
panel "Recent Students" do | ||
table_for Student.limit(4) do | ||
column("name"){|student| (student.name)} | ||
column("email"){|student| link_to(student.email,admin_lecturer_path(student.id))} | ||
column("university"){|student| (student.university)} | ||
column("faculty"){|student| (student.faculty)} | ||
column("major"){|student| (student.major)} | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ActiveAdmin.register DiscussionBoard do | ||
|
||
menu parent: "DBs/Posts", priority:1 | ||
permit_params :title, :activated, :course_id, :created_at, :updated_at | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ActiveAdmin.register Grade do | ||
|
||
menu parent: "Assignment", priority:2 | ||
permit_params :problem_id, :student_id, :grade, :editor_id, :editor_type, :created_at, :updated_at | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
ActiveAdmin.register Hint do | ||
|
||
menu parent: "Problems", priority:4 | ||
permit_params :message, :category, :time, :submission_counter, :model_answer_id, | ||
:owner_id, :owner_type, :created_at, :updated_at | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
ActiveAdmin.register Lecturer do | ||
|
||
menu parent: "Users",priority:1 | ||
permit_params :email, :password, :password_confirmation, :dob, :gender, :degree, | ||
:university, :department, :name | ||
# [Admin - Story 3.19] | ||
# creates a form for creating Lecturer | ||
# Parameters: none. | ||
# Returns: none. | ||
# Author: Mimi | ||
form do |f| | ||
f.inputs "Lecturer Details" do | ||
f.input :name | ||
f.input :email | ||
f.input :password | ||
f.input :password_confirmation | ||
f.input :degree | ||
f.input :university | ||
f.input :department | ||
f.input :dob | ||
f.input :gender | ||
end | ||
f.actions | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ActiveAdmin.register ModelAnswer do | ||
|
||
menu parent: "Problems", priority:8 | ||
permit_params :title, :answer, :problem_id, :owner_id, :owner_type | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
ActiveAdmin.register Post do | ||
|
||
menu parent: "DBs/Posts",priority:2 | ||
permit_params :title, :img, :content, :views_count, :discussion_board_id, :owner_id, | ||
:owner_type, :created_at, :updated_at | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
ActiveAdmin.register Problem do | ||
|
||
menu parent: "Problems", priority:1 | ||
permit_params :title, :description, :incomplete, :views_count, :time_limit, :track_id, | ||
:snippet, :fill_gaps, :public, :owner_id, :owner_type, :created_at, :updated_at | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
ActiveAdmin.register Recommendation do | ||
|
||
menu parent: "Problems", priority:7 | ||
permit_params :problem_id, :student_id, :recommender_id | ||
# [Admin - Story 3.19] | ||
# creates a form for creating "Recommendation" | ||
# Parameters: none. | ||
# Returns: none. | ||
# Author: Mimi | ||
form do |f| | ||
f.inputs "Recommendation Details" do | ||
f.input :problem_id | ||
f.input :student_id | ||
f.input :recommender_id | ||
end | ||
f.actions | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ActiveAdmin.register Reply do | ||
|
||
menu parent: "DBs/Posts",priority:3 | ||
permit_params :content, :img, :post_id, :owner_id, :owner_type, :created_at, :updated_at | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
ActiveAdmin.register Student do | ||
|
||
menu parent: "Users", priority: 3 | ||
permit_params :name, :email, :password, :password_confirmation, :faculty, :semester, | ||
:major, :university, :dob, :gender | ||
# [Admin - Story 3.19] | ||
# creates a form for creating Student | ||
# Parameters: none. | ||
# Returns: none. | ||
# Author: Mimi | ||
form do |f| | ||
f.inputs "Student Details" do | ||
f.input :name | ||
f.input :email | ||
f.input :password | ||
f.input :password_confirmation | ||
f.input :faculty | ||
f.input :semester | ||
f.input :major | ||
f.input :university | ||
f.input :dob | ||
f.input :gender | ||
end | ||
f.actions | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
ActiveAdmin.register TeachingAssistant do | ||
|
||
menu parent: "Users",priority:2 | ||
permit_params :email, :password, :password_confirmation, :dob, :gender, :degree, :graduated_year, | ||
:graduated_from, :university, :department, :name | ||
# [Admin - Story 3.19] | ||
# creates a form for creating teaching_assistant | ||
# Parameters: none. | ||
# Returns: none. | ||
# Author: Mimi | ||
form do |f| | ||
f.inputs "Teacher Assistant Details" do | ||
f.input :name | ||
f.input :email | ||
f.input :password | ||
f.input :password_confirmation | ||
f.input :degree | ||
f.input :university | ||
f.input :department | ||
f.input :dob | ||
f.input :gender | ||
f.input :graduated_from | ||
f.input :graduated_year | ||
end | ||
f.actions | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
ActiveAdmin.register TestCase do | ||
|
||
menu parent: "Problems", priority:5 | ||
permit_params :input, :output, :model_answer_id, :problem_id, :owner_id, :owner_type, | ||
:created_at, :updated_at | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
ActiveAdmin.register Topic do | ||
|
||
menu parent: "Subject", priority:2 | ||
permit_params :title, :description, :order_factor, :course_id, :lecturer_id, :created_at, | ||
:updated_at | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
ActiveAdmin.register Track do | ||
|
||
menu parent: "Subject", priority:3 | ||
permit_params :title, :difficulty, :views_count, :topic_id, :owner_id, :owner_type, | ||
:created_at, :updated_at | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ActiveAdmin.register TrackProgression do | ||
|
||
menu parent: "Subject", priority:5 | ||
permit_params :level, :student_id, :topic_id, :created_at, :updated_at | ||
end |
Oops, something went wrong.