• 
      

    Enable per-user defaults for Markdown.

    Review Request #6517 — Created Oct. 28, 2014 and submitted

    Information

    Review Board
    release-2.0.x
    f7da229...

    Reviewers

    This adds a setting in the My Account page for controlling whether
    Markdown is enabled by default. When enabled, all text fields will
    default to Markdown mode. When disabled, only fields already set for
    rich text in the database will be in Markdown mode by default.

    The default for users will be based on the 'default_use_rich_text'
    setting in siteconfig. Right now, this is not exposed in the UI, but it
    will be in a separate change.

    There were a few places left in the codebase where we were assigning
    default values for rich_text fields, and those have been removed,
    allowing the UI to control the default based on this setting instead.

    Saw that the default for the setting was to enable Markdown.

    Edited text fields set for rich text and plain text in the database, and
    both were set to edit in Markdown by default.

    Disabled the default. Saw that that choice persisted.

    Edited text fields set for rich text and plain text in the database. Only
    the ones set for rich text were set to edit in Markdown by default.

    Description From Last Updated

    Col: 80 E501 line too long (84 > 79 characters)

    reviewbotreviewbot

    local variable 'profile' is assigned to but never used

    reviewbotreviewbot

    local variable 'profile' is assigned to but never used

    reviewbotreviewbot

    Don't we want to be able to have a system default as well? If so, I think this should be …

    daviddavid

    Maybe put this in an else clause in order to balance it?

    daviddavid

    Col: 29 E241 multiple spaces after ':'

    reviewbotreviewbot
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/accounts/evolutions/__init__.py
          reviewboard/reviews/models/review_request_draft.py
          reviewboard/accounts/forms/pages.py
          reviewboard/accounts/models.py
          reviewboard/accounts/evolutions/profile_default_use_rich_text.py
          reviewboard/changedescs/models.py
      
      Ignored Files:
          reviewboard/templates/base.html
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/accounts/evolutions/__init__.py
          reviewboard/reviews/models/review_request_draft.py
          reviewboard/accounts/forms/pages.py
          reviewboard/accounts/models.py
          reviewboard/accounts/evolutions/profile_default_use_rich_text.py
          reviewboard/changedescs/models.py
      
      Ignored Files:
          reviewboard/templates/base.html
      
      
    2. Show all issues
      Col: 80
       E501 line too long (84 > 79 characters)
      
    3. Show all issues
       local variable 'profile' is assigned to but never used
      
    4. Show all issues
       local variable 'profile' is assigned to but never used
      
    5. 
        
    chipx86
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/accounts/evolutions/__init__.py
          reviewboard/reviews/models/review_request_draft.py
          reviewboard/accounts/forms/pages.py
          reviewboard/accounts/models.py
          reviewboard/accounts/evolutions/profile_default_use_rich_text.py
          reviewboard/changedescs/models.py
      
      Ignored Files:
          reviewboard/templates/base.html
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/accounts/evolutions/__init__.py
          reviewboard/reviews/models/review_request_draft.py
          reviewboard/accounts/forms/pages.py
          reviewboard/accounts/models.py
          reviewboard/accounts/evolutions/profile_default_use_rich_text.py
          reviewboard/changedescs/models.py
      
      Ignored Files:
          reviewboard/templates/base.html
      
      
    2. 
        
    david
    1. 
        
    2. reviewboard/accounts/models.py (Diff revision 2)
       
       
      Show all issues

      Don't we want to be able to have a system default as well? If so, I think this should be nullable and default to None.

      1. I wasn't planning to add a system deafult. Just a per-user default. I can change that, but it does complicate any lookups of the user default. Worth adding?

      2. I believe $customer would be very happy if we did.

      3. I think if you add a property in the profile that does the fallback, it won't really be complicated at all.

      4. If a user doesn't save a default in their settings, but are used to having it enabled, and the admin then changes the default, the user will suddenly see new behavior. Kind of confusing. :/

      5. Yeah, I suppose. Maybe we can add help text to strongly encourage admins to notify their users if they change the default?

    3. 
        
    chipx86
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/admin/siteconfig.py
          reviewboard/accounts/evolutions/__init__.py
          reviewboard/reviews/models/review_request_draft.py
          reviewboard/accounts/forms/pages.py
          reviewboard/accounts/models.py
          reviewboard/accounts/evolutions/profile_default_use_rich_text.py
          reviewboard/changedescs/models.py
      
      Ignored Files:
          reviewboard/templates/base.html
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/admin/siteconfig.py
          reviewboard/accounts/evolutions/__init__.py
          reviewboard/reviews/models/review_request_draft.py
          reviewboard/accounts/forms/pages.py
          reviewboard/accounts/models.py
          reviewboard/accounts/evolutions/profile_default_use_rich_text.py
          reviewboard/changedescs/models.py
      
      Ignored Files:
          reviewboard/templates/base.html
      
      
    2. reviewboard/admin/siteconfig.py (Diff revision 3)
       
       
      Show all issues
      Col: 29
       E241 multiple spaces after ':'
      
    3. 
        
    david
    1. 
        
    2. reviewboard/accounts/models.py (Diff revision 3)
       
       
      Show all issues

      Maybe put this in an else clause in order to balance it?

    3. 
        
    david
    1. Ship It!

    2. 
        
    chipx86
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to markdown-redesign (78e807b)