From 524e13877d868f8af4ef8623b815c5a54c687383 Mon Sep 17 00:00:00 2001 From: iobridge Date: Wed, 30 Mar 2011 00:08:19 -0400 Subject: [PATCH] Updated views and styles --- app/views/api_keys/index.html.erb | 62 ++++++----- app/views/channels/edit.html.erb | 38 ++++--- app/views/channels/index.html.erb | 32 ++++-- app/views/channels/show.html.erb | 179 +++++++++++++++++------------- app/views/pages/home.html.erb | 2 - app/views/users/edit.html.erb | 119 ++++++++++---------- app/views/users/show.html.erb | 11 +- config/locales/en.yml | 2 +- public/stylesheets/custom.css | 3 + 9 files changed, 249 insertions(+), 199 deletions(-) diff --git a/app/views/api_keys/index.html.erb b/app/views/api_keys/index.html.erb index 23ac5c4..d006feb 100644 --- a/app/views/api_keys/index.html.erb +++ b/app/views/api_keys/index.html.erb @@ -1,35 +1,43 @@ -

<%= t(:api_key_write) %>

-<%= button_to t(:api_key_write_new), channel_api_keys_path(@channel, :write => 1), :confirm => t(:confirm_new_api_key) %> -
+

+ <%= link_to t(:channels), channels_path %> » + <%= link_to channel_path(@channel.id) do %> <%= t(:channel) %> <%= @channel.id %><% end %> » + <%= t(:api_keys) %> +

+ +

<%= t(:api_key_write) %>

<%= @key %>

-

<%= t(:api_key_read) %>

-<%= button_to t(:api_key_read_new), channel_api_keys_path(@channel, :write => 0), %> -
+<%= button_to t(:api_key_write_new), channel_api_keys_path(@channel, :write => 1), :confirm => t(:confirm_new_api_key) %> +

+ +

<%= t(:api_key_read) %>

<% @read_keys.each do |read_key| %> - - - - - - - - - - - - - -
<%= t(:api_key_key) %>:<%= read_key.api_key %>
<%= t(:note) %>: - <%= 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 %> -
<%= f.hidden_field :api_key, :value => read_key.api_key %> -
<%= f.submit t(:note_save) %>
- <% end %> - <%= button_to t(:api_key_delete), :controller => 'api_keys', :action => 'destroy', :api_key => read_key.api_key %>
-

+ + + + + + + + + + + + + +
<%= t(:api_key_key) %>:<%= read_key.api_key %>
<%= t(:note) %>: + <%= 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 %> +
<%= f.hidden_field :api_key, :value => read_key.api_key %> +
<%= f.submit t(:note_save) %>
+ <% end %> + <%= button_to t(:api_key_delete), { :controller => 'api_keys', :action => 'destroy', :api_key => read_key.api_key}, :confirm => t(:confirm_read_key_delete) %>
+

<% end %> + +<%= button_to t(:api_key_read_new), channel_api_keys_path(@channel, :write => 0), %> +
diff --git a/app/views/channels/edit.html.erb b/app/views/channels/edit.html.erb index 6f97202..974158e 100644 --- a/app/views/channels/edit.html.erb +++ b/app/views/channels/edit.html.erb @@ -1,67 +1,71 @@ -

<%= t(:channel_edit) %>

+

+ <%= link_to t(:channels), channels_path %> » + <%= link_to channel_path(@channel.id) do %> <%= t(:channel) %> <%= @channel.id %><% end %> » + <%= t(:edit) %> +

<%= form_for @channel, :html => {:method => 'put'} do |d| %> <%= error_messages_for 'channel', :header_message => t(:try_again), :message => t(:channel_error) %> - +
- + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/app/views/channels/index.html.erb b/app/views/channels/index.html.erb index 0639dbf..6ea0d2d 100644 --- a/app/views/channels/index.html.erb +++ b/app/views/channels/index.html.erb @@ -1,9 +1,25 @@ -<%= form_for :channel do |d| %> - - <%= d.submit t(:channel_create) %> +

<%= t(:channels) %>

+<% if @channels.length > 0 %> +
<%= t(:channel_name) %><%= t(:channel_name) %> <%= d.text_field :name %>
<%= t(:channel_description) %><%= t(:channel_description) %> <%= d.text_field :description %>
<%= t(:api_key) %><%= t(:api_key) %> <%= @key %>
<%= t(:latitude) %><%= t(:latitude) %> <%= d.text_field :latitude %>
<%= t(:longitude) %><%= t(:longitude) %> <%= d.text_field :longitude %>
<%= t(:elevation) %><%= t(:elevation) %> <%= d.text_field :elevation %>
<%= t(:public) %><%= t(:public) %> <%= d.check_box :public_flag %>
<%= t(:field) %> 1<%= t(:field) %> 1 <%= d.text_field :field1, :class => 'field' %>
<%= t(:field) %> 2<%= t(:field) %> 2 <%= d.text_field :field2, :class => 'field' %>
<%= t(:field) %> 3<%= t(:field) %> 3 <%= d.text_field :field3, :class => 'field' %>
<%= t(:field) %> 4<%= t(:field) %> 4 <%= d.text_field :field4, :class => 'field' %>
<%= t(:field) %> 5<%= t(:field) %> 5 <%= d.text_field :field5, :class => 'field' %>
<%= t(:field) %> 6<%= t(:field) %> 6 <%= d.text_field :field6, :class => 'field' %>
<%= t(:field) %> 7<%= t(:field) %> 7 <%= d.text_field :field7, :class => 'field' %>
<%= t(:field) %> 8<%= t(:field) %> 8 <%= d.text_field :field8, :class => 'field' %>
+ + + + + + <% @channels.each do |d| %> + + + + + <% end %> + +
<%= t(:channel_id) %><%= t(:channel_name) %>
<%= link_to d.id, channel_path(d.id) %><%= link_to d.name, channel_path(d.id) %>
+ +

+ <% end %> -
-<% @channels.each do |d| %> - name: <%= link_to d.name, channel_path(d.id) %> -
-<% end %> \ No newline at end of file + +<%= form_for :channel do |d| %> + + <%= d.submit t(:channel_create) %> +<% end %> \ No newline at end of file diff --git a/app/views/channels/show.html.erb b/app/views/channels/show.html.erb index 0a5263f..87c9de1 100644 --- a/app/views/channels/show.html.erb +++ b/app/views/channels/show.html.erb @@ -1,83 +1,102 @@ -<% if current_user %> - <%= link_to t(:channel_edit), edit_channel_path(@channel.id) %> -
- <%= link_to t(:api_keys_manage), channel_api_keys_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(:channels), channels_path %> » + <%= t(:channel) %> <%= @channel.id %> +

+ +<% 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) %> -
- <%= link_to "#{t(:charts_view)}", channel_charts_path(@channel) %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
<%= t(:channel_name) %>:<%= @channel.name %>
<%= t(:api_key) %>:<%= @key %>
<%= t(:channel_description) %>:<%= @channel.description %>
<%= t(:created) %>:<%= l @channel.created_at, :format => :pretty %>
<%= t(:latitude) %>:<%= @channel.latitude %>
<%= t(:longitude) %>:<%= @channel.longitude %>
<%= t(:elevation) %>:<%= @channel.elevation %>
<%= t(:field) %> 1:<%= @channel.field1 %>
<%= t(:field) %> 2:<%= @channel.field2 %>
<%= t(:field) %> 3:<%= @channel.field3 %>
<%= t(:field) %> 4:<%= @channel.field4 %>
<%= t(:field) %> 5:<%= @channel.field5 %>
<%= t(:field) %> 6:<%= @channel.field6 %>
<%= t(:field) %> 7:<%= @channel.field7 %>
<%= t(:field) %> 8:<%= @channel.field8 %>
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <% @channel.attribute_names.each do |attr| %> + <% if attr.index('field') and @channel[attr] and !@channel[attr].empty? %> + + + + + + + <% end %> + <% end %> + +
<%= t(:channel_id) %>:<%= @channel.id %>
<%= t(:channel_name) %>:<%= @channel.name %>
<%= t(:api_key_write) %>:<%= @key %>
<%= t(:channel_description) %>:<%= @channel.description %>
<%= t(:created) %>:<%= l @channel.created_at, :format => :pretty %>
<%= t(:latitude) %>:<%= @channel.latitude %>
<%= t(:longitude) %>:<%= @channel.longitude %>
<%= t(:elevation) %>:<%= @channel.elevation %>
<%= t(:field) %> <%= attr[-1] %>:<%= @channel[attr] %>
+ <% else %> - <% if @channel.public_flag %> - <%= t(:channel_public) %> -
- <%= @channel.name %> - <% else %> - <%= t(:channel_not_public) %> - <% end %> + <% if @channel.public_flag %> + <%= t(:channel_public) %> +

+ + + + + + + + + + + <% @channel.attribute_names.each do |attr| %> + <% if attr.index('field') and @channel[attr] and !@channel[attr].empty? %> + + + + + + + <% end %> + <% end %> + +
<%= t(:channel_name) %>:<%= @channel.name %>
<%= t(:channel_description) %>:<%= @channel.description %>
<%= t(:field) %> <%= attr[-1] %>:<%= @channel[attr] %>
+ + <% @channel.attribute_names.each do |attr| %> + <% if attr.index('field') and @channel[attr] and !@channel[attr].empty? %> + +

+ + + <% end %> + <% end %> + <% else %> + <%= t(:channel_not_public) %> + <% end %> + <% end %> \ No newline at end of file diff --git a/app/views/pages/home.html.erb b/app/views/pages/home.html.erb index 321e673..9a5b16a 100644 --- a/app/views/pages/home.html.erb +++ b/app/views/pages/home.html.erb @@ -1,7 +1,5 @@ <% if current_user %> <%= t(:homepage_logged_in) %> <% else %> - <%= t(:homepage) %> - <% end %> \ No newline at end of file diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index 2ff7aaf..687bf3d 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -1,61 +1,62 @@ -

<%= t(:account_edit) %>

-
+

+ <%= link_to t(:myaccount), account_path %> » + <%= t(:account_edit) %> +

+ <%= form_for @user, :url => account_path do |f| %> <%= error_messages_for 'user', :header_message => t(:try_again), :message => t(:account_error_edit) %> - - - - - - - - - - - - - - - - - - - - - -
-
<%= f.label :login, t(:userid) %>
-
- <%= f.text_field :login %> -
-
<%= f.label t(:email) %>
-
- <%= f.text_field :email %> -
<%= t(:time_zone) %><%= time_zone_select 'user', 'time_zone', nil, :default => 'Eastern Time (US & Canada)' %>
-
<%= f.label :password, raw(t(:password_change_raw)) %>
-
- <%= f.password_field :password %> -
- <%= f.label :password_confirmation, raw(t(:password_confirmation_raw)) %> - - <%= f.password_field :password_confirmation %> -
-

-

<%= t(:account_changes) %>

- - - - - - - - - -
- <%= raw(t(:password_current_raw)) %> - - -
- <%= t(:account_security) %> -
<%= f.submit t(:account_edit_submit) %>
-<% end %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
<%= f.label :login, t(:userid) %>
+
+ <%= f.text_field :login %> + +
+
<%= f.label t(:email) %>
+
+ <%= f.text_field :email %> +
<%= t(:time_zone) %><%= time_zone_select 'user', 'time_zone', nil, :default => 'Eastern Time (US & Canada)' %>
+
<%= f.label :password, raw(t(:password_change_raw)) %>
+
+ <%= f.password_field :password %> +
+ <%= f.label :password_confirmation, raw(t(:password_confirmation_raw)) %> + + <%= f.password_field :password_confirmation %> + +
+ <%= raw(t(:password_current_raw)) %> + + +
<%= f.submit t(:account_edit_submit) %>
+<% end %> \ No newline at end of file diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 30353ed..df22620 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -1,5 +1,10 @@

<%= t(:account_info) %>

- + +<%= link_to t(:account_edit), edit_account_path %> + +

+ +
@@ -13,7 +18,3 @@
<%= t(:userid) %> <%= @user.login %><%= @user.time_zone %>
-

-
- <%= link_to t(:account_edit), edit_account_path %> -
diff --git a/config/locales/en.yml b/config/locales/en.yml index a0365ed..49a99be 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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" diff --git a/public/stylesheets/custom.css b/public/stylesheets/custom.css index 02752a7..1737350 100644 --- a/public/stylesheets/custom.css +++ b/public/stylesheets/custom.css @@ -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; }