From 929afe2f129df259ed3d7606931f0857c28a41a6 Mon Sep 17 00:00:00 2001 From: Thomas Lecavelier Date: Thu, 12 Sep 2013 14:32:12 +0200 Subject: [PATCH] Add bootstrap, jquery-ui and convert Element.toggle to bootstrap collapse --- app/helpers/admin/content_helper.rb | 2 +- app/views/admin/content/_form.html.erb | 68 +- app/views/admin/shared/_macros.html.erb | 2 +- app/views/layouts/administration.html.erb | 5 +- config/application.rb | 1 - public/javascripts/bootstrap.js | 2280 +++ public/javascripts/bootstrap.min.js | 6 + public/javascripts/jquery-ui.js | 15003 ++++++++++++++++++++ public/javascripts/publify_jquery.js | 5 + public/stylesheets/jquery-ui.css | 1177 ++ 10 files changed, 18532 insertions(+), 17 deletions(-) create mode 100644 public/javascripts/bootstrap.js create mode 100644 public/javascripts/bootstrap.min.js create mode 100644 public/javascripts/jquery-ui.js create mode 100644 public/javascripts/publify_jquery.js create mode 100644 public/stylesheets/jquery-ui.css diff --git a/app/helpers/admin/content_helper.rb b/app/helpers/admin/content_helper.rb index 4b2194e755..7750f55c4a 100644 --- a/app/helpers/admin/content_helper.rb +++ b/app/helpers/admin/content_helper.rb @@ -62,7 +62,7 @@ def get_post_types end def toggle_element(element, label=_("Change")) - "#{label}".html_safe + link_to(label, "##{element}", :"data-toggle" => :collapse, :"data-target" => "##{element}") end def publish_now_or_already_published(article) diff --git a/app/views/admin/content/_form.html.erb b/app/views/admin/content/_form.html.erb index aa5d5286fd..74214688e0 100644 --- a/app/views/admin/content/_form.html.erb +++ b/app/views/admin/content/_form.html.erb @@ -50,7 +50,7 @@ <%= t(".publish_settings") %>

<%= t(".status") %>: <%= _(@article.state.to_s.downcase) %> - <%= t('.change')%> + <%= t('.change')%>

<%= t(".allowed_comments_and_trackbacks", allow_comment: content_tag(:strong, get_feedback_status(@article.allow_comments)), allow_trackback: content_tag(:strong, get_feedback_status(@article.allow_pings))) %> - <%= t('.change')%> + <%= t('.change')%>

<%= t(".published") %> <%= publish_now_or_already_published @article %> - <%= t('.change')%> + <%= t('.change')%>

<%= t(".visibility") %>: <%= @article.password.nil? || @article.password.empty? ? t(".public") : t(".protected") %> - <%= t('.change')%> + <%= t('.change')%>