Changeset 884

Show
Ignore:
Timestamp:
11/28/11 17:31:18 (6 months ago)
Author:
brent
Message:

Fixed course summary pages when the bar is clicked on.

Location:
4.0/enpraxis.educommons/trunk/enpraxis/educommons
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • 4.0/enpraxis.educommons/trunk/enpraxis/educommons/annotations/configure.zcml

    r798 r884  
    2626     /> 
    2727 
    28   <adapter name="getClearCopyright"  
     28  <adapter name="getCopyrightCleared"  
    2929           factory=".indexers.getCopyrightCleared" /> 
    3030 
    31   <adapter name="getAaccessibilityCompliant" 
     31  <adapter name="getAccessibilityCompliant" 
    3232           factory=".indexers.getAccessibilityCompliant" /> 
    3333 
  • 4.0/enpraxis.educommons/trunk/enpraxis/educommons/browser/accessibilityview.py

    r746 r884  
    3737                access.accessible = True 
    3838                message=_(u'Accessibility Compliant set to True') 
     39                self.context.reindexObject() 
    3940            elif 'False' == value and access.accessible: 
    4041                access.accessible = False 
    4142                message=_(u'Accessibility Compliant set to False') 
     43                self.context.reindexObject() 
    4244        return message 
    4345 
  • 4.0/enpraxis.educommons/trunk/enpraxis/educommons/browser/copyrightview.py

    r746 r884  
    3737                clear.clearedcopyright = True 
    3838                message = _(u'Copyright Cleared') 
     39                self.context.reindexObject() 
    3940            elif 'False' == value and clear.clearedcopyright: 
    4041                clear.clearedcopyright = False 
    4142                message = _(u'Copyright Revoked') 
     43                self.context.reindexObject() 
    4244        return message 
    4345 
  • 4.0/enpraxis.educommons/trunk/enpraxis/educommons/browser/summarycontents.py

    r506 r884  
    3434 
    3535 
    36  
    3736class SummaryContentsView(FolderContentsView): 
    3837    """ 
     
    5857    """                 
    5958 
    60  
    61     def __init__(self, context, request, contentFilter={}): 
     59    def __init__(self, context, request, contentFilter=None): 
    6260        """ 
    6361        Initialize the table 
     
    7169                           buttons=self.buttons) 
    7270 
    73     @property 
    74     def items(self): 
    75         """ 
    76         """ 
    77         plone_utils = getToolByName(self.context, 'plone_utils') 
    78         plone_view = getMultiAdapter((self.context, self.request), name=u'plone') 
    79         portal_workflow = getToolByName(self.context, 'portal_workflow') 
    80         portal_properties = getToolByName(self.context, 'portal_properties') 
    81         site_properties = portal_properties.site_properties 
    82          
    83         use_view_action = site_properties.getProperty('typesUseViewActionInListings', ()) 
    84         browser_default = self.context.browserDefault() 
    85         
    86  
    87         contentsMethod = self.context.queryCatalog 
    88         
    89         results = list() 
    90         for i, obj in enumerate(contentsMethod(self.contentFilter)): 
    91             if i % 2 == 0: 
    92                 table_row_class = "draggable even" 
    93             else: 
    94                 table_row_class = "draggable odd" 
    95  
    96             url = obj.getURL() 
    97             path = obj.getPath or "/".join(obj.getPhysicalPath()) 
    98             icon = plone_view.getIcon(obj); 
    9971             
    100             type_class = 'contenttype-' + plone_utils.normalizeString( 
    101                 obj.portal_type) 
    102  
    103             review_state = obj.review_state 
    104             state_class = 'state-' + plone_utils.normalizeString(review_state) 
    105             relative_url = obj.getURL(relative=True) 
    106             obj_type = obj.portal_type 
    107  
    108             modified = plone_view.toLocalizedTime( 
    109                 obj.ModificationDate, long_format=1) 
    110              
    111             if obj_type in use_view_action: 
    112                 view_url = url + '/view' 
    113             elif obj.is_folderish: 
    114                 view_url = url + "/folder_contents"               
    115             else: 
    116                 view_url = url 
    117  
    118             is_browser_default = len(browser_default[1]) == 1 and ( 
    119                 obj.id == browser_default[1][0]) 
    120  
    121             if IAnnotations(obj.getObject()).has_key('eduCommons.clearcopyright'): 
    122                 cc_status = IAnnotations(obj.getObject())['eduCommons.clearcopyright'] 
    123             else: 
    124                 cc_status = False 
    125                                
    126             results.append(dict( 
    127                 url = url, 
    128                 id  = obj.getId, 
    129                 quoted_id = urllib.quote_plus(obj.getId), 
    130                 path = path, 
    131                 title_or_id = obj.pretty_title_or_id(), 
    132                 description = obj.Description, 
    133                 obj_type = obj_type, 
    134                 size = obj.getObjSize, 
    135                 modified = modified, 
    136                 icon = icon.html_tag(), 
    137                 type_class = type_class, 
    138                 wf_state = review_state, 
    139                 state_title = portal_workflow.getTitleForStateOnType(review_state, 
    140                                                            obj_type), 
    141                 state_class = state_class, 
    142                 is_browser_default = is_browser_default, 
    143                 folderish = obj.is_folderish, 
    144                 relative_url = relative_url, 
    145                 view_url = view_url, 
    146                 table_row_class = table_row_class, 
    147                 is_expired = self.context.isExpired(obj), 
    148                 cc_status = cc_status, 
    149             )) 
    150         return results 
    151  
    15272    @property 
    15373    def buttons(self): 
  • 4.0/enpraxis.educommons/trunk/enpraxis/educommons/browser/summary_table.pt

    r8 r884  
    6161                >State</tal:state>&nbsp;</th> 
    6262            <th class="nosort"  
    63                 id="foldercontents-order-column" 
    64                 tal:condition="view/show_sort_column"> 
    65               &nbsp;<tal:order i18n:translate="listingheader_order">Flags</tal:order>&nbsp;</th> 
     63                id="foldercontents-cc-column"> 
     64              &nbsp;<tal:cc i18n:domain="eduCommons" i18n:translate="">Flags</tal:cc>&nbsp;</th> 
    6665          </tr> 
    6766      </thead> 
     
    10099                      <img tal:replace="structure item/icon" /> 
    101100                      <a href="#" tal:attributes="href  item/view_url; 
    102                                                 title string: ${item/obj_type}: ${item/description}; 
     101                                                title string: ${item/obj_type}: ${item/brain/Description}; 
    103102                                                class item/state_class;"> 
    104103                        <strong tal:omit-tag="not: item/is_browser_default" 
     
    129128                  <span tal:condition="not: item/state_title">&nbsp;</span> 
    130129              </td> 
    131               <td tal:define="copyright_status item/cc_status" width="15px" align="center"> 
    132                 <span tal:condition="copyright_status">&copy;</span> 
     130              <td tal:define="copyright_status item/brain/getCopyrightCleared|nothing; 
     131                              access_status item/brain/getAccessibilityCompliant|nothing"  
     132                  width="15px"  
     133                  align="center"> 
     134                <span tal:condition="copyright_status" style="color: green;">c</span> 
     135                <span tal:condition="access_status" style="color: blue;">a</span> 
    133136              </td> 
    134137             </tr> 
  • 4.0/enpraxis.educommons/trunk/enpraxis/educommons/portlet/courseinfo.pt

    r747 r884  
    1818            </td> 
    1919            <td class="statecolumn"> 
    20               <a tal:attributes="href string:${url}/summary_conents?sort_on=getObjPositionInCourse&state=${item}"> 
     20              <a tal:attributes="href string:${url}/summary_contents?sort_on=getObjPositionInCourse&state=${item}"> 
    2121                <img alt="barchart" class="statecolumnimage" 
    2222                     tal:attributes="width python:view.statePercent(item); 
  • 4.0/enpraxis.educommons/trunk/enpraxis/educommons/profiles/default/catalog.xml

    r744 r884  
    2222  <column value="getOerType" /> 
    2323  <column value="getFullCourseName" /> 
     24  <column value="getCopyrightCleared" /> 
     25  <column value="getAccessibilityCompliant" /> 
    2426</object>