openrightsgroup / blocked-org-uk

Template front-end code, markup, style-sheets, images and other assets for the Censorship Monitoring Project (blocked.org.uk)
https://www.blocked.org.uk/
GNU General Public License v3.0
13 stars 5 forks source link

Show results for submitted URL if they exist. #29

Closed graphiclunarkid closed 10 years ago

graphiclunarkid commented 10 years ago

Submission of form goes to results page, which should show the results for the submitted URL if they exist.

Issue #10 deals with querying the API for the results data. This issue deals with the front end JS for triggering that mechanism as well as displaying and styling the data on the results page.

webal commented 10 years ago

I've styled this now, though I think it would be good to have a CTA like 'contact ORG if this affects you'

graphiclunarkid commented 10 years ago

Yes - good idea. Maybe that feature should be a separate github issue though?

mkillock commented 10 years ago

Quick note: I've changed the &fsFormTopic parameter in FormIt call on the home page back to 'Blocked Site' - recent entries in the Formsave table are under 'test' whether that matters?

Also @webal - nice job!

webal commented 10 years ago

Matt, one thing I couldn't figure out was how to set the the options for the getURLHistory snippet, I had to hardcode a fallback value for the name of a chunk template I needed to add to the results page - see this line of code:

$FooterTplChunk = $modx->getOption('FooterTpl', $scriptProperties, 'ISPResultsFooter');

It all works fine, but to keep consistency I guess it should be set somewhere - I couldn't figure out where though!

mkillock commented 10 years ago

What you did is fine because the default value can be overrided by supplying the value in the snippet call, but I've made a minor tweak for consistency's sake.

The options are set in the Snippet call, e.g. at the bottom. The values that are supplied are the names of the chunks, so you can use the snippet on several pages with different html styling in different chunks to display the same information differently, if desired.

I've added that parameter to the call on the 'site submitted' page, and removed the hardcode fallback value and it's still putting in the /table tag on that page, so the behaviour is the same as you had it.

[[!GetURLHistory? &Url='[[!+fi.domainToCheck]]' &HeaderTpl='ISPResultsHeader' &FooterTpl='ISPResultsFooter' ... etc

webal commented 10 years ago

Thanks, I was looking through the settings/properties and completely missed that!

mkillock commented 10 years ago

This is all done now, right @webal? Unless there are more style changes you'd like to make?

webal commented 10 years ago

I'm happy as it is, but if anyone wants the styling changed just let me know...

mkillock commented 10 years ago

looks good to me!