diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 608172a8ce87f463e76c3ad98f01d9fb013897e7..61019549c1b48e0a360ce2358c670e461c41f568 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -12,8 +12,8 @@ // //= require jquery //= require jquery_ujs -//= require turbolinks -//= require jquery.turbolinks //= require bootstrap-sprockets //= require select2 -//= require_tree ./application \ No newline at end of file +//= require jquery.turbolinks +//= require turbolinks +//= require_tree ./application diff --git a/app/assets/stylesheets/application/welcome.scss b/app/assets/stylesheets/application/welcome.scss index 48d235608ad21a57cd9a89ad24eca108987c98c9..cd013dfe6f8619442a4f543676f1b38d30ba9330 100644 --- a/app/assets/stylesheets/application/welcome.scss +++ b/app/assets/stylesheets/application/welcome.scss @@ -6,18 +6,34 @@ background-color: #2178F5; color: white; } -.mainpage-subject { + +.mainpage-subjects, .mainpage-highlights { + margin-top: 30px; + + h2 { + margin-bottom: 15px; + } +} + +.mainpage-subject-element { width: 250px; - + h4 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } + .more { + text-align: right; + margin-top: -30px; + margin-bottom: 30px; + } } + .divider{ height: 5px; } + .general-highlights { padding-left: 0px; padding-right: 0px; diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index de80bcb1437b314e942ef3ed91978a885de071d1..bc02e96038e0189350f2a81f702119a8c34c8b10 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -1,21 +1,19 @@ class WelcomeController < ApplicationController def index - @Carousel = Array.new - @General = Array.new + @carousel = [] + @general = [] mainPage = main_page_repository.all.first - @Carousel = carousel_repository.all + @carousel = carousel_repository.all - @General = mainPage["highlights"].collect do |id| + @general = mainPage["highlights"].take(3).collect do |id| learning_object_repository.find(id) end - @General = @General.take(3) - - @Subjects = subject_repository.all - @Subjects.delete_if{|s| not s.highlights.present?} - @Subjects = @Subjects.take(8) + @subjects = subject_repository.all_from_offset_to_limit 0, 10 + @subjects.reject{|s| not s.highlights.present?} + @subjects = @subjects.take(6) end def faq diff --git a/app/views/shared/application/_header.html.erb b/app/views/shared/application/_header.html.erb index 0936cdd336eb45b8b6955f85b302eb5ca5798356..16e5c4d411d334dbfa9a61e36acb8d8e1c391c96 100644 --- a/app/views/shared/application/_header.html.erb +++ b/app/views/shared/application/_header.html.erb @@ -18,7 +18,7 @@ <div class="container"> <div class="row"> <div class="col-md-3 logo-container"> - <div class="logo"> + <div class="logo" data-no-turbolink> <%= link_to root_path do %> <%= image_tag image_path("logo.png"), class: "logo-image" %><br/> diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index 166d3cc3e6160d88a8548687cc442f2ae0592db0..69d4d07acbf46ed76d26b4bd81115f13135ff81e 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -1,13 +1,13 @@ <div class="row"> <div class="col-md-7"> <div class="row"> - <% if @Carousel.present? %> + <% if @carousel.present? %> <div id="myCarousel" class="carousel slide" data-ride="carousel"> <!-- Indicators --> <ol class="carousel-indicators"> <% i = 0 %> - <% @Carousel.each do |highlight| %> - <% if highlight == @Carousel.first %> + <% @carousel.each do |highlight| %> + <% if highlight == @carousel.first %> <li data-target="#myCarousel" data-slide-to="<%= i %>" class="active"></li> <% else %> <li data-target="#myCarousel" data-slide-to="<%= i %>"></li> @@ -16,8 +16,8 @@ <% end %> </ol> <div class="carousel-inner" role="listbox"> - <% @Carousel.each do |highlight|%> - <% if highlight == @Carousel.first %> + <% @carousel.each do |highlight|%> + <% if highlight == @carousel.first %> <% highlight_class="item active" %> <% else %> <% highlight_class="item" %> @@ -36,11 +36,11 @@ </div> <% end %> </div> - <div class="row"> - <% if @General.present? %> + <div class="row mainpage-highlights"> + <% if @general.present? %> <ul class="list-unstyled"> <h2>Destaques</h2> - <%= render @General, orientation: 'horizontal' %> + <%= render @general, orientation: 'horizontal' %> <% end %> </ul> </div> @@ -50,10 +50,9 @@ <div style="padding: 30px; min-height: 400px"> <h2>Cadastre-se!</h2><br> <h2>Vantagens de cadastrar:</h2><br> - <h2>Tem Muitas!</h2><br> - <h2>Tem Muitas!</h2><br> - <h2>Tem Muitas!</h2><br> - <h2>Tem Muitas!</h2><br> + <h2>Faça suas coleções.</h2><br> + <h2>Curta objetos.</h2><br> + <h2>Tenha seus objetos favoritos.</h2><br> </div> <div style="width: 100%; padding: 30px;"> <%= form_tag(new_user_registration_path, method: 'get') do %> @@ -65,16 +64,16 @@ </div> </div> -<div class="row"> +<div class="row mainpage-subjects"> <div class="col-md-12"> - <% unless @Subjects.nil? || @Subjects.empty?%> + <% unless @subjects.nil? || @subjects.empty?%> <div class="row learning-object-columns"> - <h2>Em Destaque</h2> - <% @Subjects.each do |subject|%> - <div class="row mainpage-subject"> + <h2>Destaque por assunto</h2> + <% @subjects.each do |subject|%> + <div class="row mainpage-subject-element"> <h4><b><%= subject.name %></b></h4> <%= render subject.highlights.first, orientation: 'vertical'%> - <p> + <p class="more"> <a href="#">Ver Mais</a> </p> </div>