This repo implements five plugins for Software Management Plan (SMP) projects in RDMO:
- a README export plugin, which creates a README.md file with the data in an SMP project
- a CITATION export plugin, which creates a CITATION.cff file with the data in an SMP project
- a CodeMeta export plugin, which creates a codemeta.json file with the data in an SMP project
- a LICENSE export plugin, which creates a LICENSE file or a licenses.zip file with the license(s) chosen for an SMP project
- an SMP Report export plugin, which creates a pdf file with all answers of an SMP project, displayed as a report
This repo also implements two mixin classes (SMPExportMixin, SMPRepoImportMixin), which can be used by other export plugins or import plugins. These classes offer SMP-specific export and import options. An example implementation for an export plugin is the GitHubExportProvider, and for an import plugin: GitHubImportProvider
Furthermore, you will find a custom field "MultivalueCheckboxMultipleChoiceField" that displays choices similar to django's MultipleChoiceField with a CheckboxSelectMultiple widget. The difference to the built-in field is, that you can optionally have an extra text field for each choice, in case you need further text input. With this custom field you can also sort selected choices. For details, check out the Field's docstring and for example implementations take a look at the GitHubExportProvider and GitHubImportProvider or try them out at our demo RDMO instance.
-
Install the plugin in your RDMO virtual environment using pip (directly from GitHub):
```bash pip install git+https://github.com/MPDL/rdmo-plugins-maus ``` -
Add "plain" and "pdf" to EXPORT_FORMATS in
config/settings/local.py:```python EXPORT_FORMATS = ( ... ('plain', _('Plain Text')), ('pdf', _('PDF')), ) ``` -
For the export plugins, add the plugins to PROJECT_EXPORTS in
config/settings/local.py:```python PROJECT_EXPORTS += [ ('smp-readme', _('README'), 'rdmo_maus.exports.smp_exports.SMPReadmeExport'), ('smp-citation', _('CITATION'), 'rdmo_maus.exports.smp_exports.SMPCitationExport'), ('smp-codemeta', _('CodeMeta'), 'rdmo_maus.exports.smp_exports.SMPCodeMetaExport'), ('smp-license', _('LICENSE'), 'rdmo_maus.exports.smp_exports.SMPLicenseExport'), ('smp-report', _('SMP Report'), 'rdmo_maus.exports.smp_exports.SMPReportExport') ] ``` -
For the README, CITATION, CodeMeta and SMP Report export plugins, import the views needed in your RDMO instance. The views are "view-smp-citation.xml", "view-smp-codemeta.xml", "view-smp-readme.xml" and "view-smp-report.xml" and can be found in our forked rdmo-catalog.
For SMP projects, users can export custom files (README, CITATION, CodeMeta, LICENSE, and SMP report) created with the SMP project's data.
This repo also implements two mixin classes (SMPExportMixin, SMPRepoImportMixin), which can be used by other export plugins or import plugins. These classes offer SMP-specific export and import options. An example implementation for an export plugin is the GitHubExportProvider, and for an import plugin: GitHubImportProvider
For details, check out the Field's docstring and for example implementations take a look at the GitHubExportProvider and GitHubImportProvider or try them out at our demo RDMO instance.
-
Import the field in your form with
from rdmo_maus.forms.custom_fields import MultivalueCheckboxMultipleChoiceField -
Define one of your fields with this custom field:
```python my_multiple_choices = MultivalueCheckboxMultipleChoiceField( label='My Sortable Multiple Choices', sortable=True, include_select_all_choice=True, choices=[ ('True,value-text-field', ('checkbox-label', 'text-label'), 'choice-1'), ('False', 'single-checkbox-label', 'choice-2') ] ) ``` -
Include form.media in your form template:
```html <head> ... {{ form.media }} </head> ```