Skip to content
Snippets Groups Projects
Commit 1e1ffb82 authored by Mauricio Giacomini Girardello's avatar Mauricio Giacomini Girardello
Browse files

adding collections files

parent 509cb909
No related branches found
No related tags found
No related merge requests found
......@@ -127,6 +127,7 @@ GEM
equalizer (~> 0.0.9)
connection_pool (2.2.0)
curb (0.8.8)
dalli (2.7.4)
debug_inspector (0.0.2)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
......@@ -378,6 +379,7 @@ DEPENDENCIES
chart-js-rails
coffee-rails (~> 4.1.0)
curb (~> 0.8.8)
dalli
devise
devise_token_auth
dspace_rest_client (~> 1.1.0)
......@@ -416,3 +418,6 @@ DEPENDENCIES
uglifier (>= 1.3.0)
web-console (~> 2.0)
whenever
BUNDLED WITH
1.10.6
......@@ -5,9 +5,14 @@ class ApplicationController < ActionController::Base
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :null_session
before_action :configure_permitted_parameters, if: :devise_controller?
before_action :set_current_user_collections, if: :user_signed_in?
protected
def set_current_user_collections
@user_collections = collection_repository.all current_user
end
def configure_permitted_parameters
registration_params = [:name, :email, :avatar, :password, :password_confirmation]
......
......@@ -16,10 +16,10 @@ class LearningObjectsController < ApplicationController
def show
@complaint = Complaint.new
@messages = [
Complaint.copyrights,
Complaint.ofensive_content,
Complaint.ofensive_user,
Complaint.fake_user
Complaint.copyrights,
Complaint.ofensive_content,
Complaint.ofensive_user,
Complaint.fake_user
]
end
......@@ -81,10 +81,14 @@ class LearningObjectsController < ApplicationController
end
end
def report_object
learning_object_repository.report current_user, @learning_object, message, description
end
def bookmark
end
private
# Use callbacks to share common setup or constraints between actions.
......@@ -103,5 +107,4 @@ class LearningObjectsController < ApplicationController
end
end
end
......@@ -17,6 +17,17 @@ module OrientDb
end
end
def create(object)
super(object)
# the collection belongs to user
create_edge "BelongsTo", object.id, object.owner.rid
end
def all(user)
[]
end
private
def odb_class
......
<button data-placement="<%= placement %>" id="create_collection_popover" type="button" class="btn btn-primary">Criar coleção</button>
<div id="create_collection_popover_content" style="display: none">
<%= render 'collections/form', collection: collection %>
</div>
<div id="create_collection_popover_title" style="display: none">
......
......@@ -3,8 +3,5 @@
<%= f.label :name %>
<%= f.text_field :name, required: true, style: 'width: 250px;' %>
<%= f.label :description %>
<%= f.text_area :description, required: true, style: 'width: 250px;' %>
<%= f.submit %>
<% end %>
......@@ -11,6 +11,10 @@
<body>
<%= render 'shared/application/header' %>
<% if user_signed_in? %>
<%= render 'learning_objects/add_to_collection_popover', collections: @user_collections %>
<% end %>
<div class="container">
<% if notice %>
<div class="alert alert-info" role="alert">
......
<div id="collections_list_popover" style="display: none; z-index: 999;">
<a href="#">Segundo ano - B</a>
<a href="#">Terceiro ano - A</a>
</div>
\ No newline at end of file
<ul>
<% collections.each do |collection| %>
<li><%= collection.name %></li>
<% end %>
</ul>
</div>
<button type="button" class="btn btn-default btn-xs add_to_collection" data-toggle="button" aria-pressed="false" autocomplete="off" title="Adicionar as coleções">
<span class="glyphicon glyphicon-list" aria-hidden="true"></span>
</button>
<div id="collections_list_popover" style="display: none; z-index: 999;">
<a href="#">Segundo ano - B</a>
<a href="#">Terceiro ano - A</a>
</div>
</button>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment