|
| 1 | +# SPDX-License-Identifier: Apache-2.0 |
| 2 | +# |
| 3 | +# http://nexb.com and https://github.com/nexB/scancode.io |
| 4 | +# The ScanCode.io software is licensed under the Apache License version 2.0. |
| 5 | +# Data generated with ScanCode.io is provided as-is without warranties. |
| 6 | +# ScanCode is a trademark of nexB Inc. |
| 7 | +# |
| 8 | +# You may not use this software except in compliance with the License. |
| 9 | +# You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0 |
| 10 | +# Unless required by applicable law or agreed to in writing, software distributed |
| 11 | +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR |
| 12 | +# CONDITIONS OF ANY KIND, either express or implied. See the License for the |
| 13 | +# specific language governing permissions and limitations under the License. |
| 14 | +# |
| 15 | +# Data Generated with ScanCode.io is provided on an "AS IS" BASIS, WITHOUT WARRANTIES |
| 16 | +# OR CONDITIONS OF ANY KIND, either express or implied. No content created from |
| 17 | +# ScanCode.io should be considered or used as legal advice. Consult an Attorney |
| 18 | +# for any legal advice. |
| 19 | +# |
| 20 | +# ScanCode.io is a free software code scanning tool from nexB Inc. and others. |
| 21 | +# Visit https://github.com/nexB/scancode.io for support and download. |
| 22 | + |
| 23 | +from django import forms |
| 24 | + |
| 25 | + |
| 26 | +class EditorForm(forms.Form): |
| 27 | + input_text = forms.CharField( |
| 28 | + widget=forms.Textarea( |
| 29 | + attrs={ |
| 30 | + "rows": 30, |
| 31 | + "class": "textarea has-fixed-size", |
| 32 | + "placeholder": "Paste your license text here.", |
| 33 | + } |
| 34 | + ), |
| 35 | + required=True, |
| 36 | + ) |
| 37 | + |
| 38 | + # def clean_input_text(self): |
| 39 | + # input_text = self.cleaned_data.get("input_text") |
| 40 | + # return " ".join(input_text.split()) |
| 41 | + |
| 42 | + # def save(self, *args, **kwargs): |
| 43 | + # license = super().save(*args, **kwargs) |
| 44 | + # self.handle_input(license) |
| 45 | + # return license |
| 46 | + |
| 47 | + # class Media: |
| 48 | + # js = ("add-inputs.js",) |
| 49 | + |
| 50 | + # def handle_inputs(self, project): |
| 51 | + # input_file = self.files.getlist("input_files") |
| 52 | + # input_text = self.cleaned_data.get("input_text") |
| 53 | + # print(input_text) |
| 54 | + # if input_file: |
| 55 | + # license.add_uploads(input_file) |
| 56 | + # elif input_text: |
| 57 | + # license.add_license(input_text) |
| 58 | + |
| 59 | + # input_files = forms.FileField( |
| 60 | + # required=False, |
| 61 | + # widget=forms.ClearableFileInput( |
| 62 | + # attrs={"class": "file-input", "multiple": False}, |
| 63 | + # ), |
| 64 | + # ) |
0 commit comments