Sha256: 9110e45178e262d1fbe48c4eae3ca3ed98947218b51138e55a7059b5676b0ab0

Contents?: true

Size: 1010 Bytes

Versions: 3

Compression:

Stored size: 1010 Bytes

Contents

<%=form_for @page,:url => admin_page_path(:id => @page.id),:html=>{:class=>"form-horizontal page_form",:target => "report" } do |f|%>
	<%=render :partial => "form",:locals => {:f => f}%>
    <div class="form-actions">
    	<%=f.submit "Save Page", :class=>"btn btn-primary btn-save",:onclick => "savePage();"%>&nbsp;<%=f.submit "Preview", :class=>"btn btn-info btn-preview"%> or <%=link_to "cancel",admin_pages_path,:class => "btn"%>
    </div>
<%end%>
<br />
<script type="text/javascript">
$(document).ready(function() {
	$('input[type=submit].btn-preview').click(function(evt) {
		
		$(this).button('reset')
		$('#preview').val(1);
		var form = $('form.page_form')[0];
		form.onsubmit = function() {
			window.open('about:blank','preview_window','width=500,height=400')
		};
		form.target = 'preview_window';
		
	});

	$('input[type=submit].btn-save').click(function(evt) {
		$('#preview').val(0);
			var form = $('form.page_form')[0];
			form.onsubmit = null;
			form.target = null;
	});
	
});

</script>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tb_cms-1.0.3 app/views/admin/pages/edit.html.erb
tb_cms-1.0.2 app/views/admin/pages/edit.html.erb
tb_cms-1.0.1 app/views/admin/pages/edit.html.erb