- <%= link_to payment.user.name_with_payee_and_member_level, payment.user unless payment.user.blank? %> |
- <%= payment.human_date %> |
+ <%= payment.user.payee unless payment.user.blank? %> |
+ <%= link_to payment.user.name, payment.user unless payment.user.blank? %> |
+ <%= payment.user.member_level_string unless payment.user.blank? %> |
+ <%= payment.date %> |
<%= payment.amount %> |
<%= link_to 'Details', payment %> |
<%= link_to 'Edit', edit_payment_path(payment) %> |
diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb
index 73140e4..963bfb9 100644
--- a/app/views/users/_form.html.erb
+++ b/app/views/users/_form.html.erb
@@ -23,6 +23,8 @@
<%= f.label :email %>
<%= f.email_field :email %>
+ <%= f.check_box :email_visible %>
+ <%= f.label :email_visible, "Show Email to All Members?" %>
<% if @user.id.blank? || !params[:password].nil? %>
<% end %>
+
+ <%= f.label :phone %>
+ <%= f.text_field :phone %>
+ <%= f.check_box :phone_visible %>
+ <%= f.label :phone_visible, "Show Phone to All Members?" %>
+
+
+ <%= f.label :twitter_url %>
+ <%= f.text_field :twitter_url, :placeholder => "https://twitter.com/heatsynclabs" %>
+ <%= f.label :facebook_url %>
+ <%= f.text_field :facebook_url, :placeholder => "https://www.facebook.com/HeatSyncLabs" %>
+ <%= f.label :github_url %>
+ <%= f.text_field :github_url, :placeholder => "https://github.com/heatsynclabs" %>
+ <%= f.label :website_url %>
+ <%= f.text_field :website_url, :placeholder => "http://www.heatsynclabs.org" %>
+
<%= f.label :waiver %>
<%= f.date_select :waiver, :include_blank => 'true', :default => 'nil' %>
@@ -69,10 +87,6 @@
<%= f.label :payee %>
<%= f.text_field :payee%>
-
- <%= f.label :phone %>
- <%= f.text_field :phone %>
-
<%= f.label :current_skills, "What skills, knowledge and experience do you bring to the community?" %>
<%= f.text_area :current_skills %>
@@ -85,6 +99,10 @@
<%= f.label :marketing_source, "How'd you find out about HeatSync?" %>
<%= f.text_area :marketing_source %>
+
+ <%= f.label :exit_reason, "Reason for Leaving" %>
+ <%= f.text_area :exit_reason %>
+
<%= f.label :instructor, "Instructor?" %>
<%= f.check_box :instructor %>
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
index fe5e953..c3c60c9 100644
--- a/app/views/users/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -1,31 +1,43 @@
<%= image_tag @user.gravatar_url(:default => "http://members.heatsynclabs.org/assets/nil.png") %>
+
+ <%= raw(@user.member_status_symbol) %>
+ <%= link_to image_tag 'twitter.png', @user.twitter_url if @user.twitter_url.present? %>
+ <%= link_to image_tag 'facebook.png', @user.facebook_url if @user.facebook_url.present? %>
+ <%= link_to image_tag 'github.png', @user.github_url if @user.github_url.present? %>
+ <%= link_to image_tag 'website.png', @user.website_url if @user.website_url.present? %>
+
+
Name:
<%= @user.name %>
+<% if current_user.admin? || @user.email_visible %>
+
+ Email:
+ <%= @user.email %>
+
+<% end %>
+
+<% if current_user.admin? || @user.phone_visible %>
+
+ Phone:
+ <%= @user.phone %>
+
+<% end %>
+
Waiver?
<%= @user.waiver.strftime("%B %d %Y") unless @user.waiver.blank? %>
-
- Current Member?
- <%= raw(@user.member_status_symbol) %>
-
-
Instructor?
<%= @user.instructor? %>
<% if current_user.admin? then %>
-
- Email:
- <%= @user.email %>
-
-
Orientation?
<%= @user.orientation.strftime("%B %d %Y") unless @user.orientation.blank? %>
@@ -44,7 +56,7 @@
Desired Member Level:
- <%= @user.member_level %>
+ <%= @user.member_level_string %>
Payment Method:
@@ -54,10 +66,6 @@
Payee:
<%= @user.payee %>
-
- Phone:
- <%= @user.phone %>
-
<% end %>
Current Skills:
@@ -72,6 +80,10 @@
Found HeatSync via:
<%= simple_format @user.marketing_source %>
+
+ Left HeatSync because:
+ <%= simple_format @user.exit_reason %>
+
<% end %>
Card: <%= link_to "+ Add", (new_card_path+"?user="+@user.id.to_s), :class => 'btn' if can? :create, Card %>
@@ -94,16 +106,24 @@
<% if @user.certifications.blank? %>
n/a<% end %>
-<% if current_user.admin? then %>
- Payments:
-
- <% @payments.each do |payment| %>
- - <%= payment.date %>
+ <% if current_user.admin? then %>
+ Payments:
+
+ <% @payments.each do |payment| %>
+ - <%= link_to payment.date, payment %>
+ <% end %>
+
+ <% else %>
+ Last Payment:
+ <% last_payment = @user.delinquency %>
+ <% if last_payment < 30 %>
+ Less than a month ago
+ <% else %>
+ <%= last_payment/30 %> months ago
+ <% end %>
<% end %>
-
-<% end %>
<% if current_user.admin? then %>
diff --git a/db/migrate/20130829070500_add_exit_reason_to_users.rb b/db/migrate/20130829070500_add_exit_reason_to_users.rb
new file mode 100644
index 0000000..46e238d
--- /dev/null
+++ b/db/migrate/20130829070500_add_exit_reason_to_users.rb
@@ -0,0 +1,5 @@
+class AddExitReasonToUsers < ActiveRecord::Migration
+ def change
+ add_column :users, :exit_reason, :string
+ end
+end
diff --git a/db/migrate/20130829074549_add_social_media_to_users.rb b/db/migrate/20130829074549_add_social_media_to_users.rb
new file mode 100644
index 0000000..8502219
--- /dev/null
+++ b/db/migrate/20130829074549_add_social_media_to_users.rb
@@ -0,0 +1,10 @@
+class AddSocialMediaToUsers < ActiveRecord::Migration
+ def change
+ add_column :users, :twitter_url, :string
+ add_column :users, :facebook_url, :string
+ add_column :users, :github_url, :string
+ add_column :users, :website_url, :string
+ add_column :users, :email_visible, :boolean
+ add_column :users, :phone_visible, :boolean
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 3cb31fb..21e3651 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1,3 +1,4 @@
+# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
@@ -10,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20130828104240) do
+ActiveRecord::Schema.define(:version => 20130829074549) do
create_table "cards", :force => true do |t|
t.string "card_number"
@@ -155,6 +156,13 @@ ActiveRecord::Schema.define(:version => 20130828104240) do
t.string "marketing_source"
t.string "payee"
t.boolean "accountant"
+ t.string "exit_reason"
+ t.string "twitter_url"
+ t.string "facebook_url"
+ t.string "github_url"
+ t.string "website_url"
+ t.boolean "email_visible"
+ t.boolean "phone_visible"
end
add_index "users", ["email"], :name => "index_users_on_email", :unique => true