pudo avatar pudo committed 4f95d00

2nd iteration of HRI.fi form, minus multi-selects

Comments (0)

Files changed (3)

 syntax: glob
 *.pyc
+*.swp
+*.swo
 *.egg-info
 #*.mo

ckanext/hrifi/forms.py

+# coding: utf-8 
 from gettext import translation
 from os.path import join, dirname
 
     builder = package.build_package_form(user_editable_groups=user_editable_groups)
     
     # Extra fields
+    builder.add_field(common.TextExtraField('title_se'))
+    builder.add_field(common.TextExtraField('title_en'))
+    builder.add_field(common.TextExtraField('external_reference_se'))
+    builder.add_field(common.TextExtraField('external_reference_en'))
+    builder.add_field(common.TextAreaExtraField('notes_se'))
+    builder.add_field(common.TextAreaExtraField('notes_en'))
     builder.add_field(common.TagField('tags'))
     builder.add_field(common.TextExtraField('external_reference'))
     builder.add_field(common.DateExtraField('date_released'))
     builder.add_field(common.DateExtraField('date_updated'))
     builder.add_field(common.TextExtraField('update_frequency'))
-    builder.add_field(common.SuggestedTextExtraField('geographic_granularity', options=schema.geographic_granularity_options))
-    builder.add_field(common.SuggestedTextExtraField('geographic_coverage', options=schema.state_options))
-    builder.add_field(common.SuggestedTextExtraField('temporal_granularity', options=schema.temporal_granularity_options))
+    builder.add_field(common.SuggestedTextExtraField('geographic_granularity',
+        options=schema.geographic_granularity_options, default='Tilastoalue'))
+    builder.add_field(common.SuggestedTextExtraField('geographic_coverage',
+        options=schema.state_options, default='Helsinki'))
+    builder.add_field(common.SuggestedTextExtraField('temporal_granularity',
+        options=schema.temporal_granularity_options, default='vuosi'))
     builder.add_field(common.DateRangeExtraField('temporal_coverage'))
-    builder.add_field(common.SuggestedTextExtraField('categories', options=schema.category_options))
+    builder.add_field(common.SuggestedTextExtraField('categories',
+        options=schema.category_options, default='Rakentaminen'))
     builder.add_field(common.SuggestedTextExtraField('department', options=schema.government_depts))
     builder.add_field(common.TextExtraField('agency'))
     builder.add_field(common.TextExtraField('taxonomy_url'))
     builder.add_field(common.TextExtraField('source'))
     #builder.add_field(common.TextExtraField('state'))
     builder.add_field(common.TextExtraField('collection'))
-    builder.add_field(HiddenTextExtraField('search_info'))
+    builder.add_field(common.TextExtraField('search_info'))
+    #builder.add_field(HiddenTextExtraField('search_info'))
     
 
     # Labels and instructions
     builder.set_field_text('name', _('Name'))
-    builder.set_field_text('title', _('Title'))
-    builder.set_field_text('external_reference', _('External Reference'))
-    builder.set_field_text('notes', _('Notes'))
+    builder.set_field_text('title', _('Otsikko (fi)'))
+    builder.set_field_text('title_se', _('Otsikko (se)'))
+    builder.set_field_text('title_en', _('Otsikko (en)'))
+    builder.set_field_text('external_reference', _('Ulkoinen linkki (fi)'))
+    builder.set_field_text('external_reference_se', _('Ulkoinen linkki (se)'))
+    builder.set_field_text('external_reference_en', _('Ulkoinen linkki (en)'))
+    builder.set_field_text('notes', _('Kuvaus (fi)'))
+    builder.set_field_text('notes_se', _('Kuvaus (se)'))
+    builder.set_field_text('notes_en', _('Kuvaus (en)'))
     builder.set_field_text('tags', _('Tags'))
     builder.set_field_text('date_released', _('Date Released'))
     builder.set_field_text('update_frequency', _('Update Frequency'))
 
     # Layout
     field_groups = OrderedDict([
-        (_('Basic information'), ['title', 'name', 'external_reference',
-                                  'notes']),
+        (_('Basic information'), ['title', 'title_se', 'title_en', 'name', 
+                                  'external_reference', 'external_reference_se',
+                                  'external_reference_en',
+                                  'notes', 'notes_se', 'notes_en']),
         (_('Details'), ['date_released', 'date_updated', 'update_frequency',
                         'geographic_granularity', 'geographic_coverage',
                         'temporal_granularity', 'temporal_coverage',
      _('Geographic coverage'), _('Temporal granularity'),
      _('Temporal coverage'), _('Categories'), _('National Statistic'),
      _('Precision'), _('Taxonomy URL'), _('Department'), _('Agency'),
-     _('Resources'), _('License')
+     _('Resources'), _('License'), _('Notes (se)'), _('Notes (en)'), 
+     _('External reference (se)'), _('External reference (en)')
      ]
 
 def get_hrifi_fieldset(is_admin=False, user_editable_groups=None, **kwargs):

theme/templates/package/search.html

       <py:if test="c.q">      
         <h4 i18n:msg="item_count"><strong>${c.page.item_count}</strong> packages found</h4>            
      </py:if>
-      <py:if test="c.page.item_count == 0 and c.q">
-        <p i18n:msg="">Would you like to <a href="${h.url_for(action='new', id=None)}">create a new package?</a></p>
-      </py:if>
-      ${package_list(c.page.items)}
-      ${c.page.pager(q=c.q)}
+     ${package_list(c.page.items)}
+     ${c.page.pager(q=c.q)}
 
   </div>
   <xi:include href="layout.html" />
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.