Changeset 580


Ignore:
Timestamp:
08/07/06 17:23:46 (13 years ago)
Author:
szabolcs
Message:

closes #610, spent 2h

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Piece.py

    r575 r580  
    2626from Resources import Resource 
    2727 
    28 schema = BaseSchema + description + tags + author_schema + license_schema + coverImage + parentVersion + contentFile + sourceFile + lemill_metadata_mods   
     28schema = BaseSchema + description + tags + author_schema + original_author_schema + license_schema + coverImage + parentVersion + contentFile + sourceFile + lemill_metadata_mods   
    2929 
    3030schema = schema + Schema(( 
     
    5151            visible = {'edit': 'invisible', 'view': 'invisible'}, 
    5252            ), 
    53         ),         
     53        ), 
    5454    )) 
    5555 
  • trunk/SectionFolder.py

    r575 r580  
    107107        return new.base_edit(portal_status_message=mess) 
    108108 
    109     def getMetadaFieldsToShowInEditor(self, object): 
     109    def getMetadataFieldsToShowInEditor(self, object): 
    110110        """ gets fields which are shown in metadata edit area """ 
    111111        type = object.meta_type 
     
    326326        """ 
    327327        file = REQUEST.get('file') 
    328         user_title = REQUEST.get('user_title') 
    329328        user_description = REQUEST.get('user_description') 
    330329        content_type = file.headers['Content-Type'] 
     
    336335            return REQUEST.RESPONSE.redirect('lemill_explain_upload_fail') 
    337336         
    338         new = self._lemill_invokeFactory(self, type, id=type+str(id(self)), title=user_title) 
     337        new = self._lemill_invokeFactory(self, type, id=type+str(id(self))) 
    339338        new.edit(description=user_description, file=file.read()) 
    340339        if type=='Piece': 
  • trunk/SharedMetadata.py

    r577 r580  
    8787       vocabulary=DisplayList((LICENSES)), 
    8888       widget=CopyrightWidget( 
    89            visible={'edit':'invisible'} 
     89           visible={'edit':'visible'} 
    9090           ), 
    9191       ), 
     
    198198)) 
    199199 
     200original_author_schema = Schema(( 
     201    StringField('originalAuthor', 
     202              schemata="metadata", 
     203              widget = StringWidget( 
     204                  visible = {'view':'invisible', 'edit':'visible'}, 
     205                  label='Original author', 
     206                  label_msgid='label_original_author', 
     207                  ), 
     208              ) 
     209)) 
     210 
    200211contentFile = Schema(( 
    201212    FileField('file', 
  • trunk/config.py

    r563 r580  
    7474 
    7575#list of shown metadata fields, if 'all' is in array then all fields are shown 
    76 SHOW_METADATA_FIELDS = {'Piece':['all',], 
     76SHOW_METADATA_FIELDS = {'Piece':['description', 'tags'], 
    7777                        'PresentationMaterial':['all',], 
    7878                        'MultimediaMaterial':['all',], 
     
    157157    } 
    158158 
    159 LICENSES = (('CreativeCommons', '''Creative Commons BY-SA License'''),) 
     159LICENSES = (('CreativeCommons', '''Creative Commons BY-SA License'''), ('FreeDocumentationLicense', 'Free Documentation License'), ('PublicDomain', 'Public Domain')) 
    160160 
    161161for section in SECTIONS: 
  • trunk/skins/lemill/base_metadata.cpt

    r493 r580  
    7373        tal:attributes="action python:here.absolute_url()+'/'+template.id"> 
    7474 
    75         <tal:fields repeat="field python: here.getMetadaFieldsToShowInEditor(here)"> 
     75        <tal:fields repeat="field python: here.getMetadataFieldsToShowInEditor(here)"> 
    7676        <metal:fieldMacro use-macro="python: here.widget(field.getName(), mode='edit')"/> 
    7777        </tal:fields> 
  • trunk/skins/lemill/document_byline.pt

    r579 r580  
    22     i18n:domain="plone" 
    33     tal:condition="python: site_properties.allowAnonymousViewAbout or not isAnon" 
    4      tal:define="creators here/getAuthors | nothing;"> 
     4     tal:define="creators here/getAuthors | nothing; 
     5                 original_author here/getOriginalAuthor |nothing;"> 
     6        
    57 
    68    <div class="documentByLine"> 
     
    1618        <tal:creatornames tal:condition="python:creators and wf_state=='public'"> 
    1719          <tal:block i18n:domain="lemill" i18n:translate="label_by_authors_prefix">by  
     20          </tal:block> 
     21          <tal:block condition="original_author"> 
     22            <tal:block content="original_author"/> 
     23            , sent by 
    1824          </tal:block> 
    1925           <span tal:repeat="creator creators" tal:omit-tag=""> 
  • trunk/skins/lemill/lemill_content_add.pt

    r497 r580  
    3232                 
    3333                <form action="" method="post" tal:attributes="action string:${here/absolute_url}/uploadIt;" enctype="multipart/form-data"> 
    34                     <div class="field"> 
    35                         <label i18n:domain="plone" i18n:translate="label_title" for="user_title">Title</label> 
    36                         <div class="formHelp"></div> 
    37                         <input type="text" name="user_title" id="user_title" size="40" /> 
    38                     </div> 
    3934                    <div class="field"> 
    4035                        <label i18n:translate="label_choose_file" for="file">Choose a file</label> 
  • trunk/skins/lemill/piece_edit.cpt

    r493 r580  
    4343      </script> 
    4444    </tal:js> 
     45    <script type="text/javascript" src="js_helpers.js"></script> 
    4546  </metal:head> 
    4647 
     
    7778        </tal:titlefield> 
    7879 
    79         <tal:fields repeat="field python: here.getMetadaFieldsToShowInEditor(here)"> 
     80        <tal:fields repeat="field python: here.getMetadataFieldsToShowInEditor(here)"> 
    8081            <metal:fieldMacro use-macro="python: here.widget(field.getName(), mode='edit')"/> 
    8182        </tal:fields> 
    8283 
     84            If you are not the author of this piece you must add <a href="javascript:setIdProperty('copyright','display','block');">copyright information</a> 
     85        <div id="copyright" style="display:none"> 
     86            <metal:fieldMacro use-macro="python: here.widget('originalAuthor', mode='edit')"/> 
     87            <metal:fieldMacro use-macro="python: here.widget('rights', mode='edit')"/> 
     88 
     89        </div> 
     90 
    8391 
    8492      <input type="hidden" name="form.submitted" value="1" /> 
    85  
    86       <input type="hidden" name="fieldset" value="metadata" 
    87        tal:attributes="value fieldset|string:metadata" /> 
    8893 
    8994      <input type="hidden" name="current_lang" value="" 
Note: See TracChangeset for help on using the changeset viewer.