thingspeak/app/views/channels/social_new.html.erb

109 lines
2.9 KiB
Plaintext
Raw Permalink Normal View History

<div id="maincontent" class="thin">
<h2>
<%= link_to t(:channels), channels_path %> &raquo;
<%= t(:social_channel_new) %>
</h2>
2014-08-01 21:57:02 +02:00
<%= form_for @channel, :url => { :action => 'social_create' } do |c| %>
<%= error_messages_for 'channel', :header_message => t(:try_again), :message => t(:channel_error) %>
<input name='userlogin' class='userlogin' />
<table class="table_no_header">
<tr>
<td class="left"><%= t(:channel_name) %></td>
<td><%= c.text_field :name %></td>
</tr>
<tr>
<td class="left"><%= t(:slug) %></td>
<td><%= c.text_field :slug %></td>
</tr>
<tr>
<td class="left"><%= t(:channel_directions) %></td>
2014-08-01 21:57:02 +02:00
<td><%= c.text_area :description, :cols => 30, :rows => 4 %></td>
</tr>
<%= fields_for :tags do |t| %>
<tr>
<td class="left"><%= t(:tags) %></td>
2014-08-01 21:57:02 +02:00
<td><%= t.text_area :name, :cols => 30, :rows => 2, :value => @channel.list_tags %></td>
</tr>
<% end %>
<tr>
<td class="left"><%= t(:field) %> 1</td>
2014-08-01 21:57:02 +02:00
<td><%= c.text_field :field1 %></td>
</tr>
<tr>
<td class="left"><%= t(:field) %> 2</td>
2014-08-01 21:57:02 +02:00
<td><%= c.text_field :field2 %></td>
</tr>
<tr>
<td class="left"><%= t(:field) %> 3</td>
2014-08-01 21:57:02 +02:00
<td><%= c.text_field :field3 %></td>
</tr>
<tr>
<td class="left"><%= t(:field) %> 4</td>
2014-08-01 21:57:02 +02:00
<td><%= c.text_field :field4 %></td>
</tr>
<tr>
<td class="left"><%= t(:field) %> 5</td>
2014-08-01 21:57:02 +02:00
<td><%= c.text_field :field5 %></td>
</tr>
<tr>
<td class="left"><%= t(:field) %> 6</td>
2014-08-01 21:57:02 +02:00
<td><%= c.text_field :field6 %></td>
</tr>
<tr>
<td class="left"><%= t(:field) %> 7</td>
2014-08-01 21:57:02 +02:00
<td><%= c.text_field :field7 %></td>
</tr>
<tr>
<td class="left"><%= t(:field) %> 8</td>
2014-08-01 21:57:02 +02:00
<td><%= c.text_field :field8 %></td>
</tr>
<tr>
<td class="left"><%= t(:message_field) %></td>
2014-08-01 21:57:02 +02:00
<td><%= c.text_field :status %></td>
</tr>
<tr>
<td class="left"></td>
<td><%= c.submit t(:social_channel_create) %></td>
</tr>
</table>
<% end %>
2014-08-01 21:57:02 +02:00
</div>
<div id="sidebar" class="ML60 medium">
<ul>
<li>
<h2><%= t(:help) %></h2>
<%= t(:help_social_channel) %>
2014-03-14 00:16:35 +01:00
<br><br>
<div class="code">http://www.socialsensornetwork.com/<b>slug</b></div>
2014-03-14 00:16:35 +01:00
<br>
<%= t(:help_social_channel_public) %>
</li>
</ul>
</div>
<script type="text/javascript">
// sets the slug field
function slugify() {
$('#channel_slug').val($('#channel_name').val().replace(/ /g, '-').replace(/[^0-9\-a-zA-Z]+/g, '').toLowerCase());
}
// when document is ready
2014-08-01 21:57:02 +02:00
$(document).on('page:load ready', function() {
// events to automatically create slug field
$('#channel_name').keyup(function() {
slugify();
});
$('#channel_name').bind('paste', function() {
slugify();
});
});
2014-08-01 21:57:02 +02:00
</script>