Changeset 887


Ignore:
Timestamp:
05/15/12 15:01:28 (2 years ago)
Author:
brent
Message:

Added fix for course ordering, refactored footer and colophon, removed all references to openocw, removed collective.jaop since it was not enabled anyway.

Location:
4.0/enpraxis.educommons/trunk/enpraxis/educommons
Files:
5 added
3 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • 4.0/enpraxis.educommons/trunk/enpraxis/educommons/browser/__init__.py

    r796 r887  
    2525from zope.annotation.interfaces import IAnnotations 
    2626from collective.contentlicensing.browser import RSSView as DefaultRSSView 
    27 from collective.contentlicensing.browser.copyrightbyline import CopyrightBylineView as DefaultCopyrightBylineView 
    2827from Products.CMFPlone.utils import getToolByName 
    2928from enpraxis.educommons.utilities.interfaces import IECUtility 
     
    159158        return resources 
    160159 
    161  
    162 class PositionView(BrowserView): 
    163  
    164     def __call__(self): 
    165         context = self.context 
    166         position = self.request['position'] 
    167         id = self.request['id'] 
    168         url = self.request['url'] 
    169          
    170         if position == 'up': 
    171             self.moveUp(context, self.request, position, id, url) 
    172         elif position == 'down': 
    173             self.moveDown(context, self.request, position, id, url) 
    174         else: 
    175             return 
    176  
    177  
    178     def moveUp(self, context, request, position, id, path): 
    179         objs = self.getNavObjects(context) 
    180  
    181         if len(objs) <= 1: 
    182             return 
    183  
    184         if objs[0].getPath() == path: 
    185             return 
    186  
    187         prev_obj = objs[0] 
    188  
    189         for obj in objs[1:]: 
    190             if path == obj.getPath(): 
    191                 self.swapPosition(obj.getObject(), prev_obj.getObject()) 
    192                 break 
    193  
    194             prev_obj = obj 
    195  
    196         request.response.redirect('order_courseobjs') 
    197                  
    198  
    199     def moveDown(self, context, request, position, id,path): 
    200         objs = self.getNavObjects(context) 
    201          
    202         if len(objs) <= 1: 
    203             return 
    204  
    205         prev_obj = None 
    206         index = 0 
    207         for obj in objs: 
    208  
    209             if len(objs) == index: 
    210                 return 
    211  
    212             if prev_obj: 
    213                 self.swapPosition(obj.getObject(), prev_obj.getObject()) 
    214                 break 
    215             if path == obj.getPath(): 
    216                 prev_obj = obj 
    217  
    218             index += 1 
    219  
    220         request.response.redirect('order_courseobjs') 
    221  
    222     def swapPosition(self, cur_obj, swp_obj): 
    223         if ICourseOrderable.providedBy(cur_obj): 
    224             cobj = ICourseOrder(cur_obj) 
    225             if ICourseOrderable.providedBy(swp_obj): 
    226                 sobj = ICourseOrder(swp_obj) 
    227                 if cobj.position == sobj.position: 
    228                     # Objects somehow have the same position 
    229                     # Force the current object down 
    230                     cobj.position += 1 
    231                 else: 
    232                     tmp = cobj.position 
    233                     cobj.position = sobj.position 
    234                     sobj.position = tmp 
    235                 cur_obj.reindexObject() 
    236                 swp_obj.reindexObject() 
    237  
    238          
    239     def getNavObjects(self, context): 
    240         contentFilter={'path':{'query':'/'.join(context.getPhysicalPath())+'/'},'sort_on':'getObjPositionInCourse'} 
    241         brains = context.portal_catalog.searchResults(contentFilter) 
    242         return [brain for brain in brains if not getattr(brain.aq_explicit, 'exclude_from_nav', True)] 
    243160 
    244161class RSSView(DefaultRSSView): 
  • 4.0/enpraxis.educommons/trunk/enpraxis/educommons/browser/configure.zcml

    r764 r887  
    1414  <browser:page 
    1515     name="order_courseobjs" 
    16      for="Products.CMFCore.interfaces.IFolderish" 
     16     for="enpraxis.educommons.interfaces.ICourse" 
    1717     class=".foldercontents.OrderContentsView" 
    1818     template="./order_objs.pt" 
     
    2121 
    2222  <browser:page 
    23      name="Course_Nav_position" 
    24      for="*" 
    25      class=".PositionView" 
     23     name="order_changecourseobjs" 
     24     for="enpraxis.educommons.interfaces.ICourse" 
     25     class=".coursenavposition.CourseNavPosition" 
    2626     permission="zope2.View" 
    2727     /> 
     
    194194     class=".packagecourseview.PackageCourseView" 
    195195     allowed_attributes="createIMSFile" 
    196      permission="zope2.View" 
    197      /> 
    198  
    199   <browser:page 
    200      for="*" 
    201      name="courseexportform" 
    202      class=".reusecourse.CourseExportForm" 
    203      permission="zope2.View" 
    204      /> 
    205  
    206   <browser:page 
    207      for="*" 
    208      name="importPackage" 
    209      class=".reusecourse.XMLRPC" 
    210      attribute="importPackage" 
    211      permission="zope2.View" 
    212      /> 
    213  
    214   <browser:page 
    215      for="*" 
    216      name="retrieveDivisions" 
    217      class=".reusecourse.XMLRPC" 
    218      attribute="retrieveDivisions" 
    219196     permission="zope2.View" 
    220197     /> 
     
    417394     /> 
    418395 
    419  
    420396  <browser:viewlet 
    421397     name="eduCommons.footer" 
    422398     manager="plone.app.layout.viewlets.interfaces.IPortalFooter" 
    423      template="footer.pt" 
     399     class=".educommonsfooter.eduCommonsFooterViewlet" 
     400     permission="zope2.View" 
     401     /> 
     402 
     403  <browser:viewlet 
     404     name="eduCommons.colophon" 
     405     manager="plone.app.layout.viewlets.interfaces.IPortalFooter" 
     406     class=".educommonscolophon.eduCommonsColophonViewlet" 
    424407     permission="zope2.View" 
    425408     /> 
  • 4.0/enpraxis.educommons/trunk/enpraxis/educommons/browser/rss_questions.pt

    r791 r887  
    127127      <div tal:replace="structure provider:plone.belowcontentbody" /> 
    128128 
    129       <div tal:replace="structure context/@@copyright_byline_view|nothing" /> 
    130  
    131       <div tal:replace="structure context/@@citation_view|nothing" /> 
    132  
    133129    </metal:main-macro> 
    134130    </div> 
  • 4.0/enpraxis.educommons/trunk/enpraxis/educommons/browser/table.pt

    r8 r887  
    3434      <thead> 
    3535          <tr> 
    36             <th class="nosort">&nbsp;</th> 
    3736            <th tal:attributes="class nosortclass" 
    3837                id="foldercontents-title-column">&nbsp;<tal:title i18n:translate="listingheader_title" 
     
    6564                 </tal:comment> 
    6665 
    67                  <td class="notDraggable"> 
    68                      <input type="checkbox" 
    69                             class="noborder" 
    70                             name="paths:list" id="#" 
    71                             value="#" 
    72                             tal:attributes="value   item/path; 
    73                                             id      string:cb_${item/id}; 
    74                                             checked item/checked; 
    75                                             alt     string:Select ${item/title_or_id}; 
    76                                             title   string:Select ${item/title_or_id}" /> 
    77                 <input type="hidden" name="selected_obj_paths:list" value="#" 
    78                        tal:attributes="value item/relative_url" /> 
    79                 <label tal:content="item/title_or_id" 
    80                        tal:attributes="for string:cb_${item/id}"  
    81                        class="hiddenStructure"> 
    82                   Item Title 
    83                 </label> 
    84               </td> 
    8566              <td> 
    8667                  <span tal:attributes="class item/type_class"> 
     
    120101                   title="Move item up" 
    121102                   i18n:attributes="title title_move_item_up;" 
    122                    tal:attributes="href string:Course_Nav_position?position=up&amp;id=${item/quoted_id}&amp;url=${item/path}"> 
     103                   tal:attributes="href string:order_changecourseobjs?position=up&amp;url=${item/path}"> 
    123104                  &#9650; 
    124105                </a> 
     
    127108                   title="Move item down" 
    128109                   i18n:attributes="title title_move_item_down;" 
    129                    tal:attributes="href string:Course_Nav_position?position=down&amp;id=${item/quoted_id}&amp;url=${item/path}"> 
     110                   tal:attributes="href string:order_changecourseobjs?position=down&amp;url=${item/path}"> 
    130111                  &#9660; 
    131112                </a> 
     
    136117    </metal:block> 
    137118  </table> 
     119<!-- 
    138120  <tal:buttons tal:repeat="button view/buttons"> 
    139121    <input class="context" 
     
    144126           tal:attributes="value button/title; name button/url; class button/cssclass" /> 
    145127  </tal:buttons> 
     128--> 
    146129  </metal:listing> 
    147130</div> 
  • 4.0/enpraxis.educommons/trunk/enpraxis/educommons/profiles/default/actions.xml

    r827 r887  
    368368    </object> 
    369369  </object> 
    370  
     370  <object name="ecfooter_actions" meta_type="CMF Action Category"> 
     371    <property name="title"></property> 
     372    <object name="feedback" meta_type="CMF Action" i18n:domain="plone"> 
     373      <property name="title" i18n:translate="">Feedback</property> 
     374      <property name="description" i18n:translate=""></property> 
     375      <property name="url_expr">string:${globals_view/navigationRootUrl}/contact-info</property> 
     376      <property name="icon_expr"></property> 
     377      <property name="available_expr"></property> 
     378      <property name="permissions"> 
     379        <element value="View"/> 
     380      </property> 
     381      <property name="visible">True</property> 
     382    </object> 
     383    <object name="sitemap" meta_type="CMF Action" i18n:domain="plone"> 
     384      <property name="title" i18n:translate="">Site Map</property> 
     385      <property name="description" i18n:translate=""></property> 
     386      <property name="url_expr">string:${globals_view/navigationRootUrl}/sitemap</property> 
     387      <property name="icon_expr"></property> 
     388      <property name="available_expr"></property> 
     389      <property name="permissions"> 
     390        <element value="View"/> 
     391      </property> 
     392      <property name="visible">True</property> 
     393    </object> 
     394    <object name="accessibility" meta_type="CMF Action" i18n:domain="plone"> 
     395      <property name="title" i18n:translate="">Accessibility</property> 
     396      <property name="description" i18n:translate=""></property> 
     397      <property 
     398         name="url_expr">string:${globals_view/navigationRootUrl}/accessibility-info</property> 
     399      <property name="icon_expr"></property> 
     400      <property name="available_expr"></property> 
     401      <property name="permissions"> 
     402        <element value="View"/> 
     403      </property> 
     404      <property name="visible">True</property> 
     405    </object> 
     406    <object name="terms_of_use" meta_type="CMF Action" i18n:domain="eduCommons"> 
     407      <property name="title" i18n:translate="">Terms of Use</property> 
     408      <property name="description" i18n:translate=""></property> 
     409      <property 
     410         name="url_expr">string:${globals_view/navigationRootUrl}/about/terms-of-use</property> 
     411      <property name="icon_expr"></property> 
     412      <property name="available_expr"></property> 
     413      <property name="permissions"> 
     414        <element value="View"/> 
     415      </property> 
     416      <property name="visible">True</property> 
     417    </object> 
     418    <object name="privacy_policy" meta_type="CMF Action" i18n:domain="eduCommons"> 
     419      <property name="title" i18n:translate="">Privacy Policy</property> 
     420      <property name="description" i18n:translate=""></property> 
     421      <property 
     422         name="url_expr">string:${globals_view/navigationRootUrl}/about/privacy-policy</property> 
     423      <property name="icon_expr"></property> 
     424      <property name="available_expr"></property> 
     425      <property name="permissions"> 
     426        <element value="View"/> 
     427      </property> 
     428      <property name="visible">True</property> 
     429    </object> 
     430    <object name="login" meta_type="CMF Action" i18n:domain="plone"> 
     431      <property name="title" i18n:translate="">Log in</property> 
     432      <property name="description" i18n:translate=""></property> 
     433      <property name="url_expr">string:${globals_view/navigationRootUrl}/login_form</property> 
     434      <property name="icon_expr"></property> 
     435      <property name="available_expr">python:member is None</property> 
     436      <property name="permissions"> 
     437        <element value="View"/> 
     438      </property> 
     439      <property name="visible">True</property> 
     440    </object> 
     441    <object name="plone_setup" meta_type="CMF Action" i18n:domain="plone"> 
     442      <property name="title" i18n:translate="">Site Setup</property> 
     443      <property name="description" i18n:translate=""></property> 
     444      <property 
     445         name="url_expr">string:${portal_url}/plone_control_panel</property> 
     446      <property name="icon_expr"></property> 
     447      <property name="available_expr"></property> 
     448      <property name="permissions"> 
     449        <element value="Manage portal"/> 
     450      </property> 
     451      <property name="visible">True</property> 
     452    </object> 
     453    <object name="logout" meta_type="CMF Action" i18n:domain="plone"> 
     454      <property name="title" i18n:translate="">Log out</property> 
     455      <property name="description" i18n:translate=""></property> 
     456      <property name="url_expr">string:${globals_view/navigationRootUrl}/logout</property> 
     457      <property name="icon_expr"></property> 
     458      <property name="available_expr">python:member is not None</property> 
     459      <property name="permissions"> 
     460        <element value="View"/> 
     461      </property> 
     462      <property name="visible">True</property> 
     463    </object> 
     464  </object> 
     465  <object name="eccolophon_actions" meta_type="CMF Action Category"> 
     466    <property name="title"></property> 
     467    <object name="poweredby_educommons" meta_type="CMF Action" i18n:domain="eduCommons"> 
     468      <property name="title" i18n:translate="">Powered by eduCommons</property> 
     469      <property name="description" i18n:translate=""></property> 
     470      <property 
     471         name="url_expr">string:http://educommons.com</property> 
     472      <property name="icon_expr"></property> 
     473      <property name="available_expr"></property> 
     474      <property name="permissions"> 
     475      <element value="View"/> 
     476      </property> 
     477      <property name="visible">True</property> 
     478    </object> 
     479    <object name="valid_xhtml" meta_type="CMF Action" i18n:domain="eduCommons"> 
     480      <property name="title" i18n:translate="">Valid XHTML</property> 
     481      <property name="description" i18n:translate=""></property> 
     482      <property 
     483         name="url_expr">string:http://validator.w3.org/check/referer</property> 
     484      <property name="icon_expr"></property> 
     485      <property name="available_expr"></property> 
     486      <property name="permissions"> 
     487        <element value="View"/> 
     488      </property> 
     489      <property name="visible">True</property> 
     490    </object> 
     491  </object> 
    371492</object> 
    372493 
  • 4.0/enpraxis.educommons/trunk/enpraxis/educommons/profiles/default/metadata.xml

    r793 r887  
    77    <dependency>profile-collective.contentlicensing:default</dependency> 
    88    <dependency>profile-collective.imstransport:default</dependency> 
    9     <dependency>profile-collective.jaop:default</dependency> 
    109    <dependency>profile-collective.oaiintercom:default</dependency> 
    1110    <dependency>profile-collective.searchandreplace:default</dependency> 
  • 4.0/enpraxis.educommons/trunk/enpraxis/educommons/profiles/default/viewlets.xml

    r804 r887  
    55    <viewlet name="plone.belowcontenttitle.documentbyline" />      
    66  </order> 
    7   <order manager="plone.portalfooter" skinname="*"> 
     7  <order manager="plone.portalfooter" skinname="Left Skin"> 
    88    <viewlet name="eduCommons.footer" /> 
    9     <viewlet name="plone.colophon" /> 
     9    <viewlet name="eduCommons.colophon" /> 
    1010  </order> 
    1111  <hidden manager="plone.belowcontentbody" skinname="Left Skin"> 
     
    2020  <hidden manager="plone.portalfooter" skinname="Plone Default"> 
    2121    <viewlet name="plone.footer" /> 
     22    <viewlet name="plone.colophon" /> 
    2223    <viewlet name="plone.site_actions" /> 
    2324  </hidden> 
    24   <hidden manager="plone.portalfooter" skinname="Left Skin"> 
    25     <viewlet name="plone.footer" /> 
    26     <viewlet name="plone.site_actions" /> 
     25  <hidden manager="plone.portalheader" skinname="Left Skin"> 
     26    <viewlet name="plone.personal_bar" /> 
    2727  </hidden> 
    2828</object> 
  • 4.0/enpraxis.educommons/trunk/enpraxis/educommons/skins/eduCommons/eduCommonsContent.css.dtml

    r804 r887  
    2727#siteaction-accessibility, 
    2828#siteaction-contact {  
    29     visibility: hidden; 
     29/*    visibility: hidden; */ 
    3030} 
    3131 
     
    799799 
    800800/* Default Plone utilizes display:table-row and table-cell, both of which don't work in IE7   */ 
    801 #portal-colophon ul { 
     801 
     802#portal-colophon-items li { 
    802803    display: inline; 
    803804} 
    804805 
    805 #portal-colophon ul li { 
    806     display: inline; 
     806#portal-colophon-items li:after {  
     807    content: " :: "; 
     808} 
     809 
     810#portal-colophon-items li:last-child:after {  
     811    content: ""; 
    807812} 
    808813 
  • 4.0/enpraxis.educommons/trunk/enpraxis/educommons/skins/eduCommons/folder_summary_view.pt

    r8 r887  
    186186        <div tal:replace="structure provider:plone.belowcontentbody" /> 
    187187 
    188         <div tal:replace="structure context/@@copyright_byline_view|nothing" /> 
    189  
    190         <div tal:replace="structure context/@@citation_view|nothing" /> 
    191  
    192188    </metal:main-macro> 
    193189    </div> 
  • 4.0/enpraxis.educommons/trunk/enpraxis/educommons/skins/eduCommons/folder_tabular_view.pt

    r8 r887  
    188188        <div tal:replace="structure provider:plone.belowcontentbody" /> 
    189189 
    190         <div tal:replace="structure context/@@copyright_byline_view|nothing" /> 
    191  
    192         <div tal:replace="structure context/@@citation_view|nothing" /> 
    193  
    194190    </metal:main-macro> 
    195191    </div> 
Note: See TracChangeset for help on using the changeset viewer.