7899936c92afb38d481356188e5868f258046dc2
[euphorik.git] / index.yaws
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"\r
3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\r
4 <erl>\r
5  out(A) ->\r
6    {header, {content_type,\r
7       case string:str((A#arg.headers)#headers.user_agent, "MSIE") of\r
8          0 -> "text/html"; %"application/xhtml+xml"; % TODO : jquery.lightbox does not support application/xhtml+xml\r
9          _ -> "text/html"\r
10       end\r
11    }}.\r
12 </erl>\r
13 <html xmlns="http://www.w3.org/1999/xhtml">\r
14 <head>\r
15    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\r
16    <title>euphorik.ch</title>\r
17    <erl>\r
18       % set the stylesheet\r
19       out(A) ->\r
20          CSS = case euphorik_bd:css_from_user_cookie(yaws_api:find_cookie_val("cookie", A)) of\r
21             undefined -> "styles/1/euphorik.css";\r
22             C -> C\r
23          end,\r
24          {ehtml, {link ,\r
25             [\r
26                {id, "mainCss" },\r
27                {rel, "stylesheet"},\r
28                {href, CSS},\r
29                {type, "text/css"},\r
30                {media, "screen"}\r
31             ], []}\r
32          }.\r
33    </erl>\r
34    <link rel="stylesheet" href="styles/jquery.lightbox.css" type="text/css" media="screen" ></link>\r
35 \r
36    <script type="text/javascript" src="js/libs/jquery.js" prod="delete"></script>\r
37    <script type="text/javascript" src="js/libs/jquery.lightbox.js" prod="delete"></script>\r
38    <script type="text/javascript" src="js/libs/md5.js" prod="delete"></script>\r
39    <script type="text/javascript" src="js/libs/json2.js" prod="delete"></script>\r
40 \r
41    <script type="text/javascript" src="js/betterjs.js" prod="delete"></script>\r
42    <script type="text/javascript" src="js/fragment.js" prod="delete"></script>\r
43 \r
44    <script type="text/javascript" src="js/euphorik.js"></script>\r
45 \r
46    <script type="text/javascript" src="js/communication.js" prod="delete"></script>\r
47    <script type="text/javascript" src="js/conf.js" prod="delete"></script>\r
48    <script type="text/javascript" src="js/util.js" prod="delete"></script>\r
49    <script type="text/javascript" src="js/formater.js" prod="delete"></script>\r
50    <script type="text/javascript" src="js/pages.js" prod="delete"></script>\r
51    <script type="text/javascript" src="js/client.js" prod="delete"></script>\r
52 \r
53    <script type="text/javascript" src="js/chat/chat.js" prod="delete"></script>\r
54    <script type="text/javascript" src="js/chat/conversation.js" prod="delete"></script>\r
55    <script type="text/javascript" src="js/chat/conversations.js" prod="delete"></script>\r
56    <script type="text/javascript" src="js/chat/message.js" prod="delete"></script>\r
57    <script type="text/javascript" src="js/chat/commandes.js" prod="delete"></script>\r
58 \r
59    <script type="text/javascript" src="js/pageStatic.js" prod="delete"></script>\r
60    <script type="text/javascript" src="js/pageMinichat.js" prod="delete"></script>\r
61    <script type="text/javascript" src="js/pageAdmin.js" prod="delete"></script>\r
62    <script type="text/javascript" src="js/pageProfile.js" prod="delete"></script>\r
63    <script type="text/javascript" src="js/pageRegister.js" prod="delete"></script>\r
64    <script type="text/javascript" src="js/pageAbout.js" prod="delete"></script>\r
65 \r
66 </head>\r
67    <body>\r
68       <div id="container">\r
69          <erl>\r
70             % permet de prédéfinir la "class" du logo pour un ekMaster...\r
71             out(A) ->\r
72                Est_ek_master = euphorik_bd:is_ek_master_from_cookie(yaws_api:find_cookie_val("cookie", A)),\r
73                {ehtml, {'div', [{id, "logo"}] ++ if Est_ek_master -> [{class, "ekMaster"}]; true -> [] end}}.\r
74 \r
75          </erl>\r
76          <div id="info" style="display:none" ><div id="icone"></div><div class="close" ></div><div class="message" ></div><div class="buttons"></div></div>\r
77          <div id="waitbar" style="display:none" ><div class="image"></div></div>\r
78          <ul id="menu">\r
79             <li class="minichat">chat</li><li class="admin" style="display:none">admin</li><li class="profile"></li><li class="register">register</li><li class="logout">logout</li><li class="about">about</li>\r
80          </ul>\r
81          <form action="" id="formMenuCss">\r
82             <p>\r
83                <select id="menuCss">\r
84                   <erl>\r
85                      % parse les styles disponible\r
86                      out(A) ->\r
87                         Stlyes_dir = A#arg.docroot ++ "/styles",\r
88                         {ok, Liste_dir} = file:list_dir(Stlyes_dir),\r
89                         {ehtml,\r
90                            lists:foldr(\r
91                               fun(Dir, Acc) ->\r
92                                  case file:consult(Stlyes_dir ++ "/" ++ Dir ++ "/infos.txt") of\r
93                                     {ok, [{nom, Nom}]} ->\r
94                                        [{option, [{value, Dir}], Nom} | Acc];\r
95                                     _ ->\r
96                                        Acc\r
97                                  end\r
98                               end,\r
99                               [],\r
100                               Liste_dir\r
101                            )\r
102                         }.\r
103                   </erl>\r
104                </select>\r
105             </p>\r
106          </form>\r
107          <div id="page"></div>\r
108          <div id="footer"><span class="copyright">copyright 2008 euphorik.ch</span><span class="termsOfUse pageLink">terms of use</span><a href="http://yaws.hyber.org"><img src="img/powered-by-yaws.gif" alt="powered by Yaws" /></a></div>\r
109       </div>\r
110    </body>\r
111 </html>\r