email hide show facility available

This commit is contained in:
Harry Bomrah 2013-09-27 12:15:16 +08:00
parent 471987f800
commit 79bc9240b7
6 changed files with 19 additions and 4 deletions

View File

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

View File

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

View File

@ -94,6 +94,12 @@
<%= f.email_field :email %> <%= f.email_field :email %>
</div> </div>
</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 --> <!-- ID Number -->
<div class="control-group"> <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='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?%> <%= 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> </div>
<div id="member-roles" class="nano"> <div id="member-roles" class="nano">

View File

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

View File

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