diff options
-rw-r--r-- | workshop_app/forms.py | 5 | ||||
-rw-r--r-- | workshop_app/models.py | 2 | ||||
-rw-r--r-- | workshop_app/templates/workshop_app/my_workshops.html | 12 | ||||
-rw-r--r-- | workshop_app/templates/workshop_app/registration/register.html | 1 | ||||
-rw-r--r-- | workshop_app/templates/workshop_app/workshop_stats.html | 2 | ||||
-rw-r--r-- | workshop_app/tests/test_models.py | 10 | ||||
-rw-r--r-- | workshop_app/tests/test_views.py | 10 |
7 files changed, 26 insertions, 16 deletions
diff --git a/workshop_app/forms.py b/workshop_app/forms.py index 054dee8..cadb379 100644 --- a/workshop_app/forms.py +++ b/workshop_app/forms.py @@ -123,7 +123,7 @@ class UserRegistrationForm(forms.Form): choices=department_choices) location = forms.CharField(max_length=255, help_text="Place/City") state = forms.ChoiceField(choices=states) - source = forms.ChoiceField(choices=source) + how_did_you_hear_about_us = forms.ChoiceField(choices=source) def clean_username(self): u_name = self.cleaned_data["username"] @@ -176,7 +176,8 @@ class UserRegistrationForm(forms.Form): new_profile.phone_number = cleaned_data["phone_number"] new_profile.location = cleaned_data["location"] new_profile.title = cleaned_data["title"] - new_profile.source = cleaned_data["source"] + new_profile.state = cleaned_data["state"] + new_profile.how_did_you_hear_about_us = cleaned_data["how_did_you_hear_about_us" ] new_profile.activation_key = generate_activation_key(new_user.username) new_profile.key_expiry_time = timezone.now() + \ timezone.timedelta(days=1) diff --git a/workshop_app/models.py b/workshop_app/models.py index 4bf4489..94b9f92 100644 --- a/workshop_app/models.py +++ b/workshop_app/models.py @@ -112,7 +112,7 @@ class Profile(models.Model): help_text='Select Coordinator if you want to organise a workshop\ in your college/school. <br> Select Instructor if you want to conduct\ a workshop.') - source = models.CharField(max_length=255, blank=True,choices=source) + how_did_you_hear_about_us = models.CharField(max_length=255, blank=True,choices=source) location = models.CharField(max_length=255,blank=True, help_text="Place/City") state = models.CharField(max_length=255, choices=states, default="IN-MH") is_email_verified = models.BooleanField(default=False) diff --git a/workshop_app/templates/workshop_app/my_workshops.html b/workshop_app/templates/workshop_app/my_workshops.html index 740e28f..d652502 100644 --- a/workshop_app/templates/workshop_app/my_workshops.html +++ b/workshop_app/templates/workshop_app/my_workshops.html @@ -81,7 +81,11 @@ <!-- Pending View --> <div class="container"> - <h3 align="center"><strong><u>My Requests</u></strong></h3> + {% if request.user.profile.position == 'instructor' %} + <h3 align="center"><strong><u>Requests for Me</u></strong></h3> + {% else %} + <h3 align="center"><strong><u>My Requests</u></strong></h3> + {% endif %} <table class="table table-striped"> <thead> <tr> @@ -171,7 +175,11 @@ <!-- Proposed View --> <div class="container"> - <h3 align="center"><strong><u>Proposed Workshops</u></strong></h3> + {% if request.user.profile.position == 'instructor' %} + <h3 align="center"><strong><u>Workshops Proposed By Coordinators</u></strong></h3> + {% else %} + <h3 align="center"><strong><u>Workshops Proposed By Me</u></strong></h3> + {% endif %} <table class="table table-striped"> <thead> <tr> diff --git a/workshop_app/templates/workshop_app/registration/register.html b/workshop_app/templates/workshop_app/registration/register.html index 6804ad0..abca610 100644 --- a/workshop_app/templates/workshop_app/registration/register.html +++ b/workshop_app/templates/workshop_app/registration/register.html @@ -49,5 +49,6 @@ <!-- <div class="alert alert-info"> <strong>Info!</strong> Instructors, please wait for our admin approval, if your instructor account is not activated in 7 days, please mail us at workshops[at]fossee[dot]in </div> --> + <br> </div> {% endblock %} diff --git a/workshop_app/templates/workshop_app/workshop_stats.html b/workshop_app/templates/workshop_app/workshop_stats.html index d923c92..ba597dc 100644 --- a/workshop_app/templates/workshop_app/workshop_stats.html +++ b/workshop_app/templates/workshop_app/workshop_stats.html @@ -359,7 +359,7 @@ domain: 'IN', displayMode: 'regions', resolution: 'provinces', - colorAxis: {colors: ['orange']}, + colorAxis: {colors: ['lightyellow', 'orange']}, legend: {position: 'top'}, }; diff --git a/workshop_app/tests/test_models.py b/workshop_app/tests/test_models.py index 44108ad..1be74a0 100644 --- a/workshop_app/tests/test_models.py +++ b/workshop_app/tests/test_models.py @@ -26,12 +26,12 @@ def setUpModule(): instructor_profile = Profile.objects.create(user=testUser2, position='instructor', department='computer engineering', institute='ace', phone_number='1122334456', - title='Doctor', source='Google', location='powai', state='IN-MH', + title='Doctor', how_did_you_hear_about_us='Google', location='powai', state='IN-MH', is_email_verified=1) coordinator_profile = Profile.objects.create(user=demoUser2, position='coordinator', department='IT', institute='iit', phone_number='1122334456',location='powai', - title='Doctor', source='Google', state='IN-MH', + title='Doctor', how_did_you_hear_about_us='Google', state='IN-MH', is_email_verified=1) workshoptype1 = WorkshopType.objects.create(workshoptype_name='ISCP', @@ -78,12 +78,12 @@ class ProfileModelTest(TestCase): self.instructor_profile1 = Profile.objects.create(user=self.testuser1, position='instructor', department='computer engineering', institute='ace', phone_number='1123323344', - title='Doctor', source='Google', location='powai', state='IN-MH', + title='Doctor', how_did_you_hear_about_us='Google', location='powai', state='IN-MH', is_email_verified=1) self.coordinator_profile1 = Profile.objects.create(user=self.demouser1, position='coordinator', department='IT', institute='iit', phone_number='1122334455', - title='Doctor', source='Google', location='powai', state='IN-MH', + title='Doctor', how_did_you_hear_about_us='Google', location='powai', state='IN-MH', is_email_verified=1) def test_profile_model(self): @@ -93,7 +93,7 @@ class ProfileModelTest(TestCase): self.assertEqual(self.coordinator_profile1.position,'coordinator') self.assertEqual(self.coordinator_profile1.location,'powai') self.assertEqual(self.instructor_profile1.location,'powai') - self.assertEqual(self.coordinator_profile1.source,'Google') + self.assertEqual(self.coordinator_profile1.how_did_you_hear_about_us,'Google') class WorkshopTypeModelTest(TestCase): diff --git a/workshop_app/tests/test_views.py b/workshop_app/tests/test_views.py index ce5e4f2..9d65ba8 100644 --- a/workshop_app/tests/test_views.py +++ b/workshop_app/tests/test_views.py @@ -36,7 +36,7 @@ class TestProfile(TestCase): position='instructor', phone_number='1122993388', location='mumbai', - source='Google', + how_did_you_hear_about_us='Google', state='IN-MH', is_email_verified=1 ) @@ -139,7 +139,7 @@ class TestWorkshopCreation(TestCase): title='Doctor', institute='IIT', position='instructor', - source='Google', + how_did_you_hear_about_us='Google', phone_number='1122993388', location='mumbai', state='IN-MH', @@ -166,7 +166,7 @@ class TestWorkshopCreation(TestCase): institute='ace', position='coordinator', title='Mr', - source='Google', + how_did_you_hear_about_us='Google', location='mumbai', state='IN-MH', phone_number='1122993388', @@ -240,7 +240,7 @@ class TestWorkshopDashboard(TestCase): institute='IIT', position='instructor', phone_number='1122993388', - source='Google', + how_did_you_hear_about_us='Google', location='mumbai', state='IN-MH', title='Mr', @@ -357,4 +357,4 @@ class TestWorkshopStats(TestCase): ) self.assertEqual(response.status_code, 200) self.assertEqual(response.get('Content-Disposition'),'attachment;\ - filename="records_from_2017-01-01_to_2017-12-31.csv"')
\ No newline at end of file + filename="records_from_2017-01-01_to_2017-12-31.csv"') |