If no channels are found in a particular group, say so.

This commit is contained in:
Andreas Öman 2008-05-04 15:12:05 +00:00
parent 4125bf6601
commit 0c02b8a597

View file

@ -136,6 +136,7 @@ ajax_channel_tab(http_connection_t *hc, http_reply_t *hr,
channel_group_t *tcg;
char dispname[20];
struct sockaddr_in *si;
int nchs = 0;
if(remain == NULL || (tcg = channel_group_by_tag(atoi(remain))) == NULL)
return HTTP_STATUS_NOT_FOUND;
@ -144,6 +145,8 @@ ajax_channel_tab(http_connection_t *hc, http_reply_t *hr,
if(LIST_FIRST(&ch->ch_transports) == NULL)
continue;
nchs++;
tcp_qprintf(tq, "<div style=\"float:left; width: 25%%\">");
snprintf(dispname, sizeof(dispname), "%s", ch->ch_name);
@ -188,6 +191,10 @@ ajax_channel_tab(http_connection_t *hc, http_reply_t *hr,
tcp_qprintf(tq, "</div>");
}
if(nchs == 0)
tcp_qprintf(tq, "<div style=\"text-align: center; font-weight: bold\">"
"No channels in this group</div>");
http_output_html(hc, hr);
return 0;
}