Sha256: d91a6352121fea93ea82709275451f058e6a28907e3e9d89ec68ae0cb3f9ab90

Contents?: true

Size: 1.92 KB

Versions: 706

Compression:

Stored size: 1.92 KB

Contents

<h1>Calendars</h1>

<form action='/admin/calendars' method='get' class='search_form'>
<input type='text' name='name_like' placeholder='Name' />
<input type='submit' value='Search' />
</form>

<p><a href='/admin/calendars/new' id='new_calendar'>New Calendar</a></p>

<form action='/admin/calendars' method='post' id='new_calendar_form'>
  <input type='hidden' name='authenticity_token' value='<%= form_authenticity_token %>'>  
  <p><input type='text' name='name' id='name' placeholder='Name' style='width: 500px;'></p>  
  <div id='new_message'></div>
  <p>
    <input type='button' value='Cancel' onclick="$('#new_calendar_form').slideToggle();">
    <input type='submit' value='Add New Calendar' onclick="add_calendar(); return false;">
  </p>
</form>

<% if @calendars.count > 0 %>
  <table class='data'>
    <tr>
      <%= raw @gen.sortable_table_headings({
  				'name'        => 'Name',
  				'description'	=> 'Description'
  			})
  		%>
    </tr>
    <% @calendars.each do |calendar| %>
      <tr onclick="window.location='/admin/calendars/<%= calendar.id %>';">
        <td><%= calendar.name %></td>
        <td><%= calendar.description %></td>    
      </tr>
    <% end %>
  </table>
  <p><%= raw @gen.generate %></p>
<% else %>
  <p>There are no calendars right now.</p>
<% end %>

<% content_for :caboose_js do %>
<script type='text/javascript'>

$(document).ready(function() {
  $('#new_calendar_form').hide();
  $('#new_calendar').click(function(e) {
    e.preventDefault();
    $('#new_calendar_form').slideToggle();
  });
});

function add_calendar() 
{
  $('#new_message').html("<p class='loading'>Adding calendar...</p>");
  $.ajax({
    url: '/admin/calendars',
    type: 'post',
    data: $('#new_calendar_form').serialize(),
    success: function(resp) {
      if (resp.error) $('#new_message').html("<p class='note error'>" + resp.error + "</p>");
      if (resp.redirect) window.location = resp.redirect;
    }
  });
}

</script>
<% end %>

Version data entries

706 entries across 706 versions & 1 rubygems

Version Path
caboose-cms-0.9.229 app/views/caboose/events/admin_index.html.erb
caboose-cms-1.0.2 app/views/caboose/events/admin_index.html.erb
caboose-cms-1.0.1 app/views/caboose/events/admin_index.html.erb
caboose-cms-0.9.228 app/views/caboose/events/admin_index.html.erb
caboose-cms-0.9.227 app/views/caboose/events/admin_index.html.erb
caboose-cms-0.9.226 app/views/caboose/events/admin_index.html.erb
caboose-cms-0.9.225 app/views/caboose/events/admin_index.html.erb
caboose-cms-0.9.224 app/views/caboose/events/admin_index.html.erb
caboose-cms-0.9.223 app/views/caboose/events/admin_index.html.erb
caboose-cms-0.9.222 app/views/caboose/events/admin_index.html.erb
caboose-cms-0.9.221 app/views/caboose/events/admin_index.html.erb
caboose-cms-0.9.220 app/views/caboose/events/admin_index.html.erb
caboose-cms-0.9.219 app/views/caboose/events/admin_index.html.erb
caboose-cms-0.9.218 app/views/caboose/events/admin_index.html.erb
caboose-cms-0.9.217 app/views/caboose/events/admin_index.html.erb
caboose-cms-0.9.216 app/views/caboose/events/admin_index.html.erb
caboose-cms-0.9.215 app/views/caboose/events/admin_index.html.erb
caboose-cms-0.9.214 app/views/caboose/events/admin_index.html.erb
caboose-cms-0.9.213 app/views/caboose/events/admin_index.html.erb
caboose-cms-0.9.212 app/views/caboose/events/admin_index.html.erb