source: trunk/skins/lemill/front-page.pt @ 1370

Revision 1370, 4.3 KB checked in by jukka, 13 years ago (diff)

Worked on #1146. Search for suitable existing story is done and stories can be written. Must find out why portal_factory decides to keep stories, if user cancels or wanders off from story creation. Also the search for existing stories is tricky. Current way isn't fast, but I don't know if it can be done any faster -- and it's our front page, will get lots of hits.

Well, one way would be to combine stories' uids to one superuid and try to match that. We'll see..

Line 
1
2<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
3      lang="en"
4      metal:use-macro="here/front-page_template/macros/master"
5      i18n:domain="lemill">
6<body>
7
8<div metal:fill-slot="main" style="width:100%" tal:define="story_candidate python:here.lemill_tool.getStoryCandidate();
9story python:story_candidate['story'];
10null python:here.REQUEST.set('chcontent',story_candidate['chcontent'].UID());
11null python:here.REQUEST.set('method',story_candidate['method'].UID());
12null python:here.REQUEST.set('tool',story_candidate['tool'].UID());">
13
14<table border="0" cellpadding="0" cellspacing="0" width="780">
15    <tr>
16        <td width="248" class="sidebar">
17            <div>
18                <a href="#" tal:attributes="href portal_url"><img src="" alt="LeMill" /></a>
19                <p i18n:translate="introduction">
20                Web community for <strong>finding</strong>, <strong>authoring</strong> and <strong>sharing</strong> learning resources
21                </p>
22            </div>
23
24            <div>
25                <p i18n:translate="new_to_lemill">
26                New to LeMill?             
27                </p>
28                <p tal:condition="isAnon" i18n:translate="join_or_tour">
29                <a href="join">Join</a> or <a href="content/tour">take a tour</a>
30                </p>
31                <p tal:condition="not:isAnon">
32                <a href="content/tour" i18n:translate="take_a_tour">Take a tour</a>
33                </p>
34            </div>
35        </td>
36        <td width="4">&nbsp;</td>
37        <td width="528" valign="top" class="learning_story">
38       
39        <table width="504" border="0" cellpadding="0" cellspacing="8">
40            <tr>
41                <td width="160" class="content_coverimage_cell">
42                                    <a href="#" tal:attributes="href string:${story_candidate/chcontent/absolute_url}/view">
43                    <img tal:attributes="src story_candidate/chcontent/coverImage/absolute_url | string:images/default_learningresource.png;
44                                        alt story_candidate/chcontent/Title | nothing;" src="images/default_learningresource.png" alt="Cover image" />
45                </a>
46                </td>
47                <td width="160" class="method_coverimage_cell">
48                <a href="#" tal:attributes="href story_candidate/method/absolute_url | nothing">
49                    <img tal:attributes="src story_candidate/method/coverImage/absolute_url | string: images/default_method.png;
50                                        alt story_candidate/method/Title | nothing;" src="images/default_method.png" alt="Cover image" />
51                </a>
52                </td>
53                <td width="160" class="tool_coverimage_cell">
54                <a href="#" tal:attributes="href story_candidate/tool/absolute_url | nothing">
55                    <img tal:attributes="src story_candidate/tool/coverImage/absolute_url | string: images/default_tool.png;
56                                        alt story_candidate/tool/Title | nothing;" src="images/default_tool.png" alt="Cover image" />
57                </a>
58                </td>
59            </tr>
60            <tr>
61                <td class="content_label_cell">
62                    <a href="content" i18n:translate="Content">Content</a>
63                </td>
64                <td class="method_label_cell">
65                    <a href="methods" i18n:translate="Method">Method</a>
66                </td>
67                <td class="tool_label_cell">
68                    <a href="tools" i18n:translate="Tool">Tool</a>
69                </td>
70            </tr>
71        </table>
72
73    <h2><b i18n:translate="heading_learning_story">Learning story</b><b tal:condition="story" tal:omit-tag="">:</b> <span tal:condition="story" tal:content="story/title" /></h2>
74
75    <div tal:condition="story">   
76    <p tal:replace="structure story/getBlurp" />
77    [<a href="" i18n:translate="continue_story" tal:attributes="href story/absolute_url">Continue...</a>]
78    </div>
79    <div tal:condition="not:story">
80    <p i18n:translate="no_story_explanation">Nobody has written a learning story about using these resources. Now it is your time to contribute.</p>
81    </div>
82    <tal:no_empties condition="python: story_candidate['chcontent'] and story_candidate['method'] and story_candidate['tool']">
83    <h2><a href="new_story" tal:attributes="href python:test(isAnon, 'join_form', '%s/%s/stories/new_story?chcontent=%s&method=%s&tool=%s' % (membersfolder.absolute_url(), member, story_candidate['chcontent'].UID(), story_candidate['method'].UID(), story_candidate['tool'].UID()))" i18n="write_your_learning_story">Write your learning story</a> <span i18n:translate="about_using_these_resources">about using these resources...</span></h2>
84    </tal:no_empties>
85
86</td>
87</tr>
88</table>
89</div>
90</body>
91</html>
92
93
Note: See TracBrowser for help on using the repository browser.