redhoterlang / src / redhot2_web_projects.erl

%% @author Torbjorn Tornkvist
%% @copyright 2010 Torbjorn Tornkvist.



         , title/0
         , layout/0
	 , event/1

-import(redhot2_common, [logo_text/0]).

main() ->
    #template { file="./templates/grid.html" }.

title() ->

layout() ->
    #container_12 {
        body=[#grid_12 { class=header, body=redhot2_common:header(projects) },
              #grid_clear {},

              #grid_8 { alpha=true, body=intro() },
              #grid_4 { omega=true, body=[] },
              #grid_clear {},

              #grid_12 { alpha=true, body=projects() },
              #grid_clear {},
              #grid_12 { body=redhot2_common:footer() }

intro() ->
    #panel { class = "intro",
             body = intro_text()}.

intro_text() ->
    "Here are a collection of some small projects that has been integrated with "
        ++ redhot2_common:logo_text() ++".".

projects() ->
    Theme = theme_chooser(),

    TwId = wf:temp_id(),
    Twitter = twitter(TwId),
    wf:wire(TwId, #event {type=click, postback=twitter, delegate=?MODULE}),

    SpId = wf:temp_id(),
    Sopcast = sopcast(SpId),
    wf:wire(SpId, #event {type=click, postback=sopcast, delegate=?MODULE}),

event({theme, Theme}) ->
    wf:session(theme, Theme),
event(twitter) ->
event(sopcast) ->
event(Event) ->

theme_chooser() ->
themes() ->
    [#panel{body=[#link{class="theme", text="DigitalChili", 
                        postback={theme,"digitalchili"}, delegate=?MODULE },
                  " is the (new) default look of "++logo_text()]}

     , #panel{body=[#link{class="theme", text="WhiteChili", 
                          postback={theme,"whitechili"}, delegate=?MODULE },
                    " very similar to the default but more whiteish and it also "
                    "plays with the <b>@font-face</b> CSS directive."]}

     , #panel{body=[#link{class="theme", text="Cantarell", 
                          postback={theme,"cantarell"}, delegate=?MODULE },
                    " very similar to the default but is using the "
                    "<a href=''>Google Font API</a> "
                    "and a touch of <a href=''>GitReady</a>."

twitter(Id) ->

twitter_text() ->
    "By clicking on the Twitter icon above you will invoke "
        "the <em>Twitter</em> page that displays tweets refering to Erlang. "
        "From that page you can also type in some other keywords that you "
        "would like to find the corresponding tweets for. If you want to "
        "bookmark the Twitter page you can use <a href=\"/twitter\">"
        "this</a> permalink.".

sopcast(Id) ->
    #panel{body=[#link{body=#image{image="/images/sopcast_logo.png", class="icon_sopcast"},

sopcast_text() ->
    "<a href=\"\">SopCast</a> "
        " is a simple and free P2P(Peer-to-Peer) technolog that makes "
        "it possible  to broadcast video and audio. "
        "By clicking on the Sopcast icon above you will invoke "
        "the <em>Sopcast</em> page that displays some sport events that are to "
        "be broadcasted (nb: the page loads slow, ~10 sec). "
        "So, let's say you want to watch that Champions League "
        "match, but it isn't broadcasted on any of your TV channels; then see "
        "if the match is Sopcasted, fire up a client and paste in the link! "
        "If you want to bookmark the Sopcast page you can use "
        "<a href=\"/sopcast\">this</a> permalink.".
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.