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

adding collections views

parent d3a1cb25
No related branches found
No related tags found
No related merge requests found
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
$ ->
$('.add_to_collection').popover
html: true
content: ->
$('#collections_list_popover').html()
title: ->
$('#collections_list_popover_title').html()
return
\ No newline at end of file
......@@ -15,4 +15,8 @@ module LearningObjectsHelper
end
end
def collections_list(learning_object)
collections = @collections.diff(learning_object_collections(learning_object))
end
end
......@@ -15,6 +15,16 @@ module OrientDb
create_edge "Likes", user.rid, learning_object.id
end
# Example:
# list = repository.for(:learning_objects).all
# list.each do |learning_object|
# learning_object.inspect <LearningObject model>
# end
def all
learning_objects_hash = connection.query "SELECT FROM LearningObject"
build_objects(learning_objects_hash) || []
end
# Usage:
# learning_object = repository.for(:learning_objects).get_by_dspace_id 123
#
......
<div class="row collections">
<h2><%= title %></h2>
<% learning_objects.each do |learning_object| %>
<!-- item -->
<div class="col-sm-4">
<div class="row">
<h4><b><%= learning_object.categories %></b></h4>
<div class="object-vertical">
<div class="panel">
<div>
<img src="http://dummyimage.com/250x150/363336/fff" alt="dummy image" class="img-responsive">
</div>
<div class="panel-body">
<h4 class="media-heading"><%= learning_object.name %></h4>
<span class="glyphicon glyphicon-eye-open"> <%= learning_object.views %> </span>
<span class="glyphicon glyphicon-star">4,5&nbsp;</span>
<span>Por <a>Usuário&nbsp;</a></span>
</div>
</div>
</div>
<p>
<a href="#">Ver Mais</a>
</p>
</div>
</div>
<!-- /item -->
<% end %>
<h2><%= collection.title %></h2>
<p><%= collection_length collection %></p>
</div>
\ No newline at end of file
<a href="#" id="create_collection_popover">Criar coleção</a>
<div id="create_collection_popover_content" style="display: none">
<%= render 'form' %>
<%= render 'collections/form' %>
</div>
<div id="create_collection_popover_title" style="display: none">
......
<form>
<label>Nome da coleção</label>
<input type='text' style="width:250px"/>
<%= form_for @collection do |f| %>
<label>Privacidade</label>
<select>
<option>Público</option>
<option>Somente seguidores</option>
</select>
<%= f.label :title %>
<%= f.text_field :title, required: true, style: 'width: 250px;' %>
<input type="submit"/>
</form>
\ No newline at end of file
<%= f.label :privacy %>
<select name="collection[privacy]">
<option value="public">Público</option>
<option value="followers">Meus seguidores</option>
<option value="only_me">Somente eu</option>
</select>
<%= f.submit %>
<% end %>
\ No newline at end of file
......@@ -13,6 +13,9 @@
<h4 class="media-heading"><%= learning_object.name %></h4>
<% end %>
</a>
<%= render 'learning_objects/add_to_collection_btn', collections_list(learning_object) %>
<span>Por <a>Usuário&nbsp;</a></span><br/>
<span class="glyphicon glyphicon-eye-open"><%= learning_object.views %>&nbsp;</span>
<span class="glyphicon glyphicon-star"><%= learning_object.likes %>&nbsp;</span><br>
......
<!--<%=debug obj%>-->
<div class="row">
<div class="col-sm-3">
<a href="app/assets/images/logo.png" class="thumbnail">
<p><%= obj.name %></p>
<!-- <%= link_to image_tag("logo.png", :class => "img-responsive"), :class => "thumbnail" %><img src="app/assets/images/logo.png" alt="" width="284" height="213">-->
<%= image_tag("logo.png") %>
</a>
</div>
<div class="col-sm-9">
<div class="col-sm-12">
<%= obj.description %>
</div>
<div class="col-sm-12">
<div align="right"><%= link_to "Ver mais...", learning_object_path(obj.id_dspace), :class => "btn btn-primary" %></div>
<br/>
<table class="table ">
<tr>
<td class="stars">Avaliações:</td><td>Postado por:</td><td class="visualis">Visualizações:</td>
</tr>
<tr>
<td>
<span class="starRating">
<input id="rating5" type="radio" name="rating" value="5" disabled>
<label for="rating5">5</label>
<input id="rating4" type="radio" name="rating" value="4" checked disabled>
<label for="rating4">4</label>
<input id="rating3" type="radio" name="rating" value="3" disabled>
<label for="rating3">3</label>
<input id="rating2" type="radio" name="rating" value="2" disabled>
<label for="rating2">2</label>
<input id="rating1" type="radio" name="rating" value="1" disabled>
<label for="rating1">1</label>
</span>
()
</td>
<td><%= link_to "<<Autor>>" %> Há ... anos</td>
<td><%= obj.views %></td>
</tr>
</table>
</div>
</div>
</div>
......@@ -10,6 +10,7 @@
<div class="media-body">
<h4 class="media-heading">Usuário</h4>
<span>nome da instituição</span>
<p>
x items
</p>
......@@ -27,6 +28,46 @@
<div class="media">
<div class="media-body">
<h4 class="media-heading">Arquivos do usuário</h4>
<p>
x items
</p>
</div>
</div>
</div>
<div class="col-md-6 right-column">
</div>
</div>
<div class="row">
<div class="col-md-3">
<%= render @objects[0], orientation: "vertical" %>
</div>
<div class="col-md-6">
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-6">
<%= render @objects[1], orientation: "vertical" %>
</div>
<div class="col-md-3"></div>
</div>
</div>
<div class="col-md-3">
<%= render @objects[2], orientation: "vertical" %>
</div>
</div>
</div>
</div>
<div class="row">
<div class="user-files">
<div class="row">
<div class="col-md-6">
<div class="media">
<div class="media-body">
<h4 class="media-heading">Coleções</h4>
<p>
x items
</p>
......@@ -56,3 +97,7 @@
</div>
</div>
</div>
<div class="row">
<%= render 'collections/create' %>
</div>
\ 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