Adding custom message in banner

Review Request #8824 - Created March 18, 2017 and updated

Kanghee Park
Review Board
master
8810, 8811, 8657, 8812, 8648
8861, 8847
reviewboard, students

Read-only mode is a feature that can be enabled by the admin to disable
most backend changes by regular users. This commit adds a custom
message for the banner when in read-only mode. The message can be
optionally added through the admin panel right under where the admin
would enable/disable read-only mode.

Ran js-tests - passed
Ran python tests - most passed, some failures fixed in future commit
Checked changing value in admin panel reflects in banner

Loading file attachments...

  • 0
  • 0
  • 8
  • 0
  • 8
Description From Last Updated
Review Bot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/admin/context_processors.py
        reviewboard/admin/forms.py
    
    Ignored Files:
        reviewboard/static/rb/css/pages/base.less
        reviewboard/static/rb/css/defs.less
        reviewboard/templates/base.html
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/admin/context_processors.py
        reviewboard/admin/forms.py
    
    Ignored Files:
        reviewboard/static/rb/css/pages/base.less
        reviewboard/static/rb/css/defs.less
        reviewboard/templates/base.html
    
    
  2. 
      
Barret Rennie
  1. 
      
  2. reviewboard/admin/context_processors.py (Diff revision 1)
     
     

    Care to add the keys to this?

  3. reviewboard/admin/forms.py (Diff revision 1)
     
     

    How about "A custom message displayed when the site is in read-only mode."

  4. reviewboard/templates/base.html (Diff revision 1)
     
     
     
     

    <b> is deprecated. Since you're making this a header, how about just using h2 (since its not the main header of the page, which is what h1 should usually be used for) instead of <span><b>

    1. Wow, I did not know that! I couldn't get it to look good with h2 since it introduces a break-line, so I just styled the span to have a font-weight: bold; attribute.

    2. You can do h2 { display: inline; } to not introduce a line-break.

  5. 
      
Kanghee Park
Kanghee Park
Kanghee Park
Barret Rennie
  1. Minor nitpicks. Looks good to me!

  2. reviewboard/admin/context_processors.py (Diff revision 2)
     
     

    "dictionary will"

  3. reviewboard/admin/context_processors.py (Diff revision 2)
     
     

    :py:class:`bool`
    
  4. reviewboard/admin/context_processors.py (Diff revision 2)
     
     
     

    Blank line between these.

  5. reviewboard/admin/context_processors.py (Diff revision 2)
     
     

    string is not a type, you mean unicode.

    Also, this won't auto link to the correct type. Use:

    :py:class:`unicode`
    
  6. 
      
Barret Rennie
  1. 
      
  2. Mind wrapping your description & testing done at 72 characters?

  3. 
      
Kanghee Park
Review request changed

Change Summary:

Update according to comments + fix description line wrapping

Description:

~  

Read-only mode is a feature that can be enabled by the admin to disable most backend changes by regular users. This commit adds a custom message for the banner when in read-only mode. The message can be optionally added through the admin panel right under where the admin would enable/disable read-only mode.

  ~

Read-only mode is a feature that can be enabled by the admin to disable

  + most backend changes by regular users. This commit adds a custom
  + message for the banner when in read-only mode. The message can be
  + optionally added through the admin panel right under where the admin
  + would enable/disable read-only mode.

Diff:

Revision 3 (+35 -5)

Show changes

Checks run (2 succeeded, 1 failed with error)

JSHint passed.
PEP8 Style Checker internal error.
Pyflakes passed.
Loading...