diff options
author | Prashant S | 2020-03-02 16:17:59 +0530 |
---|---|---|
committer | GitHub | 2020-03-02 16:17:59 +0530 |
commit | a87bea9854a2ab1248abac74c4b2f04f819297ee (patch) | |
tree | 37a17342e5764293454ae0e6e768e30f91c54f39 | |
parent | 7590b51f3a31c989d110eed4e132ea23c6c49afd (diff) | |
parent | 204f6ff6518a8aec1b4d374104616caa41713e8a (diff) | |
download | arduino_projects_website-a87bea9854a2ab1248abac74c4b2f04f819297ee.tar.gz arduino_projects_website-a87bea9854a2ab1248abac74c4b2f04f819297ee.tar.bz2 arduino_projects_website-a87bea9854a2ab1248abac74c4b2f04f819297ee.zip |
Merge pull request #8 from Sashi20/master
Remove attachments field from proposal form
-rw-r--r-- | arduino_blog/forms.py | 20 | ||||
-rw-r--r-- | arduino_blog/migrations/0006_remove_proposal_attachment.py | 17 | ||||
-rw-r--r-- | arduino_blog/models.py | 2 | ||||
-rw-r--r-- | arduino_blog/templates/home.html | 20 | ||||
-rw-r--r-- | arduino_blog/templates/submit-cfp.html | 7 | ||||
-rw-r--r-- | arduino_projects_website/settings.py | 1 |
6 files changed, 31 insertions, 36 deletions
diff --git a/arduino_blog/forms.py b/arduino_blog/forms.py index 20c3d2f..4945b79 100644 --- a/arduino_blog/forms.py +++ b/arduino_blog/forms.py @@ -237,9 +237,9 @@ class AbstractProposalForm(forms.ModelForm): error_messages={ 'required': 'About the author field required.'}, ) - attachment = forms.FileField(widget=forms.ClearableFileInput(attrs={'multiple': True}), - label='Please upload relevant documents (if any)', - required=False,) + # attachment = forms.FileField(widget=forms.ClearableFileInput(attrs={'multiple': True}), + # label='Please upload relevant documents (if any)', + # required=False,) title_of_the_project = forms.CharField(widget=forms.TextInput(attrs={'class': 'form-control', 'placeholder': 'Title of the Project'}), required=True, error_messages={ @@ -272,17 +272,3 @@ class AbstractProposalForm(forms.ModelForm): super(AbstractProposalForm, self).__init__(*args, **kwargs) self.fields['completion_date'].disabled = True self.fields['completion_date'].initial = (datetime.date.today() + relativedelta(months=1)) - - def clean_attachment(self): - import os - cleaned_data = self.cleaned_data - attachment = cleaned_data.get('attachment', None) - if attachment: - ext = os.path.splitext(attachment.name)[1] - valid_extensions = ['.pdf'] - if not ext in valid_extensions: - raise forms.ValidationError( - u'File not supported! Only .pdf file is accepted') - if attachment.size > (5*1024*1024): - raise forms.ValidationError('File size exceeds 5MB') - return attachment diff --git a/arduino_blog/migrations/0006_remove_proposal_attachment.py b/arduino_blog/migrations/0006_remove_proposal_attachment.py new file mode 100644 index 0000000..1cb0463 --- /dev/null +++ b/arduino_blog/migrations/0006_remove_proposal_attachment.py @@ -0,0 +1,17 @@ +# Generated by Django 3.0.3 on 2020-03-02 10:16 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('arduino_blog', '0005_auto_20200228_1241'), + ] + + operations = [ + migrations.RemoveField( + model_name='proposal', + name='attachment', + ), + ] diff --git a/arduino_blog/models.py b/arduino_blog/models.py index b8c60c8..84c6bd0 100644 --- a/arduino_blog/models.py +++ b/arduino_blog/models.py @@ -117,7 +117,7 @@ class Proposal(BaseClass): email = models.CharField(max_length=128) title_of_the_project = models.CharField(max_length=250) abstract = models.TextField(max_length=700) - attachment = models.FileField(upload_to=get_document_dir) + #attachment = models.FileField(upload_to=get_document_dir) status = models.CharField(max_length=100, default='Pending', editable=True) completion_date = models.DateTimeField(null=True, blank=True) approval_date = models.DateTimeField(null=True, blank=True) diff --git a/arduino_blog/templates/home.html b/arduino_blog/templates/home.html index b7f99fd..ddf9e7f 100644 --- a/arduino_blog/templates/home.html +++ b/arduino_blog/templates/home.html @@ -10,19 +10,13 @@ <div class="container"> <h1>Open Source Hardware Project</h1> <p class="lead text-muted text-justify"> - Back in 2005, a group of students envisaged a world where they have affordable access to digital devices, - that they can interact with the environment using sensors and microcontrollers. Fast forward 15 years and Arduino has - become a household name in the community of not just students, but also novices, professionals and DIY makers. - The formidable headway that was brought about has given courage and vision to all the opensource hardware projects - henceforth. We at FOSSEE also became a part by adopting the platform, and using it to teach Electronics across India. - The learning resources, both hardware and lectures, put together by the Opensource-hardware team of FOSSEE and - Spoken Tutorial has already demonstrated effective learning. - Here, we are here providing you a platform for showcasing your ambitious projects, forming a community around the - users and become part of our opensource-hardware activities. We are inviting proposals from you, those who have implemented - projects using Arduino or are in the process, to contribute the documentation/DIY instructions of their projects. - We promise to put together a well presented, shareable documentation of your project in our website. - Every contributor can thus build an online portfolio which they can take pride in and may also land them a job one day! - Please signup and make a profile for proposal submission right away and become one of the first contributors! + Back in 2005, a group of students envisaged a world where they have affordable access to digital devices, that they can interact with the environment using sensors and microcontrollers. Fast forward 15 years and Arduino has become a household name in the community of not just students, but also novices, professionals and DIY makers. The formidable headway that was brought about has given courage and vision to all the opensource hardware projects henceforth. We at FOSSEE also became a part by adopting the platform, and using it to teach Electronics across India. The learning resources, both hardware and lectures, put together by the Opensource-hardware team of FOSSEE and Spoken-tutorial has already demonstrated effective learning. + </p> + <p class="lead text-muted text-justify"> + Here, we are here providing you a platform for showcasing your ambitious projects, forming a community around the users and become part of our opensource-hardware activities. We are inviting proposals from you, those who have implemented projects using Arduino or are in the process, to contribute the documentation/DIY instructions of their projects. We promise to put together a well presented, shareable documentation of your project in our website. Every contributor can thus build an online portfolio which they can take pride in and may also land them a job one day! + </p> + <p class="lead text-muted text-justify"> + Please signup and make a profile for proposal submission right away and become one of the first contributors! </p> <p> <a href="{% url 'arduino_blog:submitabstract' %}" class="btn btn-primary my-2">Contribute first</a> diff --git a/arduino_blog/templates/submit-cfp.html b/arduino_blog/templates/submit-cfp.html index 988bc60..6e20b5c 100644 --- a/arduino_blog/templates/submit-cfp.html +++ b/arduino_blog/templates/submit-cfp.html @@ -43,12 +43,9 @@ <div id="charNum"></div> </label> </div> + <div class="form-group"> - <label for="attachment">Attachments:</label> - {% render_field proposal_form.attachment %} - </div> - <div class="form-group"> - <label for="abstract">Expected completion date (Aprox. 1 month) + <label for="abstract">Expected completion date (Approx. 1 month) <span style="color:red;">*</span>: </label> diff --git a/arduino_projects_website/settings.py b/arduino_projects_website/settings.py index 8e1b509..d9e11b9 100644 --- a/arduino_projects_website/settings.py +++ b/arduino_projects_website/settings.py @@ -138,3 +138,4 @@ EMAIL_FILE_PATH = os.path.join(BASE_DIR, "sent_emails") ACCOUNT_DEFAULT_HTTP_PROTOCOL = "https" SENDER_EMAIL = SENDER_EMAIL BCC_EMAIL_ID = BCC_EMAIL_ID + |