diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index a78fdfa..5eab23a 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -12,7 +12,7 @@ // //= require jquery2 //= require jquery_ujs -//= require turbolinks +// require turbolinks //= require cocoon //= require main //= require_tree . diff --git a/app/controllers/admin/abouts_controller.rb b/app/controllers/admin/abouts_controller.rb index c63027d..d49be09 100644 --- a/app/controllers/admin/abouts_controller.rb +++ b/app/controllers/admin/abouts_controller.rb @@ -56,6 +56,6 @@ def set_admin_about # Only allow a trusted parameter "white list" through. def admin_about_params - params.require(:admin_about).permit(:slug, :description,:image) + params.require(:admin_about).permit(:slug, :description,:image, :base64_image) end end diff --git a/app/controllers/admin/admission_processes_controller.rb b/app/controllers/admin/admission_processes_controller.rb index e6c2fe5..f9d8112 100644 --- a/app/controllers/admin/admission_processes_controller.rb +++ b/app/controllers/admin/admission_processes_controller.rb @@ -56,6 +56,6 @@ def set_admin_admission_process # Only allow a trusted parameter "white list" through. def admin_admission_process_params - params.require(:admin_admission_process).permit(:step, :name, admin_admission_process_images_attributes:[:id,:image,:_destroy,admin_admission_process_image_details_attributes:[:id,:details,:_destroy]]) + params.require(:admin_admission_process).permit(:step, :name, admin_admission_process_images_attributes:[:id,:image,:base64_image,:_destroy,admin_admission_process_image_details_attributes:[:id,:details,:_destroy]]) end end diff --git a/app/controllers/admin/courses_controller.rb b/app/controllers/admin/courses_controller.rb index de2ac18..63d9fe2 100644 --- a/app/controllers/admin/courses_controller.rb +++ b/app/controllers/admin/courses_controller.rb @@ -56,6 +56,6 @@ def set_admin_course # Only allow a trusted parameter "white list" through. def admin_course_params - params.require(:admin_course).permit(:name, :description, :image) + params.require(:admin_course).permit(:name, :description, :image, :base64_image) end end diff --git a/app/controllers/admin/mini_sliders_controller.rb b/app/controllers/admin/mini_sliders_controller.rb index b1e672a..b416732 100644 --- a/app/controllers/admin/mini_sliders_controller.rb +++ b/app/controllers/admin/mini_sliders_controller.rb @@ -56,6 +56,6 @@ def set_admin_mini_slider # Only allow a trusted parameter "white list" through. def admin_mini_slider_params - params.require(:admin_mini_slider).permit(:name,:image) + params.require(:admin_mini_slider).permit(:name,:image,:base64_image) end end diff --git a/app/controllers/admin/news_controller.rb b/app/controllers/admin/news_controller.rb index 2cb77ed..f3713c8 100644 --- a/app/controllers/admin/news_controller.rb +++ b/app/controllers/admin/news_controller.rb @@ -56,6 +56,6 @@ def set_admin_news # Only allow a trusted parameter "white list" through. def admin_news_params - params.require(:admin_news).permit(:name, :description,:image) + params.require(:admin_news).permit(:name, :description,:image, :base64_large_image, :base64_thumb_image) end end diff --git a/app/controllers/admin/sliders_controller.rb b/app/controllers/admin/sliders_controller.rb index 3d63ab0..9e239c6 100644 --- a/app/controllers/admin/sliders_controller.rb +++ b/app/controllers/admin/sliders_controller.rb @@ -56,6 +56,6 @@ def set_admin_slider # Only allow a trusted parameter "white list" through. def admin_slider_params - params.require(:admin_slider).permit(:name, :caption_1, :caption_2, :image) + params.require(:admin_slider).permit(:name, :caption_1, :caption_2, :image, :base64_image) end end diff --git a/app/controllers/admin/testimonials_controller.rb b/app/controllers/admin/testimonials_controller.rb index 43b54f8..6715b1f 100644 --- a/app/controllers/admin/testimonials_controller.rb +++ b/app/controllers/admin/testimonials_controller.rb @@ -56,6 +56,6 @@ def set_admin_testimonial # Only allow a trusted parameter "white list" through. def admin_testimonial_params - params.require(:admin_testimonial).permit(:name, :description, :department_id, :semester_id,:image) + params.require(:admin_testimonial).permit(:name, :description, :department_id, :semester_id,:image, :base64_image) end end diff --git a/app/controllers/admin/websites_controller.rb b/app/controllers/admin/websites_controller.rb index 7428090..e8cce6a 100644 --- a/app/controllers/admin/websites_controller.rb +++ b/app/controllers/admin/websites_controller.rb @@ -56,6 +56,6 @@ def set_admin_website # Only allow a trusted parameter "white list" through. def admin_website_params - params.require(:admin_website).permit(:name, :logo, :favicon, :details) + params.require(:admin_website).permit(:name, :logo, :favicon, :details, :base64_logo, :base64_favicon) end end diff --git a/app/views/admin/abouts/_form.html.erb b/app/views/admin/abouts/_form.html.erb index 71fc503..dd3a6c0 100644 --- a/app/views/admin/abouts/_form.html.erb +++ b/app/views/admin/abouts/_form.html.erb @@ -1,33 +1,36 @@ <%= form_for(admin_about) do |f| %> - <% if admin_about.errors.any? %> -
-

<%= pluralize(admin_about.errors.count, "error") %> prohibited this admin_about from being saved:

+ <% if admin_about.errors.any? %> +
+

<%= pluralize(admin_about.errors.count, "error") %> prohibited this admin_about from being saved:

- -
- <% end %> - -
- <%= f.label :slug %> - <%= f.text_field :slug %> -
+ +
+ <% end %> -
- <%= f.label :description %> - <%= f.text_area :description %> -
-
- <%= f.label :image %> - <%= f.file_field :image %> +
+ <%= f.label :slug %> + <%= f.text_field :slug %> +
+
+ <%= f.label :description %> + <%= f.text_area :description %> +
+
+ <%= f.label :image %> + <% if Rails.env.development? %> + <%= f.file_field :image %> + <% else %> + <%= f.text_field :base64_image %> + <% end %> -
+
-
- <%= f.submit %> -
+
+ <%= f.submit %> +
<% end %> diff --git a/app/views/admin/abouts/index.html.erb b/app/views/admin/abouts/index.html.erb index cf96beb..51940e6 100644 --- a/app/views/admin/abouts/index.html.erb +++ b/app/views/admin/abouts/index.html.erb @@ -17,7 +17,9 @@ <%= admin_about.slug %> <%= admin_about.description %> + <% if Rails.env.development? %> <%= image_tag admin_about.image.url(:thumb) %> + <% end %> <%= link_to 'Show', admin_about %> <%= link_to 'Edit', edit_admin_about_path(admin_about) %> <%= link_to 'Destroy', admin_about, method: :delete, data: {confirm: 'Are you sure?'} %> diff --git a/app/views/admin/abouts/show.html.erb b/app/views/admin/abouts/show.html.erb index 3ee1c19..fce9560 100644 --- a/app/views/admin/abouts/show.html.erb +++ b/app/views/admin/abouts/show.html.erb @@ -9,11 +9,12 @@ Description: <%= @admin_about.description %>

+<% if Rails.env.development? %>

Image: <%= image_tag @admin_about.image.url(:thumb) %>

- +<% end %> <%= link_to 'Edit', edit_admin_about_path(@admin_about) %> | <%= link_to 'Back', admin_abouts_path %> <%= render 'shared/extends_admin_layout' %> diff --git a/app/views/admin/admission_processes/_admin_admission_process_image_fields.html.erb b/app/views/admin/admission_processes/_admin_admission_process_image_fields.html.erb index 6e07458..f7c0b6b 100644 --- a/app/views/admin/admission_processes/_admin_admission_process_image_fields.html.erb +++ b/app/views/admin/admission_processes/_admin_admission_process_image_fields.html.erb @@ -1,7 +1,11 @@
<%= f.label :image %> + <% if Rails.env.development? %> <%= f.file_field :image %> + <% else %> + <%= f.text_field :base64_image %> + <% end %>
<%= f.label :admission_process_image_details %> diff --git a/app/views/admin/admission_processes/show.html.erb b/app/views/admin/admission_processes/show.html.erb index cd93e3d..867c589 100644 --- a/app/views/admin/admission_processes/show.html.erb +++ b/app/views/admin/admission_processes/show.html.erb @@ -8,13 +8,16 @@

Name: <%= @admin_admission_process.name %> -<% @admin_admission_process.admin_admission_process_images.each do |i|%> -<%= image_tag i.image.url(:thumb) %> + <% if Rails.env.development? %> + <% @admin_admission_process.admin_admission_process_images.each do |i|%> + <%= image_tag i.image.url(:thumb) %> <%end%> +<% end %> + <% @admin_admission_process.admin_admission_process_images.each do|i|%> - <% i.admin_admission_process_image_details.each do |j| %> -<%= j.details %> -<%end%> + <% i.admin_admission_process_image_details.each do |j| %> + <%= j.details %> + <%end%> <%end%>

diff --git a/app/views/admin/courses/_form.html.erb b/app/views/admin/courses/_form.html.erb index 83a59f3..5279651 100644 --- a/app/views/admin/courses/_form.html.erb +++ b/app/views/admin/courses/_form.html.erb @@ -1,30 +1,34 @@ <%= form_for(admin_course) do |f| %> - <% if admin_course.errors.any? %> -
-

<%= pluralize(admin_course.errors.count, "error") %> prohibited this admin_course from being saved:

+ <% if admin_course.errors.any? %> +
+

<%= pluralize(admin_course.errors.count, "error") %> prohibited this admin_course from being saved:

-
    - <% admin_course.errors.full_messages.each do |message| %> -
  • <%= message %>
  • - <% end %> -
-
- <% end %> +
    + <% admin_course.errors.full_messages.each do |message| %> +
  • <%= message %>
  • + <% end %> +
+
+ <% end %> -
- <%= f.label :name %> - <%= f.text_field :name %> -
+
+ <%= f.label :name %> + <%= f.text_field :name %> +
-
- <%= f.label :description %> - <%= f.text_area :description %> -
+
+ <%= f.label :description %> + <%= f.text_area :description %> +
<%= f.label :image %> - <%= f.file_field :image %> + <% if Rails.env.development? %> + <%= f.file_field :image %> + <% else %> + <%= f.text_field :base64_image %> + <% end %> +
+
+ <%= f.submit %>
-
- <%= f.submit %> -
<% end %> diff --git a/app/views/admin/courses/index.html.erb b/app/views/admin/courses/index.html.erb index 4e3c49d..cd09677 100644 --- a/app/views/admin/courses/index.html.erb +++ b/app/views/admin/courses/index.html.erb @@ -17,7 +17,9 @@ <%= admin_course.name %> <%= admin_course.description %> + <% if Rails.env.development? %> <%= image_tag admin_course.image.url(:thumb) %> + <% end %> <%= link_to 'Show', admin_course %> <%= link_to 'Edit', edit_admin_course_path(admin_course) %> <%= link_to 'Destroy', admin_course, method: :delete, data: { confirm: 'Are you sure?' } %> diff --git a/app/views/admin/courses/show.html.erb b/app/views/admin/courses/show.html.erb index 2b5b946..6d9f9a6 100644 --- a/app/views/admin/courses/show.html.erb +++ b/app/views/admin/courses/show.html.erb @@ -6,11 +6,12 @@

Description: <%= @admin_course.description %> +<% if Rails.env.development? %>

Image: <%= image_tag @admin_course.image.url(:thumb) %>

- +<% end %> <%= link_to 'Edit', edit_admin_course_path(@admin_course) %> | <%= link_to 'Back', admin_courses_path %> <%= render 'shared/extends_admin_layout' %> diff --git a/app/views/admin/mini_sliders/_form.html.erb b/app/views/admin/mini_sliders/_form.html.erb index 6cbee42..ee01748 100644 --- a/app/views/admin/mini_sliders/_form.html.erb +++ b/app/views/admin/mini_sliders/_form.html.erb @@ -1,26 +1,30 @@ <%= form_for(admin_mini_slider) do |f| %> - <% if admin_mini_slider.errors.any? %> -
-

<%= pluralize(admin_mini_slider.errors.count, "error") %> prohibited this admin_mini_slider from being saved:

+ <% if admin_mini_slider.errors.any? %> +
+

<%= pluralize(admin_mini_slider.errors.count, "error") %> prohibited this admin_mini_slider from being saved:

-
    - <% admin_mini_slider.errors.full_messages.each do |message| %> -
  • <%= message %>
  • - <% end %> -
-
- <% end %> +
    + <% admin_mini_slider.errors.full_messages.each do |message| %> +
  • <%= message %>
  • + <% end %> +
+
+ <% end %> -
- <%= f.label :name %> - <%= f.text_field :name %> -
+
+ <%= f.label :name %> + <%= f.text_field :name %> +
<%= f.label :image %> - <%= f.file_field :image %> + <% if Rails.env.development? %> + <%= f.file_field :image %> + <% else %> + <%= f.text_field :base64_image %> + <% end %> +
+
+ <%= f.submit %>
-
- <%= f.submit %> -
<% end %> diff --git a/app/views/admin/mini_sliders/index.html.erb b/app/views/admin/mini_sliders/index.html.erb index b633d85..639a63e 100644 --- a/app/views/admin/mini_sliders/index.html.erb +++ b/app/views/admin/mini_sliders/index.html.erb @@ -14,7 +14,9 @@ <% @admin_mini_sliders.each do |admin_mini_slider| %> <%= admin_mini_slider.name %> + <% if Rails.env.development? %> <%= image_tag admin_mini_slider.image.url(:thumb) %> + <% end %> <%= link_to 'Show', admin_mini_slider %> <%= link_to 'Edit', edit_admin_mini_slider_path(admin_mini_slider) %> <%= link_to 'Destroy', admin_mini_slider, method: :delete, data: { confirm: 'Are you sure?' } %> diff --git a/app/views/admin/mini_sliders/show.html.erb b/app/views/admin/mini_sliders/show.html.erb index 5424890..df92d05 100644 --- a/app/views/admin/mini_sliders/show.html.erb +++ b/app/views/admin/mini_sliders/show.html.erb @@ -3,7 +3,9 @@

Name: <%= @admin_mini_slider.name %> -<%= image_tag @admin_mini_slider.image.url(:thumb) %> + <% if Rails.env.development? %> + <%= image_tag @admin_mini_slider.image.url(:thumb) %> + <% end %>

<%= link_to 'Edit', edit_admin_mini_slider_path(@admin_mini_slider) %> | diff --git a/app/views/admin/news/_form.html.erb b/app/views/admin/news/_form.html.erb index ca19c69..e0eaadc 100644 --- a/app/views/admin/news/_form.html.erb +++ b/app/views/admin/news/_form.html.erb @@ -22,7 +22,12 @@
<%= f.label :image %> + <% if Rails.env.development? %> <%= f.file_field :image %> + <% else %> + large: <%= f.text_field :base64_large_image %> + thumb: <%= f.text_field :base64_thumb_image %> + <% end %>
diff --git a/app/views/admin/news/index.html.erb b/app/views/admin/news/index.html.erb index a98a485..ec4edf2 100644 --- a/app/views/admin/news/index.html.erb +++ b/app/views/admin/news/index.html.erb @@ -17,7 +17,9 @@ <%= admin_news.name %> <%= admin_news.description %> + <% if Rails.env.development? %> <%= image_tag admin_news.image.url(:thumb) %> + <% end %> <%= link_to 'Show', admin_news %> <%= link_to 'Edit', edit_admin_news_path(admin_news) %> <%= link_to 'Destroy', admin_news, method: :delete, data: { confirm: 'Are you sure?' } %> diff --git a/app/views/admin/news/show.html.erb b/app/views/admin/news/show.html.erb index bd8870b..d6f6e5e 100644 --- a/app/views/admin/news/show.html.erb +++ b/app/views/admin/news/show.html.erb @@ -9,11 +9,12 @@ Description: <%= @admin_news.description %>

+<% if Rails.env.development? %>

Thumbs <%= image_tag @admin_news.image.url(:thumb) %>

- +<% end %> <%= link_to 'Edit', edit_admin_news_path(@admin_news) %> | <%= link_to 'Back', admin_news_index_path %> <%= render 'shared/extends_admin_layout' %> diff --git a/app/views/admin/sliders/_form.html.erb b/app/views/admin/sliders/_form.html.erb index ff0e5ae..5f65d4a 100644 --- a/app/views/admin/sliders/_form.html.erb +++ b/app/views/admin/sliders/_form.html.erb @@ -17,7 +17,11 @@
<%= f.label :image%> + <% if Rails.env.development? %> <%= f.file_field :image %> + <% else %> + <%= f.text_field :base64_image %> + <% end %>
<%= f.label :caption_1 %> diff --git a/app/views/admin/sliders/index.html.erb b/app/views/admin/sliders/index.html.erb index 384b8e3..0bf42fa 100644 --- a/app/views/admin/sliders/index.html.erb +++ b/app/views/admin/sliders/index.html.erb @@ -18,7 +18,9 @@ <%= admin_slider.name %> <%= admin_slider.caption_1 %> <%= admin_slider.caption_2 %> + <% if Rails.env.development? %> <%=image_tag admin_slider.image.url(:thumb) %> + <% end %> <%= link_to 'Show', admin_slider %> <%= link_to 'Edit', edit_admin_slider_path(admin_slider) %> <%= link_to 'Destroy', admin_slider, method: :delete, data: { confirm: 'Are you sure?' } %> diff --git a/app/views/admin/sliders/show.html.erb b/app/views/admin/sliders/show.html.erb index 76da3c5..d7993b9 100644 --- a/app/views/admin/sliders/show.html.erb +++ b/app/views/admin/sliders/show.html.erb @@ -3,10 +3,13 @@

Name: <%= @admin_slider.name %> -

- Image - <%= image_tag @admin_slider.image.url(:thumb) %> -

+ + <% if Rails.env.development? %> +

+ Image + <%= image_tag @admin_slider.image.url(:thumb) %> +

+<% end %>

Caption 1: <%= @admin_slider.caption_1 %> diff --git a/app/views/admin/testimonials/_form.html.erb b/app/views/admin/testimonials/_form.html.erb index 827b9e7..4b422ac 100644 --- a/app/views/admin/testimonials/_form.html.erb +++ b/app/views/admin/testimonials/_form.html.erb @@ -32,7 +32,11 @@

<%= f.label :image %> + <% if Rails.env.development? %> <%= f.file_field :image %> + <% else %> + <%= f.text_field :base64_image %> + <% end %>
diff --git a/app/views/admin/testimonials/index.html.erb b/app/views/admin/testimonials/index.html.erb index 84f9558..f1563fa 100644 --- a/app/views/admin/testimonials/index.html.erb +++ b/app/views/admin/testimonials/index.html.erb @@ -20,7 +20,9 @@ <%= admin_testimonial.description %> <%= admin_testimonial.department.name %> <%= admin_testimonial.semester.name %> + <% if Rails.env.development? %> <%=image_tag admin_testimonial.image.url(:thumb) %> + <% end %> <%= link_to 'Show', admin_testimonial %> <%= link_to 'Edit', edit_admin_testimonial_path(admin_testimonial) %> <%= link_to 'Destroy', admin_testimonial, method: :delete, data: { confirm: 'Are you sure?' } %> diff --git a/app/views/admin/testimonials/show.html.erb b/app/views/admin/testimonials/show.html.erb index e5a75be..2277e11 100644 --- a/app/views/admin/testimonials/show.html.erb +++ b/app/views/admin/testimonials/show.html.erb @@ -19,7 +19,10 @@ Semester: <%= @admin_testimonial.semester.name %>

+ +<% if Rails.env.development? %> image:<%= image_tag@admin_testimonial.image.url(:thumb) %> +<% end %> <%= link_to 'Edit', edit_admin_testimonial_path(@admin_testimonial) %> | <%= link_to 'Back', admin_testimonials_path %> diff --git a/app/views/admin/websites/_form.html.erb b/app/views/admin/websites/_form.html.erb index 3fa1951..63945d7 100644 --- a/app/views/admin/websites/_form.html.erb +++ b/app/views/admin/websites/_form.html.erb @@ -1,34 +1,42 @@ <%= form_for(admin_website) do |f| %> - <% if admin_website.errors.any? %> -
-

<%= pluralize(admin_website.errors.count, "error") %> prohibited this admin_website from being saved:

+ <% if admin_website.errors.any? %> +
+

<%= pluralize(admin_website.errors.count, "error") %> prohibited this admin_website from being saved:

-
    - <% admin_website.errors.full_messages.each do |message| %> -
  • <%= message %>
  • - <% end %> -
-
- <% end %> +
    + <% admin_website.errors.full_messages.each do |message| %> +
  • <%= message %>
  • + <% end %> +
+
+ <% end %> -
- <%= f.label :name %> - <%= f.text_field :name %> -
-
- <%= f.label :details %> - <%= f.text_area :details %> -
-
- <%= f.label :logo %> - <%= f.file_field :logo %> -
-
- <%= f.label :favicon %> - <%= f.file_field :favicon %> -
+
+ <%= f.label :name %> + <%= f.text_field :name %> +
+
+ <%= f.label :details %> + <%= f.text_area :details %> +
+
+ <%= f.label :logo %> + <% if Rails.env.development? %> + <%= f.file_field :logo %> + <% else %> + <%= f.text_field :base64_logo %> + <% end %> +
+
+ <%= f.label :favicon %> + <% if Rails.env.development? %> + <%= f.file_field :favicon %> + <% else %> + <%= f.text_field :base64_favicon %> + <% end %> +
-
- <%= f.submit %> -
+
+ <%= f.submit %> +
<% end %> diff --git a/app/views/admin/websites/show.html.erb b/app/views/admin/websites/show.html.erb index e7871ed..1f0b311 100644 --- a/app/views/admin/websites/show.html.erb +++ b/app/views/admin/websites/show.html.erb @@ -5,8 +5,10 @@ <%= @admin_website.name %> Details: <%= @admin_website.details %> - logo:<%= image_tag @admin_website.logo.url(:thumb) %> - favicon:<%= image_tag @admin_website.favicon.url(:medium) %> + <% if Rails.env.development? %> + logo:<%= image_tag @admin_website.logo.url(:thumb) %> + favicon:<%= image_tag @admin_website.favicon.url(:medium) %> + <% end %>

<%= link_to 'Edit', edit_admin_website_path(@admin_website) %> | diff --git a/app/views/frontend/about.html.erb b/app/views/frontend/about.html.erb index 67561c0..9fffc36 100644 --- a/app/views/frontend/about.html.erb +++ b/app/views/frontend/about.html.erb @@ -1,6 +1,10 @@

Welcome to <%= @about.slug %>

-

<%= image_tag @about.image.url(:large) %>

+ <% if Rails.env.development? %> +

<%= image_tag @about.image.url(:large) %>

+ <% else %> + + <% end %> <%= @about.description.html_safe %>
diff --git a/app/views/frontend/admission_eligibility.html.erb b/app/views/frontend/admission_eligibility.html.erb index 276d95d..a97b2ee 100644 --- a/app/views/frontend/admission_eligibility.html.erb +++ b/app/views/frontend/admission_eligibility.html.erb @@ -12,7 +12,7 @@
- <%= admission_eligibility.description %> + <%= admission_eligibility.description.html_safe %>
diff --git a/app/views/frontend/courses.html.erb b/app/views/frontend/courses.html.erb index aeb1854..35b8651 100644 --- a/app/views/frontend/courses.html.erb +++ b/app/views/frontend/courses.html.erb @@ -2,6 +2,10 @@

Welcome to <%= @course.name %>

+ <% if Rails.env.development? %>

<%= image_tag @course.image.url(:large), class: 'fix800 img-responsive' %>

+ <% else %> +

+ <% end %>

<%= @course.description.html_safe %>

diff --git a/app/views/frontend/event.html.erb b/app/views/frontend/event.html.erb index 10941be..ce3534e 100644 --- a/app/views/frontend/event.html.erb +++ b/app/views/frontend/event.html.erb @@ -11,7 +11,7 @@ <%= event.starting_time %> - <%= event.ending_time %> <%= event.place %>

-

<%= event.details %>

+

<%= event.details.html_safe %>

<% end %> diff --git a/app/views/frontend/home.html.erb b/app/views/frontend/home.html.erb index fd1fb93..383c95b 100644 --- a/app/views/frontend/home.html.erb +++ b/app/views/frontend/home.html.erb @@ -5,7 +5,11 @@