Use gem bootstrap-wysihtml5 on textarea

This commit is contained in:
Xavier J 2016-02-18 11:56:54 +01:00
parent 3a76275058
commit 20a41ef172
8 changed files with 19 additions and 9 deletions

View file

@ -75,6 +75,7 @@ gem 'mailjet'
gem "smart_listing"
gem 'css_splitter'
gem 'bootstrap-wysihtml5-rails', '~> 0.3.3.8'
group :test do
gem 'capybara'

View file

@ -64,6 +64,8 @@ GEM
bootstrap-sass (3.3.5)
autoprefixer-rails (>= 5.0.0.1)
sass (>= 3.2.19)
bootstrap-wysihtml5-rails (0.3.3.8)
railties (>= 3.0)
builder (3.2.2)
byebug (5.0.0)
columnize (= 0.9.0)
@ -449,6 +451,7 @@ DEPENDENCIES
active_model_serializers
bootstrap-datepicker-rails
bootstrap-sass (~> 3.3.5)
bootstrap-wysihtml5-rails (~> 0.3.3.8)
byebug
capybara
carrierwave

View file

@ -27,6 +27,8 @@
//= require smart_listing
//= require turf
//= require franceconnect
//= require bootstrap-wysihtml5
//= require bootstrap-wysihtml5/locales/fr-FR
$(document).on('page:load', scroll_to);

View file

@ -0,0 +1,8 @@
$(document).ready(wysihtml5_active);
$(document).on('page:load', wysihtml5_active);
function wysihtml5_active (){
$('.wysihtml5').each(function(i, elem) {
$(elem).wysihtml5({ toolbar:{ "fa": true } });
});
}

View file

@ -21,6 +21,7 @@
*/
@import "bootstrap-sprockets";
@import "bootstrap";
@import "bootstrap-wysihtml5/bootstrap3-wysihtml5";
body {
background-color: rgb(255, 255, 255);

View file

@ -7,12 +7,7 @@
= @facade.dossier.procedure.libelle
.description
- begin
- @facade.dossier.description.split(/(?:\n\r?|\r\n?')/).each do |line|
= line
%br
- rescue
=''
= @facade.dossier.description.html_safe
- if @facade.dossier.mandataire_social && gestionnaire_signed_in?
.mandataire_social.text-success.center

View file

@ -13,7 +13,7 @@
.row
.col-md-12
%h4 Description de votre projet *
= text_area_tag :description, @dossier.description, rows: '6', placeholder: 'Description du projet', class: 'form-control'
= text_area_tag :description, @dossier.description, rows: '6', placeholder: 'Description du projet', class: 'form-control wysihtml5'
#liste_champs
-unless @champs.nil?

View file

@ -1,7 +1,7 @@
.content#commentaires_flux{style:'width:100%;'}
%div#commentaire_new{style: 'width:80%; margin-left:auto; margin-right:auto'}
= form_tag(url_for({ controller: 'commentaires', action: :create, dossier_id: @facade.dossier.id }), class: 'form-inline', method: 'POST') do
%textarea.form-control{id: 'texte_commentaire', name: 'texte_commentaire', style: 'width: 100%; margin-bottom:2%', rows: '5', placeholder:"Dialoguer avec votre interlocuteur privilégié en charge de votre dossier."}
%textarea.form-control{id: 'texte_commentaire', class: 'wysihtml5', name: 'texte_commentaire', style: 'width: 100%; margin-bottom:2%', rows: '5', placeholder:"Dialoguer avec votre interlocuteur privilégié en charge de votre dossier."}
%input.form-control.btn.btn-success{:type => 'submit', :value => 'Poster', style: 'float:right'}
%br
%br
@ -14,5 +14,5 @@
=com.created_at_fr
%br
.description#body
=com.body
=com.body.html_safe
%br