summaryrefslogtreecommitdiff
path: root/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/meeting.html
blob: b8a0b642ccdb934cb1de9bdf1d45f3d1c1cab812 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
{% extends "ndf/base.html" %}
{% load i18n %}
{% load ndf_tags %}
{% load pagination_tags %}
{% get_group_name groupid as group_name_tag %}

{% block title %} {{ title }} {% endblock %}

{% block help_content %}
  <p>
    {% trans "Video chat." %}
  </p>

{% endblock %}

{% block meta_content %}
  <h2 class="subheader">{% trans "Meeting" %}</h2>
{% endblock %}

{% block search_content %}

{% endblock %}

{% block related_content %}
  {% if user.is_authenticated %}
  {% user_access_policy groupid request.user as user_access %}
  {% if user_access == "allow" %}
  <br/>
  <div class="create card">
    <div class="chat">
      <br/>
     <!-- <a class="button medium" href="https://chatb.org" target="Chatb"> --> 
               	
           
      	<a class="button medium" href="https://chatb.org/#{{meetingid}}" target="Chatb"> 
        <span class="start">&nbsp;&nbsp;{% trans "Start Meeting" %}</span>
      </a>
    </div>
  </div>
<div id="res">                                                                <!-- For adding the division of online members -->
</div>
<script>
	
	var aa={{online_users|safe}}                                               <!-- ramkarnani -->
	k=aa.length
	//var aa=[];
	//var name={{request.user.username}}
	//for (i=0;i<k;i++){
	//		test = total_list[i];
	//		test1=total_list[i].user.username;
	//		if (test1.match(/name/))
	//		{
	//			 document.getElementById("aa").appendChild(test);
	//		}
	//	}
	var str = "<table>"
	str +="<th>Online</th>"
	for (i=0; i<k; i++) {                                                     // for adding list of online member in html template
			if (Number(aa[i].status) ==1) {
			str+= "<tr><td>" + aa[i].user.username + "</td><td>" + "<img src='/static/ndf/images/dot.jpg' width=30em></td><td><input type='checkbox' name='invite' id= '"+ aa[i].user.username +"' value='invite'>Invite</td></tr>";
	//		var nam = "#" + aa[i].user.username;
	//		prev.push($(nam).prop('checked'));
	//		alert("hey");
		      }
		   }
	str += "</table>"
	$("#res").html(str)
	
</script>


  {% endif %}
  {% endif %}
{% endblock %}




{% block body_content %}                                                                      <!-- ramkarnani -->
<script>
	$(document).ready(function(){
		var size = $(window).height();
		$("#ifrm").css("height",0.9*size);
	});

	$(window).resize(function(){
		var size = $(window).height();
		// alert(size);
		$("#ifrm").css("height",0.9*size);
	});


</script>


<iframe src="" name="Chatb" style="position:relative" id="ifrm" height="450em" width="100%" frameborder="1"> </iframe> 


<script>


	$(document).ready(function(){

var timer,delay = 1000*10;

timer = setInterval(function(){                             // Ajax call for getting refreshed list of online users after 1 minute 
	$.ajax({
		url:"{% url 'get_online_users' group_id %}",
		dataType:'json',		
		//data: '',
		success: function(data){                                                                  <!-- ramkarnani -->
		//console.log(JSON.stringify(data))
		//alert("hello")
		var aa= data;
		//var aa=[];
		//var name={{request.user.username}};
		var prev=[];
		k=aa.length;
		//for (i=0;i<k;i++){
		//	test = total_list[i];
		//	test1=total_list[i].user.username;
		//	if (test1.match(/name/))
		//	{
		//		 document.getElementById("aa").appendChild(test);
		//	}
		
		var str = "<table>";
		str+="<th>Online</th>"
		
		for (i=0; i<k; i++) {                                                     // for adding list of online member in html template
			if (Number(aa[i].status) ==1) {
				str += "<tr><td>" + aa[i].user.username + "</td><td><img src='/static/ndf/images/dot.jpg' width=30em></td><td><input type='checkbox' name='invite' id='"+ aa[i].user.username +"' value='invite'>Invite</td></tr>";

				//prev[i]=false;
				var nam = "#" + aa[i].user.username;
				prev.push($(nam).prop('checked'));
				//alert("heya");

				
  	      }
	   }
		str += "</table>"
		//console.log(str);
		//console.log(aa, "",k);
		$("#res").html(str)
	
		for (i=0;i<k;i++){
			var nam = "#" + aa[i].user.username;
			if (prev[i]==true){
				$(nam).prop('checked',true);

			}
		}
	   
		//alert(JSON.stringify(data));		
	  }
		});
		
        }, delay); 


        
        //getOnlineUsers();
        });
	var aa ={{online_users|safe}}
	k=aa.length
	for (i=0;i<k;i++){
		var usr = aa[i].user.username;
		var nam1 = "#" + usr;

		$(nam1).click(function(){
			// alert("check");
			//console.log(nam1);
			aaa = nam1;                                                                            <!-- ramkarnani -->
			$.ajax({
				url:"{% url 'invite_meeting' group_id meetingid %}",
				dataType:'json',
				data : { "usr": usr},			
				
				success: function(data){
					//typeof(data);
					//console.log(JSON.stringify(data));
					//alert("hello");

					}
				});
			});
	}

</script>





{% endblock %}