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
1=== modified file 'src/postorius/views/user.py'
2--- src/postorius/views/user.py 2015-04-15 22:53:02 +0000
3+++ src/postorius/views/user.py 2015-04-25 13:26:21 +0000
4@@ -331,11 +331,42 @@
5 template='postorius/more_info_display.html'):
6 """Displays more_info in new tab.
7 """
8+ list_identity_helpid=['advertised','display_name','mail_host','description',
9+ 'subject_prefix']
10+ list_automatic_responses_helpid=['autorespond_owner','autoresponse_owner_text',
11+ 'autorespond_postings','autoresponse_postings_text','autorespond_requests',
12+ 'autoresponse_request_text','autoresponse_grace_period','send_welcome_message',
13+ 'welcome_message_uri','admin_immed_notify','admin_notify_mchanges']
14+ alter_messages_helpid=['filter_content','collapse_alternatives',
15+ 'convert_html_to_plaintext','anonymous_list','include_rfc2369_headers',
16+ 'allow_list_posts','reply_to_address','first_strip_reply_to','reply_goes_to_list',
17+ 'posting_pipeline']
18+ digest_settings_helpid=['digest_size_threshold']
19+ message_acceptance_helpid=['acceptable_aliases','administrivia',
20+ 'default_member_action','default_nonmember_action']
21+ archive_policy_settings_helpid=['archive_policy']
22+ list_subscription_policy_helpid=['subscription_policy']
23
24- if(formid == 'list_settings'):
25- form = ListSettings(
26- visible_section='List Identity',
27- visible_option='None',
28+ if(helpid in list_identity_helpid):
29+ form = ListIdentityForm(
30+ data=request.POST)
31+ elif(helpid in list_automatic_responses_helpid):
32+ form = ListAutomaticResponsesForm(
33+ data=request.POST)
34+ elif(helpid in alter_messages_helpid):
35+ form = AlterMessagesForm(
36+ data=request.POST)
37+ elif(helpid in digest_settings_helpid):
38+ form = DigestSettingsForm(
39+ data=request.POST)
40+ elif(helpid in message_acceptance_helpid):
41+ form = MessageAcceptanceForm(
42+ data=request.POST)
43+ elif(helpid in archive_policy_settings_helpid):
44+ form = ArchivePolicySettingsForm(
45+ data=request.POST)
46+ elif(helpid in list_subscription_policy_helpid):
47+ form = ListSubscriptionPolicyForm(
48 data=request.POST)
49
50 for field in form:

Subscribers

People subscribed via source and target branches