]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^
+
diff --git a/app/views/channels/_addportlet.html.erb b/app/views/channels/_addportlet.html.erb
new file mode 100644
index 0000000..0aab268
--- /dev/null
+++ b/app/views/channels/_addportlet.html.erb
@@ -0,0 +1,2 @@
+
+
diff --git a/app/views/channels/_channelinfo.html.erb b/app/views/channels/_channelinfo.html.erb
new file mode 100644
index 0000000..e6744ce
--- /dev/null
+++ b/app/views/channels/_channelinfo.html.erb
@@ -0,0 +1,24 @@
+
+
<%= @channel.name %>
+
<%= @channel.list_tags %>
+
+
by <%= link_to @channel.user.login, user_profile_path(@channel.user.login) %>
+
<%= @channel.description %>
+
+
+
+
+ <% unless @channel.url.blank? %>
+
+ <%= link_to t(:for_more_information), @channel.url, :target => '_blank', :class => 'topLink' %>
+
+ <% end %>
+ <% if @mychannel %>
+
+ <% end %>
+
+
diff --git a/app/views/channels/_devinfo.html.erb b/app/views/channels/_devinfo.html.erb
new file mode 100644
index 0000000..44bb3b8
--- /dev/null
+++ b/app/views/channels/_devinfo.html.erb
@@ -0,0 +1,29 @@
+
+
+
+
+
+
diff --git a/app/views/channels/_edit.html.erb b/app/views/channels/_edit.html.erb
new file mode 100644
index 0000000..0d4a397
--- /dev/null
+++ b/app/views/channels/_edit.html.erb
@@ -0,0 +1,174 @@
+
+<% flash.each do |name, msg| %>
+
+<% end %>
+ <%= form_for @channel, :html => {:method => 'put'} do |c| %>
+ <% unless session[:errors].nil?
+ session[:errors].each do |attr, msg|
+ @channel.errors.add(attr, msg)
+ end
+ session[:errors] = nil %>
+ <% end %>
+
+
+ <%= error_messages_for 'channel', :header_message => t(:try_again), :message => t(:channel_error) %>
+
+
+
+ <% end %>
+
+
+
+
<%= t(:channel_clear_message) %>
+ <%= button_to t(:channel_clear), { :controller => 'channels', :action => 'clear', :id => @channel.id }, :data => { :confirm => t(:confirm_channel_clear) } %>
+
+
+
+
<%= t(:channel_delete_message) %>
+ <%= button_to t(:channel_delete), channel_path(@channel.id), :method => 'delete', :data => { :confirm => t(:confirm_channel_delete) } %>
+
+
+
+
diff --git a/app/views/channels/_import.html.erb b/app/views/channels/_import.html.erb
new file mode 100644
index 0000000..4ee45e8
--- /dev/null
+++ b/app/views/channels/_import.html.erb
@@ -0,0 +1,48 @@
+
+ <%= t(:upload_select) %>
+
+<% flash.each do |name, msg| %>
+
+<% end %>
+ <%= form_for :upload, :url => upload_channel_path(@channel), :html => { :multipart => true } do |f| %>
+ <%= f.file_field :csv %>
+
+ <%= t(:time_zone) %>
+ <%= time_zone_select 'feed', 'time_zone', nil, :default => 'UTC' %>
+
+ <%= f.submit t(:upload), :disable_with => t(:uploading) %>
+ <% end %>
+
+
+
+
diff --git a/app/views/channels/_list.html.erb b/app/views/channels/_list.html.erb
new file mode 100644
index 0000000..e9d94da
--- /dev/null
+++ b/app/views/channels/_list.html.erb
@@ -0,0 +1,23 @@
+
+ <% @channels.each do |channel| %>
+
+ <% channel.ranking = channel.calc_ranking if channel.ranking.blank? %>
+
+
+
+ <%= link_to channel.name, channel_path(channel.id), :id => "showsite_#{channel.id}" %>
+
+
by <%= channel.user.login %>
+
<%= channel.description %>
+
+
+ <% channel.tags.each do |tag| %>
+ <%= tag.name %> <% unless tag == channel.tags.last %>, <% end %>
+ <% end %>
+
+
+
+
+ <% end %>
+
+
diff --git a/app/views/channels/_private_show.html.erb b/app/views/channels/_private_show.html.erb
new file mode 100644
index 0000000..148b4f6
--- /dev/null
+++ b/app/views/channels/_private_show.html.erb
@@ -0,0 +1,31 @@
+<%= render :partial => 'channelinfo', :locals => { :zone => "private" } %>
+
+
Channel Stats
+
+ Created <%= @channel.created_at %>
+ Updated <%= @channel.updated_at %>
+
+
<%= @channel.feeds.count %> Entries
+
+
+
diff --git a/app/views/channels/_public_show.html.erb b/app/views/channels/_public_show.html.erb
new file mode 100644
index 0000000..a54e24d
--- /dev/null
+++ b/app/views/channels/_public_show.html.erb
@@ -0,0 +1,75 @@
+<% if @channel.public? %>
+
+<%= render :partial => 'channelinfo', :locals => { :zone => "public" } %>
+
+
+
+
+
+
+<% else %>
+
+
<%= t(:channel_not_public) %>
+
+<% end %>
+
diff --git a/app/views/channels/_socialbuttons.html.erb b/app/views/channels/_socialbuttons.html.erb
new file mode 100644
index 0000000..661f562
--- /dev/null
+++ b/app/views/channels/_socialbuttons.html.erb
@@ -0,0 +1,26 @@
+
+
+
diff --git a/app/views/channels/index.html.erb b/app/views/channels/index.html.erb
index 6ea0d2d..d0011ba 100644
--- a/app/views/channels/index.html.erb
+++ b/app/views/channels/index.html.erb
@@ -1,25 +1,79 @@
-<%= t(:channels) %>
-<% if @channels.length > 0 %>
-
+
+
+
+
+
+
+
+
+ Developers?
+ <%= link_to 'JSON', "#{@api_domain}channels/#{@channel.id}/feed.json?results=100&location=true&offset=0&round=2&status=true" %>
+ <%= link_to 'XML', "#{@api_domain}channels/#{@channel.id}/feed.xml?results=100&location=true&offset=0&round=2&status=true" %>
+ <%= link_to 'CSV', "#{@api_domain}channels/#{@channel.id}/feed.csv?results=100&location=true&offset=0&round=2&status=true" %>
+
+
+
+
+
+
+
+
<%= @channel.name %>
+
+
+
+
+ <% if !@channel.description.blank? %>
+
<%= t(:channel_directions) %>: <%= @channel.description %>
+
+ <% end %>
+
+ <%= form_tag "#{@post_url}" do %>
+
+ <% @fields.each do |f| %>
+
+ <%= @channel[f] %>
+ <%= text_field_tag "#{f}" %>
+
+ <% end %>
+ <% if !@channel.status.blank? %>
+
+ <%= @channel.status %>
+ <%= text_area_tag :status %>
+
+ <% end %>
+
+
+
+
+ <%= submit_tag t(:submit), :id => 'submit' %>
+
+
+
+
+
+ <% end %>
+
+
+
+
+
+
+
+ <% @fields.each do |f| %>
+
+
+ <% end %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/views/channels/watched.html.erb b/app/views/channels/watched.html.erb
new file mode 100644
index 0000000..4cd8108
--- /dev/null
+++ b/app/views/channels/watched.html.erb
@@ -0,0 +1,18 @@
+
-
<%= title %>
-
+
<%= options %>
-
+
-
+
+
+<% if displayconfig %>
+ <%= render :partial => 'charts/display',
+ :locals => {
+ :index => index,
+ :width => @width,
+ :height => @height,
+ :src => src,
+ :options => options
+ }
+ %>
+<% end %>
\ No newline at end of file
+ });
+
+ // event to capture update button click
+ $('#button<%= index %>').click(function() {
+ var width = <%= (@width) ? @width : 450 %>;
+ var height = <%= @height ? @height : 260 %>;
+ updateChart(<%= index %>, true, width, height, <%= @channel.id %>);
+
+ });
+
+
+ $('.mutuallyexclusive<%= index %>').change(function() {
+ selectedValue = $(this).val();
+ $('.mutuallyexclusive<%= index %>').each(function () {
+ $(this).val("");
+ });
+ $(this).val(selectedValue);
+ });
+
+
+
diff --git a/app/views/charts/_display.html.erb b/app/views/charts/_display.html.erb
new file mode 100644
index 0000000..49fb42b
--- /dev/null
+++ b/app/views/charts/_display.html.erb
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+ <%= t(:chart_embed_code) %>:
+
+
+
+
diff --git a/app/views/charts/index.html.erb b/app/views/charts/index.html.erb
index 2e1fe33..c5c7e40 100644
--- a/app/views/charts/index.html.erb
+++ b/app/views/charts/index.html.erb
@@ -1,104 +1,66 @@
-
+
+
+ <%= link_to t(:channels), channels_path %> »
+ <%= link_to channel_path(@channel.id) do %> <%= t(:channel) %> <%= @channel.id %><% end %> »
+ <%= t(:charts) %>
+
+
+ <% 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
+ }
+ %>
+
+ <%= t(:chart_owned) %>
+ <% end %>
+
+ <% @channel.attribute_names.each do |attr| %>
+ <% if attr.index('field') and @channel[attr] and !@channel[attr].empty? %>
+ <%= 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
+ }
+ %>
+
+ <% end %>
+ <% end %>
+
-
- <%= link_to t(:channels), channels_path %> »
- <%= link_to channel_path(@channel.id) do %> <%= t(:channel) %> <%= @channel.id %><% end %> »
- <%= t(:charts) %>
-
-
-<%= render :partial => 'config',
- :locals => {
- :title => t(:chart_example),
- :src => "https://api.thingspeak.com/channels/3/charts/1",
- :options => '×cale=60&round=2',
- :index => 0,
- :width => @width,
- :height => @height
- }
-%>
-
-
<%= t(:chart_owned) %>
-
-<% @channel.attribute_names.each do |attr| %>
- <% if attr.index('field') and @channel[attr] and !@channel[attr].empty? %>
-
- <%= render :partial => 'config',
- :locals => {
- :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
- }
- %>
-
- <% end %>
-<% end %>
+
\ No newline at end of file
+
diff --git a/app/views/charts/show.html.erb b/app/views/charts/show.html.erb
index b279c01..d1d1245 100644
--- a/app/views/charts/show.html.erb
+++ b/app/views/charts/show.html.erb
@@ -1,89 +1,127 @@
-
-
-
-
-
+ <%= javascript_include_tag 'application' %>
- $(document).ready(function() {
- // blank array for holding chart data
- var chartData = [];
- // variable for the local date in milliseconds
- var localDate;
- // variable for the last date added to the chart
- var last_date;
+
;'>
+
diff --git a/app/views/comments/_comment.html.erb b/app/views/comments/_comment.html.erb
new file mode 100644
index 0000000..ee2ba90
--- /dev/null
+++ b/app/views/comments/_comment.html.erb
@@ -0,0 +1,45 @@
+
>
+
+ <%= render :partial => 'comments/comment', :collection => comment.children %>
+
+
diff --git a/app/views/docs/_response.html.erb b/app/views/docs/_response.html.erb
new file mode 100644
index 0000000..edff5c3
--- /dev/null
+++ b/app/views/docs/_response.html.erb
@@ -0,0 +1,5 @@
+
+ Response in:
+ TEXT JSON XML
+
+
diff --git a/app/views/docs/index.html.erb b/app/views/docs/index.html.erb
new file mode 100644
index 0000000..c88aa0d
--- /dev/null
+++ b/app/views/docs/index.html.erb
@@ -0,0 +1,4 @@
+
+ welcome
+
+
diff --git a/app/views/feed/debug.html.erb b/app/views/feed/debug.html.erb
new file mode 100644
index 0000000..f36242c
--- /dev/null
+++ b/app/views/feed/debug.html.erb
@@ -0,0 +1,11 @@
+<%= @count %> records processed
+
+<%= @time_start %> => start controller
+
+<%= @time_after_db %> => after database operations (<%= @time_after_db - @time_start %> seconds)
+
+<%= @time_after_sort %> => after sorting (<%= @time_after_sort - @time_after_db %> seconds)
+
+<%= @time_after_json %> => after to_json is processed (<%= @time_after_json - @time_after_sort %> seconds)
+
+<%= Time.now %> => after view output (<%= Time.now - @time_after_json %> seconds)
\ No newline at end of file
diff --git a/app/views/feed/index.csv.erb b/app/views/feed/index.csv.erb
index 0bbbd25..dac5bb8 100644
--- a/app/views/feed/index.csv.erb
+++ b/app/views/feed/index.csv.erb
@@ -1,2 +1,2 @@
-<% if @success %><%= CSV.generate_line @csv_headers %><% @feed_output.each do |feed| %><% row = [] %><% @csv_headers.each do |attr| %><% row.push(feed.send(attr)) %><% end %><%= CSV.generate_line row %><% end %><% else %>-1<% end %>
+<% if @success %><%= CSV.generate_line @csv_headers %><% @feed_output.each do |feed| %><% row = [] %><% @csv_headers.each do |attr| %><% row.push(feed.send(attr)) %><% end %><%= CSV.generate_line(row).html_safe %><% end %><% else %>-1<% end %>
diff --git a/app/views/feed/index.html.erb b/app/views/feed/index.html.erb
index d19c639..088f036 100644
--- a/app/views/feed/index.html.erb
+++ b/app/views/feed/index.html.erb
@@ -1 +1 @@
-<%= render :partial => 'index.json.erb' %>
\ No newline at end of file
+<%= render :partial => 'feed/index.json.erb' %>
\ No newline at end of file
diff --git a/app/views/headers/_fields.html.erb b/app/views/headers/_fields.html.erb
new file mode 100644
index 0000000..a2810a3
--- /dev/null
+++ b/app/views/headers/_fields.html.erb
@@ -0,0 +1,14 @@
+
+
+
+ <%= t(:thinghttp_header_name) %>
+ <%= header.text_field :name, :class => 'form-control input-sm' %>
+
+ <%= t(:thinghttp_header_value) %>
+ <%= header.text_field :value, :class => 'form-control input-sm' %>
+ <%= header.link_to_remove t(:thinghttp_header_remove) %>
+
+
+
+
+
diff --git a/app/views/layouts/_footer.html.erb b/app/views/layouts/_footer.html.erb
new file mode 100644
index 0000000..e04d0c8
--- /dev/null
+++ b/app/views/layouts/_footer.html.erb
@@ -0,0 +1,20 @@
+
+
diff --git a/app/views/layouts/_ga.html.erb b/app/views/layouts/_ga.html.erb
new file mode 100644
index 0000000..0f10532
--- /dev/null
+++ b/app/views/layouts/_ga.html.erb
@@ -0,0 +1,12 @@
+
+
diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb
index 0aaa2ff..86e1ebd 100644
--- a/app/views/layouts/_header.html.erb
+++ b/app/views/layouts/_header.html.erb
@@ -1,12 +1,68 @@
-
- <% if current_user %>
-
<%= link_to t(:signout), logout_path, :method => 'delete' %>
- <% else %>
-
- <%= link_to t(:signup), new_user_path %>
-
-
<%= link_to t(:signin), login_path %>
- <% end %>
+
+
+
+
+
+
+ <% if current_user %>
+
+ dropdown">
+ <%=t(:channels)%>
+
+
+ ><%= link_to t(:plugins), plugins_path %>
+ dropdown">
+ <%=t(:account)%>
+
+
+
+ <% else %>
+ ><%= link_to t(:channels), public_channels_path %>
+ ><%= link_to t(:features), features_pages_path %>
+ <% end %>
+
+
+
+
+
+ <%=t(:support)%>
+
+
+
+ <%= t(:blog)%>
+
+ <% if current_user %>
+ <%= link_to t(:signout), logout_path %>
+ <% else %>
+ <%= link_to t(:signin), login_path %>
+ <%= link_to t(:signup), new_account_path %>
+ <% end %>
+
+
+
+
-
<%= link_to t(:application_name), root_path %>
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index c6d20f8..9929d8c 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -1,16 +1,34 @@
-
-
<%= @title.nil? ? (@menu.nil? ? t(:application_name) : @menu.capitalize + ' - ' + t(:application_name)) : @title + ' - ' + t(:application_name) %>
- <%= stylesheet_link_tag "application" %>
- <%= javascript_include_tag "application" %>
- <%= csrf_meta_tag %>
-
-
-
-
+
+
<%= @title.nil? ? (@menu.nil? ? 'ThingSpeak' : @menu.capitalize + ' - ThingSpeak') : @title + ' - ThingSpeak' %>
+
+ <%= stylesheet_link_tag 'application' %>
+
+
+
+
+ <%= javascript_include_tag 'application' %>
+
+ <%= csrf_meta_tag %>
+ <% if Rails.env == 'production' %>
+ <%= render 'layouts/ga' %>
+ <% end %>
+
+ <%= yield :head %>
+
+
+
+
+
+ <%= render 'layouts/header' %>
+
+ <%= yield %>
+
+
+
+ <%= render 'layouts/footer' %>
+
+
+
diff --git a/app/views/mailer/password_reset.html.erb b/app/views/mailer/password_reset.html.erb
index 3707c0e..e22845e 100644
--- a/app/views/mailer/password_reset.html.erb
+++ b/app/views/mailer/password_reset.html.erb
@@ -5,13 +5,13 @@
- <%= t(:password_reset_message1) %>
-
- <%= t(:password_reset_message2) %>
-
- <%= t(:password_reset_message3) %>
-
- <%= @webpage %>
+ <%= t(:password_reset_message1) %>
+
+ <%= t(:password_reset_message2) %>
+
+ <%= t(:password_reset_message3) %>
+
+ <%= @webpage %>
+