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