Sha256: 132d0e811239a14c5ccbe1a2d447c58de2529f5462177fb1c81195ed0f0c1b8f

Contents?: true

Size: 1.13 KB

Versions: 456

Compression:

Stored size: 1.13 KB

Contents

<h1>New role</h1>

<form action='/admin/roles' method='post' id='new_role_form'>
<input type='hidden' name='authenticity_token' value='<%= form_authenticity_token %>' /> 
<p><select name='parent_id'>
  <option value=''>-- Select a parent role --</option>
  <% Caboose::Role.flat_tree(@site.id, ' - ').each do |r| %>
    <option value='<%= r.id %>'><%= r.name %></option>
  <% end %>
</select></p>
<p><input type='text' name='name' id='name' placeholder='Name' value='' style='width: 200px;' /></p>
<div id='message'></div>
<p><input type='submit' value='Add Role' /></p>
</form>

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

$(document).ready(function() {
  $('#new_role_form').submit(function() { add_role(); return false; });
});

function add_role()
{
  $('#message').html("<p class='loading'>Adding role...</p>");
  $.ajax({
    url: '/admin/roles',
    type: 'post',
    data: $('#new_role_form').serialize(),
    success: function(resp) {
      if (resp.error) $('#message').html("<p class='note error'>" + resp.error + "</p>");
      if (resp.redirect) window.location = resp.redirect;    
    }
  });
}

</script>
<% end %>

Version data entries

456 entries across 456 versions & 1 rubygems

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