-
Couldn't load subscription status.
- Fork 79
Fixes #2398 #2658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #2398 #2658
Changes from 7 commits
9797a1a
ad34d04
c73bd55
8aed862
f6cfb15
043f5eb
7b5f42d
6b099ca
ebd99b0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,26 @@ | ||
| # August 6, 2018 | ||
| # Create parameters for the ssh/scp remote file upload commands | ||
|
|
||
|
|
||
| from json import loads, dumps | ||
|
|
||
| from qiita_db.sql_connection import TRN | ||
| from qiita_db.software import Software, Command | ||
| from qiita_db.exceptions import (QiitaDBError, QiitaDBDuplicateError) | ||
| from qiita_db.util import convert_to_id | ||
| from qiita_db.study import Study | ||
| from re import sub | ||
|
|
||
| # August 31, 2018 | ||
| # Strip any UTF-8 characters that are not also printable ASCII characters | ||
| # from study titles. As some analysis packages cannot interpret UTF-8 | ||
| # characters, it becomes important to remove them from study titles, as | ||
| # they are used as metadata/identifiers when creating new analyses. | ||
| studies = Study.get_by_status('public') | ||
|
||
|
|
||
| for study in studies: | ||
| new_title = sub(r'[^\x20-\x7E]+', '', study.title) | ||
| if new_title != study.title: | ||
| study.title = new_title | ||
|
|
||
|
|
||
| # August 6, 2018 | ||
| # Create parameters for the ssh/scp remote file upload commands | ||
| # Copied from patch 58.py. Couldn't import due to how patching system works | ||
| def create_command(software, name, description, parameters, outputs=None, | ||
| analysis_only=False): | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,8 @@ | ||
| {% extends sitebase.html %} | ||
| {% block head %} | ||
| <script type="text/javascript" src="{% raw qiita_config.portal_dir %}/static/vendor/js/jquery.validate.min.js"></script> | ||
| <script type = "text/javascript" | ||
| src = "{% raw qiita_config.portal_dir %}/static/vendor/js/jquery.validate.min.js"> | ||
| </script> | ||
| <style> | ||
| .custom-combobox { | ||
| position: relative; | ||
|
|
@@ -32,7 +34,9 @@ | |
| var title = $(this).val(); | ||
| // removing any duplicated whitespaces | ||
| title = title.replace(/ +(?= )/g, ''); | ||
| // removing wite spaces from the front of the text | ||
| //remove all utf-8 encoded characters that are not also printable ASCII characters. | ||
| title = title.replace(/[^\x20-\x7E]+/g, ""); | ||
| // removing white spaces from the front of the text | ||
| $(this).val(title.trimLeft()); | ||
| }); | ||
| $("#create_study").validate({ | ||
|
|
@@ -156,8 +160,11 @@ <h3> | |
| {% if form_item.label.text == 'Environmental Packages' %} | ||
| {% set kwargs['size'] = len(form_item.choices) %} | ||
| {% set additional_info = 'You can select multiple entries by control-clicking (mac: command-clicking)' %} | ||
| {% elif form_item.label.text == 'Principan Investigator'%} | ||
| {% elif form_item.label.text == 'Principal Investigator'%} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks! |
||
| {% set kwargs['class_'] = kwargs['class_'] + ' chzn-select' %} | ||
| {% elif form_item.label.text == 'Study Title'%} | ||
| {% set additional_info = 'Study titles may only contain ASCII characters' %} | ||
|
|
||
| {% end %} | ||
| <tr> | ||
| <td width="20%">{% raw form_item.label %} <br /> <small>{{additional_info}}</small></td> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This patch needs to be moved to its own file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can do this in my PR as I'm fixing conflicts; however, in the past we have decided to have only one patch per release cycle ... thus; the idea of having in the same patch