podemos-info/census

View on GitHub
app/views/procedures/_person_compare.arb

Summary

Maintainability
Test Coverage
# frozen_string_literal: true

context.instance_eval do
  if procedure.after_person
    panel t("census.procedures.person.changes") do
      tabs do
        tab t("census.procedures.person.before") do
          render partial: "people/show", locals: { context: context, title: "", changes: procedure.person_changeset,
                                                   resource: procedure.before_person, mode: :changes }
        end

        tab t("census.procedures.person.after") do
          render partial: "people/show", locals: { context: context, title: "", changes: procedure.person_changeset,
                                                   resource: procedure.after_person, mode: :changes }
        end

        tab t("census.procedures.person.now") do
          render partial: "people/show", locals: { context: context, title: "", changes: procedure.person_changeset,
                                                   resource: procedure.person, mode: :changes }
        end
      end
    end
  end
end