Merge lp:~pskoli93/postorius/Helptext-Fixes into lp:postorius

Proposed by Pavan Koli
Status: Needs review
Proposed branch: lp:~pskoli93/postorius/Helptext-Fixes
Merge into: lp:postorius
Diff against target: 50 lines (+35/-4)
1 file modified
src/postorius/views/user.py (+35/-4)
To merge this branch: bzr merge lp:~pskoli93/postorius/Helptext-Fixes
Reviewer Review Type Date Requested Status
Mailman Coders Pending
Review via email: mp+257460@code.launchpad.net

Description of the change

If we go to a list settings page and click on the question mark to open the more info tab, a new tab opens with an error that ListSettings is not defined globally.

Initially a ListSettings form was there but now different forms have been created for different list tasks like ListIdentityForm, ListAutomaticResponseForm etc. In all these forms if a user clicks on more info tab the 'formid' is equal to 'list_settings' and every form has the same 'formid', so there is no clear way to identify for which forms' option the more info is sought.

The solution to this is that a separate list(Python list) has been created for the separate forms with the 'helpid' stored in these lists(Python list). Now if a user clicks on more info tab we check which list(Python list) it corresponds to, by comparing the 'helpid', and then loading the appropriate help text from the appropriate form.

To post a comment you must log in.

Unmerged revisions

248. By pkoli <email address hidden>

Helptext fixes

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/postorius/views/user.py'
--- src/postorius/views/user.py 2015-04-15 22:53:02 +0000
+++ src/postorius/views/user.py 2015-04-25 13:26:21 +0000
@@ -331,11 +331,42 @@
331 template='postorius/more_info_display.html'):331 template='postorius/more_info_display.html'):
332 """Displays more_info in new tab.332 """Displays more_info in new tab.
333 """333 """
334 list_identity_helpid=['advertised','display_name','mail_host','description',
335 'subject_prefix']
336 list_automatic_responses_helpid=['autorespond_owner','autoresponse_owner_text',
337 'autorespond_postings','autoresponse_postings_text','autorespond_requests',
338 'autoresponse_request_text','autoresponse_grace_period','send_welcome_message',
339 'welcome_message_uri','admin_immed_notify','admin_notify_mchanges']
340 alter_messages_helpid=['filter_content','collapse_alternatives',
341 'convert_html_to_plaintext','anonymous_list','include_rfc2369_headers',
342 'allow_list_posts','reply_to_address','first_strip_reply_to','reply_goes_to_list',
343 'posting_pipeline']
344 digest_settings_helpid=['digest_size_threshold']
345 message_acceptance_helpid=['acceptable_aliases','administrivia',
346 'default_member_action','default_nonmember_action']
347 archive_policy_settings_helpid=['archive_policy']
348 list_subscription_policy_helpid=['subscription_policy']
334349
335 if(formid == 'list_settings'):350 if(helpid in list_identity_helpid):
336 form = ListSettings(351 form = ListIdentityForm(
337 visible_section='List Identity',352 data=request.POST)
338 visible_option='None',353 elif(helpid in list_automatic_responses_helpid):
354 form = ListAutomaticResponsesForm(
355 data=request.POST)
356 elif(helpid in alter_messages_helpid):
357 form = AlterMessagesForm(
358 data=request.POST)
359 elif(helpid in digest_settings_helpid):
360 form = DigestSettingsForm(
361 data=request.POST)
362 elif(helpid in message_acceptance_helpid):
363 form = MessageAcceptanceForm(
364 data=request.POST)
365 elif(helpid in archive_policy_settings_helpid):
366 form = ArchivePolicySettingsForm(
367 data=request.POST)
368 elif(helpid in list_subscription_policy_helpid):
369 form = ListSubscriptionPolicyForm(
339 data=request.POST)370 data=request.POST)
340371
341 for field in form:372 for field in form:

Subscribers

People subscribed via source and target branches