2014-02-17 18:05:39 +01:00
|
|
|
<div id="maincontent">
|
|
|
|
<h2>
|
|
|
|
<%= link_to t(:channels), channels_path %> »
|
|
|
|
<%= link_to channel_path(@channel.id) do %> <%= t(:channel) %> <%= @channel.id %><% end %> »
|
|
|
|
<%= t(:charts) %>
|
|
|
|
</h2>
|
|
|
|
|
|
|
|
<% if !@channel.active? %>
|
|
|
|
<%= render :partial => 'config',
|
|
|
|
:locals => {
|
|
|
|
:displayconfig => true,
|
|
|
|
:title => t(:chart_example),
|
|
|
|
:src => "https://api.thingspeak.com/channels/3/charts/1",
|
|
|
|
:options => '×cale=60&round=2',
|
|
|
|
:index => 0,
|
|
|
|
:width => @width,
|
|
|
|
:height => @height
|
|
|
|
}
|
|
|
|
%>
|
|
|
|
|
|
|
|
<h3><%= t(:chart_owned) %></h3>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<% @channel.attribute_names.each do |attr| %>
|
|
|
|
<% if attr.index('field') and @channel[attr] and !@channel[attr].empty? %>
|
2014-02-28 19:57:58 +01:00
|
|
|
|
2014-02-17 18:05:39 +01:00
|
|
|
<%= render :partial => 'config',
|
|
|
|
:locals => {
|
|
|
|
:displayconfig => true,
|
|
|
|
:title => "#{@channel.name} - #{@channel[attr]}",
|
|
|
|
:src => "#{@domain}channels/#{@channel_id}/charts/#{attr[-1]}",
|
|
|
|
:options => @channel["options#{attr[-1]}"],
|
|
|
|
:index => attr[-1],
|
|
|
|
:width => @width,
|
|
|
|
:height => @height
|
|
|
|
}
|
|
|
|
%>
|
2014-02-28 19:57:58 +01:00
|
|
|
|
2014-02-17 18:05:39 +01:00
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="sidebar">
|
|
|
|
<ul>
|
|
|
|
<li>
|
2014-02-28 19:57:58 +01:00
|
|
|
<div class="helplink">(<a href="/docs/charts"><%= t(:help_options) %></a>)</div>
|
2014-02-17 18:05:39 +01:00
|
|
|
<h2><%= t(:help_charts) %></h2>
|
|
|
|
<%= t(:help_charts_options) %>
|
2014-03-14 00:16:35 +01:00
|
|
|
<br><br>
|
2014-02-17 18:05:39 +01:00
|
|
|
<%= t(:help_charts_embed) %>
|
2014-03-14 00:16:35 +01:00
|
|
|
<br><br>
|
2014-02-17 18:05:39 +01:00
|
|
|
• <a href="http://community.thingspeak.com/tutorials/wordpress/how-to-embed-a-thingspeak-chart-on-your-wordpress-blog/">WordPress Tutorial</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2011-03-27 22:56:15 +02:00
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
2014-07-23 19:45:15 +02:00
|
|
|
$(document).on('page:load ready', function() {
|
2014-02-17 18:05:39 +01:00
|
|
|
// if chrome/safari error occurs, reload page
|
|
|
|
if ($('#title0').val() == '60' && $('#color0').val() == '10') {
|
|
|
|
window.location.reload();
|
|
|
|
}
|
|
|
|
});
|
2011-03-27 22:56:15 +02:00
|
|
|
|
2014-02-17 18:05:39 +01:00
|
|
|
</script>
|
2014-02-28 19:57:58 +01:00
|
|
|
|