decidim-archive / decidim-accountability

:warning: [DEPRECATED] Accountability module for Decidim framework. Integrated on decidim/decidim repository.
0 stars 1 forks source link

Accountability global section #4

Closed furilo closed 7 years ago

furilo commented 7 years ago

Hey @xabier @andreslucena

Here is the first round for the global accountability section in decidim.barcelona.

We are proposing a section in the main menu nav, don't know if that was the idea (it makes sense, but given that almost all links point to other external webs, we may miss those users). In any case, it should be not a problem to link it from another place.

Content is directly derived from AccessInfo-Sustentia docs. Proposed screens:

Section home It serves as a map of all the content, plus the accountability flow chart and secondary elements.

  1. Simple option
  2. Visual
  3. Boxed

Inner sections We develop explanations for each section and give access, showing that you are going out. We may want to adjust a little bit heading and paragraph font sizes to better convey hierarchy.

  1. Tabs (we haven taken this tabs from the style guide, although maybe its a meta-component, we think it does the job great)
  2. Simple inner nav (if we don't want to use the meta-element)

cc @martgnz

xabier commented 7 years ago

Nice work! @htmlboy any preferences?

htmlboy commented 7 years ago

Hi! Here's some quick feedback regarding this:

andreslucena commented 7 years ago

@carolromero @arnaumonty please check this

xabier commented 7 years ago

@furilo 1,1 is definitely my favorite combination , as @htmlboy suggests, the more you can adapt to the official styles the better.

carolromero commented 7 years ago

@furilo good job! I also prefer the tabs option for inner sections. And as @xabier and @htmlboy already said, keeping consistency with existing styles ensures scalability (I'm thinking about other cities using Decidim that might incorporate this in the future).

xabier commented 7 years ago

In order to abstract this to other cities we need the title and content of the boxes and links to be configurable via admin-panel. @furilo is this the case?

furilo commented 7 years ago

@xabier yes, we'll make this editable through the admin UI. Is there any screen in the admin that does something similar that you'd like us to stick to?

furilo commented 7 years ago

@xabier Mmm... Although I'm realizing now that I was thinking more on the Results pages (https://github.com/decidim/decidim/issues/586#issuecomment-292511093) than in this, taking into account that in these screens, everything is custom for BCN, and therefore we were thinking on just creating normal static pages where we add all the HTML.

furilo commented 7 years ago

So, should we go on with 1,1 ?

furilo commented 7 years ago

(we are waiting to start with the HTML)

xabier commented 7 years ago

So, should we go on with 1,1 ?

yes

-- Dr. Xabier E. Barandiaran

furilo commented 7 years ago

Hey @josepjaume @oriolgual - how/where should we integrate this content? This is something -if I'm not wrong- specific to BCN, so it maybe could be simple static files in that repo. For this maybe it should not be a problem to make a PR, as it is only static content.

Or it could be static pages, but we may end up including inline styles ( = ugly). So which option do you consider best?

Also, @xabier @andreslucena it is confirmed that we'll create that new "Rendición de cuentas" option in the main menu?

xabier commented 7 years ago

Also, @xabier @andreslucena it is confirmed that we'll create that new "Rendición de cuentas" option in the main menu?

We need to work with that hypothesis, yes.

josepjaume commented 7 years ago

@furilo depends on the frequency of updates / complexity of the layout. I usually prefer to keep control over the HTML myself and change stuff via a PR rather than trying to use a CMS for that.

Adding the element on the menu is easily doable by overriding the view partial, but I've been wanting to create a small DSL to extend menus so the core itself accommodates these scenarios without risking breaking the contract.

I described this in an issue a while ago (feels like ages but it's only been 6 months!): https://github.com/decidim/decidim/issues/131

josepjaume commented 7 years ago

Something along the lines of:

# In the core
Decidim.menu :main_menu do |menu|
  menu.item I18n.t('decidim.main_menu.processes'), decidim.processes_path, weight: 0

  # or even stuff like
  Decidim::Pages.where(show_in_main_menu: true).each do |page|
    menu.item page.title, page_path(page), weight: 3
  end
end

# In an engine
Decidim.menu :main_menu do |menu|
  menu.item I18n.t('decidim.main_menu.accountability'), decidim.accountability_path, weight: 0, i18n: true
end

# In the view. 
# This evaluates all registered blocks in the context of the view and renders the resulting
# data structure so they can access routes, helpers (current_organization), etc.
<%= render_menu :main_menu %>

This could leverage https://github.com/codeplant/simple-navigation or https://github.com/comfy/active_link_to to make things easier.

amaia commented 7 years ago

@josepjaume would that mean modifying decidim-core? I think we don't have enough time for that in this week.

The content for this page is specific to Barcelona, so it wouldn't have to go inside this engine, afaik. Is there a way to just add a new controller/view for the static content in decidim-barcelona and use the decidim layout without making this content part of an engine?

andreslucena commented 7 years ago

@josepjaume regarding the menu option, I'd prefer a solution that could work on other contexts. I've mixed feelings, but I'm thinking on something like https://github.com/spree/deface that "allows you to customize HTML (ERB, Haml and Slim) views in a Rails application without editing the underlying view."

josepjaume commented 7 years ago

@amaia yeah, I understand :). I only outlined what I think might be a good solution, but right now, the best you can do is monkeypatch the view on decidim-barcelona and include any extra routes/views/styles you want. In the end, it's just a Rails app :).

@andreslucena Yeah, deface looks like an option, but I'm worried about performance penalties and overall complexity of the thing.

amaia commented 7 years ago

@josepjaume this is what we've done for now to be able to show a static page (stil a lot of i18n missing): https://github.com/PopulateTools/decidim-barcelona/tree/static-accountability-pages

It feels very hacky, I had to include a bunch of helpers and overwrite the Ability class to make the decidim/application layout work for these static pages (the user menu was the main thing that needed most of that). Do have suggestions for a better approach?