petities/petitions.eu

View on GitHub
app/views/petitions/index.html.slim

Summary

Maintainability
Test Coverage
- title t('petitions.title')

- content_for :head do
  - auto_discovery_link_tag(:rss, updates_url(format: :rss))

div.page
  javascript:
    window.page = #{@page};
    window.sorting = "#{@sorting}";

  div.search-container.whitespace

    = form_tag(search_petitions_path(locale: I18n.locale), method: :get, role: "search") do
      = text_field_tag :search, params[:search], class: "search-container-input", placeholder: t('header.search')
      = hidden_field_tag :locale, I18n.locale

      button.search-container-button type="submit"
        i.fa.fa-search
    div.clearfix

  - if user_signed_in?
    div.header-user-wrapper.user-index
      = render partial: 'shared/userbox'

  section.petitions-overview-wrapper

    = render partial: 'sort_options'

    div.petitions-overview-container
      = render partial: 'list'

      div.clearfix

    div.navigation-bar
      = link_to_next_page @petitions, t('index.more'), params: { sorting: @sorting }, class: 'navigation-loadmore button', remote: true

      div.clearfix

      = link_to t('index.all'), all_petitions_path, class: 'navigation-toall'


  aside.news-intro-blocks-container
    - if @news
      - @news[0,2].each do |news|
        div.news-intro-block
          h2.news-intro-block-title= news.title
          div.news-intro-block-date= l(news.created_at.to_date)
          div.news-intro-block-intro
            = markdown intro_text(news.text)
          = link_to update_path(news)
            = t('index.read')