<%  @calendar_view_disable=1    %>
<div style="width:100%;left:0px;position:absolute;height:calc(100% - 0px);top:0px">
	<%
		#	gt - Глобальная таблица
			@container=''
			@gt_structure=[]	
			@gt_structure.push({:onclick => "", :row_name => t('.rating'), :value => "'+logins_info_list_rating_color(data.data[i].rating)+'", :width => "width:100px", :filter => 'rating' })
			@gt_structure.push({:onclick => "logins_info_list_open_detailed('+data.data[i].id+')", :row_name => t(:login), :value => "<b>'+data.data[i].name+'</b>", :width => "", :filter => 'name' })
			@gt_structure.push({:onclick => "", :row_name => t('.full_name'), :value => "'+logins_info_list_check_null(data.data[i].full_name)+'", :width => "", :filter => 'full_name' })
			@gt_structure.push({:onclick => "", :row_name => 'Email', :value => "'+logins_info_list_check_null(data.data[i].email)+'", :width => "", :filter => 'email' })
			@gt_structure.push({:onclick => "", :row_name => t('.department'), :value => "'+logins_info_list_check_null(data.data[i].department)+'", :width => "", :filter => 'department' })
			@gt_structure.push({:onclick => "", :row_name => t(:offices), :value => "'+data.data[i].office_name+'", :width => "", :filter => 'office_name' })
			@gt_structure.push({:onclick => "", :row_name => '', :value => "<a class=\"href_edit_button\" onclick=\"logins_info_list_edit('+data.data[i].id+')\" >#{t(:edit)}</a>", :width => "width:150px", :filter => 'none' })
	%>
	<%= render partial: "shared/table", locals: {
		name:"logins_list",
		header:@gt_structure,
		query:"#{get_login_list_settings_logins_info_index_path}",
		action_after:0,
		time:1,
		add_params:'',
		offset:50,
		first_sort:'rating;DESC',
		additional_field:@container
	} %>
</div>
<script>
	var calendar_from_date=new Date()
	var calendar_to_date=new Date()
	function logins_info_list_check_null(value){
		if (value == null || value == ''){
			return '<div style="color:<%= $red %>"><%= t('.undefined') %></div>'
		}else{
			return value
		}
	}
	function logins_info_list_open_detailed(id){
		window.open('/settings/logins_info/'+id, '_self')
	}
	function logins_info_list_edit(id){
		window.open('/settings/logins_info/'+id+'/edit', '_self')
	}
	function logins_info_list_rating_color(rating){
		if (rating <= 3){
			color='<%= $red %>'
		}else if (rating > 3 && rating < 7){
			color='<%= $yellow %>'
		}else{
			color='<%= $green %>'
		}
		return '<div style="width:60px;height:30px;line-height:30px;background:'+color+';color:<%= $white %>;font-size:20px" align="center"><b>'+rating+'</b></div>'
	}
</script>