{% extends 'portals/index.html' %}

{% set action_url = h.url_for(controller='ckanext.orgportals.controllers.portals:OrgportalsController', action='contentpage_show', page_name=page.name, org_name=page.org_name) %}

{% block content %}
  <h1 class="content-page-container__header">{{ page.content_title }}</h1>
  <div class="content-page-container__text">{{ h.render_markdown(page.content) }}</div>

  <div class="contact-form-container">
    <form id="contact-form-container__form" method="post" action="{{ action_url }}">
      <fieldset>
        <input type="text" placeholder="{{ _('Your name') }}" name="contact_name" tabindex="1" required autofocus />
      </fieldset>
      <fieldset>
        <input type="email" placeholder="{{ _('Your email address') }}" name="contact_email" tabindex="2" required />
      </fieldset>
      <fieldset>
        <textarea placeholder="{{ _('Type your message here') }}..." name="contact_message" tabindex="3" required></textarea>
      </fieldset>
      <fieldset>
        <button name="submit" type="submit" id="contact-submit">{{ _('Submit') }}</button>
      </fieldset>
      <p>{{ page.contact_response_message }}</p>
    </form>
  </div>
{% endblock %}

{% extends 'portals/index.html' %}

{% if c.source == 'admin' %}
  {% set action_url = h.url_for(controller='ckanext.orgportals.controllers.portals:OrgportalsController', action='contentpage_show', page_name=page.name, org_name=page.org_name, source='admin') %}
{% else %}
  {% set action_url = h.url_for(controller='ckanext.orgportals.controllers.portals:OrgportalsController', action='show_portal_contentpage', page_name=page.name) %}
{% endif %}

{% block content %}
  <h1 class="content-page-container__header">{{ page.content_title }}</h1>
  <div class="content-page-container__text">{{ h.render_markdown(page.content) }}</div>

  <div class="contact-form-container">
    <form id="contact-form-container__form" method="post" action="{{ action_url }}">
      <h3>Contact</h3>
      <fieldset>
        <input type="text" placeholder="{{ _('Your name') }}" name="contact_name" tabindex="1" required autofocus />
      </fieldset>
      <fieldset>
        <input type="email" placeholder="{{ _('Your email address') }}" name="contact_email" tabindex="2" required />
      </fieldset>
      <fieldset>
        <textarea placeholder="{{ _('Type your message here') }}..." name="contact_message" tabindex="3" required></textarea>
      </fieldset>
      <fieldset>
        <button name="submit" type="submit" id="contact-submit">{{ _('Submit') }}</button>
      </fieldset>
      <p>{{ page.contact_response_message }}</p>
    </form>
  </div>
{% endblock %}

Fix issue with action url
Fix issue with action url
