Pulling most recent update
Pulling most recent update

Merge branch 'rails4' of https://github.com/kschneider3/expertiza into rails4

Conflicts:
	app/controllers/submitted_content_controller.rb
	config/database.yml.example.BAK
Patched bug #392:

Users could see a "Delete Hyperlink" button when reviewing other people's submissions.
In order to check assignment owner against current reviewer, the assignment_participant
needed to be pulled out and passed individually. From there, the hyperlink form partial
checks the current logged in user against the assignment owner.
Tested for teamed assignments.

After patching the code to prevent the "Delete Selected Hyperlinks" button from
showing up when not the submisstion owner, the button no longer shows. However,
teamed assignments still displays the other team members submissions when listing
submissions to review. This is because the app/views/submitted_content/_main form partial
does not check if the @current_user is in the same team.

Modified _main.html.erb to pass only what is needed to the _hyperlink.html.erb form partial
(specifically, the assignment_participant). The passed in participant into _main.html.erb
was not consistently the same object.

In the _hyperlink form partial, the @current_user.name is checked against the
assignment_participant.handle. If they are the same, then the button shows up, otherwise it
is not rendered. Here, the assignment_participant is whoever submitted the content that
will be displayed by the current _hyperlink form partial rendering. This check allows
the _hyperlink form partial to still be used when looking at the current user's work
to delete submitted content.
Pushing the fix for 392.

_main.html.erb extracts the AssignmentParticipant that is passed in
from participant. This may be an array (when reviewing other people's work),
it may not be (when looking at your own work), but usually it is an array.
From there, the assignment_participant (value extracted from the
passed in participant) is passed to _hyperlinks.html.erb to be checked.
In _hyperlinks, if the @current_user is the owner of the submission,
then the button renders.
Merge branch 'rails4' of https://github.com/kschneider3/expertiza into rails4