adding csv import to channels

This commit is contained in:
ioBridge
2011-04-05 16:26:52 -04:00
parent 1fd9d38fbd
commit 2194956a33
4 changed files with 179 additions and 7 deletions

View File

@ -0,0 +1,16 @@
<h2>
<%= link_to t(:channels), channels_path %> &raquo;
<%= link_to channel_path(@channel.id) do %> <%= t(:channel) %> <%= @channel.id %><% end %> &raquo;
<%= t(:import) %>
</h2>
<%= t(:upload_select) %>
<br /><br />
<%= form_for :upload, :url => {:controller => 'channels', :action => 'upload', :channel_id => params[:channel_id]}, :html => { :multipart => true } do |f| %>
<%= f.file_field :csv %>
<br /><br />
<%= t(:time_zone) %>
<%= time_zone_select 'feed', 'time_zone', nil, :default => 'UTC' %>
<br /><br />
<%= f.submit t(:upload), :disable_with => t(:uploading) %>
<% end %>

View File

@ -4,13 +4,16 @@
</h2>
<% if current_user && current_user.id == @channel.user_id %>
<%= link_to t(:channel_edit), edit_channel_path(@channel.id) %> |
<%= link_to t(:api_keys_manage), channel_api_keys_path(@channel) %> |
<%= link_to "#{t(:charts_view)}", channel_charts_path(@channel) %> |
<%= link_to "#{t(:channel_feed)} (json)", channel_feed_index_path(@channel, :key => @key, :format => :json) %> |
<%= link_to "#{t(:channel_feed)} (xml)", channel_feed_index_path(@channel, :key => @key, :format => :xml) %> |
<%= link_to "#{t(:channel_feed)} (csv)", channel_feed_index_path(@channel, :key => @key, :format => :csv) %>
<ul>
<li><%= link_to t(:channel_edit), edit_channel_path(@channel.id) %></li>
<li><%= link_to t(:api_keys_manage), channel_api_keys_path(@channel) %></li>
<li><%= link_to "#{t(:charts_view)}", channel_charts_path(@channel) %></li>
<li><%= link_to "#{t(:channel_feed)} (json)", channel_feed_index_path(@channel, :key => @key, :format => :json) %></li>
<li><%= link_to "#{t(:channel_feed)} (xml)", channel_feed_index_path(@channel, :key => @key, :format => :xml) %></li>
<li><%= link_to "#{t(:channel_feed)} (csv)", channel_feed_index_path(@channel, :key => @key, :format => :csv) %></li>
<li><%= link_to t(:import_data), channel_import_path(@channel) %></li>
</ul>
<br /><br />
<table class="table_no_header">
@ -30,6 +33,10 @@
<td class="left"><%= t(:channel_description) %>:</td>
<td><%= @channel.description %></td>
</tr>
<tr>
<td class="left"><%= t(:entries) %>:</td>
<td><%= (@channel.last_entry_id) ? @channel.last_entry_id : '0' %></td>
</tr>
<tr>
<td class="left"><%= t(:created) %>:</td>
<td><%= l @channel.created_at, :format => :pretty %></td>