fact_check with Ray's permission check.

needs Ray's new css
This commit is contained in:
Matthew K. Fu JuYuan 2012-04-05 15:06:01 +08:00
parent d8b20ae993
commit ef88c2dbc2
4 changed files with 35 additions and 11 deletions

Binary file not shown.

View File

@ -1,5 +1,6 @@
$('.check[checked="checked"]').parents(".checkbox").addClass("checked")
$(".checkbox").click(function(){
$(document).ready(function() {
$('.check[checked="checked"]').parents(".checkbox").addClass("checked");
$(".checkbox").click(function(){
if($(this).children(".check").attr("checked")){
// uncheck
$(this).children(".check").attr('checked', false);
@ -9,4 +10,5 @@ $(".checkbox").click(function(){
$(this).children(".check").attr({checked: "checked"});
$(this).addClass("checked");
}
});
});

View File

@ -1,7 +1,23 @@
<%= content_tag :div ,:id => "users_checkbox_ary", do -%>
<% sys_users = User.all -%>
<% sys_users.each do |user| -%>
<%= label_tag "lab-user-#{user.id}", user.name rescue '' -%>
<%= check_box_tag "[users][#{user.id}]", 'true',users.include?(user) -%>
<div class="checkblock">
<div class="checkbox clear">
<div class="check-icon">
<i class="icons-check-2 icons-white"></i>
</div>
<div class='member-avatar'>
<% if user.avatar? %>
<%= image_tag(user.avatar.thumb.url,:class => "member-img") %>
<% else %>
<%= image_tag "person.png",:class => "member-img" %>
<% end %>
</div>
<%= label_tag "lab-user-#{user.id}", (user.name rescue ''),:class=>"member-name",:id=>nil -%>
<%= check_box_tag "[users][#{user.id}]", 'true',users.include?(user),:class => "check" -%>
</div>
</div>
<% end -%>
<% end -%>

View File

@ -1,3 +1,9 @@
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "inc/permission-checkbox" %>
<% end %>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "inc/permission-checkbox" %>
<% end %>
<%#= label_tag :fact_check_setting, t("announcement.bulletin.fact_check_setting") %>
<%= form_tag('', :remote => true) %>
<div class="subnav">