Sha256: e45234093d091d41f9fc858ff0d30fe742c9db843e9ab6ee4d9767dd1029a4db

Contents?: true

Size: 1.38 KB

Versions: 3

Compression:

Stored size: 1.38 KB

Contents

<% page_title "Select template" %>

<div class="list-select-template-widget">
<% if @templates.blank? %>
<span class="nodata">No templates found in "<%= @select_template_prefix %>"</span>
<% end %>
<%
    table @templates, style: 'smart-list-table', html_params: { id: 'listSelectTemplate' }  do
        column :module
        column :filename
    end
%>

</div>

<% form nil, html_params: { class: 'select-template-form' } do %>
<%= button :cancel %>
<%= button :select, onclick: "on_click_select();", id: "btn-select-template", disabled: true %>
<% end %>


<script type="text/javascript">
var list = null;

$(function(){
    list = new SmartListTable( $("#listSelectTemplate").first(), {
        column: 2,
        on_select: on_template_select,
    });
    var selected_template_id = '<%= @select_template_name %>';
    if ( selected_template_id ) {
        list.select( selected_template_id );
    }
});

var template_id = null;
var template_label = null;

function on_template_select( id, object, el ) {
    console.log("template selected: "+id);
    $("#btn-select-template").removeAttr('disabled');
    template_id = id;
    template_label = object.contents;
}
function on_click_select() {
    console.log("clicked Select: id:"+template_id+" label: '"+template_label+"'" );
    admin_modal_select_and_close( { template_id: template_id, template_label: template_label } );
    return false;
}
</script>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
aerogel-pages-1.4.16 views/admin/pages/edit/select_template.html.erb
aerogel-pages-1.4.14 views/admin/pages/edit/select_template.html.erb
aerogel-pages-1.4.12 views/admin/pages/edit/select_template.html.erb