static void gss_server_resource_main_page (GssTransaction * t) { GString *s; GList *g; s = t->s = g_string_new (""); gss_html_header (t); GSS_P ("<ul class='thumbnails'>\n"); for (g = t->server->programs; g; g = g_list_next (g)) { GssProgram *program = g->data; if (program->is_archive) continue; GSS_P ("<li class='span4'>\n"); GSS_P ("<div class='thumbnail'>\n"); GSS_P ("<a href=\"/%s%s%s\">", GSS_OBJECT_NAME (program), t->session ? "?session_id=" : "", t->session ? t->session->session_id : ""); gss_program_add_jpeg_block (program, t); GSS_P ("</a>\n"); GSS_P ("<h5>%s</h5>\n", GSS_OBJECT_SAFE_TITLE (program)); GSS_P ("</div>\n"); GSS_P ("</li>\n"); } GSS_P ("</ul>\n"); if (t->server->enable_vod) { GSS_P ("<ul class='thumbnails'>\n"); for (g = t->server->programs; g; g = g_list_next (g)) { GssProgram *program = g->data; if (!program->is_archive) continue; GSS_P ("<li class='span4'>\n"); GSS_P ("<div class='thumbnail'>\n"); GSS_P ("<a href=\"/%s%s%s\">", GSS_OBJECT_NAME (program), t->session ? "?session_id=" : "", t->session ? t->session->session_id : ""); gss_program_add_jpeg_block (program, t); GSS_P ("</a>\n"); GSS_P ("<h5>%s</h5>\n", GSS_OBJECT_SAFE_TITLE (program)); GSS_P ("</div>\n"); GSS_P ("</li>\n"); } GSS_P ("</ul>\n"); } gss_html_footer (t); }
void gss_program_get_resource (GssTransaction * t) { GssProgram *program = (GssProgram *) t->resource->priv; GString *s = g_string_new (""); t->s = s; gss_html_header (t); GSS_P ("<h1>%s</h1>\n", GSS_OBJECT_SAFE_TITLE (program)); gss_program_add_video_block (program, t, 0); GSS_P ("<br>%s", program->safe_description); GSS_A ("<br>"); gss_program_add_stream_table (program, s); if (t->session && t->session->is_admin) { gss_config_append_config_block (G_OBJECT (program), t, FALSE); } gss_html_footer (t); }
void gss_html_header_bare (GssTransaction * t) { GString *s = t->s; GSS_P ("<!DOCTYPE html>\n" "<html lang='en'>\n" "<head>\n" "<meta charset='utf-8'>\n" "<title>%s</title>\n", GSS_OBJECT_SAFE_TITLE (t->server)); GSS_A ("<meta name='viewport' content='width=device-width, initial-scale=1.0'>\n"); #if 0 GSS_A ("<meta name='description' content=''>\n" "<meta name='author' content=''>\n"); #endif GSS_A ("<link href='/bootstrap/css/bootstrap.css' rel='stylesheet'>\n"); GSS_A ("<style type='text/css'>\n" "body {\n" "padding-top: 60px;\n" "padding-bottom: 40px;\n" "}\n" ".sidebar-nav {\n" "padding: 9px 0;\n" "}\n" "</style>\n"); GSS_A ("<link href='/bootstrap/css/bootstrap-responsive.css' rel='stylesheet'>\n"); #if 0 GSS_A ("<!--[if lt IE 9]>\n" "<script src='http://html5shim.googlecode.com/svn/trunk/html5.js'></script>\n" "<![endif]-->\n"); #endif #if 0 GSS_A ("<link rel='shortcut icon' href='/favicon.ico'>\n"); GSS_A ("<link rel='apple-touch-icon-precomposed' sizes='144x144' href='../assets/ico/apple-touch-icon-144-precomposed.png'>\n" "<link rel='apple-touch-icon-precomposed' sizes='114x114' href='../assets/ico/apple-touch-icon-114-precomposed.png'>\n" "<link rel='apple-touch-icon-precomposed' sizes='72x72' href='../assets/ico/apple-touch-icon-72-precomposed.png'>\n" "<link rel='apple-touch-icon-precomposed' href='../assets/ico/apple-touch-icon-57-precomposed.png'>\n"); #endif GSS_A ("</head>\n"); }
void gss_html_header (GssTransaction * t) { GString *s = t->s; gchar *session_id; GList *g; if (t->session) { session_id = g_strdup_printf ("?session_id=%s", t->session->session_id); } else { session_id = g_strdup (""); } gss_html_header_bare (t); GSS_A ("<body>\n"); GSS_A ("<div class='navbar navbar-fixed-top'>\n" "<div class='navbar-inner'>\n" "<div class='container-fluid'>\n" "<a class='btn btn-navbar' data-toggle='collapse' data-target='.nav-collapse'>\n" "<span class='icon-bar'></span>\n" "<span class='icon-bar'></span>\n" "<span class='icon-bar'></span>\n" "</a>\n"); GSS_P ("<a class='brand' href='/%s'>%s</a>\n" "<div class='btn-group pull-right'>\n", session_id, GSS_OBJECT_SAFE_TITLE (t->server)); if (t->session) { GSS_P ("<a class='btn dropdown-toggle' data-toggle='dropdown' data-target='#'>\n" "<i class='icon-user'></i> %s\n" "<span class='caret'></span></a>\n", t->session->username); } else { t->server->append_login_html (t->server, t); } GSS_P ("<ul class='dropdown-menu'>\n" "<li><a href='/profile%s'>Profile</a></li>\n" "<li class='divider'></li>\n" "<li><a href='/logout%s'>Sign Out</a></li>\n" "</ul>\n" "</div>\n" "<div class='nav-collapse'>\n" "<ul class='nav'>\n" "<li class='active'><a href='/%s'>Home</a></li>\n" "<li><a href='/about%s'>About</a></li>\n" "<li><a href='/contact%s'>Contact</a></li>\n" "</ul>\n" "</div><!--/.nav-collapse -->\n" "</div>\n" "</div>\n" "</div>\n" "<div class='container-fluid'>\n" "<div class='row-fluid'>\n" "<div class='span3'>\n" "<div class='well sidebar-nav'>\n", session_id, session_id, session_id, session_id, session_id); GSS_A ("<ul class='nav nav-list'>\n"); if (t->server->featured_resources) { GSS_A ("<li class='nav-header'>Featured Pages</li>\n"); for (g = t->server->featured_resources; g; g = g_list_next (g)) { GssResource *resource = g->data; GSS_P ("<li %s><a href='%s%s'>%s</a></li>\n", (resource == t->resource) ? "class='active'" : "", resource->location, session_id, resource->name); }; } GSS_A ("<li class='nav-header'>Programs</li>\n"); for (g = t->server->programs; g; g = g_list_next (g)) { GssProgram *program = g->data; if (program->is_archive) continue; GSS_P ("<li %s><a href='%s%s'>%s</a></li>\n", (program->resource == t->resource) ? "class='active'" : "", program->resource->location, session_id, GSS_OBJECT_SAFE_TITLE (program)); }; if (t->server->enable_vod) { GSS_A ("<li class='nav-header'>Archive</li>\n"); for (g = t->server->programs; g; g = g_list_next (g)) { GssProgram *program = g->data; if (!program->is_archive) continue; GSS_P ("<li %s><a href='%s%s'>%s</a></li>\n", (program->resource == t->resource) ? "class='active'" : "", program->resource->location, session_id, GSS_OBJECT_SAFE_TITLE (program)); }; if (t->session) { GSS_P ("<li class='nav-header'>User</li>\n" "<li><a href='/add_program%s'>Add Program</a></li>\n" "<li><a href='/dashboard%s'>Dashboard</a></li>\n", session_id, session_id); } } if (t->session && t->session->is_admin) { GList *g; GSS_A ("<li class='nav-header'>Administration</li>\n"); for (g = t->server->admin_resources; g; g = g_list_next (g)) { GssResource *r = (GssResource *) g->data; GSS_P ("<li %s><a href='%s%s'>%s</a></li>\n", (r == t->resource) ? "class='active'" : "", r->location, session_id, r->name); } } GSS_A ("</ul>\n" "</div><!--/.well -->\n" "</div><!--/span-->\n" "<div class='span9'>\n"); g_free (session_id); if (t->server->add_warnings) { t->server->add_warnings (t, t->server->add_warnings_priv); } }