orbit4-5/app/views/page_parts/edit.html.erb

52 lines
1.6 KiB
Plaintext
Raw Normal View History

<%#= form_for @part, url: {action: "update"} do |f| %>
<%#= f.hidden_field :page_part_id, value: @part.id.to_s %>
<%#= render :partial => "form", :locals => { :f => f } %>
<%# end %>
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "lib/main-forms" %>
<% end %>
<%= form_for @part, url: {action: "update"}, :remote=>true, html: { class: "form-horizontal main-forms"} do |f| %>
2014-04-01 07:10:21 +00:00
<%= f.hidden_field :page_part_id, value: @part.id.to_s %>
<%= render :partial => "form", :locals => { :f => f } %>
<% end %>
<script>
$('.btn-group input[type="radio"]').each(function(index, el) {
if($(this).prop('checked')) {
$(this).closest('label').addClass('active');
$("#" + $(this).val()).addClass('active');
}
});
$('.btn-group').on("click", 'label', function(event) {
$(this).find('input').prop('checked', true);
event.preventDefault();
});
$("#public_r_tag").on("change", "#tag_list select", function() {
$.getScript($(this).attr('rel') + '?type=' + $(this).val() + "&id=" + "<%= @part.id %>" );
});
</script>
<script>
function toggleChecked(status) {
$(".checkbox").each( function() {
$(this).attr("checked",status);
})
}
</script>
2014-04-01 07:10:21 +00:00
<script type="text/javascript">
// $("select.module_name").on("change",function(){
// var select = $(this);
// if(select.val()){
// $.ajax({
// url : "/page_parts/getwidgets",
// dataType : "html",
// data : {"module" : select.val(),"number_of_select" : select.data("number").replace("pp_","")},
// type : "get"
// }).done(function(html){
// $("span[for=" + select.data("number") + "]").html(html);
// })
// }
// })
2014-04-01 07:10:21 +00:00
</script>