From 39fbc77540137b2574de41f8badb170e83257fcc Mon Sep 17 00:00:00 2001 From: Marcela Ribeiro de Oliveira <mro15@inf.ufpr.br> Date: Thu, 17 Mar 2016 11:32:24 -0300 Subject: [PATCH] Bookmark action button, fix align footer --- app/assets/stylesheets/application.scss | 6 ++++++ .../stylesheets/application/learning_objects.scss | 10 ++++++++++ app/controllers/institutions_controller.rb | 6 +++--- app/controllers/learning_objects_controller.rb | 2 +- app/views/learning_objects/show.html.erb | 5 +++++ app/views/management/carousels/_form.html.erb | 2 +- app/views/management/complaint_reasons/_form.html.erb | 2 +- app/views/management/mime_types/_form.html.erb | 2 +- app/views/management/object_types/_form.html.erb | 4 ++-- app/views/shared/application/_footer.html.erb | 2 ++ app/views/shared/application/_footer_home.html.erb | 2 ++ 11 files changed, 34 insertions(+), 9 deletions(-) diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index f95f3f9c..ef076c00 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -504,6 +504,12 @@ header { padding-top: 50px; } } + .center-footer{ + margin-left: auto; + margin-right: auto; + background: green; + width: 980px; + } .logo-footer{ width: 18%; diff --git a/app/assets/stylesheets/application/learning_objects.scss b/app/assets/stylesheets/application/learning_objects.scss index 17cdf3e2..f2077fd6 100644 --- a/app/assets/stylesheets/application/learning_objects.scss +++ b/app/assets/stylesheets/application/learning_objects.scss @@ -230,6 +230,16 @@ $checked_icon: 'icons/checked.png'; margin-top: 5px; } } + .bookmark{ + i{ + padding-top: 3px; + color: #818080; + width: 20px; + height: 20px; + margin-bottom: 5px; + margin-top: 5px; + } + } .download{ line-height: 35px; diff --git a/app/controllers/institutions_controller.rb b/app/controllers/institutions_controller.rb index 0496cd65..0f89f86b 100644 --- a/app/controllers/institutions_controller.rb +++ b/app/controllers/institutions_controller.rb @@ -31,7 +31,7 @@ class InstitutionsController < ApplicationController respond_to do |format| if Institution.save @institution - format.html { redirect_to @institution, notice: 'Institution was successfully created.' } + format.html { redirect_to @institution, notice: t('activerecord.attributes.institution.create.notice.successfully_created') } else format.html { render :new } end @@ -43,7 +43,7 @@ class InstitutionsController < ApplicationController def update respond_to do |format| if Institution.update(institution_params) - format.html { redirect_to @learning_object, notice: 'Institution was successfully updated.' } + format.html { redirect_to @learning_object, notice: t('activerecord.attributes.institution.update.notice.successfully_updated') } else format.html { render :edit } end @@ -56,7 +56,7 @@ class InstitutionsController < ApplicationController Institution.destroy @institution respond_to do |format| - format.html { redirect_to institutions_url, notice: 'Learning object was successfully destroyed.' } + format.html { redirect_to institutions_url, notice: t('activerecord.attributes.institution.destroy.notice.successfully_destroy') } end end diff --git a/app/controllers/learning_objects_controller.rb b/app/controllers/learning_objects_controller.rb index 3995ddfb..2a492b4e 100644 --- a/app/controllers/learning_objects_controller.rb +++ b/app/controllers/learning_objects_controller.rb @@ -64,7 +64,7 @@ class LearningObjectsController < ApplicationController LearningObject.destroy @learning_object respond_to do |format| - format.html { redirect_to learning_objects_url, notice: 'Learning object was successfully destroyed.' } + format.html { redirect_to learning_objects_url, notice: 'Objeto educacional excluÃdo com sucesso.' } end end diff --git a/app/views/learning_objects/show.html.erb b/app/views/learning_objects/show.html.erb index 8cafb1f1..609690c4 100644 --- a/app/views/learning_objects/show.html.erb +++ b/app/views/learning_objects/show.html.erb @@ -79,6 +79,11 @@ <%= image_tag "icons/btn_add.png", alt: "Adicionar à coleção" %> </a> </div> + <div class="action"> + <%= link_to bookmark_add_path(id: @learning_object.id, type: @learning_object.class.to_s), class:"btn btn-primary bookmark", title: "Adicionar aos favoritos", method: :post, remote: true do %> + <i class="fa fa-bookmark"></i> + <%end%> + </div> <div class="action"> <%= render 'complaints/complaints_button' %> </div> diff --git a/app/views/management/carousels/_form.html.erb b/app/views/management/carousels/_form.html.erb index 9c4fa033..c763b8bc 100644 --- a/app/views/management/carousels/_form.html.erb +++ b/app/views/management/carousels/_form.html.erb @@ -2,7 +2,7 @@ <% if @carousel.errors.any? %> <div class="ls-alert-danger"> - <h2><%= pluralize(@carousel.errors.count, "erro") %> <%= "happened".pluralize(@carousel.errors.count) %>:</h2> + <h2><%= pluralize(@carousel.errors.count, "erro") %> <%= "ocorreu".pluralize(@carousel.errors.count) %>:</h2> <ul> <% @carousel.errors.full_messages.each do |message| %> <li><%= message %></li> diff --git a/app/views/management/complaint_reasons/_form.html.erb b/app/views/management/complaint_reasons/_form.html.erb index 07a08e4e..9e65eb93 100644 --- a/app/views/management/complaint_reasons/_form.html.erb +++ b/app/views/management/complaint_reasons/_form.html.erb @@ -2,7 +2,7 @@ <% if @complaint_reason.errors.any? %> <div class="ls-alert-danger"> - <h2><%= pluralize(@complaint_reason.errors.count, "erro") %> <%= "happened".pluralize(@complaint_reason.errors.count) %>:</h2> + <h2><%= pluralize(@complaint_reason.errors.count, "erro") %> <%= "ocorreu".pluralize(@complaint_reason.errors.count) %>:</h2> <ul> <% @complaint_reason.errors.full_messages.each do |message| %> <li><%= message %></li> diff --git a/app/views/management/mime_types/_form.html.erb b/app/views/management/mime_types/_form.html.erb index 8419a7d4..5b165af2 100644 --- a/app/views/management/mime_types/_form.html.erb +++ b/app/views/management/mime_types/_form.html.erb @@ -1,7 +1,7 @@ <%= form_for([:management, @mime_type]) do |f| %> <% if @mime_type.errors.any? %> <div id="error_explanation"> - <h2><%= pluralize(@mime_type.errors.count, "error") %> prohibited this management_mime_type from being saved:</h2> + <h2><%= pluralize(@mime_type.errors.count, "erro") %> impedem este mime_type de ser salvo:</h2> <ul> <% @mime_type.errors.full_messages.each do |message| %> diff --git a/app/views/management/object_types/_form.html.erb b/app/views/management/object_types/_form.html.erb index 7cb97dfb..77b367b3 100644 --- a/app/views/management/object_types/_form.html.erb +++ b/app/views/management/object_types/_form.html.erb @@ -1,7 +1,7 @@ <%= form_for([:management ,@object_type]) do |f| %> <% if @object_type.errors.any? %> <div id="error_explanation"> - <h2><%= pluralize(@object_type.errors.count, "error") %> prohibited this management_object_type from being saved:</h2> + <h2><%= pluralize(@object_type.errors.count, "error") %> impedem este tipo de objeto de ser salvo:</h2> <ul> <% @object_type.errors.full_messages.each do |message| %> @@ -47,4 +47,4 @@ placeholder: "MimeTypes", width: '100%' }); -</script> \ No newline at end of file +</script> diff --git a/app/views/shared/application/_footer.html.erb b/app/views/shared/application/_footer.html.erb index d6c62da8..1f2bb8e5 100644 --- a/app/views/shared/application/_footer.html.erb +++ b/app/views/shared/application/_footer.html.erb @@ -15,6 +15,7 @@ <div class="main"> <div class="container container-height"> <div class="row top-padding"> + <div class="center-footer"> <div class="logo-footer col-md-2"> <%= link_to 'http://www.brasil.gov.br/' do %> <%= image_tag 'logo_brasil.png',class:'logos-footer' %> @@ -40,6 +41,7 @@ <%= image_tag 'logo_c3.png', class:'logos-footer c3sl-size'%> <% end %> </div> + </div> </div> </div> diff --git a/app/views/shared/application/_footer_home.html.erb b/app/views/shared/application/_footer_home.html.erb index adc9be49..6ecfb250 100644 --- a/app/views/shared/application/_footer_home.html.erb +++ b/app/views/shared/application/_footer_home.html.erb @@ -28,6 +28,7 @@ <div class="main"> <div class="container container-height"> <div class="row top-padding"> + <div class="center-footer"> <div class="logo-footer col-md-2"> <%= link_to 'http://www.brasil.gov.br/' do %> <%= image_tag 'logo_brasil.png',class:'logos-footer' %> @@ -53,6 +54,7 @@ <%= image_tag 'logo_c3.png', class:'logos-footer c3sl-size'%> <% end %> </div> + </div> </div> </div> -- GitLab