Skip to content

Commit

Permalink
Issue #526 fixing conflicts with master
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad Mamdouh authored and Muhammad Mamdouh committed May 17, 2014
2 parents b18eb8d + ab01061 commit e6595a6
Show file tree
Hide file tree
Showing 80 changed files with 3,591 additions and 326 deletions.
2 changes: 2 additions & 0 deletions tutor/.rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--color
--format documentation
2 changes: 1 addition & 1 deletion tutor/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GIT
remote: git://github.com/gregbell/active_admin.git
revision: 109ab88cb7c0777d3460cbfac3cc217068ecfabf
revision: 213984f19d7869429fbfb3c4dffe6e78d98e88b5
specs:
activeadmin (1.0.0.pre)
arbre (~> 1.0)
Expand Down
65 changes: 41 additions & 24 deletions tutor/app/admin/admin_user.rb
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
6 changes: 6 additions & 0 deletions tutor/app/admin/assignment.rb
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
6 changes: 6 additions & 0 deletions tutor/app/admin/assignment_problem.rb
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
6 changes: 6 additions & 0 deletions tutor/app/admin/attempt.rb
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
6 changes: 6 additions & 0 deletions tutor/app/admin/contest.rb
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
5 changes: 5 additions & 0 deletions tutor/app/admin/contest_progress.rb
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
6 changes: 6 additions & 0 deletions tutor/app/admin/course.rb
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
5 changes: 5 additions & 0 deletions tutor/app/admin/course_student.rb
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
5 changes: 5 additions & 0 deletions tutor/app/admin/cproblem.rb
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
82 changes: 51 additions & 31 deletions tutor/app/admin/dashboard.rb
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
5 changes: 5 additions & 0 deletions tutor/app/admin/discussion_board.rb
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
5 changes: 5 additions & 0 deletions tutor/app/admin/grade.rb
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
6 changes: 6 additions & 0 deletions tutor/app/admin/hint.rb
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
25 changes: 25 additions & 0 deletions tutor/app/admin/lecturer.rb
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
5 changes: 5 additions & 0 deletions tutor/app/admin/model_answer.rb
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
6 changes: 6 additions & 0 deletions tutor/app/admin/post.rb
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
6 changes: 6 additions & 0 deletions tutor/app/admin/problem.rb
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
18 changes: 18 additions & 0 deletions tutor/app/admin/recommendation.rb
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
5 changes: 5 additions & 0 deletions tutor/app/admin/reply.rb
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
26 changes: 26 additions & 0 deletions tutor/app/admin/student.rb
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
27 changes: 27 additions & 0 deletions tutor/app/admin/teaching_assistant.rb
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
6 changes: 6 additions & 0 deletions tutor/app/admin/test_case.rb
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
6 changes: 6 additions & 0 deletions tutor/app/admin/topic.rb
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
6 changes: 6 additions & 0 deletions tutor/app/admin/track.rb
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
5 changes: 5 additions & 0 deletions tutor/app/admin/track_progression.rb
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
Loading

0 comments on commit e6595a6

Please sign in to comment.