email hide show facility available

This commit is contained in:
Harry Bomrah 2013-09-27 12:15:16 +08:00 committed by saurabhbhatia
parent 250a03f074
commit fd77230247
6 changed files with 19 additions and 4 deletions

View File

@ -16,6 +16,7 @@ class User
field :first_name, localize: true
field :last_name, localize: true
field :email
field :email_hidden, :type => Boolean, :default => false
field :sex, :default => 'unknown'
field :office_tel
field :cache_dept,type: Hash

View File

@ -6,6 +6,7 @@
<%= stylesheet_link_tag "lib/main-list" %>
<%= stylesheet_link_tag "lib/filter" %>
<%= stylesheet_link_tag "lib/member" %>
<%= stylesheet_link_tag "lib/togglebox" %>
<% end -%>
<% content_for :page_specific_javascript do -%>

View File

@ -94,6 +94,12 @@
<%= f.email_field :email %>
</div>
</div>
<div class="control-group">
<%= f.label "Disable email", :class=>"control-label muted" %>
<div class="controls">
<%= f.check_box :email_hidden %>
</div>
</div>
<!-- ID Number -->
<div class="control-group">

View File

@ -22,6 +22,7 @@
<%= link_to("<i class='icon-edit'></i> #{t(:edit)}".html_safe,edit_admin_users_new_interface_path(@user),:class=>"btn btn-mini" ) if is_admin?%>
<%= link_to("<i class='icons-cycle'></i> #{t("users.change_passwd")}".html_safe,admin_users_new_interface_edit_passwd_path(@user),:class=>"btn btn-mini" ) if is_admin?%>
</div>
</div>
<div id="member-roles" class="nano">

View File

@ -38,7 +38,10 @@
<%= @job_title %>
</li>
<% end %>
<li><b class="o-members-label"><%= t("users.email")%></b><%= member.email %></li>
<% if !member.email_hidden? %>
<li><b class="o-members-label"><%= t("users.email")%></b><%= member.email %></li>
<% end %>
<li><b class="o-members-label"><%= t("users.office_tel")%></b><%= member.office_tel %></li>
</ul>
</li>
@ -79,7 +82,9 @@
%>
<li><b class="o-members-label"><%= @member_lists.get_member_list_attribute_field_name("teacher","job_title") %></b><%= @job_title %></li>
<% end %>
<li><b class="o-members-label"><%= t("users.email")%></b> <%= member.email %></li>
<% if !member.email_hidden? %>
<li><b class="o-members-label"><%= t("users.email")%></b> <%= member.email %></li>
<% end %>
<li><b class="o-members-label"><%= t("users.office_tel")%></b><%= member.office_tel %></li>
</ul>
</li>

View File

@ -9,11 +9,12 @@
<td><%= t('users.name')%></td>
<td><%= @member.name%></td>
</tr>
<% if !@member.email_hidden? %>
<tr>
<td><%= t('users.email')%></td>
<td><a href="mailto:<%= @member.email %>"><%= @member.email %></a></td>
</tr>
<% end %>
<% if !@member.office_tel.blank? %>
<tr>
<td><%= t('users.office_tel')%></td>