Waiting for an internal review - how to add due date in status text

6 views
Skip to first unread message

Miroslav (Code for Croatia, ImamoPravoZnati.org)

unread,
May 21, 2022, 12:10:12 PM5/21/22
to Alaveteli Dev
Hello Alaveteli dev,
I'm looking for a way to extend existing message that now says:

"Waiting for an internal review by AUTHORITY NAME of their handling of this request."

that can be found here:


to include also same text about due date that we see when status is "waiting response":

"They should respond promptly and normally no later than DD MMMM YYYY (details)."

Is there a way I can override 

"def status_text_internal_review(info_request, opts = {})"

in my theme's helper_patches.rb?

I tried adding this to helper_patches.rb of the theme, but then "ModuleHelper" undefined error was produced when building/deploying the theme:

  ModuleHelper.class_eval do
    def status_text_internal_review(info_request, opts = {})
      str = _('Waiting for an <strong>internal review</strong> by ' \
              '{{public_body_link}} of their handling of this request.',
              :public_body_link => public_body_link(info_request.public_body))
      str += ' '
      if info_request.public_body.not_subject_to_law?
        str += _('Although not legally required to do so, we would have ' \
                 'expected {{public_body_link}} to have responded by ',
                 :public_body_link => public_body_link(info_request.public_body))
      else
        str += _('By law, {{public_body_link}} should normally have responded ' \
                 '<strong>promptly</strong> and',
                 :public_body_link => public_body_link(info_request.public_body))
        str += ' '
        str += _('by')
        str += ' '
      end
      str += content_tag(:strong,
                         simple_date(info_request.date_response_required_by))
      str += ' '
      str += "("
      str += details_help_link(info_request.public_body)
      str += ")"
    end
  end

This is because in Croatia, due date is not changed, so I expect to see the due date still.
Also we misuse "internal_review" actually because there is no internal review by Croatian FOI law, so we use it to mark that user tried to expedite the case (in Croatian "požurnica").

I was also thinking to add a new status, but then internal review already has reply template that we need, and also asks user when sending a reply if it's "internal review" or something else, so it has actually useful flow for our "expedite" memo flow. Also "internal review" is already deeply coded into Alaveteli, so it would be a mess removing it on all places (so we just renamed the name of that status to "expedited" status).

If it's possible to override a status text in theme, that would solve everything for us to continue using "internal review" for our "expedite" flow.

Thanks,
Miroslav

Graeme Porteous

unread,
May 23, 2022, 12:54:41 PM5/23/22
to alavet...@googlegroups.com
Hi Miroslav,

I'm not sure where `ModuleHelper` came from but the method you're attempting to override exists in the `InfoRequestHelper` module. Try changing the first line to `InfoRequestHelper.class_eval do` and see if that helps.

--
Graeme Porteous
gra...@mysociety.org


Code for Croatia brine o zaštiti Vaše privatnosti. Molimo vas da ograničite dijeljenje svojih osobnih podataka putem elektroničke pošte.
Vodite računa o okolišu. Ne tiskajte ovu poruku ako nije neophodno.

--
You received this message because you are subscribed to the Google Groups "Alaveteli Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to alaveteli-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/alaveteli-dev/c42bf5ef-21ef-40fd-997e-fd62ffdc6d7en%40googlegroups.com.

Miroslav Schlossberg

unread,
May 23, 2022, 1:18:37 PM5/23/22
to alavet...@googlegroups.com
Hi Graeme,
That worked wonderfully! Not sure where I found "ModuleHelper" :D

Example of changed status text:

Waiting for an internal review by Grad Obrovac of their handling of this request. By law, Grad Obrovac should normally have responded promptly and by 14 February 2022 (details)

Cheers,
Miroslav


You received this message because you are subscribed to a topic in the Google Groups "Alaveteli Dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/alaveteli-dev/V6B2YPIlyDM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to alaveteli-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/alaveteli-dev/CAD%3D4AygNWrJKm-B2thaeG3Kka5wTJUbVHOe2XzdXKa-vRhj%3DNA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages