announcement-test/temp_file/app/views/admin/sites/_notifications.html.erb

54 lines
1.9 KiB
Plaintext

<script src="/assets/lib/jquery-ui-1.12.1/jquery-ui.min.js"></script>
<link rel="stylesheet" href="/assets/lib/jquery-ui-1.12.1/jquery-ui.min.css">
<script type="text/javascript">
function see_detail(i){
$(".detail-only-content-"+i).dialog("option", "width", $(window).width()*0.8);
$(".detail-only-content-"+i).dialog("option", "min-height", $(window).height()*0.2);
$(".detail-only-content-"+i).dialog("option", "max-height", $(window).height()*0.8);
$(".detail-only-content-"+i).dialog("option", "max-height", $(window).height()*0.8);
if ($(".detail-only-content-"+i).find('.content').attr('data-href')==''){
$(".detail-only-content-"+i).dialog("option", "buttons", {});
}
$(".detail-only-content-"+i).dialog("open");
}
$(document).ready(function(){
$("div[class^='detail-only-content']").dialog({
autoOpen: false,
show: "blind",
model:true,
hide: "explode",
buttons:{
'<%= t('announcement.more') %>':function(){
window.open($(this).parents("div").find('.content').attr('data-href'), "_blank")
}
}
});
})
</script>
<% Array(@data['site_anncs']).compact.each_with_index do |v,i| %>
<div class="detail-only-content-<%= i %>">
<div class="content" data-href="<%= v['see_more_link'] %>">
<%= v['content'][I18n.locale.to_s].to_s.html_safe %>
</div>
</div>
<% end %>
<div class="box-header">
<h2>
<i class="icons-chat"></i>
<span class="break"></span>
Messages from RulingCare
</h2>
</div>
<div class="box-content">
<table class="table table-bordered table-striped table-hover">
<tbody>
<% Array(@data['site_anncs']).compact.each_with_index do |v,i| %>
<tr>
<td style="cursor: pointer;" onclick="see_detail(<%= i %>)"><%= v['title'][I18n.locale.to_s].to_s.html_safe %></td>
</tr>
<% end %>
</tbody>
</table>
</div>