gnowledge/gstudio — pull request #948 by AvadootNachankar (2014-12-21 12:05:05+00:00)
Title: Bug fixes and Other Improvements (Group url redirection to group's dashboard url)

**Functionalities Implemented:**
1) FC-enrollment-fix: Creating only one StudentCourseEnrollment node for Foundation Course type Courses
2) Group url redirection to new group's dashboard url
3) Bug fixes and Other Improvements

**Run following commands:**
1) ```python manage.py filldb```
2) ```python manage.py mis_college_group -g```
3) ```python manage.py sync_existing_documents```
4) ```bower install```

**FC-enrollment-fix: Creating only one StudentCourseEnrollment node for Foundation Course type Courses**
1. templates/ndf/student_enroll.html
- UI updated
- No selection provided for AnnouncedCourse
- For Foundation Course, populating all announced-course(s)
- For Courses other than Foundation Course, populating only given announced-course for which enrollment is happening
- Announced-courses listed as unorderd list items (previously listed in drop-down)
- Selection of enrolled or non-enrolled checkbox commented
- Registration-year date-widget removed (taken care in respective ajax call)
- Ajax call on click of ```Find``` button modified

2. templates/ndf/group_dashboard.html
- Updating Student-Course Enrollment Approval task's status
- Via ```task_status``` received from ajax call on click of Approval button

3. views/course.py
- ```course_create_edit()``` modified:
- For courses of type Foundation Course, creating only one StudentCourseEnrollment node
- On the other hand, for courses of type Domain Part-I & Domain Part-II, creating StudentCourseEnrollment node for each of them

4. views/person.py
- ```person_enroll()``` modified:
- Based on Course Type, enrollment happens and it's corresponding Approval task is created

5. views/userDashboard.py
- ```group_dashboard()``` modified:
- Based on Course Type, course ObjectIds are passed and corresponding Tasks are shown
- In case of Foundation course type, all of them are passed
- Otherwise, the given announced course's ObjectId is passed for which approval is going on

6. views/ajax_views.py
- ```get_anncourses_allstudents()``` modified:
- Sending count of enrolled and non-enrolled students
- ```groupid``` context varaible added
- ```get_students_for_approval()```
- Based on Course Type, course ObjectIds are processed for approving enrollment of students into them
- approve_students() modified:
- Approval task's status update modified: Keeping track of On going and closed task

**Group url redirection to new group's dashboard url**

1. templates/ndf/group.html
- In group's list-view, on click of card redirects to group's dashboard.

2. templates/ndf/base.html
- On click of selected element from drop-down list of groups, redirects to group's dashboard.

**Bug fixes and Other Improvements**

1. management/commands/mis_college_group.py
- Task, Batch & Event added to default GApps list used for setting GApps for colllege group(s).

2. management/commands/sync_existing_documents.py
- Code added to replace "for_acourse" RelationType's object_cardinality field's value from 1 to 100.
- Bug fix - Missing declaration of variable added.

3. templatetags/ndf_tags.py
- Print statement removed.

4. views/ajax_views.py
- Import updated: Missing ```create_gattribute``` added
- ```get_college_wise_students_data()``` updated: Two new college entries added in a list.

5. views/course.py
- Saving part modified of announced-course edit (updation of due time of enrollment)
- Saving of due time of enrollment updated
- Fetching values from attribute_set modified
- Instead of fetching values via specifying index explicitly, now fetching by properly iterating the list

6. templates/ndf/student_enroll.html
- Alert message put on click of Complete button

7. bower.json
- **jQuery BlockUI plugin added**
- lets you simulate synchronous behavior when using AJAX, without locking the browser.
- When activated, it will prevent user activity with the page (or part of the page) until it is deactivated.
- It adds elements to the DOM to give it both the appearance and behavior of blocking user interaction.

8. templates/ndf/base.html
- Ajax loader image replaced with BlockUI plugin's message; which now blocks selected elements on the page
- Prevents unecessary clicks by the user at time of processing the ajax query

9. BlockUI plugin's message added to prevent unecessary clicks by the user at time of processing POST request
- templates/ndf/announced_course_create_edit.html
- templates/ndf/Nussd_event_Schedule.html
- templates/ndf/event_create_edit.html