modif mode édition portlets
This commit is contained in:
parent
127730fd76
commit
df07856d2e
@ -24,10 +24,33 @@
|
||||
|
||||
|
||||
#= require redactor
|
||||
#= require redactor_plugins/fontsize
|
||||
#= require redactor_plugins/fontfamily
|
||||
#= require redactor_plugins/fontcolor
|
||||
|
||||
#= require nested_fields
|
||||
|
||||
#= require_tree ./note_files
|
||||
portlet_to_move = false
|
||||
content_type_to_move =false
|
||||
@open_collapse3 = ->
|
||||
$("#collapse3 .panel").show()
|
||||
$("#collapse3").show()
|
||||
|
||||
@reset_edit_pane = ->
|
||||
$("#element_form").html()
|
||||
$("#collapse3").hide()
|
||||
|
||||
@unselect_portlet = ->
|
||||
$(".portlet.active").removeClass("active")
|
||||
reset_edit_pane()
|
||||
|
||||
@cancel_move_portlet = ->
|
||||
$(".move_message").show()
|
||||
$(".cancel_message").hide()
|
||||
|
||||
$(".move").removeClass("move")
|
||||
$(".portlet_placeholder").remove()
|
||||
portlet_to_move = false
|
||||
|
||||
$(document).ready ->
|
||||
|
||||
@ -61,9 +84,12 @@ $(document).ready ->
|
||||
|
||||
|
||||
$(document).on "click", ".portlet", (event) ->
|
||||
if !$(this).hasClass("active") and portlet_to_move == false
|
||||
|
||||
$(".portlet.active").removeClass("active")
|
||||
$(this).addClass("active")
|
||||
|
||||
|
||||
$.ajax({url : $(this).data("edit-link"), type: "GET"});
|
||||
$("#collapse3 .trash").attr("href", $(this).data("show-link"));
|
||||
|
||||
@ -73,13 +99,18 @@ $(document).ready ->
|
||||
portlet_to_move = false
|
||||
content_type_to_move = false
|
||||
$("#element_form").html("")
|
||||
$("#collapse3").collapse('hide');
|
||||
$("#collapse2").collapse('show');
|
||||
|
||||
$(".portlet.active").removeClass("active")
|
||||
|
||||
portlet_to_move = false
|
||||
content_type_to_move =false
|
||||
|
||||
|
||||
|
||||
|
||||
$(document).on "click", "#content_types .content_type", ->
|
||||
cancel_move_portlet()
|
||||
unselect_portlet()
|
||||
reset_edit_pane()
|
||||
|
||||
|
||||
type = $(this).data("type")
|
||||
content_type_to_move = type
|
||||
@ -87,12 +118,24 @@ $(document).ready ->
|
||||
$(this).addClass("move")
|
||||
false
|
||||
|
||||
|
||||
|
||||
$(document).on "click", ".portlet_handle", ->
|
||||
if portlet_to_move == false
|
||||
|
||||
$(".move_message").hide()
|
||||
$(".cancel_message").show()
|
||||
|
||||
|
||||
id = $(this).data("portlet-id")
|
||||
portlet_to_move = $("#portlet_"+id)
|
||||
init_portlets_place_holder()
|
||||
portlet_to_move.addClass("move")
|
||||
false
|
||||
else
|
||||
cancel_move_portlet()
|
||||
|
||||
false
|
||||
|
||||
$(document).on "click", ".portlet_placeholder", ->
|
||||
if portlet_to_move != false
|
||||
@ -100,7 +143,7 @@ $(document).ready ->
|
||||
$(".move").removeClass("move")
|
||||
$(".portlet_placeholder").remove()
|
||||
update_block_portlet_order(portlet_to_move.closest(".block_portlets").data("block_id"))
|
||||
portlet_to_move = false
|
||||
cancel_move_portlet()
|
||||
else
|
||||
|
||||
block_id = $(this).closest(".block_portlets").data("block_id")
|
||||
@ -344,3 +387,14 @@ $(document).on "scroll", () ->
|
||||
|
||||
$("#toolbar-text, #menu_item_informations").css
|
||||
top : top
|
||||
|
||||
$(document).on "click", "#menu_item_informations .save", ->
|
||||
$(this).closest(".panel").find("form").submit()
|
||||
return false
|
||||
|
||||
$(document).on "click", "#menu_item_informations h4", ->
|
||||
$(this).next(".panel").toggle()
|
||||
return false
|
||||
|
||||
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
73
app/assets/javascripts/redactor_plugins/fontcolor.js
Executable file
73
app/assets/javascripts/redactor_plugins/fontcolor.js
Executable file
@ -0,0 +1,73 @@
|
||||
if (!RedactorPlugins) var RedactorPlugins = {};
|
||||
|
||||
RedactorPlugins.fontcolor = function()
|
||||
{
|
||||
return {
|
||||
init: function()
|
||||
{
|
||||
var colors = [
|
||||
'#ffffff', '#000000', '#eeece1', '#1f497d', '#4f81bd', '#c0504d', '#9bbb59', '#8064a2', '#4bacc6', '#f79646', '#ffff00',
|
||||
'#f2f2f2', '#7f7f7f', '#ddd9c3', '#c6d9f0', '#dbe5f1', '#f2dcdb', '#ebf1dd', '#e5e0ec', '#dbeef3', '#fdeada', '#fff2ca',
|
||||
'#d8d8d8', '#595959', '#c4bd97', '#8db3e2', '#b8cce4', '#e5b9b7', '#d7e3bc', '#ccc1d9', '#b7dde8', '#fbd5b5', '#ffe694',
|
||||
'#bfbfbf', '#3f3f3f', '#938953', '#548dd4', '#95b3d7', '#d99694', '#c3d69b', '#b2a2c7', '#b7dde8', '#fac08f', '#f2c314',
|
||||
'#a5a5a5', '#262626', '#494429', '#17365d', '#366092', '#953734', '#76923c', '#5f497a', '#92cddc', '#e36c09', '#c09100',
|
||||
'#7f7f7f', '#0c0c0c', '#1d1b10', '#0f243e', '#244061', '#632423', '#4f6128', '#3f3151', '#31859b', '#974806', '#7f6000'
|
||||
];
|
||||
|
||||
var buttons = ['fontcolor', 'backcolor'];
|
||||
|
||||
for (var i = 0; i < 2; i++)
|
||||
{
|
||||
var name = buttons[i];
|
||||
|
||||
var button = this.button.add(name, this.lang.get(name));
|
||||
var $dropdown = this.button.addDropdown(button);
|
||||
|
||||
$dropdown.width(242);
|
||||
this.fontcolor.buildPicker($dropdown, name, colors);
|
||||
|
||||
}
|
||||
},
|
||||
buildPicker: function($dropdown, name, colors)
|
||||
{
|
||||
var rule = (name == 'backcolor') ? 'background-color' : 'color';
|
||||
|
||||
var len = colors.length;
|
||||
var self = this;
|
||||
var func = function(e)
|
||||
{
|
||||
e.preventDefault();
|
||||
self.fontcolor.set($(this).data('rule'), $(this).attr('rel'));
|
||||
};
|
||||
|
||||
for (var z = 0; z < len; z++)
|
||||
{
|
||||
var color = colors[z];
|
||||
|
||||
var $swatch = $('<a rel="' + color + '" data-rule="' + rule +'" href="#" style="float: left; font-size: 0; border: 2px solid #fff; padding: 0; margin: 0; width: 22px; height: 22px;"></a>');
|
||||
$swatch.css('background-color', color);
|
||||
$swatch.on('click', func);
|
||||
|
||||
$dropdown.append($swatch);
|
||||
}
|
||||
|
||||
var $elNone = $('<a href="#" style="display: block; clear: both; padding: 5px; font-size: 12px; line-height: 1;"></a>').html(this.lang.get('none'));
|
||||
$elNone.on('click', $.proxy(function(e)
|
||||
{
|
||||
e.preventDefault();
|
||||
this.fontcolor.remove(rule);
|
||||
|
||||
}, this));
|
||||
|
||||
$dropdown.append($elNone);
|
||||
},
|
||||
set: function(rule, type)
|
||||
{
|
||||
this.inline.format('span', 'style', rule + ': ' + type + ';');
|
||||
},
|
||||
remove: function(rule)
|
||||
{
|
||||
this.inline.removeStyleRule(rule);
|
||||
}
|
||||
};
|
||||
};
|
32
app/assets/javascripts/redactor_plugins/fontfamily.js
Executable file
32
app/assets/javascripts/redactor_plugins/fontfamily.js
Executable file
@ -0,0 +1,32 @@
|
||||
if (!RedactorPlugins) var RedactorPlugins = {};
|
||||
|
||||
RedactorPlugins.fontfamily = function()
|
||||
{
|
||||
return {
|
||||
init: function ()
|
||||
{
|
||||
var fonts = [ 'Lato', 'Stylograph','Arial', 'Helvetica', 'Georgia', 'Times New Roman', 'Monospace' ];
|
||||
var that = this;
|
||||
var dropdown = {};
|
||||
|
||||
$.each(fonts, function(i, s)
|
||||
{
|
||||
dropdown['s' + i] = { title: s, func: function() { that.fontfamily.set(s); }};
|
||||
});
|
||||
|
||||
dropdown.remove = { title: 'Remove Font Family', func: that.fontfamily.reset };
|
||||
|
||||
var button = this.button.add('fontfamily', 'Change Font Family');
|
||||
this.button.addDropdown(button, dropdown);
|
||||
|
||||
},
|
||||
set: function (value)
|
||||
{
|
||||
this.inline.format('span', 'style', 'font-family:' + value + ';');
|
||||
},
|
||||
reset: function()
|
||||
{
|
||||
this.inline.removeStyleRule('font-family');
|
||||
}
|
||||
};
|
||||
};
|
75
app/assets/javascripts/redactor_plugins/fontsize.js
Executable file
75
app/assets/javascripts/redactor_plugins/fontsize.js
Executable file
@ -0,0 +1,75 @@
|
||||
if (!RedactorPlugins) var RedactorPlugins = {};
|
||||
|
||||
RedactorPlugins.fontsize = function()
|
||||
{
|
||||
return {
|
||||
init: function()
|
||||
{
|
||||
var fonts = [10, 11, 12, 14, 16, 18, 20, 24, 28, 30];
|
||||
var that = this;
|
||||
var dropdown = {};
|
||||
|
||||
$.each(fonts, function(i, s)
|
||||
{
|
||||
dropdown['s' + i] = { title: s + 'px', func: function() { that.fontsize.set(s); } };
|
||||
});
|
||||
|
||||
dropdown.remove = { title: 'Remove Font Size', func: that.fontsize.reset };
|
||||
|
||||
var button = this.button.add('fontsize', 'Change Font Size');
|
||||
this.button.addDropdown(button, dropdown);
|
||||
},
|
||||
set: function(size)
|
||||
{
|
||||
this.inline.format('span', 'style', 'font-size: ' + size + 'px;');
|
||||
},
|
||||
reset: function()
|
||||
{
|
||||
this.inline.removeStyleRule('font-size');
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
if (!RedactorPlugins) var RedactorPlugins = {};
|
||||
|
||||
RedactorPlugins.scriptbuttons = function()
|
||||
{
|
||||
return {
|
||||
init: function()
|
||||
{
|
||||
var sup = this.button.add('superscript', 'Superscript');
|
||||
var sub = this.button.add('subscript', 'Subscript');
|
||||
|
||||
// make your added buttons as Font Awesome's icon
|
||||
this.button.setAwesome('superscript', 'fa-superscript');
|
||||
this.button.setAwesome('subscript', 'fa-subscript');
|
||||
|
||||
this.button.addCallback(sup, this.scriptbuttons.formatSup);
|
||||
this.button.addCallback(sub, this.scriptbuttons.formatSub);
|
||||
},
|
||||
formatSup: function()
|
||||
{
|
||||
this.inline.format('sup');
|
||||
},
|
||||
formatSub: function()
|
||||
{
|
||||
this.inline.format('sub');
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
if (!RedactorPlugins) var RedactorPlugins = {};
|
||||
|
||||
RedactorPlugins.bufferbuttons = function()
|
||||
{
|
||||
return {
|
||||
init: function()
|
||||
{
|
||||
var undo = this.button.addFirst('undo', 'Undo');
|
||||
var redo = this.button.addAfter('undo', 'redo', 'Redo');
|
||||
|
||||
this.button.addCallback(undo, this.buffer.undo);
|
||||
this.button.addCallback(redo, this.buffer.redo);
|
||||
}
|
||||
};
|
||||
};
|
@ -3,19 +3,16 @@
|
||||
@import "bootstrap";
|
||||
|
||||
@import "fontawesome/font-awesome";
|
||||
//@import "admin/lesshat";
|
||||
|
||||
@import "manager";
|
||||
@import "redactor";
|
||||
@import "pane_hover";
|
||||
@import "vendor/select2";
|
||||
|
||||
@import "admin/topics";
|
||||
|
||||
#admin_navbar{
|
||||
#admin_nav{
|
||||
border-radius:0px;
|
||||
|
||||
}
|
||||
|
||||
span.preview{
|
||||
img{
|
||||
max-width:125px;
|
||||
@ -197,9 +194,10 @@ text-decoration:none;
|
||||
position:fixed;
|
||||
bottom:0px;
|
||||
|
||||
right:1em;
|
||||
left:1em;
|
||||
min-width:600px;
|
||||
width:50%;
|
||||
z-index:3;
|
||||
|
||||
}
|
||||
|
||||
@ -350,7 +348,12 @@ text-decoration:none;
|
||||
|
||||
|
||||
#menu_item_inspector_container{
|
||||
.panel{
|
||||
border-radius:0px;
|
||||
border-left:0px;
|
||||
border-right:0px;
|
||||
|
||||
}
|
||||
.accordion{
|
||||
|
||||
height:auto;
|
||||
@ -638,6 +641,13 @@ cursor:pointer;
|
||||
box-sizing: border-box;
|
||||
&.active{
|
||||
border:3px solid rgba(129,155,237,1);
|
||||
.redactor-editor{
|
||||
background:rgba(225,237,251,1);
|
||||
|
||||
}
|
||||
}
|
||||
&.portlet_text_content{
|
||||
border:0;
|
||||
}
|
||||
|
||||
&.move{
|
||||
@ -645,3 +655,166 @@ opacity:0.5;
|
||||
}
|
||||
|
||||
}
|
||||
h1{
|
||||
margin-top:0;
|
||||
|
||||
}
|
||||
|
||||
.table-striped tr:nth-child(odd) td, .table-striped tr:nth-child(odd) th{
|
||||
|
||||
background:rgba(235,244,250,1) !important;
|
||||
|
||||
}
|
||||
|
||||
.block_portlets{
|
||||
.portlet{
|
||||
min-height:50px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#menu_item_informations{
|
||||
#collapse3{
|
||||
|
||||
position:relative;
|
||||
padding-bottom:50px;
|
||||
}
|
||||
|
||||
|
||||
#element_form_action{
|
||||
|
||||
position:fixed;
|
||||
width:330px;
|
||||
right:0;
|
||||
bottom:0;
|
||||
border-top:solid rgba(221,221,221,1) 1px;
|
||||
|
||||
.portlet_handle, .trash, .save{
|
||||
border-radius:0;
|
||||
border:0;
|
||||
margin:0;
|
||||
display:block;
|
||||
float:left;
|
||||
padding:10px 12px;
|
||||
|
||||
}
|
||||
|
||||
.portlet_handle{
|
||||
width:35%;
|
||||
|
||||
.cancel_message{
|
||||
display:none;
|
||||
}
|
||||
}
|
||||
.trash{
|
||||
width:20%;
|
||||
}
|
||||
.save{
|
||||
width:45%;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.row{
|
||||
|
||||
margin:auto;
|
||||
max-width:1100px;
|
||||
display:block;
|
||||
|
||||
|
||||
&:after{
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both;
|
||||
|
||||
}
|
||||
|
||||
.columns{
|
||||
|
||||
display:block;
|
||||
|
||||
box-sizing: border-box;
|
||||
float:left;
|
||||
display:inline-block;
|
||||
|
||||
&.span_12{
|
||||
width:100%;
|
||||
|
||||
}
|
||||
|
||||
&.span_11{
|
||||
width:100/12*11;
|
||||
|
||||
}
|
||||
&.span_10{
|
||||
width:percentage(1/12*10);
|
||||
|
||||
}
|
||||
&.span_9{
|
||||
width:percentage(1/12*9);
|
||||
|
||||
}
|
||||
&.span_8{
|
||||
width:percentage(1/12*8);
|
||||
|
||||
}
|
||||
&.span_7{
|
||||
width:percentage(1/12*7);
|
||||
|
||||
}
|
||||
|
||||
&.span_6{
|
||||
width:percentage(1/12*6);
|
||||
|
||||
}
|
||||
&.span_5{
|
||||
width:percentage(1/12*5);
|
||||
|
||||
}
|
||||
&.span_4{
|
||||
width:percentage(1/12*4);
|
||||
|
||||
}
|
||||
&.span_3{
|
||||
width:percentage(1/12*3);
|
||||
|
||||
}
|
||||
&.span_2{
|
||||
width:percentage(1/12*2);
|
||||
|
||||
}
|
||||
|
||||
&.span_1{
|
||||
width:percentage(1/12*1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
#menu_item_informations{
|
||||
h4{
|
||||
color: #333333;
|
||||
background-color: whitesmoke;
|
||||
border:1px solid #dddddd;
|
||||
padding:10px 15px;
|
||||
font-size:16px;
|
||||
cursor:pointer;
|
||||
border-left:0px;
|
||||
border-right:0px;
|
||||
}
|
||||
|
||||
.panel{
|
||||
padding:0 10px;
|
||||
}
|
||||
}
|
||||
#collapse3{
|
||||
height:auto !important;
|
||||
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -5,7 +5,17 @@
|
||||
=render :partial => "admin/blocks/block", :locals => {:block => page.blocks[0], :sortable => true}
|
||||
|
||||
|
||||
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
#menu_item_inspector_container
|
||||
|
||||
|
||||
@ -14,51 +24,50 @@
|
||||
|
||||
|
||||
|
||||
.accordion#menu_item_informations.panel-group
|
||||
.panel.panel-default
|
||||
.panel-heading
|
||||
%h4.panel-title
|
||||
%a.panel-toggle{:href => "#collapseOne",:data => {:toggle => "collapse", :parent => "#menu_item_informations"}}
|
||||
#menu_item_informations
|
||||
%h4
|
||||
Infos sur la page
|
||||
|
||||
|
||||
#collapseOne.panel-collapse.collapse
|
||||
.panel-body
|
||||
.panel#collapseOne{:style => "display:none;"}
|
||||
=render :partial => "edit_form"
|
||||
|
||||
.panel.panel-default
|
||||
.panel-heading
|
||||
%h4.panel-title
|
||||
%a.panel-toggle{:href => "#collapse2",:data => {:toggle => "collapse", :parent => "#menu_item_informations"}}
|
||||
éléments
|
||||
%h4 éléments
|
||||
|
||||
|
||||
#collapse2.panel-collapse.collapse.in
|
||||
.panel-body
|
||||
.panel#collapse2
|
||||
.block_portlets_sortable#content_types
|
||||
-page.blocks[0].alloweds_types.each do |slug, name|
|
||||
|
||||
.content_type{:id => slug, :"data-type" => slug}
|
||||
=#i slug.to_s.constantize.picto
|
||||
=image_tag("admin/content_type/type_"+slug.to_s+".png", :alt => name, :title => name, :class => "handle")
|
||||
|
||||
|
||||
.panel.panel-default
|
||||
.panel-heading
|
||||
%h4.panel-title
|
||||
%a.panel-toggle{:href => "#collapse3",:data => {:toggle => "collapse", :parent => "#menu_item_informations"}}
|
||||
Modifier l'élément
|
||||
#collapse3{:style => "display:none;"}
|
||||
%h4 Modifier l'élément
|
||||
|
||||
|
||||
#collapse3.panel-collapse.collapse
|
||||
.panel-body
|
||||
|
||||
.panel
|
||||
#element_form
|
||||
|
||||
%div
|
||||
%a.btn.btn-default.portlet_handle{:href => "#", :data => {:portlet_id => nil}}
|
||||
%div#element_form_action
|
||||
%a.move.btn.btn-default.portlet_handle{:href => "#", :data => {:portlet_id => nil}}
|
||||
%span.move_message
|
||||
=ic :arrows
|
||||
|
||||
déplacer
|
||||
=link_to ic(:"trash-o")+" Supprimer", "#", :method => :delete, :data => { :confirm => "Etes-vous sûr ?"}, :remote => true, :class => "btn btn-danger trash"
|
||||
%span.cancel_message
|
||||
=ic :ban
|
||||
|
||||
annuler
|
||||
|
||||
=link_to ic(:"trash-o"), "#", :method => :delete, :data => { :confirm => "Etes-vous sûr ?"}, :remote => true, :class => "btn btn-danger trash"
|
||||
|
||||
%button.save.btn.btn-primary
|
||||
=ic(:"floppy-o")
|
||||
|
||||
Sauvegarder
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
%tr#testimony_row.testimony_row.row{:id => testimony.id}
|
||||
%tr#testimony_row.testimony_row{:id => testimony.id}
|
||||
%td=testimony.author
|
||||
%td=testimony.quote
|
||||
|
||||
|
@ -5,7 +5,17 @@
|
||||
=render :partial => "admin/blocks/block", :locals => {:block => @testimony.block, :sortable => true}
|
||||
|
||||
|
||||
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
#menu_item_inspector_container
|
||||
|
||||
|
||||
@ -14,28 +24,18 @@
|
||||
|
||||
|
||||
|
||||
.accordion#menu_item_informations.panel-group
|
||||
.panel.panel-default
|
||||
.panel-heading
|
||||
%h4.panel-title
|
||||
%a.panel-toggle{:href => "#collapseOne",:data => {:toggle => "collapse", :parent => "#menu_item_informations"}}
|
||||
#menu_item_informations
|
||||
%h4
|
||||
Infos sur le témoignage
|
||||
|
||||
|
||||
#collapseOne.panel-collapse.collapse
|
||||
.panel-body
|
||||
.panel#collapseOne{:style => "display:none;"}
|
||||
=link_to "modifier", edit_admin_testimony_path(@testimony), :remote => true,:class => "btn"
|
||||
=render :partial => "show"
|
||||
|
||||
.panel.panel-default
|
||||
.panel-heading
|
||||
%h4.panel-title
|
||||
%a.panel-toggle{:href => "#collapse2",:data => {:toggle => "collapse", :parent => "#menu_item_informations"}}
|
||||
éléments
|
||||
%h4 éléments
|
||||
|
||||
|
||||
#collapse2.panel-collapse.collapse.in
|
||||
.panel-body
|
||||
.panel#collapse2
|
||||
.block_portlets_sortable#content_types
|
||||
-@testimony.alloweds_types.each do |slug, name|
|
||||
|
||||
@ -43,27 +43,30 @@
|
||||
=image_tag("admin/content_type/type_"+slug.to_s+".png", :alt => name, :title => name, :class => "handle")
|
||||
|
||||
|
||||
#collapse3{:style => "display:none;"}
|
||||
%h4 Modifier l'élément
|
||||
|
||||
|
||||
.panel.panel-default
|
||||
.panel-heading
|
||||
%h4.panel-title
|
||||
%a.panel-toggle{:href => "#collapse3",:data => {:toggle => "collapse", :parent => "#menu_item_informations"}}
|
||||
Modifier l'élément
|
||||
|
||||
|
||||
#collapse3.panel-collapse.collapse
|
||||
.panel-body
|
||||
|
||||
.panel
|
||||
#element_form
|
||||
|
||||
%div
|
||||
%a.btn.btn-default.portlet_handle{:href => "#", :data => {:portlet_id => nil}}
|
||||
%div#element_form_action
|
||||
%a.move.btn.btn-default.portlet_handle{:href => "#", :data => {:portlet_id => nil}}
|
||||
%span.move_message
|
||||
=ic :arrows
|
||||
|
||||
déplacer
|
||||
=link_to ic(:"trash-o")+" Supprimer", "#", :method => :delete, :data => { :confirm => "Etes-vous sûr ?"}, :remote => true, :class => "btn btn-danger trash"
|
||||
|
||||
|
||||
%span.cancel_message
|
||||
=ic :ban
|
||||
|
||||
annuler
|
||||
|
||||
=link_to ic(:"trash-o"), "#", :method => :delete, :data => { :confirm => "Etes-vous sûr ?"}, :remote => true, :class => "btn btn-danger trash"
|
||||
|
||||
%button.save.btn.btn-primary
|
||||
=ic(:"floppy-o")
|
||||
|
||||
Sauvegarder
|
||||
|
||||
|
||||
|
||||
|
@ -5,7 +5,17 @@
|
||||
=render :partial => "admin/blocks/block", :locals => {:block => @topic.block, :sortable => true}
|
||||
|
||||
|
||||
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
#menu_item_inspector_container
|
||||
|
||||
|
||||
@ -14,30 +24,17 @@
|
||||
|
||||
|
||||
|
||||
.accordion#menu_item_informations.panel-group
|
||||
.panel.panel-default
|
||||
.panel-heading
|
||||
%h4.panel-title
|
||||
%a.panel-toggle{:href => "#collapseOne",:data => {:toggle => "collapse", :parent => "#menu_item_informations"}}
|
||||
#menu_item_informations
|
||||
%h4
|
||||
Infos sur la ressource
|
||||
|
||||
|
||||
#collapseOne.panel-collapse.collapse
|
||||
.panel-body
|
||||
.panel#collapseOne{:style => "display:none;"}
|
||||
=render :partial => "form"
|
||||
|
||||
%h4 éléments
|
||||
|
||||
|
||||
|
||||
.panel.panel-default
|
||||
.panel-heading
|
||||
%h4.panel-title
|
||||
%a.panel-toggle{:href => "#collapse2",:data => {:toggle => "collapse", :parent => "#menu_item_informations"}}
|
||||
éléments
|
||||
|
||||
|
||||
#collapse2.panel-collapse.collapse.in
|
||||
.panel-body
|
||||
.panel#collapse2
|
||||
.block_portlets_sortable#content_types
|
||||
-@topic.block.alloweds_types.each do |slug, name|
|
||||
|
||||
@ -45,28 +42,29 @@
|
||||
=image_tag("admin/content_type/type_"+slug.to_s+".png", :alt => name, :title => name, :class => "handle")
|
||||
|
||||
|
||||
.panel.panel-default
|
||||
.panel-heading
|
||||
%h4.panel-title
|
||||
%a.panel-toggle{:href => "#collapse3",:data => {:toggle => "collapse", :parent => "#menu_item_informations"}}
|
||||
Modifier l'élément
|
||||
#collapse3{:style => "display:none;"}
|
||||
%h4 Modifier l'élément
|
||||
|
||||
|
||||
#collapse3.panel-collapse.collapse
|
||||
.panel-body
|
||||
|
||||
.panel
|
||||
#element_form
|
||||
|
||||
%div
|
||||
%a.btn.btn-default.portlet_handle{:href => "#", :data => {:portlet_id => nil}}
|
||||
%div#element_form_action
|
||||
%a.move.btn.btn-default.portlet_handle{:href => "#", :data => {:portlet_id => nil}}
|
||||
%span.move_message
|
||||
=ic :arrows
|
||||
|
||||
déplacer
|
||||
=link_to ic(:"trash-o")+" Supprimer", "#", :method => :delete, :data => { :confirm => "Etes-vous sûr ?"}, :remote => true, :class => "btn btn-danger trash"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
%span.cancel_message
|
||||
=ic :ban
|
||||
|
||||
annuler
|
||||
|
||||
=link_to ic(:"trash-o"), "#", :method => :delete, :data => { :confirm => "Etes-vous sûr ?"}, :remote => true, :class => "btn btn-danger trash"
|
||||
|
||||
%button.save.btn.btn-primary
|
||||
=ic(:"floppy-o")
|
||||
|
||||
Sauvegarder
|
||||
|
||||
|
||||
|
@ -81,9 +81,4 @@
|
||||
-if BlockContent::STYLES.size > 0
|
||||
Style :
|
||||
= f.select :style, BlockContent::STYLES
|
||||
%br
|
||||
|
||||
|
||||
= f.submit "Sauvegarder", :class => "btn btn-primary"
|
||||
|
||||
|
||||
|
@ -9,7 +9,3 @@
|
||||
%td Style :
|
||||
%td= f.select :style, BreakContent::STYLES
|
||||
|
||||
= f.submit "Sauvegarder", :class => "btn btn-primary"
|
||||
|
||||
|
||||
|
||||
|
@ -29,11 +29,3 @@
|
||||
|
||||
|
||||
|
||||
= f.submit "Sauvegarder", :class => "btn btn-primary"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -9,10 +9,3 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
= f.submit "Sauvegarder", :class => "btn btn-primary"
|
||||
|
||||
|
||||
|
||||
|
@ -1,9 +1,10 @@
|
||||
= semantic_form_for [:portlet, @gallery_content], :remote => true do |form|
|
||||
|
||||
%p
|
||||
=link_to "Ajouter des images", "#", :onclick => "select_gallery_images_from_manager('#{form.object.id.to_s}');return false;", :class => "btn btn-default" if form.object.id
|
||||
-if GalleryContent::STYLES.size > 0
|
||||
Style :
|
||||
= form.select :style, GalleryContent::STYLES
|
||||
|
||||
= form.submit "Sauvegarder", :class => "btn btn-primary"
|
||||
|
||||
|
||||
|
||||
|
@ -1,14 +1,8 @@
|
||||
#myModal.modal.fade{"aria-hidden" => "true", "aria-labelledby" => "myModalLabel", :role => "dialog", :tabindex => "-1"}
|
||||
|
||||
|
||||
|
||||
|
||||
.modal-header
|
||||
%button.close{"aria-hidden" => "true", "data-dismiss" => "modal", :type => "button"} ×
|
||||
%h3#myModalLabel Modifier les infos
|
||||
.modal-body
|
||||
|
||||
= semantic_form_for [:portlet, @gallery_image], :remote => true do |form|
|
||||
.content
|
||||
|
||||
%h3 Modifier les infos
|
||||
|
||||
= form.inputs do
|
||||
= form.input :title, :label => "Titre :"
|
||||
= form.input :tags, :label => "Tags :"
|
||||
@ -17,15 +11,8 @@
|
||||
|
||||
|
||||
|
||||
|
||||
.modal-footer
|
||||
%button.btn{"aria-hidden" => "true", "data-dismiss" => "modal"} Annuler
|
||||
%button.btn.btn-primary{"aria-hidden" => "true", "data-dismiss" => "modal", :onclick => "$(this).closest('.modal').find('form').submit();"} Sauvegarder
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.actions
|
||||
=form.submit "Sauvegarder", :class => "btn btn-primary"
|
||||
|
||||
|
||||
|
||||
|
@ -1,2 +1 @@
|
||||
|
||||
$('<%= escape_javascript(render(:partial => "form"))%>').modal('show');
|
||||
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>");
|
@ -6,7 +6,7 @@
|
||||
=f.text_area :content, :style => "width:98%;height:400px;", :class => "inputText", :id => "ace_editor_textarea"
|
||||
|
||||
%pre#ace_editor_pre{:style => "margin:0px;"}
|
||||
|
||||
=raw "<!---"
|
||||
<script>
|
||||
var editor;
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
=raw "---->"
|
||||
%table.form_table
|
||||
%tr
|
||||
%td Style :
|
||||
@ -40,13 +40,6 @@
|
||||
|
||||
.action
|
||||
%button{:onclick => "$(this).closest('.html_content_form').toggleClass('large');editor.resize() ;return false;"} zoom
|
||||
= f.submit "Sauvegarder", :class => "btn btn-primary"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -27,6 +27,3 @@
|
||||
= form.input :popup, :label => "Ouvrir dans une popup ?", :as => :boolean
|
||||
|
||||
|
||||
= form.submit "Sauvegarder", :class => "btn btn-primary"
|
||||
|
||||
|
||||
|
@ -9,6 +9,4 @@
|
||||
= form.input :cible, :label => "Cible :" , :as => :qi_cible_select
|
||||
|
||||
|
||||
= form.submit "Sauvegarder", :class => "btn btn-primary"
|
||||
|
||||
|
@ -19,8 +19,4 @@
|
||||
%p
|
||||
Zoom
|
||||
= f.select :zoom, MapContent::ZOOMS
|
||||
%br
|
||||
= f.submit "Sauvegarder", :class => "btn btn-primary"
|
||||
|
||||
|
||||
|
||||
|
@ -5,9 +5,14 @@ $("#new_portlet_form_inline").replaceWith("<%= escape_javascript(render(@portlet
|
||||
|
||||
|
||||
|
||||
$("#collapse3 .trash").attr("href", $("#portlet_<%= @portlet.id %>").data("show-link"));
|
||||
|
||||
update_block_portlet_order(block_portlet_id);
|
||||
//$.ajax({url : $("#portlet_<%= @portlet.id %>").data("edit-link"), type: "GET"});
|
||||
|
||||
|
||||
$(".block_portlets").sortable("enable");
|
||||
cancel_move_portlet();
|
||||
unselect_portlet();
|
||||
|
||||
|
||||
<%= flash_js %>
|
@ -1,4 +1,10 @@
|
||||
|
||||
cancel_move_portlet();
|
||||
reset_edit_pane();
|
||||
$("#portlet_<%= @portlet.id %>").remove();
|
||||
$("#element_form").html("");
|
||||
<%= flash_js %>
|
||||
block_js_initialize();
|
||||
|
||||
update_portlet_order();
|
||||
|
||||
|
||||
|
@ -1,18 +1,11 @@
|
||||
//$("#portlet_<%= @portlet.id %>").html("<div id='edit_portlet_content_form'></div>");
|
||||
|
||||
//$("#edit_portlet_content_form").html("<%= escape_javascript(render( :partial => "form")) %>");
|
||||
|
||||
$("#toolbar-text").html("");
|
||||
$("#element_form").html("<%= escape_javascript(render( :partial => "form")) %>");
|
||||
|
||||
|
||||
$("#collapse2").collapse('hide');
|
||||
$("#collapse3").collapse('show');
|
||||
//$(".block_portlets").sortable("disable");
|
||||
|
||||
|
||||
|
||||
open_collapse3();
|
||||
|
||||
<%- cancel_button = escape_javascript(link_to("annuler", portlet_portlet_path(@portlet), :class => "button cancel", :remote => true)); %>
|
||||
|
||||
$("#portlet_<%= @portlet.id %>").find('.buttons ol').prepend('<%= cancel_button %>');
|
||||
|
||||
|
||||
|
@ -1,21 +1,7 @@
|
||||
$("#new_portlet_content_form").html("<%= escape_javascript(render( :partial => "portlet/shared/new")) %>");
|
||||
$("#toolbar-text").html("");
|
||||
$("#element_form").html("<%= escape_javascript(render( :partial => "form")) %>");
|
||||
|
||||
$(".block_portlets").sortable("disable");
|
||||
$("#collapse3 .portlet_handle").data("portlet-id", "");
|
||||
|
||||
open_collapse3();
|
||||
|
||||
|
||||
var first_form_element = $("#new_portlet_content_form input:text:visible:first")
|
||||
if(first_form_element.length == 0){
|
||||
first_form_element = $("#new_portlet_content_form .text_editor:first")
|
||||
|
||||
//first_form_element.tinymce().focus();
|
||||
}
|
||||
|
||||
if(first_form_element.length == 0){
|
||||
first_form_element = $("#new_portlet_content_form textarea:first")
|
||||
}
|
||||
|
||||
|
||||
first_form_element.focus();
|
||||
|
||||
uninitialize_block_js();
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
$("#portlet_<%= @portlet.id %>").replaceWith("<%= escape_javascript(render(@portlet)) %>");
|
||||
$("#portlet_<%= @portlet.id %>").addClass("active")
|
||||
//$("#element_form").html("")
|
||||
//$(".block_portlets").sortable("enable");
|
||||
|
||||
cancel_move_portlet();
|
||||
unselect_portlet();
|
||||
|
||||
<%= flash_js %>
|
@ -15,8 +15,4 @@
|
||||
Style :
|
||||
= f.select :style, TableContent::STYLES
|
||||
|
||||
%br
|
||||
= f.submit "Sauvegarder", :class => "btn btn-primary"
|
||||
|
||||
|
||||
|
@ -1,12 +1,15 @@
|
||||
%p Vous pouvez modifier le contenu directement à l'endroit où vous avez placé votre texte.
|
||||
%p N'oubliez pas de sauvegarder vos modifications avec le bouton ci dessous.
|
||||
|
||||
-if @text_content.id
|
||||
=semantic_form_for( [:portlet, @text_content], :remote => true, :html => {:"data-portlet-id" => @text_content.portlet.id}) do |f|
|
||||
|
||||
%p{:style => "text-align:center;"}= f.submit "Sauvegarder", :class => "btn btn-primary"
|
||||
|
||||
=f.text_area :content, :style => "width:98%;height:600px;", :class => "redactor_content", :style => "display:none;"
|
||||
|
||||
|
||||
|
||||
|
||||
-if TextContent::STYLES.size > 0
|
||||
Style :
|
||||
= f.select :style, TextContent::STYLES
|
||||
@ -16,15 +19,17 @@
|
||||
:javascript
|
||||
$("#element_form form").submit(function (e){
|
||||
|
||||
$("textarea").val($('#portlet_'+$("#element_form form").data("portlet-id")+' .content').html());
|
||||
$("#element_form textarea").val($('#portlet_'+$("#element_form form").data("portlet-id")+' .content').redactor('code.get'));
|
||||
$("#toolbar-text").html("");
|
||||
|
||||
});
|
||||
|
||||
$('#portlet_'+$("#element_form form").data("portlet-id")+' .content').redactor({
|
||||
plugins: ['fontcolor'],
|
||||
focus: true,
|
||||
toolbarExternal: '#toolbar-text',
|
||||
buttons : ['undo','redo','|', 'formatting', '|', 'bold', 'italic', 'deleted','underline','|', 'fontcolor','|', 'alignleft', 'aligncenter', 'alignright', 'justify', '|', 'unorderedlist', 'orderedlist', 'outdent', 'indent', '|', 'table', 'link', '|','fontcolor', 'backcolor','|', 'horizontalrule', '|','html']
|
||||
buttonSource: true,
|
||||
buttons : [ 'html','alignleft', 'aligncenter', 'alignright', 'justify', 'formatting', 'bold', 'italic', 'deleted','underline','unorderedlist', 'orderedlist', 'outdent', 'indent','image', 'file', 'link', 'alignment','fontsize', 'horizontalrule','fontcolor', 'backcolor'],
|
||||
plugins : ['bufferbuttons','fontsize',"fontfamily", 'fontcolor', 'scriptbuttons']
|
||||
|
||||
|
||||
|
||||
@ -33,16 +38,9 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-else
|
||||
=semantic_form_for( [:portlet, @text_content], :remote => true) do |f|
|
||||
|
||||
%p{:style => "text-align:center;"}= f.submit "Sauvegarder", :class => "btn btn-primary"
|
||||
|
||||
=f.text_area :content, :style => "width:98%;height:600px;", :class => "redactor_content"
|
||||
=f.text_area :content, :style => "width:98%;height:600px;", :class => "redactor_content", :style => "display:none;"
|
||||
|
||||
|
||||
|
||||
@ -53,14 +51,23 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
:javascript
|
||||
|
||||
$('.redactor_content').redactor({
|
||||
plugins: ['fontcolor'],
|
||||
$("#new_portlet_form_inline").html('<div class="content"></div>')
|
||||
|
||||
content_element = $('#new_portlet_form_inline .content')
|
||||
|
||||
$("#element_form form").submit(function (e){
|
||||
|
||||
$("#element_form textarea").val(content_element.redactor('code.get'));
|
||||
$("#toolbar-text").html("");
|
||||
|
||||
});
|
||||
|
||||
content_element.redactor({
|
||||
focus: true,
|
||||
toolbarExternal: '#toolbar-text',
|
||||
buttons : ['undo','redo','|', 'formatting', '|', 'bold', 'italic', 'deleted','underline','|', 'fontcolor','|', 'alignleft', 'aligncenter', 'alignright', 'justify', '|', 'unorderedlist', 'orderedlist', 'outdent', 'indent', '|', 'table', 'link', '|','fontcolor', 'backcolor','|', 'horizontalrule', '|','html']
|
||||
buttons : ['undo','redo','|', 'formatting', '|', 'bold', 'italic', 'deleted','underline','|', 'alignleft', 'aligncenter', 'alignright', 'justify', '|', 'unorderedlist', 'orderedlist', 'outdent', 'indent', '|', 'table', 'link', '|','fontcolor', 'backcolor','|', 'horizontalrule', '|','html']
|
||||
|
||||
|
||||
|
||||
@ -69,4 +76,3 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
=semantic_form_for( [:portlet, @title_content], :remote => true) do |f|
|
||||
=semantic_form_for( [:portlet, @title_content], :remote => true, :html => {:"data-portlet-id" => (@title_content.portlet.id if @title_content.portlet)}) do |f|
|
||||
|
||||
=f.text_field :content, :style => "width:98%;", :class => "inputText" if !@title_content.id
|
||||
=f.text_field :content, :style => "width:98%;", :class => "inputText", :style => ("display:none;" if @title_content.id)
|
||||
|
||||
Importance :
|
||||
= f.select :level, TitleContent::LEVELS
|
||||
@ -9,7 +9,26 @@
|
||||
= f.select :style, TitleContent::STYLES
|
||||
%br
|
||||
|
||||
= f.submit "Sauvegarder", :class => "btn btn-primary"
|
||||
-if @title_content.id
|
||||
|
||||
:javascript
|
||||
|
||||
$("#element_form form").submit(function (e){
|
||||
|
||||
$("#element_form #title_content_content").val($('#portlet_'+$("#element_form form").data("portlet-id")+' .title_content_inline').redactor('code.get'));
|
||||
$("#toolbar-text").html("");
|
||||
|
||||
});
|
||||
|
||||
$('#portlet_'+$("#element_form form").data("portlet-id")+' .title_content_inline').redactor({
|
||||
focus: true,
|
||||
toolbarExternal: '#toolbar-text',
|
||||
buttonSource: true,
|
||||
plugins : [ 'fontcolor', 'scriptbuttons'],
|
||||
buttons: [ 'bold', 'italic'],
|
||||
allowedTags: ['sup', "strong", "em", "sub", "span", "br"],
|
||||
linebreaks: true
|
||||
|
||||
|
||||
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user