forked from saasbook/coursequestionbank
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
55 changed files
with
365 additions
and
76 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
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
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
2 changes: 1 addition & 1 deletion
2
app/controllers/instructor_controller.rb → app/controllers/instructors_controller.rb
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
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
class Ability | ||
include CanCan::Ability | ||
|
||
def initialize(user) | ||
# Define abilities for the passed in user here. For example: | ||
# | ||
# user ||= User.new # guest user (not logged in) | ||
# if user.admin? | ||
# can :manage, :all | ||
# else | ||
# can :read, :all | ||
# end | ||
# | ||
# The first argument to `can` is the action you are giving the user | ||
# permission to do. | ||
# If you pass :manage it will apply to every action. Other common actions | ||
# here are :read, :create, :update and :destroy. | ||
# | ||
# The second argument is the resource the user can perform the action on. | ||
# If you pass :all it will apply to every resource. Otherwise pass a Ruby | ||
# class of the resource. | ||
# | ||
# The third argument is an optional hash of conditions to further filter the | ||
# objects. | ||
# For example, here the user can only update published articles. | ||
# | ||
# can :update, Article, :published => true | ||
# | ||
# See the wiki for details: | ||
# https://github.com/ryanb/cancan/wiki/Defining-Abilities | ||
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 @@ | ||
class Admin < Instructor | ||
# attr_accessible :title, :body | ||
def is_admin? | ||
false | ||
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
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class NullCollection < Collection | ||
# attr_accessible :title, :body | ||
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
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,6 +1,8 @@ | ||
= form_for collection do |f| | ||
= form_for(collection, :remote => !!remote) do |f| #magical hacks to set remote to be true when called from finalize_upload | ||
= f.label :name | ||
= f.text_field :name | ||
= f.label :description | ||
= f.text_field :description | ||
= f.label 'Mark as public?' | ||
= f.check_box :is_public | ||
= f.submit |
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,8 +1,20 @@ | ||
<<<<<<< HEAD | ||
%h3= "Your collection: #{@collection.name}" | ||
=render :partial=> 'form', locals: {collection: @collection} | ||
%p.collectioncontrols | ||
=link_to "Delete Collection", collection_path(@collection), :class => 'btn btn-danger', method: :delete, :confirm => 'Delete this collection?' | ||
%p.collectioncontrols | ||
=link_to "Export Collection", export_path(:id => @collection), :class => 'btn btn-info' | ||
|
||
= render :partial => "shared/problems_table", locals: {problems_index: false, collection: @collection, problems: @collection.problems} | ||
= render :partial => "shared/problems_table", locals: {problems_index: false, collection: @collection, problems: @collection.problems} | ||
======= | ||
%h3= "Your collection #{@collection.name}" | ||
=render :partial=> 'form', locals: {collection: @collection, remote: false} | ||
%p | ||
Delete this collection? | ||
=link_to 'trash_can_icon', collection_path(@collection), method: :delete, :confirm => 'Delete this collection?' | ||
%p | ||
Export this collection: | ||
=link_to 'export button', export_path(:id => @collection) | ||
= render :partial => "shared/problems_table", locals: {problems_index: false, collection: @collection, problems: @collection.problems} | ||
>>>>>>> d0ea43498e3f0a2e8de3fcb02232d15b7b51459a |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
- if @collection.instructor == @current_user | ||
= link_to "Click here to edit this collection", edit_collection_path(id: @collection) | ||
= render :partial => "shared/problems_table", locals: {problems_index: false, collection: @collection, problems: @collection.problems} |
Oops, something went wrong.