Changeset 3024 for trunk


Ignore:
Timestamp:
05/06/10 17:51:18 (10 years ago)
Author:
jukka
Message:

Fixed #1979

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/CommonMixIn.py

    r3013 r3024  
    563563            roles =[] 
    564564         
    565         v['subView'] = subView = (view_id in ['discussion', 'about_view', 'history_view','collections_list','manage_translations','manage_convert'] or version) and not isDeleted 
     565        v['subView'] = subView = (view_id in ['discussion', 'about_view', 'history_view','collections_list','manage_translations','manage_convert', 'feedback_view'] or version) and not isDeleted 
    566566        v['mainView'] = mainView = not (subView or isDeleted or (isPrivate and not (owner or canManage) )) 
    567567        v['canUndelete'] = canModerate and isDeleted  
  • trunk/LeMillTool.py

    r3016 r3024  
    15831583        return s.startswith('<?xml') and s.find('<kml') > -1 
    15841584 
    1585     def getLatestBlogEntry(self): 
    1586         """ get latest blog entry title for front-page """  
    1587         ltool = getToolByName(self, 'portal_languages') 
    1588         lang = ltool.getPreferredLanguage() 
    1589         blog_rss = "http://blog.lemill.net/"+lang+"/?feed=rss2" 
    1590         blogurl = "http://blog.lemill.net/" 
    1591         if not lang: 
    1592             return '' 
    1593         try: 
    1594             rss = urllib2.urlopen(blog_rss) 
    1595             blogurl = "http://blog.lemill.net/"+lang 
    1596         except: 
    1597             try: 
    1598                 rss = urllib2.urlopen("http://blog.lemill.net/en/?feed=rss2") 
    1599             except: 
    1600                 return '' 
    1601         html = rss.read() 
    1602         try: 
    1603             dom = xml.dom.minidom.parseString(html) 
    1604         except:  # if dom can't parse text 
    1605             return '' 
    1606         items = dom.getElementsByTagName("item") 
    1607         # if no blog entry 
    1608         if len(items) == 0: 
    1609             return '' 
    1610         latest_item = items[0] 
    1611         try: 
    1612             itemTitle = latest_item.getElementsByTagName("title") 
    1613             titleTextNode =  itemTitle[0].childNodes 
    1614             title = titleTextNode[0].data 
    1615             itemLink = latest_item.getElementsByTagName("link") 
    1616             linkTextNode = itemLink[0].childNodes 
    1617             link = linkTextNode[0].data 
    1618             itemDate = latest_item.getElementsByTagName("pubDate") 
    1619             dateTextNode = itemDate[0].childNodes 
    1620             date = dateTextNode[0].data 
    1621         except: 
    1622             return '' 
    1623         # format date 
    1624         try: 
    1625             utc_time = time.strptime(date, "%a, %d %b %Y %H:%M:%S +0000") 
    1626             secs = calendar.timegm(utc_time) 
    1627             localtime = time.localtime(secs) 
    1628             date = time.strftime("%Y-%m-%d", localtime) 
    1629         except ValueError: 
    1630             pass 
    1631         return {'blogurl':blogurl, 'title':title, 'title_url':link, 'date':date} 
    1632  
    16331585    def shortenedText(self, text, max_length): 
    16341586        #return text[:max_length] 
  • trunk/skins/lemill/feedback_view.pt

    r2912 r3024  
    1212            <span i18n:domain="lemill" i18n:translate="text_deleted_heading" tal:condition="here/isDeleted">(DELETED)</span> 
    1313        </h1> 
     14         
     15        <p><a i18n:translate="back_to_resource_link" href="" tal:attributes="href string:${here_url}/view">Return to view exercise</a></p> 
    1416         
    1517        <tal:messages condition="python:web_feedback[1][0]"> 
  • trunk/skins/lemill/front-page.pt

    r3014 r3024  
    44      i18n:domain="lemill"> 
    55<body> 
     6 
    67<div metal:fill-slot="bodyslot" style="width:100%" tal:define="story_candidate python:here.lemill_tool.getStoryCandidate(); 
    7 story python:story_candidate['story'];"> 
     8story python:story_candidate['story']; 
     9lang_code context/portal_languages/getPreferredLanguage;  
     10lang_code python:test(lang_code in ['fi','et'], lang_code,'en');   
     11blog_url python:'http://blog.lemill.net/'+ lang_code"> 
     12<script type="text/javascript"> 
     13$(document).ready(function(){ 
     14getLatestBlogPost('fi'); 
     15}) 
     16</script> 
     17 
    818<table metal:use-macro="here/main_template/macros/personal_toolbar" /> 
    919<table id="tb-portal-columns" border="0" cellpadding="0" cellspacing="0" width="780" align="center"> 
     
    106116</tr> 
    107117</table> 
    108 <table id="tb-portal-columnbottom" border="0" cellpadding="0" cellspacing="0" width="780" align="center" tal:define="latest_entry context/lemill_tool/getLatestBlogEntry" tal:condition="latest_entry"><tr><td> 
     118<table id="tb-portal-columnbottom" border="0" cellpadding="0" cellspacing="0" width="780" align="center"><tr><td> 
    109119<div class="frontpage-blog"> 
    110120<b> 
    111121    <span i18n:translate="latest_from_blog">Latest from  
    112      <span i18n:name="our_blog"><a href="" tal:attributes="href latest_entry/blogurl" i18n:translate="our_blog">our blog</a>:</span> 
     122     <span i18n:name="our_blog"><a href="" tal:attributes="href blog_url" i18n:translate="our_blog">our blog</a>:</span> 
    113123    </span> 
    114     <a href="" tal:attributes="href latest_entry/title_url" tal:content="latest_entry/title" /> 
    115124</b> 
    116 (<span tal:replace="latest_entry/date" />) 
     125    <span id="title_from_blog"></span> 
    117126</div> 
    118127</td></tr></table> 
     
    135144    </tr> 
    136145</table> 
     146 
    137147</div> 
    138148</body> 
  • trunk/skins/lemill/lemill_community_view.pt

    r3000 r3024  
    3232        </li>         
    3333        <li> 
    34             <a i18n:translate="label_browse_by_name_cloud" href="browse_people" class="byTextsFont">By name cloud</a> 
     34            <a i18n:translate="label_browse_by_name_cloud" class="byTextsFont">By name cloud</a> 
    3535        </li>         
    3636        <li> 
  • trunk/skins/lemill/lemill_content_view.pt

    r3000 r3024  
    3333        </li> 
    3434        <li> 
    35             <a i18n:translate="label_browse_by_title_cloud" href="browse_resources" class="byTextsFont">By title cloud</a> 
    36         </li>         
    37         <li> 
    3835            <a i18n:translate="label_browse_by_subject_area" href="subject_area" class="byTextsFont">By subject area</a>: 
    3936            <span tal:repeat="result context/top3subject_areas | nothing"> 
  • trunk/skins/lemill/master.js

    r3018 r3024  
    3737    }); 
    3838}); 
     39 
     40 
     41 
     42/* load blog post titles for front page, uses google api (jGFeed) as a proxy */ 
     43 
     44/* 
     45 * jGFeed 1.0 - Google Feed API abstraction plugin for jQuery 
     46 * 
     47 * Copyright (c) 2009 jQuery HowTo 
     48 * 
     49 * Licensed under the GPL license: 
     50 *   http://www.gnu.org/licenses/gpl.html 
     51 * 
     52 * URL: 
     53 *   http://jquery-howto.blogspot.com 
     54 * 
     55 * Author URL: 
     56 *   http://me.boo.uz 
     57 * 
     58 */ 
     59(function($){$.extend({jGFeed:function(url,fnk,num,key){if(url==null){return false;}var gurl="http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&callback=?&q="+url;if(num!=null){gurl+="&num="+num;}if(key!=null){gurl+="&key="+key;}$.getJSON(gurl,function(data){if(typeof fnk=="function"){fnk.call(this,data.responseData.feed);}else{return false;}});}});})(jQuery); 
     60 
     61function getLatestBlogPost(lang){ 
     62 $.jGFeed("http://blog.lemill.net/"+lang+"/?feed=rss2",function(data){ 
     63        item=data['entries'][0]; 
     64        pd= new Date(Date.parse(item["publishedDate"])); 
     65        html='<b><a href="'+item['link']+'">'+item['title']+'</a></b> ('+pd.getFullYear()+'-'+pd.getMonth()+'-'+pd.getDate()+')'; 
     66        $("span#title_from_blog").html(html);                
     67 },1); 
     68} 
    3969 
    4070 
     
    765795(function(b){var e,d,a=[],c=window;b.fn.tinymce=function(j){var p=this,g,k,h,m,i,l="",n="";if(!p.length){return}if(!j){return tinyMCE.get(p[0].id)}function o(){var r=[],q=0;if(f){f();f=null}p.each(function(t,u){var s,w=u.id,v=j.oninit;if(!w){u.id=w=tinymce.DOM.uniqueId()}s=new tinymce.Editor(w,j);r.push(s);if(v){s.onInit.add(function(){var x,y=v;if(++q==r.length){if(tinymce.is(y,"string")){x=(y.indexOf(".")===-1)?null:tinymce.resolve(y.replace(/\.\w+$/,""));y=tinymce.resolve(y)}y.apply(x||tinymce,r)}})}});b.each(r,function(t,s){s.render()})}if(!c.tinymce&&!d&&(g=j.script_url)){d=1;h=g.substring(0,g.lastIndexOf("/"));if(/_(src|dev)\.js/g.test(g)){n="_src"}m=g.lastIndexOf("?");if(m!=-1){l=g.substring(m+1)}c.tinyMCEPreInit={base:h,suffix:n,query:l};if(g.indexOf("gzip")!=-1){i=j.language||"en";g=g+(/\?/.test(g)?"&":"?")+"js=true&core=true&suffix="+escape(n)+"&themes="+escape(j.theme)+"&plugins="+escape(j.plugins)+"&languages="+i;if(!c.tinyMCE_GZ){tinyMCE_GZ={start:function(){tinymce.suffix=n;function q(r){tinymce.ScriptLoader.markDone(tinyMCE.baseURI.toAbsolute(r))}q("langs/"+i+".js");q("themes/"+j.theme+"/editor_template"+n+".js");q("themes/"+j.theme+"/langs/"+i+".js");b.each(j.plugins.split(","),function(s,r){if(r){q("plugins/"+r+"/editor_plugin"+n+".js");q("plugins/"+r+"/langs/"+i+".js")}})},end:function(){}}}}b.ajax({type:"GET",url:g,dataType:"script",cache:true,success:function(){tinymce.dom.Event.domLoaded=1;d=2;o();b.each(a,function(q,r){r()})}})}else{if(d===1){a.push(o)}else{o()}}};b.extend(b.expr[":"],{tinymce:function(g){return g.id&&!!tinyMCE.get(g.id)}});function f(){function i(l){if(l==="remove"){this.each(function(n,o){var m=h(o);if(m){m.remove()}})}this.find("span.mceEditor,div.mceEditor").each(function(n,o){var m=tinyMCE.get(o.id.replace(/_parent$/,""));if(m){m.remove()}})}function k(n){var m=this,l;if(n!==e){i.call(m);m.each(function(p,q){var o;if(o=tinyMCE.get(q.id)){o.setContent(n)}})}else{if(m.length>0){if(l=tinyMCE.get(m[0].id)){return l.getContent()}}}}function h(m){var l=null;(m)&&(m.id)&&(c.tinymce)&&(l=tinyMCE.get(m.id));return l}function g(l){return !!((l)&&(l.length)&&(c.tinymce)&&(l.is(":tinymce")))}var j={};b.each(["text","html","val"],function(n,l){var o=j[l]=b.fn[l],m=(l==="text");b.fn[l]=function(r){var p=this;if(!g(p)){return o.call(p,r)}if(r!==e){k.call(p.filter(":tinymce"),r);o.call(p.not(":tinymce"),r);return p}else{var q="";(m?p:p.eq(0)).each(function(t,u){var s=h(u);q+=s?(m?s.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):s.getContent()):o.call(b(u),r)});return q}}});b.each(["append","prepend"],function(n,m){var o=j[m]=b.fn[m],l=(m==="prepend");b.fn[m]=function(q){var p=this;if(!g(p)){return o.call(p,q)}if(q!==e){p.filter(":tinymce").each(function(s,t){var r=h(t);r&&r.setContent(l?q+r.getContent():r.getContent()+q)});o.call(p.not(":tinymce"),q);return p}}});b.each(["remove","replaceWith","replaceAll","empty"],function(m,l){var n=j[l]=b.fn[l];b.fn[l]=function(){i.call(this,l);return n.apply(this,arguments)}});j.attr=b.fn.attr;b.fn.attr=function(n,q,o){var m=this;if((!n)||(n!=="value")||(!g(m))){return j.attr.call(m,n,q,o)}if(q!==e){k.call(m.filter(":tinymce"),q);j.attr.call(m.not(":tinymce"),n,q,o);return m}else{var p=m[0],l=h(p);return l?l.getContent():j.attr.call(b(p),n,q,o)}}}})(jQuery); 
    766796 
     797 
     798 
    767799// Loading tinyMCE and setting it to class mceEditor 
    768800 
  • trunk/skins/lemill/widget_exercise.pt

    r3014 r3024  
    8080    <tal:block tal:content="structure context/lemill_tool/generateCaptcha" /> 
    8181        <div class="visualClear" style="height:10px">&nbsp;</div> 
    82         </div> 
    83  
    8482            <p> 
    8583        <input class="context" 
     
    9391            </p> 
    9492            <input type="hidden" name="submit_web_feedback" id="submit_web_feedback" value="1" /> 
     93        </div> 
     94 
    9595     
    9696    </fieldset> 
Note: See TracChangeset for help on using the changeset viewer.