# HG changeset patch # User Brian Neal # Date 1471484347 18000 # Node ID ce6a0c12cbf35c926f9f5cb9470cd89357cc43f4 # Parent 2574cd24773e6ebdea529e43f6317e946ced3031 Convert edit profile to V3 design. diff -r 2574cd24773e -r ce6a0c12cbf3 bio/forms.py --- a/bio/forms.py Wed Aug 03 21:17:59 2016 -0500 +++ b/bio/forms.py Wed Aug 17 20:39:07 2016 -0500 @@ -31,19 +31,17 @@ class EditUserProfileForm(forms.ModelForm): """Form for editing the fields of the UserProfile model.""" - location = forms.CharField(required=False, widget=forms.TextInput(attrs={'size': 64 })) - occupation = forms.CharField(required=False, widget=forms.TextInput(attrs={'size': 64 })) - interests = forms.CharField(required=False, widget=forms.TextInput(attrs={'size': 64 })) time_zone = forms.CharField(required=False, widget=forms.HiddenInput()) use_24_time = forms.BooleanField(label='Show times in 24-hour mode', required=False) - profile_text = forms.CharField(required=False, - widget=forms.Textarea(attrs={'class': 'markItUp'})) - signature = forms.CharField(required=False, - widget=forms.Textarea(attrs={'class': 'markItUp'})) + hide_email = forms.BooleanField( + label="Don't show my email address on my public profile", + required=False) auto_favorite = forms.BooleanField( - label='Automatically favorite every forum topic I create or reply to', required=False) + label='Automatically favorite every forum topic I create or reply to', + required=False) auto_subscribe = forms.BooleanField( - label='Automatically subscribe to every forum topic I create or reply to', required=False) + label='Automatically subscribe to every forum topic I create or reply to', + required=False) class Meta: model = UserProfile diff -r 2574cd24773e -r ce6a0c12cbf3 bio/views.py --- a/bio/views.py Wed Aug 03 21:17:59 2016 -0500 +++ b/bio/views.py Wed Aug 17 20:39:07 2016 -0500 @@ -105,8 +105,6 @@ @login_required def edit_profile(request): if request.method == 'POST': - if request.POST.get('submit_button', 'Cancel') == 'Cancel': - return redirect('bio-me') profile = request.user.profile user_form = EditUserForm(request.POST, instance=request.user) profile_form = EditUserProfileForm(request.POST, instance=profile) @@ -124,6 +122,7 @@ return render(request, 'bio/edit_profile.html', { 'user_form': user_form, 'profile_form': profile_form, + 'V3_DESIGN': True, }) ####################################################################### diff -r 2574cd24773e -r ce6a0c12cbf3 sg101/templates/bio/edit_profile.html --- a/sg101/templates/bio/edit_profile.html Wed Aug 03 21:17:59 2016 -0500 +++ b/sg101/templates/bio/edit_profile.html Wed Aug 17 20:39:07 2016 -0500 @@ -1,40 +1,180 @@ -{% extends 'bio/base.html' %} +{% extends 'v3/base.html' %} {% load bio_tags %} +{% load core_tags %} {% load elsewhere_tags %} {% load script_tags %} {% load static from staticfiles %} {% block title %}Edit Profile{% endblock %} +{% block content %} + + + +

Edit Profile for {{ user.username }}

+
+
+

+ {% avatar user 0 %} +

+
+
+
+ +
+ +
{% csrf_token %} + {{ user_form.non_field_errors }} + {{ user_form.first_name.errors }} +
+
+ +
+
+ {{ user_form.last_name.errors }} +
+
+ +
+
+ {{ user_form.email.errors }} +
+
+ +
+
+ {{ profile_form.non_field_errors }} + {{ profile_form.location.errors }} +
+
+ +
+
+ {{ profile_form.country.errors }} +
+
+ +

Optional

+
+
+ {{ profile_form.birthday.errors }} +
+
+ +

Optional; the year is not shown to others

+
+
+ {{ profile_form.occupation.errors }} +
+
+ +
+
+ {{ profile_form.interests.errors }} +
+
+ +
+
+ {% post_box profile_form.profile_text %} + {% post_box profile_form.signature %} + {{ profile_form.hide_email.errors }} +
+
+ {{ profile_form.hide_email }} + +
+
+ {{ profile_form.use_24_time.errors }} +
+
+ {{ profile_form.use_24_time }} + +
+
+ {{ profile_form.auto_favorite.errors }} +
+
+ {{ profile_form.auto_favorite }} + +
+
+ {{ profile_form.auto_subscribe.errors }} +
+
+ {{ profile_form.auto_subscribe }} + +
+
+
+ My Time Zone + {{ profile_form.time_zone.errors }} +
+
+ +
+
+ +
+
+ {{ profile_form.time_zone }} +
+
+
+ + Cancel +
+
+
+ My Links + {% elsewhere_links user %} + Edit Links +
+
+{% include 'core/v3/post_box_modals.html' %} +{% endblock %} {% block custom_js %} -{% script_tags 'jquery-ui markitup' %} +{% script_tags 'jquery-ui' %} + {% endblock %} -{% block content %} -
-

Edit Profile for {{ user.username }}

-
{% csrf_token %} - - - - - - {{ user_form.as_table }} - {{ profile_form.as_table }} - - - - - - - - -
- Change Avatar - Change Avatar{% avatar user 0 %}
- Edit Links - Edit Elsewhere Links{% elsewhere_links user %}
Time Zone:
  -
-
-
-
-{% endblock %} diff -r 2574cd24773e -r ce6a0c12cbf3 sg101/templates/core/v3/post_box.html --- a/sg101/templates/core/v3/post_box.html Wed Aug 03 21:17:59 2016 -0500 +++ b/sg101/templates/core/v3/post_box.html Wed Aug 17 20:39:07 2016 -0500 @@ -2,7 +2,7 @@
-
+