2020-07-28 03:26:45 +00:00
|
|
|
__package__ = 'archivebox.core'
|
|
|
|
|
2020-07-02 20:54:25 +00:00
|
|
|
from django import forms
|
|
|
|
|
2020-07-28 03:26:45 +00:00
|
|
|
from ..util import URL_REGEX
|
|
|
|
|
2020-07-13 16:21:37 +00:00
|
|
|
CHOICES = (
|
2020-07-28 03:26:45 +00:00
|
|
|
('0', 'depth = 0 (archive just these URLs)'),
|
|
|
|
('1', 'depth = 1 (archive these URLs and all URLs one hop away)'),
|
2020-07-13 16:21:37 +00:00
|
|
|
)
|
2020-07-02 20:54:25 +00:00
|
|
|
|
|
|
|
class AddLinkForm(forms.Form):
|
2020-07-28 03:26:45 +00:00
|
|
|
url = forms.RegexField(label="URLs (one per line)", regex=URL_REGEX, min_length='6', strip=True, widget=forms.Textarea, required=True)
|
|
|
|
depth = forms.ChoiceField(label="Archive depth", choices=CHOICES, widget=forms.RadioSelect, initial='0')
|