Updated views and styles

This commit is contained in:
iobridge 2011-03-30 00:08:19 -04:00
parent 15cd43d621
commit 524e13877d
9 changed files with 249 additions and 199 deletions

View File

@ -1,35 +1,43 @@
<h2><%= t(:api_key_write) %></h2>
<%= button_to t(:api_key_write_new), channel_api_keys_path(@channel, :write => 1), :confirm => t(:confirm_new_api_key) %>
<br />
<h2>
<%= link_to t(:channels), channels_path %> &raquo;
<%= link_to channel_path(@channel.id) do %> <%= t(:channel) %> <%= @channel.id %><% end %> &raquo;
<%= t(:api_keys) %>
</h2>
<h3><%= t(:api_key_write) %></h3>
<%= @key %>
<br /><br />
<h2><%= t(:api_key_read) %></h2>
<%= button_to t(:api_key_read_new), channel_api_keys_path(@channel, :write => 0), %>
<br />
<%= button_to t(:api_key_write_new), channel_api_keys_path(@channel, :write => 1), :confirm => t(:confirm_new_api_key) %>
<br /><br />
<h3><%= t(:api_key_read) %></h3>
<% @read_keys.each do |read_key| %>
<table>
<tr>
<td><%= t(:api_key_key) %>:</td>
<td><%= read_key.api_key %></td>
</tr>
<tr>
<td class="VAT"><%= t(:note) %>:</td>
<td>
<%= form_for read_key, :as => :api_key, :url => { :controller => 'api_keys', :action => 'update' }, :html => {:method => 'put'} do |f| %>
<%= f.text_area :note, :cols => 30, :rows => 4 %>
</td>
</tr>
<tr>
<td><%= f.hidden_field :api_key, :value => read_key.api_key %></td>
<td>
<div class="FL"><%= f.submit t(:note_save) %></div>
<% end %>
<%= button_to t(:api_key_delete), :controller => 'api_keys', :action => 'destroy', :api_key => read_key.api_key %></td>
</tr>
</table>
<br /><br />
<table>
<tr>
<td><%= t(:api_key_key) %>:</td>
<td><%= read_key.api_key %></td>
</tr>
<tr>
<td class="VAT"><%= t(:note) %>:</td>
<td>
<%= form_for read_key, :as => :api_key, :url => { :controller => 'api_keys', :action => 'update' }, :html => {:method => 'put'} do |f| %>
<%= f.text_area :note, :cols => 30, :rows => 4 %>
</td>
</tr>
<tr>
<td><%= f.hidden_field :api_key, :value => read_key.api_key %></td>
<td>
<div class="FL"><%= f.submit t(:note_save) %></div>
<% end %>
<%= button_to t(:api_key_delete), { :controller => 'api_keys', :action => 'destroy', :api_key => read_key.api_key}, :confirm => t(:confirm_read_key_delete) %></td>
</tr>
</table>
<br /><br />
<% end %>
<%= button_to t(:api_key_read_new), channel_api_keys_path(@channel, :write => 0), %>
<br />

View File

@ -1,67 +1,71 @@
<h2><%= t(:channel_edit) %></h2>
<h2>
<%= link_to t(:channels), channels_path %> &raquo;
<%= link_to channel_path(@channel.id) do %> <%= t(:channel) %> <%= @channel.id %><% end %> &raquo;
<%= t(:edit) %>
</h2>
<%= form_for @channel, :html => {:method => 'put'} do |d| %>
<%= error_messages_for 'channel', :header_message => t(:try_again), :message => t(:channel_error) %>
<input name='userlogin' class='userlogin' />
<table>
<table class="table_no_header">
<tr>
<td><%= t(:channel_name) %></td>
<td class="left"><%= t(:channel_name) %></td>
<td><%= d.text_field :name %></td>
</tr>
<tr>
<td><%= t(:channel_description) %></td>
<td class="left"><%= t(:channel_description) %></td>
<td><%= d.text_field :description %></td>
</tr>
<tr>
<td><%= t(:api_key) %></td>
<td class="left"><%= t(:api_key) %></td>
<td><%= @key %></td>
</tr>
<tr>
<td><%= t(:latitude) %></td>
<td class="left"><%= t(:latitude) %></td>
<td><%= d.text_field :latitude %></td>
</tr>
<tr>
<td><%= t(:longitude) %></td>
<td class="left"><%= t(:longitude) %></td>
<td><%= d.text_field :longitude %></td>
</tr>
<tr>
<td><%= t(:elevation) %></td>
<td class="left"><%= t(:elevation) %></td>
<td><%= d.text_field :elevation %></td>
</tr>
<tr>
<td><%= t(:public) %></td>
<td class="left"><%= t(:public) %></td>
<td><%= d.check_box :public_flag %></td>
</tr>
<tr>
<td><%= t(:field) %> 1</td>
<td class="left"><%= t(:field) %> 1</td>
<td><%= d.text_field :field1, :class => 'field' %></td>
</tr>
<tr>
<td><%= t(:field) %> 2</td>
<td class="left"><%= t(:field) %> 2</td>
<td><%= d.text_field :field2, :class => 'field' %></td>
</tr>
<tr>
<td><%= t(:field) %> 3</td>
<td class="left"><%= t(:field) %> 3</td>
<td><%= d.text_field :field3, :class => 'field' %></td>
</tr>
<tr>
<td><%= t(:field) %> 4</td>
<td class="left"><%= t(:field) %> 4</td>
<td><%= d.text_field :field4, :class => 'field' %></td>
</tr>
<tr>
<td><%= t(:field) %> 5</td>
<td class="left"><%= t(:field) %> 5</td>
<td><%= d.text_field :field5, :class => 'field' %></td>
</tr>
<tr>
<td><%= t(:field) %> 6</td>
<td class="left"><%= t(:field) %> 6</td>
<td><%= d.text_field :field6, :class => 'field' %></td>
</tr>
<tr>
<td><%= t(:field) %> 7</td>
<td class="left"><%= t(:field) %> 7</td>
<td><%= d.text_field :field7, :class => 'field' %></td>
</tr>
<tr>
<td><%= t(:field) %> 8</td>
<td class="left"><%= t(:field) %> 8</td>
<td><%= d.text_field :field8, :class => 'field' %></td>
</tr>
<tr>

View File

@ -1,9 +1,25 @@
<%= form_for :channel do |d| %>
<input name='userlogin' class='userlogin' />
<%= d.submit t(:channel_create) %>
<h2><%= t(:channels) %></h2>
<% if @channels.length > 0 %>
<table class="nicetable">
<tr class="header TAC">
<td><%= t(:channel_id) %></td>
<td><%= t(:channel_name) %></td>
</tr>
<% @channels.each do |d| %>
<tr>
<td class="left"><%= link_to d.id, channel_path(d.id) %></td>
<td><%= link_to d.name, channel_path(d.id) %></td>
</tr>
<% end %>
</table>
<br /><br />
<% end %>
<br />
<% @channels.each do |d| %>
name: <%= link_to d.name, channel_path(d.id) %>
<br />
<% end %>
<%= form_for :channel do |d| %>
<input name='userlogin' class='userlogin' />
<%= d.submit t(:channel_create) %>
<% end %>

View File

@ -1,83 +1,102 @@
<% if current_user %>
<%= link_to t(:channel_edit), edit_channel_path(@channel.id) %>
<br />
<%= link_to t(:api_keys_manage), channel_api_keys_path(@channel) %>
<br />
<%= link_to "#{t(:channel_feed)} (json)", channel_feed_index_path(@channel, :key => @key, :format => :json) %>
<br />
<%= link_to "#{t(:channel_feed)} (xml)", channel_feed_index_path(@channel, :key => @key, :format => :xml) %>
<br />
<h2>
<%= link_to t(:channels), channels_path %> &raquo;
<%= t(:channel) %> <%= @channel.id %>
</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) %>
<br />
<%= link_to "#{t(:charts_view)}", channel_charts_path(@channel) %>
<table>
<tr>
<td><%= t(:channel_name) %>:</td>
<td><%= @channel.name %></td>
</tr>
<tr>
<td><%= t(:api_key) %>:</td>
<td><%= @key %></td>
</tr>
<tr>
<td><%= t(:channel_description) %>:</td>
<td><%= @channel.description %></td>
</tr>
<tr>
<td><%= t(:created) %>:</td>
<td><%= l @channel.created_at, :format => :pretty %></td>
</tr>
<tr>
<td><%= t(:latitude) %>:</td>
<td><%= @channel.latitude %></td>
</tr>
<tr>
<td><%= t(:longitude) %>:</td>
<td><%= @channel.longitude %></td>
</tr>
<tr>
<td><%= t(:elevation) %>:</td>
<td><%= @channel.elevation %></td>
</tr>
<tr>
<td><%= t(:field) %> 1:</td>
<td><%= @channel.field1 %></td>
</tr>
<tr>
<td><%= t(:field) %> 2:</td>
<td><%= @channel.field2 %></td>
</tr>
<tr>
<td><%= t(:field) %> 3:</td>
<td><%= @channel.field3 %></td>
</tr>
<tr>
<td><%= t(:field) %> 4:</td>
<td><%= @channel.field4 %></td>
</tr>
<tr>
<td><%= t(:field) %> 5:</td>
<td><%= @channel.field5 %></td>
</tr>
<tr>
<td><%= t(:field) %> 6:</td>
<td><%= @channel.field6 %></td>
</tr>
<tr>
<td><%= t(:field) %> 7:</td>
<td><%= @channel.field7 %></td>
</tr>
<tr>
<td><%= t(:field) %> 8:</td>
<td><%= @channel.field8 %></td>
</tr>
</table>
<br /><br />
<table class="table_no_header">
<tr>
<td class="left"><%= t(:channel_id) %>:</td>
<td><%= @channel.id %></td>
</tr>
<tr>
<td class="left"><%= t(:channel_name) %>:</td>
<td><%= @channel.name %></td>
</tr>
<tr>
<td class="left"><%= t(:api_key_write) %>:</td>
<td><%= @key %></td>
</tr>
<tr>
<td class="left"><%= t(:channel_description) %>:</td>
<td><%= @channel.description %></td>
</tr>
<tr>
<td class="left"><%= t(:created) %>:</td>
<td><%= l @channel.created_at, :format => :pretty %></td>
</tr>
<tr>
<td class="left"><%= t(:latitude) %>:</td>
<td><%= @channel.latitude %></td>
</tr>
<tr>
<td class="left"><%= t(:longitude) %>:</td>
<td><%= @channel.longitude %></td>
</tr>
<tr>
<td class="left"><%= t(:elevation) %>:</td>
<td><%= @channel.elevation %></td>
</tr>
<% @channel.attribute_names.each do |attr| %>
<% if attr.index('field') and @channel[attr] and !@channel[attr].empty? %>
<tr>
<td class="left"><%= t(:field) %> <%= attr[-1] %>:</td>
<td><%= @channel[attr] %></td>
</tr>
<% end %>
<% end %>
</table>
<% else %>
<% if @channel.public_flag %>
<%= t(:channel_public) %>
<br />
<%= @channel.name %>
<% else %>
<%= t(:channel_not_public) %>
<% end %>
<% if @channel.public_flag %>
<%= t(:channel_public) %>
<br /><br />
<table class="table_no_header">
<tr>
<td class="left"><%= t(:channel_name) %>:</td>
<td><%= @channel.name %></td>
</tr>
<tr>
<td class="left"><%= t(:channel_description) %>:</td>
<td><%= @channel.description %></td>
</tr>
<% @channel.attribute_names.each do |attr| %>
<% if attr.index('field') and @channel[attr] and !@channel[attr].empty? %>
<tr>
<td class="left"><%= t(:field) %> <%= attr[-1] %>:</td>
<td><%= @channel[attr] %></td>
</tr>
<% end %>
<% end %>
</table>
<% @channel.attribute_names.each do |attr| %>
<% if attr.index('field') and @channel[attr] and !@channel[attr].empty? %>
<br /><br />
<iframe width="450" height="250" style="border: 1px solid #cccccc;" src="<%= "#{@domain}channels/#{@channel.id}/charts/#{attr[-1]}" %>"></iframe>
<% end %>
<% end %>
<% else %>
<%= t(:channel_not_public) %>
<% end %>
<% end %>

View File

@ -1,7 +1,5 @@
<% if current_user %>
<%= t(:homepage_logged_in) %>
<% else %>
<%= t(:homepage) %>
<% end %>

View File

@ -1,61 +1,62 @@
<h2><%= t(:account_edit) %></h2>
<br />
<h2>
<%= link_to t(:myaccount), account_path %> &raquo;
<%= t(:account_edit) %>
</h2>
<%= form_for @user, :url => account_path do |f| %>
<%= error_messages_for 'user', :header_message => t(:try_again), :message => t(:account_error_edit) %>
<input name='userlogin' class='userlogin' />
<table class="bigtable">
<tr>
<td class="left">
<div class="vcenter"><%= f.label :login, t(:userid) %></div>
</td>
<td class="right">
<%= f.text_field :login %>
</td>
</tr>
<tr>
<td class="left">
<div class="vcenter"><%= f.label t(:email) %></div>
</td>
<td class="right">
<%= f.text_field :email %>
</td>
</tr>
<tr>
<td><%= t(:time_zone) %></td>
<td><%= time_zone_select 'user', 'time_zone', nil, :default => 'Eastern Time (US & Canada)' %></td>
</tr>
<tr>
<td class="left">
<div class="vcenter"><%= f.label :password, raw(t(:password_change_raw)) %></div>
</td>
<td class="right">
<%= f.password_field :password %>
</td>
<tr>
<td class="left">
<%= f.label :password_confirmation, raw(t(:password_confirmation_raw)) %>
</td>
<td class="right">
<%= f.password_field :password_confirmation %>
</td>
</tr>
</table>
<br /><br />
<h3><%= t(:account_changes) %></h3>
<table class="bigtable">
<tr>
<td class="left">
<%= raw(t(:password_current_raw)) %>
</td>
<td class="right">
<input name="password_current" type="password" />
<br />
<%= t(:account_security) %>
</td>
</tr>
<tr>
<td class="left"></td>
<td class="right"><%= f.submit t(:account_edit_submit) %></td>
</tr>
</table>
<% end %>
<input name='userlogin' class='userlogin' />
<table class="table_no_header">
<tr>
<td class="left">
<div class="vcenter"><%= f.label :login, t(:userid) %></div>
</td>
<td class="right">
<%= f.text_field :login %>
</td>
</tr>
<tr>
<td class="left">
<div class="vcenter"><%= f.label t(:email) %></div>
</td>
<td class="right">
<%= f.text_field :email %>
</td>
</tr>
<tr>
<td class="left"><%= t(:time_zone) %></td>
<td><%= time_zone_select 'user', 'time_zone', nil, :default => 'Eastern Time (US & Canada)' %></td>
</tr>
<tr>
<td class="left">
<div class="vcenter"><%= f.label :password, raw(t(:password_change_raw)) %></div>
</td>
<td class="right">
<%= f.password_field :password %>
</td>
<tr>
<td class="left">
<%= f.label :password_confirmation, raw(t(:password_confirmation_raw)) %>
</td>
<td class="right">
<%= f.password_field :password_confirmation %>
</td>
</tr>
<tr>
<td class="left">
<%= raw(t(:password_current_raw)) %>
</td>
<td class="right">
<input name="password_current" type="password" />
</td>
</tr>
<tr>
<td class="left"></td>
<td class="right"><%= f.submit t(:account_edit_submit) %></td>
</tr>
</table>
<% end %>

View File

@ -1,5 +1,10 @@
<h2><%= t(:account_info) %></h2>
<table class="bigtable styletable">
<%= link_to t(:account_edit), edit_account_path %>
<br /><br />
<table class="table_no_header">
<tr>
<td class="left"><%= t(:userid) %></td>
<td><%= @user.login %></td>
@ -13,7 +18,3 @@
<td><%= @user.time_zone %></td>
</tr>
</table>
<br /><br />
<div class="details">
<%= link_to t(:account_edit), edit_account_path %>
</div>

View File

@ -107,7 +107,7 @@ en:
height: "Height"
home: "Home"
homepage: "ThingSpeak is an Open Internet of Things project by ioBridge."
homepage_logged_in: "Homepage for logged in user!"
homepage_logged_in: ""
latitude: "Latitude"
longitude: "Longitude"
median: "Median"

View File

@ -38,6 +38,9 @@ table { border-collapse: collapse; }
.nicetable .header td { padding-top: 3px; }
.nicetable td { padding: 2px 10px; border-bottom: 1px solid #bbbbbb; }
.nicetable .stripe { background-color: #f9f9f9; }
.table_no_header { font-size: 14px; border: 1px solid #bbbbbb; }
.table_no_header td { padding: 2px 10px; border-bottom: 1px solid #bbbbbb; }
.table_no_header .left { font-weight: bold; }
.pagination { font-size: 14px; }
.centerme { display: table; margin: 0 auto; }
.fixedwidth { width: 990px; display: table; margin: 0 auto; }