| 24 | |
| 25 | |
| 26 | class AddLinkForm(forms.Form): |
| 27 | url = forms.RegexField(label="URLs (one per line)", regex=URL_REGEX, min_length='6', strip=True, widget=forms.Textarea, required=True) |
| 28 | parser = forms.ChoiceField(label="URLs format", choices=[('auto', 'Auto-detect parser'), *PARSER_CHOICES], initial='auto') |
| 29 | tag = forms.CharField(label="Tags (comma separated tag1,tag2,tag3)", strip=True, required=False) |
| 30 | depth = forms.ChoiceField(label="Archive depth", choices=DEPTH_CHOICES, initial='0', widget=forms.RadioSelect(attrs={"class": "depth-selection"})) |
| 31 | archive_methods = forms.MultipleChoiceField( |
| 32 | label="Archive methods (select at least 1, otherwise all will be used by default)", |
| 33 | required=False, |
| 34 | widget=forms.SelectMultiple, |
| 35 | choices=ARCHIVE_METHODS, |
| 36 | ) |
| 37 | # TODO: hook these up to the view and put them |
| 38 | # in a collapsible UI section labeled "Advanced" |
| 39 | # |
| 40 | # exclude_patterns = forms.CharField( |
| 41 | # label="Exclude patterns", |
| 42 | # min_length='1', |
| 43 | # required=False, |
| 44 | # initial=URL_DENYLIST, |
| 45 | # ) |
| 46 | # timeout = forms.IntegerField( |
| 47 | # initial=TIMEOUT, |
| 48 | # ) |
| 49 | # overwrite = forms.BooleanField( |
| 50 | # label="Overwrite any existing Snapshots", |
| 51 | # initial=False, |
| 52 | # ) |
| 53 | # index_only = forms.BooleanField( |
| 54 | # label="Add URLs to index without Snapshotting", |
| 55 | # initial=False, |
| 56 | # ) |
| 57 | |
| 58 | class TagWidgetMixin: |
| 59 | def format_value(self, value): |
no outgoing calls
no test coverage detected