Skip to content
Snippets Groups Projects
Commit 69a83250 authored by Mateus Rambo Strey's avatar Mateus Rambo Strey
Browse files

visual fixes

parent 600a3b9c
No related branches found
No related tags found
No related merge requests found
......@@ -78,6 +78,8 @@ $(document).on 'submit', '#collections-modal-form', (evt, params) ->
# if $('.collection-show-page').val() != undefined
# array with selected objects ids
selected_objects = []
$ ->
selected_objects = []
# valid types of operations in collections
permitted_types = ['add', 'download', 'copy', 'move', 'remove']
......
$(document).ready(function() {
$(".learning-object-columns").each(function() {
var html = '',
i = 1;
$(document).trigger('create-learning-object-columns');
});
$("> div", this).each(function () {
if (i == 2) {
html = '<div class="col-md-6"><div class="row"><div class="col-md-3">&nbsp;</div><div class="col-md-6">';
// TODO: find a way to not remove wrapper div
html += $(this).clone().wrap('<div>').parent().html();
html += '</div><div class="col-md-3">&nbsp;</div></div></div>';
$(this).replaceWith(html);
$(document).on('create-learning-object-columns', function() {
$parents = $(".learning-object-columns");
i = 0;
}
else {
$(this).wrap('<div class="col-md-3"></div>');
// small screen = 2 columns
if ($(window).width() < 1000) {
$parents.each(function() {
var html = '',
i = 1,
even = false;
i += 1;
}
$("> div", this).each(function () {
append = (even) ? ' style="text-align: -webkit-right; text-align: -moz-right;"' : '';
even = !(even);
$(this).wrap('<div class="col-sm-6"' + append +'></div>');
});
});
});
}
// bigger screen = 3 columns hack
else {
$parents.each(function() {
var html = '',
i = 1;
$("> div", this).each(function () {
if (i == 2) {
html = '<div class="col-md-6"><div class="row"><div class="col-md-3">&nbsp;</div><div class="col-md-6">';
// TODO: find a way to not remove wrapper div
html += $(this).clone().wrap('<div>').parent().html();
html += '</div><div class="col-md-3">&nbsp;</div></div></div>';
$(this).replaceWith(html);
i = 0;
}
else {
$(this).wrap('<div class="col-md-3"></div>');
i += 1;
}
});
});
}
});
......@@ -58,11 +58,11 @@
</div>
</nav>
<div class="row learning-object-columns">
<br/>
<% @collection.learning_objects.each do |learning_object| %>
<div class= "row">
<div class="learning-object-columns">
<br/>
<% @collection.learning_objects.each do |learning_object| %>
<%= render learning_object, orientation: 'vertical' %>
<% end %>
<% end %>
</div>
</div>
......@@ -35,7 +35,7 @@
<div class="rating-panel">
<% if user_signed_in? %>
<div class="actions">
<div class="col-md-3 action">
<div class="col-sm-3 action">
<%= link_to like_learning_object_path(id: @learning_object.id), class: 'vote',method: :post, remote: true do %>
<% if @liked %>
<%= image_tag "icons/Curtir_02.png", alt: "Descurtir" %>
......@@ -45,19 +45,19 @@
<h6>curtir objeto</h6>
<% end %>
</div>
<div class="col-md-3 action">
<div class="col-sm-3 action">
<a href="<%= @learning_object.get_retrievelink %>">
<%= image_tag "icons/download.png", alt: "Download do objeto" %>
<h6>salvar no computador</h6>
</a>
</div>
<div class="col-md-3 action">
<div class="col-sm-3 action">
<a tabindex="0" class="add_to_collection" role="button" data-toggle="popover" data-placement="left" title="Adicionar as coleções" data-loid="<%= @learning_object.id %>" data-poload="/learning_objects/<%= ERB::Util.url_encode(@learning_object.id) %>/collections.json">
<%= image_tag "icons/collection-add.png", alt: "Adicionar à coleção" %>
<h6>adicionar à coleção</h6>
</a>
</div>
<div class="col-md-3 action">
<div class="col-sm-3 action">
<%= render 'complaints/complaints_button' %>
</div>
</div>
......
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