add content changes from @miriampena for grant intro page

Congrats!

Expect a copy of your grant proposal coming from eef-grant-submissions@beam.eco

Grant request process

          Intro
          FAQ
          Form

              It is our great pleasure to announce that we have just opened our grant program. The goal of it is to
              fund open source development, trainings, workshops and other initiatives that will help increase
              and expand the Beam community. These grants are funded by our sponsors,
              membership fees and donations.

The current focus of the foundation is on increasing and
              expanding the
              community so we will favour grants that are targeted to
              beneficiaries that
              are new to Erlang/Elixir and the ecosystem. We prefer grants that
              support
              online workshops, online training materials, hands-on trainings,
              development
              work (open source) and diversity efforts. On non-beam focused
              events where
              there is a clear Beam language component of the event, the grant
              will only
              support the Beam language component of the event. The EEF will
              consider
              supporting a hackathon if the event has hands-on Beam languages
              education
              for a minimum of 6 hours. We will not fund prizes for hackathons
              or swag.

We recommend that you submit grant proposals via our form at
              least 12
              weeks prior to the event. Proposals should be concise and have a
              clear
              objective. We encourage those applying for funding to try and get
              sponsorship
              from corporations or local sponsors as we want to encourage
              sustainable, long term relationships with them. The EEF could limit the
              number of events per
              organizer and/or city that are granted within a given year.

            If you want to apply for a grant, fill out the form here.
              If you have any questions please reach out to
              education@erlef.org

FAQ

                          <button class="btn btn-link" type="button"
                            data-toggle="collapse"
                            data-target="#accordion-tab-1-content-1"
                            aria-expanded="false"
                            aria-controls="accordion-tab-1-content-1"> When
                            should I submit my grant request?</button>

                          We recommend that grant requests be submitted at least
                          12 weeks before the funding is needed.

                          <button class="btn btn-link" type="button"
                            data-toggle="collapse"
                            data-target="#accordion-tab-1-content-2"
                            aria-expanded="false"
                            aria-controls="accordion-tab-1-content-2">What grant
                            can I ask for organizing a
                            conference?</button>

The maximum conference grant size is typically
                            around 10 USD per
                            attendee. We prefer to help new events get
                            established in their community
                            and we encourage them to apply for different funding
                            local options as well.
                            Bigger conferences might be assigned a lower amount
                            per attendee.
                            Educational programs run within the conference
                            should request a separate
                            budget.

                          <button class="btn btn-link" type="button"
                            data-toggle="collapse"
                            data-target="#accordion-tab-1-content-3"
                            aria-expanded="false"
                            aria-controls="accordion-tab-1-content-3">
                            I am organizing a workshop. What grant can I ask
                            for?
                          </button>

Our maximum educational program grant size is
                            typically USD 25 per
                            student, provided the students each receive at least
                            6 hours of BEAM
                            languages instruction as part of it, however we are
                            open to
                            review this amount on a case by case basis. Please
                            note that
                            subsequent requests for workshops in the same area
                            may be
                            funded at a lower rate to encourage sustainable,
                            long-term
                            relationships with local sponsors.

When submitting your workshop grant request, it
                            helps us to see a brief budget as this example:

                              Items
                              Unit Cost
                              Quantity
                              Total Cost

                                Lunch and drinks
                                9
                                50
                                450

                                Travel expenses
                                20
                                3
                                60

                                Hotel expenses
                                50
                                2
                                100

                                Total

                                610

<button class="btn btn-link" type="button"
                            data-toggle="collapse"
                            data-target="#accordion-tab-1-content-4"
                            aria-expanded="false"
                            aria-controls="accordion-tab-1-content-4">
                            Is there a maximum grant size that can be
                            awarded?</button>

There is no maximum, however bear in mind that the
                            foundation has a limited budget and we reserve the
                            right of giving a grant smaller than requested, let
                            us know if this is a problem for you.

Grant Proposal Form

  <%= unless @errors == [] do %>

      Errors :

      <% errs = Enum.reduce(@errors, "", fn(err, acc) -> acc <> "
#{err}
" end) %>
    <%= raw errs %>

<% end %>
  <%= form_for @conn, Routes.grant_path(@conn, :create), [id: "grant_form", multipart: true, class: "dropzone"], fn _f -> %>

                  * First name
                  <input type="text" name="first_name" class="form-control"
                    id="first_name" maxlength="50" placeholder="First name" required>

                  * Last name
                  <input type="text" class="form-control"
                    id="last_name" maxlength="50" name="last_name" placeholder="Last name" required>

                  * Nick Name

                    <input type="text" maxlength="50" class="form-control" name="nick_name"
                      id="nick_name" placeholder="Nick Name"
                      aria-describedby="inputGroupPrepend3" required>

                  * Email address
                  <input type="email" maxlength="50" name="email_address" class="form-control"
                    id="email_address" aria-describedby="emailHelp"
                    placeholder="Enter email" required>

                  * Phone Number
                  <input type="text" maxlength="20" name="phone_number" class="form-control" id="phone_number"
                    placeholder="Phone Number" required>

                  Organization Name
                  <input type="text" maxlength="50" name="org_name" class="form-control" id="org_name"
                    placeholder="Organization Name">

                  Organization Email
                  <input type="email" maxlength="50" name="org_email" class="form-control" id="org_email"
                    placeholder="Organization Email">

                  * City
                  <input type="text" maxlength="85"  name="city" class="form-control"
                    id="city" placeholder="City" required>

                    Please provide a valid city.

                  * Country Subdivision
                  <input type="text" maxlength="2" name="subdivision" class="form-control"
                                                     id="subdivision" placeholder="Subdivison" required>
                  ISO 3166-2 code for your country's subdivsion (e.g., state or province)

                  * Postal Code
                  <input type="text" maxlength="10" name="postal_code" class="form-control"
                    id="postal_code" placeholder="Postal Code" required>

                  * Country
                  <input type="text" maxlength="2" name="country" class="form-control"
                                                    id="country" placeholder="Country" required>
                  ISO 3166-1 for your country

                  Twitter Handle
                  <input type="text" maxlength="50" name="twitter" class="form-control" id="twitter"
                    placeholder="Twitter Handle">

                  LinkedIn
                  <input type="text" maxlength="50" class="form-control" name="linkedin" id="linkedin"
                    placeholder="LinkedIn">

                  WebSite
                  <input type="text" maxlength="50" class="form-control" name="website" id="website"
                    placeholder="WebSite">

                  * Small Bio
                  <textarea class="form-control"
                            id="bio" rows="3"
                                     name="bio"
                                     maxlength="5000"
                    placeholder="Small Bio" required></textarea>

                  * Grant Type
                  <select name="grant_type" class="form-control" id="grant_type" required>
                    <option data-type="none" data-requires-coc="false" value="">--</option>
                    <option data-type="conference" data-requires-coc="true"  value="Conference">Conference</option>
                    <option data-type="devel_work" data-requires-coc="false" value="Development Work">Development Work</option>
                    <option data-type="event_site_sub" data-requires-coc="true" value="Event Site Description">Event Site Description</option>
                    <option data-type="kids_camp" data-requires-coc="true" value="Kids Coding Camp">Kids Coding Camp</option>
                    <option data-type="sprint" data-requires-coc="false" value="Sprint">Sprint</option>
                    <option data-type="training" data-requires-coc="false" value="Training Program">Training Program</option>
                    <option data-type="workshop-edu" data-requires-coc="true" value="Workshop-Education">Workshop-Educational</option>
                    <option data-type="workshop-women" data-requires-coc="true" value="Workgroup-Women">Workshop-Women</option>
                    <option data-type="other" value="Other">Other</option>
                  </select>

A gathering including talks and other events to promote Beam languages in the local community. A separate grant should be submitted for educational programs that are a subset of conference events.

                    Develop a Beam languages-based open source program or library.

                      The subscription cost of a service providing advertising services for Beam languages-related events.

                    Teach aspiring Beam language coders under age 18 coding skills.

                    Development of an open-source project for 2+ days in a team environment.

                    Multiple weeks or month course on Beam languages that is principally hands-on

                    An interactive, hands-on, training into one or more specific Beam languages topics/themes/goals, which supports and mentors women.

                      An interactive, hands-on, training into one or more specific Beam languages topics/themes/goals. It should include at least 6 hours of instruction

                  * Link to code of conduct of the event
                    (required for workshops and conferences)
                  <input id="coc_input" name="code_of_conduct_link" type="text" class="form-control"
                    placeholder="">

                  Optional File attachment(s) :

                  <input type="file" name="files[]" accept="image/png, image/jpeg, application/pdf" />

                    <input type="file" name="files[]" accept="image/png, image/jpeg, application/pdf" />

                    <input type="file" name="files[]" accept="image/png, image/jpeg, application/pdf" />

                    <input type="file" name="files[]" accept="image/png, image/jpeg, application/pdf" />

                    <input type="file" name="files[]" accept="image/png, image/jpeg, application/pdf" />

                  * Purpose

Describe
                    the purpose of the grant, location and date, including the
                    date in which the funds must be received. We recommend to
                    send the requests at minimum 12 weeks before the
                    event so we have enough time to review, ask questions and
                    send you the funds.
                    Make sure you explain how this grant is designed to help
                    grow the community. Also let us know what other forms of
                    sponsorship you have applied for.
                    For workshops/trainings please include the staff:student
                    ratio, the amount of hands-on training time and a lesson
                    plan with learning outcomes for participants.

                  <textarea class="form-control"
                    id="purpose" name="purpose" rows="3"
                    placeholder="Purpose" maxlength="5000" required></textarea>

                      Specify here the grant amount in detail. Please note that
                      the EEF may only be able to provide partial funding for a
                      proposal so let us know if this is acceptable to you. Be
                      sure to include a breakdown of the amount you are
                      requesting. We prefer to see what you plan on using the
                      funds for.
                      Example: 1200$ total ($700 for venue, $300 for trav
                      el, $200 for food). To thank you for your sponsorship, we
                      will place the EEF logo on our site and offer you 3 free
                      tickets to the event to distribute as you see fit.

                  * Amount

                      $

                    <input id="grant_amount" maxlength="6" name="grant_amount" type="text" value="" min="0.00" step="1.00"
                      data-number-to-fixed="2" data-number-stepfactor="100"
                      class="form-control currency" required>

                    Preferred payment
                      method
                    <select class="form-control" id="payment_method" name="payment_method" required>
                      <option value="">--</option>
                      <option value="Paypal">Paypal</option>
                      <option value="Zelle">Zelle</option>
                      <option value="Check">Check</option>
                      <option value="Wire">Wire</option>
                    </select>
                    We can do checks only within
                      the US. If the request is for $500 or less, PayPal is
                      suggested.

                      * Beneficiaries

                        Describe who will be the beneficiaries of the grant and
                        the expected size of the event.
                        For onsite events we would love to have an overview of
                        other Beam related
                        activities/meetups/trainings/conferences located in that
                        area, the number of attendees, frequency and such.

                      <textarea class="form-control"
                        id="beneficiaries" name="beneficiaries" rows="3"
                        placeholder="Beneficiaries" maxlength="5000" required></textarea>

                    * Report

The EEF would like to
                      see how the grant was used so we require that we receive a
                      report that will help us understand the impact that the
                      grants are having and how the activities are received
                      by the community. We require to receive this report within
                      one month of the event. Please describe in this section
                      what items you will include on the report and what follow
                      up activities do you plan on. For example: blog posts,
                      post events write-ups, web pages, project updates, lessons
                      learned (what went well and what needs to improve), the
                      feedback from the participants, social media, number of
                      attendees, demographics, and such.

                    <textarea class="form-control"
                              id="report" rows="3"
                                          name="report"
                                          maxlength="5000"
                      placeholder="Report" required></textarea>

                <button id="submit_form" class="btn btn-primary mt-2" type="submit">Submit</button>

            <% end %>

Congrats!

Expect a copy of your grant proposal coming from eef-grant-submissions@beam.eco

Grant request process

          Intro
          FAQ
          Form

Introduction

The current focus of the foundation is on increasing and
              expanding the
              community so we will favour grants that are targeted to
              beneficiaries that
              are new to Erlang/Elixir and the ecosystem. We prefer grants that
              support
              online workshops, online training materials, hands-on trainings,
              development
              work (open source) and diversity efforts. On non-beam focused
              events where
              there is a clear Beam language component of the event, the grant
              will only
              support the Beam language component of the event. The EEF will
              consider
              supporting a hackathon if the event has hands-on Beam languages
              education
              for a minimum of 6 hours. We will not fund prizes for hackathons
              or swag.

We recommend that you submit grant proposals via our form at
              least 12
              weeks prior to the event. Proposals should be concise and have a
              clear
              objective. We encourage those applying for funding to try and get
              sponsorship
              from corporations or local sponsors as we want to encourage
              sustainable, long
              term relationships with them.

The EEF could limit the number of events per organizer and/or
              city that are
              granted within a given year. If you have any questions reach out
              to
              education@erlef.org

FAQ

                          <button class="btn btn-link" type="button"
                            data-toggle="collapse"
                            data-target="#accordion-tab-1-content-1"
                            aria-expanded="false"
                            aria-controls="accordion-tab-1-content-1"> When
                            should I submit my grant request?</button>

                          We recommend that grant requests be submitted at least
                          12 weeks before the funding is needed.

                          <button class="btn btn-link" type="button"
                            data-toggle="collapse"
                            data-target="#accordion-tab-1-content-2"
                            aria-expanded="false"
                            aria-controls="accordion-tab-1-content-2">What grant
                            can I ask for organizing a
                            conference?</button>

The maximum conference grant size is typically
                            around 10 USD per
                            attendee. We prefer to help new events get
                            established in their community
                            and we encourage them to apply for different funding
                            local options as well.
                            Bigger conferences might be assigned a lower amount
                            per attendee.
                            Educational programs run within the conference
                            should request a separate
                            budget.

                          <button class="btn btn-link" type="button"
                            data-toggle="collapse"
                            data-target="#accordion-tab-1-content-3"
                            aria-expanded="false"
                            aria-controls="accordion-tab-1-content-3">
                            I am organizing a workshop. What grant can I ask
                            for?
                          </button>

Our maximum educational program grant size is
                            typically USD 25 per
                            student, provided the students each receive at least
                            6 hours of BEAM
                            languages instruction as part of it, however we are
                            open to
                            review this amount on a case by case basis. Please
                            note that
                            subsequent requests for workshops in the same area
                            may be
                            funded at a lower rate to encourage sustainable,
                            long-term
                            relationships with local sponsors.

When submitting your workshop grant request, it
                            helps us to see a brief budget as this example:

                              Items
                              Unit Cost
                              Quantity
                              Total Cost

                                Lunch and drinks
                                9
                                50
                                450

                                Travel expenses
                                20
                                3
                                60

                                Hotel expenses
                                50
                                2
                                100

                                Total

                                610

<button class="btn btn-link" type="button"
                            data-toggle="collapse"
                            data-target="#accordion-tab-1-content-4"
                            aria-expanded="false"
                            aria-controls="accordion-tab-1-content-4">
                            Is there a maximum grant size that can be
                            awarded?</button>

There is no maximum, however bear in mind that the
                            foundation has a limited budget and we reserve the
                            right of giving a grant smaller than requested, let
                            us know if this is a problem for you.

Grant Proposal Form

  <%= unless @errors == [] do %>

      Errors :

      <% errs = Enum.reduce(@errors, "", fn(err, acc) -> acc <> "
#{err}
" end) %>
    <%= raw errs %>

<% end %>
  <%= form_for @conn, Routes.grant_path(@conn, :create), [id: "grant_form", multipart: true, class: "dropzone"], fn _f -> %>

                  * First name
                  <input type="text" name="first_name" class="form-control"
                    id="first_name" maxlength="50" placeholder="First name" required>

                  * Last name
                  <input type="text" class="form-control"
                    id="last_name" maxlength="50" name="last_name" placeholder="Last name" required>

                  * Nick Name

                    <input type="text" maxlength="50" class="form-control" name="nick_name"
                      id="nick_name" placeholder="Nick Name"
                      aria-describedby="inputGroupPrepend3" required>

                  * Email address
                  <input type="email" maxlength="50" name="email_address" class="form-control"
                    id="email_address" aria-describedby="emailHelp"
                    placeholder="Enter email" required>

                  * Phone Number
                  <input type="text" maxlength="20" name="phone_number" class="form-control" id="phone_number"
                    placeholder="Phone Number" required>

                  Organization Name
                  <input type="text" maxlength="50" name="org_name" class="form-control" id="org_name"
                    placeholder="Organization Name">

                  Organization Email
                  <input type="email" maxlength="50" name="org_email" class="form-control" id="org_email"
                    placeholder="Organization Email">

                  * City
                  <input type="text" maxlength="85"  name="city" class="form-control"
                    id="city" placeholder="City" required>

                    Please provide a valid city.

                  * Country Subdivision
                  <input type="text" maxlength="2" name="subdivision" class="form-control"
                                                     id="subdivision" placeholder="Subdivison" required>
                  ISO 3166-2 code for your country's subdivsion (e.g., state or province)

                  * Postal Code
                  <input type="text" maxlength="10" name="postal_code" class="form-control"
                    id="postal_code" placeholder="Postal Code" required>

                  * Country
                  <input type="text" maxlength="2" name="country" class="form-control"
                                                    id="country" placeholder="Country" required>
                  ISO 3166-1 for your country

                  Twitter Handle
                  <input type="text" maxlength="50" name="twitter" class="form-control" id="twitter"
                    placeholder="Twitter Handle">

                  LinkedIn
                  <input type="text" maxlength="50" class="form-control" name="linkedin" id="linkedin"
                    placeholder="LinkedIn">

                  WebSite
                  <input type="text" maxlength="50" class="form-control" name="website" id="website"
                    placeholder="WebSite">

                  * Small Bio
                  <textarea class="form-control"
                            id="bio" rows="3"
                                     name="bio"
                                     maxlength="5000"
                    placeholder="Small Bio" required></textarea>

                  * Grant Type
                  <select name="grant_type" class="form-control" id="grant_type" required>
                    <option data-type="none" data-requires-coc="false" value="">--</option>
                    <option data-type="conference" data-requires-coc="true"  value="Conference">Conference</option>
                    <option data-type="devel_work" data-requires-coc="false" value="Development Work">Development Work</option>
                    <option data-type="event_site_sub" data-requires-coc="true" value="Event Site Description">Event Site Description</option>
                    <option data-type="kids_camp" data-requires-coc="true" value="Kids Coding Camp">Kids Coding Camp</option>
                    <option data-type="sprint" data-requires-coc="false" value="Sprint">Sprint</option>
                    <option data-type="training" data-requires-coc="false" value="Training Program">Training Program</option>
                    <option data-type="workshop-edu" data-requires-coc="true" value="Workshop-Education">Workshop-Educational</option>
                    <option data-type="workshop-women" data-requires-coc="true" value="Workgroup-Women">Workshop-Women</option>
                    <option data-type="other" value="Other">Other</option>
                  </select>

A gathering including talks and other events to promote Beam languages in the local community. A separate grant should be submitted for educational programs that are a subset of conference events.

                    Develop a Beam languages-based open source program or library.

                      The subscription cost of a service providing advertising services for Beam languages-related events.

                    Teach aspiring Beam language coders under age 18 coding skills.

                    Development of an open-source project for 2+ days in a team environment.

                    Multiple weeks or month course on Beam languages that is principally hands-on

                    An interactive, hands-on, training into one or more specific Beam languages topics/themes/goals, which supports and mentors women.

                      An interactive, hands-on, training into one or more specific Beam languages topics/themes/goals. It should include at least 6 hours of instruction

                  * Link to code of conduct of the event
                    (required for workshops and conferences)
                  <input id="coc_input" name="code_of_conduct_link" type="text" class="form-control"
                    placeholder="">

                  Optional File attachment(s) :

                  <input type="file" name="files[]" accept="image/png, image/jpeg, application/pdf" />

                    <input type="file" name="files[]" accept="image/png, image/jpeg, application/pdf" />

                    <input type="file" name="files[]" accept="image/png, image/jpeg, application/pdf" />

                    <input type="file" name="files[]" accept="image/png, image/jpeg, application/pdf" />

                    <input type="file" name="files[]" accept="image/png, image/jpeg, application/pdf" />

                  * Purpose

Describe
                    the purpose of the grant, location and date, including the
                    date in which the funds must be received. We recommend to
                    send the requests at minimum 12 weeks before the
                    event so we have enough time to review, ask questions and
                    send you the funds.
                    Make sure you explain how this grant is designed to help
                    grow the community. Also let us know what other forms of
                    sponsorship you have applied for.
                    For workshops/trainings please include the staff:student
                    ratio, the amount of hands-on training time and a lesson
                    plan with learning outcomes for participants.

                  <textarea class="form-control"
                    id="purpose" name="purpose" rows="3"
                    placeholder="Purpose" maxlength="5000" required></textarea>

                      Specify here the grant amount in detail. Please note that
                      the EEF may only be able to provide partial funding for a
                      proposal so let us know if this is acceptable to you. Be
                      sure to include a breakdown of the amount you are
                      requesting. We prefer to see what you plan on using the
                      funds for.
                      Example: 1200$ total ($700 for venue, $300 for trav
                      el, $200 for food). To thank you for your sponsorship, we
                      will place the EEF logo on our site and offer you 3 free
                      tickets to the event to distribute as you see fit.

                  * Amount

                      $

                    <input id="grant_amount" maxlength="6" name="grant_amount" type="text" value="" min="0.00" step="1.00"
                      data-number-to-fixed="2" data-number-stepfactor="100"
                      class="form-control currency" required>

                    Preferred payment
                      method
                    <select class="form-control" id="payment_method" name="payment_method" required>
                      <option value="">--</option>
                      <option value="Paypal">Paypal</option>
                      <option value="Zelle">Zelle</option>
                      <option value="Check">Check</option>
                      <option value="Wire">Wire</option>
                    </select>
                    We can do checks only within
                      the US. If the request is for $500 or less, PayPal is
                      suggested.

                      * Beneficiaries

                        Describe who will be the beneficiaries of the grant and
                        the expected size of the event.
                        For onsite events we would love to have an overview of
                        other Beam related
                        activities/meetups/trainings/conferences located in that
                        area, the number of attendees, frequency and such.

                      <textarea class="form-control"
                        id="beneficiaries" name="beneficiaries" rows="3"
                        placeholder="Beneficiaries" maxlength="5000" required></textarea>

                    * Report

The EEF would like to
                      see how the grant was used so we require that we receive a
                      report that will help us understand the impact that the
                      grants are having and how the activities are received
                      by the community. We require to receive this report within
                      one month of the event. Please describe in this section
                      what items you will include on the report and what follow
                      up activities do you plan on. For example: blog posts,
                      post events write-ups, web pages, project updates, lessons
                      learned (what went well and what needs to improve), the
                      feedback from the participants, social media, number of
                      attendees, demographics, and such.

                    <textarea class="form-control"
                              id="report" rows="3"
                                          name="report"
                                          maxlength="5000"
                      placeholder="Report" required></textarea>

                <button id="submit_form" class="btn btn-primary mt-2" type="submit">Submit</button>

            <% end %>


WIP structural changes

WIP structural changes

  <%= gettext "Thank you for so much registering/logging in!" %>

          <a class="btn btn-default" href="<%= page_path(@conn, :index, @conn.assigns.locale ) %>"><%= gettext "Back" %>

          <%= button(gettext("Log out"), to: user_selection_path(@conn, :delete, @conn.assigns[:user].id, method: :delete), method: "delete", class: "btn btn-default")  %>

    <%= for temperature <- storage_temperatures do %>
      <div class='<%= temperature %>'>
        <%= Gettext.gettext(OpenPantry.Web.Gettext, display(temperature)) %>

    <% end %>

        <%= for {stock_type, _type_id, _stocks} <- @stock_by_type do %>
          <li class="<%= active(stock_type, @stock_by_type)%>">
            <a href="#<%= stock_type %>" data-toggle="tab"> <%= stock_type %>

        <% end %>

        <%= for {stock_type, type_id, stocks} <- @stock_by_type do %>
          <%= render OpenPantry.Web.SharedView,
                      "stock_type.html",
                      stock_type: stock_type,
                      type_id: type_id,
                      stock_by_type: @stock_by_type,
                      stocks: stocks,
                      package: @package,
                      credits: @credits
          %>
        <% end %>

        <%= for {stock_type, type_id, _stocks} <- @stock_by_type do %>
          <%= stock_type %> <%= gettext("remaining:") %>
          <span class="js-credit-count credit-type-<%= type_id %>" data-credit-type="<%= type_id %>" >
            <%=  @credits[stock_type] %>

        <%= end %>

        <%= form_for @user_order, food_selection_path(@conn, :update, @conn.assigns.locale, @user_order.data.id), fn f -> %>
          <%= hidden_input(f, :finalized, value: true) %>
          <%= submit gettext("Complete your order!") %>
        <% end %>

          <%# TBD?
            <colgroup>
              <col>
              <col>
              <col>
              <col>
            </colgroup>
          %>

            <%= gettext("Item description") %>
            <%= gettext("Item packaging") %>
            <%= gettext("Weight") %>
            <%= gettext("Quantity requested") %>

            <%= for distribution <- @distributions do %>
              <%= render OpenPantry.Web.SharedView, "distribution.html", distribution: distribution %>
            <% end %>

  <%= gettext "Thank you for so much registering/logging in!" %>

          <a class="btn btn-default" href="<%= page_path(@conn, :index, @conn.assigns.locale ) %>"><%= gettext "Back" %>

          <%= button(gettext("Log out"), to: user_selection_path(@conn, :delete, @conn.assigns[:user].id, method: :delete), method: "delete", class: "btn btn-default")  %>

    <%= for temperature <- storage_temperatures do %>
      <div class='<%= temperature %>'>
        <%= Gettext.gettext(OpenPantry.Web.Gettext, display(temperature)) %>

    <% end %>

        <%= for {stock_type, _type_id, _stocks} <- @stock_by_type do %>
          <li class="<%= active(stock_type, @stock_by_type)%>">
            <a href="#<%= stock_type %>" data-toggle="tab"> <%= stock_type %>

        <% end %>

           <%= gettext("Cart") %>

        <%= for {stock_type, type_id, stocks} <- @stock_by_type do %>
          <%= render OpenPantry.Web.SharedView,
                      "stock_type.html",
                      stock_type: stock_type,
                      type_id: type_id,
                      stock_by_type: @stock_by_type,
                      stocks: stocks,
                      package: @package,
                      credits: @credits
          %>
        <% end %>

            <%= form_for @user_order, food_selection_path(@conn, :update, @conn.assigns.locale, @user_order.data.id), fn f -> %>
              <%= hidden_input(f, :finalized, value: true) %>
              <%= submit gettext("Complete your order!") %>
            <% end %>

              <%# TBD?
                <colgroup>
                  <col>
                  <col>
                  <col>
                  <col>
                </colgroup>
              %>

                <%= gettext("Item description") %>
                <%= gettext("Item packaging") %>
                <%= gettext("Weight") %>
                <%= gettext("Quantity requested") %>

                <%= for distribution <- @distributions do %>
                  <%= render OpenPantry.Web.SharedView, "distribution.html", distribution: distribution %>
                <% end %>


actually the arrows were missing

actually the arrows were missing

          <%= @persona.name %>

Panoptikum-ID

<%= @persona.pid %>

Permalink (URI)

<%= PanWeb.Endpoint.url %>/<%= @persona.pid %>

Name

<%= @persona.name %>

              <%= if @persona.uri do %>

Uri

<%= @persona.uri %>

              <% end %>

Business Cards

<%= link [fa_icon("vcard-o"), " Show"], to: persona_frontend_url(@conn, :business_card, @persona) %>

            Id: <%= @persona.id %>

            <%= if @persona.image_url do %>
              <object data="<%= @persona.image_url %>"
                      alt="<%= @persona.image_title%>"
                      type="image/png"
                      width="150"
                      class="thumbnail"
                      id="photo">

              </object>
            <% else %>

            <% end %>

        <%= if @current_user do %>

            <%= like_or_unlike(@current_user.id, @persona.id) %>
            <%= follow_or_unfollow(@current_user.id, @persona.id) %>

        <% end %>

    <%= cond do %>
      <% !@current_user -> %>

Claiming not available

You can only claim personas, if you are logged in.

      <% !@current_user.podcaster -> %>

Claiming not available

You didn't say you are a podcaster in
             <%= link "My Profile",  to: user_frontend_path(@conn, :my_profile),
                                     class: "btn btn-sm btn-default" %> yet.

      <% !@current_user.email_confirmed -> %>

Claiming not available

You didn't confirm your email address by clicking on the
             confirmation link in the email sent to you after login.

      <% !@persona.email -> %>

Claiming

Please take the time to read the text on the following screen carefully.

<%= link "Start claiming process", to: persona_frontend_path(@conn, :warning, @persona),
                                              class: "btn btn-normal" %>

      <% true -> %>

Claiming

You can send an email to the owner of this persona and ask her for permission
           to add you as a manifestation of this persona.

           Your name, username and email address will be sent alongside in the email
           to give the owner a chance to get in contact with you.

<%= link "Claim", to: persona_frontend_path(@conn, :claim, @persona),
                             class: "btn btn-normal",
                             method: :post,
                             data: [confirm: "Are you sure?"] %>

    <% end %>

<%= if @persona.description || @persona.long_description do %>

<%= @persona.description %>

      <%= markdown(@persona.long_description) %>

<% end %>

<%= if @engagements != [] do %>

Engagements, <%= @persona.name %> has entered

            Podcast
            Role

          <%= for {podcast, engagements} <- Enum.group_by(@engagements, &Map.get(&1, :podcast)) do %>

               <%= link [fa_icon("podcast"), " ", truncate(podcast.title, 50)],
                             to: podcast_frontend_path(@conn, :show, podcast),
                             class: "btn btn-default btn-xs",
                             style: "color: #000" %>

                <%= for engagement <- engagements do %>
                  <%= engagement.role %>
                <% end %>

          <% end %>

<% end %>

<%= if @gigs != [] do %>

Gigs, <%= @persona.name %> has been engaged in

            Date
            Podcast
            Episode
            Role

          <%= for episode <- ordered_episodes(@gigs) do %>

              <%= if episode.publishing_date, do: format_date(episode.publishing_date) %>
              <%= link [fa_icon("podcast"), " ", episode.podcast.title],
                             to: podcast_frontend_path(@conn, :show, episode.podcast),
                             class: "btn btn-default btn-xs truncate",
                             style: "color: #000" %>
              <%= link [fa_icon("headphones"), " ", episode.title],
                          to: episode_frontend_path(@conn, :show, episode),
                          class: "btn btn-primary btn-xs truncate" %>

                <%= for gig <- @grouped_gigs[episode] do %>
                  <%= gig.role %>
                <% end %>

          <% end %>

<% end %>

<%= if @messages.total_entries > 0 do %>

Messages created by <%= @persona.name %>

      <%= pagination_links @conn, @messages, [Integer.to_string(@persona.id)],
                   path: &persona_frontend_path/4,
                   action: :show,
                   view_style: :bootstrap %>

        <%= for message <- @messages.entries do %>
          <li class="list-group-item message-<%= message.type %>">

              <%= if message.creator, do: message.creator.name, else: message.persona.name %>:

            <%= raw message.content %>
            <%= message.inserted_at %>

        <% end %>

<% end %>

          <%= @persona.name %>

Panoptikum-ID

<%= @persona.pid %>

Permalink (URI)

<%= PanWeb.Endpoint.url %>/<%= @persona.pid %>

Name

<%= @persona.name %>

              <%= if @persona.uri do %>

Uri

<%= @persona.uri %>

              <% end %>

Business Cards

<%= link [fa_icon("vcard-o"), " Show"], to: persona_frontend_url(@conn, :business_card, @persona) %>

            Id: <%= @persona.id %>

            <%= if @persona.image_url do %>
              <object data="<%= @persona.image_url %>"
                      alt="<%= @persona.image_title%>"
                      type="image/png"
                      width="150"
                      class="thumbnail"
                      id="photo">

              </object>
            <% else %>

            <% end %>

        <%= if @current_user do %>

            <%= like_or_unlike(@current_user.id, @persona.id) %>
            <%= follow_or_unfollow(@current_user.id, @persona.id) %>

        <% end %>

    <%= cond do %>
      <%= !@current_user -> %>

Claiming not available

You can only claim personas, if you are logged in.

      <%= @current_user && !@current_user.podcaster %>

Claiming not available

You didn't say you are a podcaster in
             <%= link "My Profile",  to: user_frontend_path(@conn, :my_profile),
                                     class: "btn btn-sm btn-default" %> yet.

      <%= @current_user && !@current_user.email_confirmed %>

Claiming not available

You didn't confirm your email address by clicking on the
             confirmation link in the email sent to you after login.

      <% !@persona.email -> %>

Claiming

Please take the time to read the text on the following screen carefully.

<%= link "Start claiming process", to: persona_frontend_path(@conn, :warning, @persona),
                                              class: "btn btn-normal" %>

      <% true -> %>

Claiming

You can send an email to the owner of this persona and ask her for permission
           to add you as a manifestation of this persona.

           Your name, username and email address will be sent alongside in the email
           to give the owner a chance to get in contact with you.

<%= link "Claim", to: persona_frontend_path(@conn, :claim, @persona),
                             class: "btn btn-normal",
                             method: :post,
                             data: [confirm: "Are you sure?"] %>

    <% end %>

<%= if @persona.description || @persona.long_description do %>

<%= @persona.description %>

      <%= markdown(@persona.long_description) %>

<% end %>

<%= if @engagements != [] do %>

Engagements, <%= @persona.name %> has entered

            Podcast
            Role

          <%= for {podcast, engagements} <- Enum.group_by(@engagements, &Map.get(&1, :podcast)) do %>

               <%= link [fa_icon("podcast"), " ", truncate(podcast.title, 50)],
                             to: podcast_frontend_path(@conn, :show, podcast),
                             class: "btn btn-default btn-xs",
                             style: "color: #000" %>

                <%= for engagement <- engagements do %>
                  <%= engagement.role %>
                <% end %>

          <% end %>

<% end %>

<%= if @gigs != [] do %>

Gigs, <%= @persona.name %> has been engaged in

            Date
            Podcast
            Episode
            Role

          <%= for episode <- ordered_episodes(@gigs) do %>

              <%= if episode.publishing_date, do: format_date(episode.publishing_date) %>
              <%= link [fa_icon("podcast"), " ", episode.podcast.title],
                             to: podcast_frontend_path(@conn, :show, episode.podcast),
                             class: "btn btn-default btn-xs truncate",
                             style: "color: #000" %>
              <%= link [fa_icon("headphones"), " ", episode.title],
                          to: episode_frontend_path(@conn, :show, episode),
                          class: "btn btn-primary btn-xs truncate" %>

                <%= for gig <- @grouped_gigs[episode] do %>
                  <%= gig.role %>
                <% end %>

          <% end %>

<% end %>

<%= if @messages.total_entries > 0 do %>

Messages created by <%= @persona.name %>

      <%= pagination_links @conn, @messages, [Integer.to_string(@persona.id)],
                   path: &persona_frontend_path/4,
                   action: :show,
                   view_style: :bootstrap %>

        <%= for message <- @messages.entries do %>
          <li class="list-group-item message-<%= message.type %>">

              <%= if message.creator, do: message.creator.name, else: message.persona.name %>:

            <%= raw message.content %>
            <%= message.inserted_at %>

        <% end %>

<% end %>


Add index page title

Add index page title

<h1 class="page-title">
<%= gettext("Get the latest job offers! 🔥") %>
</h1>
<%= for offer <- @offers do %>
  <%= render("_offer.html", conn: @conn, offer: offer, show_cta: false) %>
<% end %>

<%= if length(@offers) == 0 do %>
  <%= render("_no-offer.html", conn: @conn) %>
<% end %>

<%= render_shared("_pagination.html", conn: @conn, page_number: @page_number, total_pages: @total_pages) %>


wrong action

wrong action

My Profile

<%= unless pro(@current_user) do %>

    Info! Disabled buttons can be used with a pro account only.

<% end %>

<%= link "Edit your data", to: user_frontend_path(@conn, :edit),
                           class: "btn btn-warning pull-right" %>

User Name

<%= @user.username %>

Full Name

<%= @user.name %>

Email

<%= @user.email %>

  <%= if @user.admin do %>

Admin

      I have admin priviliges.

  <% end %>

Podcaster

    <%= if @user.podcaster do %>
      I am a podcaster myself.
    <% else %>
      I am not a podcaster.
    <% end %>

Privacy

    <%= if @user.share_follows do %>
      I do currently share my followings.
    <% else %>
      I do not share my followings.
    <% end %>

    <%= if @user.share_subscriptions do %>
      I do currently share my subscriptions.
    <% else %>
      I do not share my subscriptions.
    <% end %>

Personas
  <button class="btn btn-primary btn-sm pull-right"
          data-toggle="popover"
          data-placement="left"
          data-title="Personas"
          data-html="true"
          data-content="Your personas are your different identities when you are podcasting.

            You might be podcasting in the name of an organisation, a group or use an alias,
            when you appear contributing to a podcast.
 We call all these different identities
            personas.">
    <%= fa_icon "info-circle" %> Help
  </button>

<%= for persona <- @user.personas do %>

        <%= persona.name %> (<%= persona.pid %>)

Pid

<%= persona.pid %>

name

<%= persona.name %>

uri

<%= persona.uri %>

email

<%= persona.email %>

description

<%= persona.description %>

image_url

<%= if persona.image_url, do: C.String.truncate(persona.image_url, 40) %>

image_title

<%= persona.image_title %>

          <%= if persona.image_url do %>
            <object data="<%= persona.image_url %>"
                    alt="<%= persona.image_title%>"
                    type="image/png"
                    width="150"
                    class="thumbnail">

            </object>
          <% else %>

          <% end %>

          <%= link "Edit persona", to: persona_frontend_path(@conn, :edit, persona),
                           class: "btn btn-warning" %>

Delegations
            <button class="btn btn-primary btn-xs pull-right"
                  data-toggle="popover"
                  data-placement="left"
                  data-title="Delegation"
                  data-content="A delegation lets the gigs (i.e. contributions to episodes) and
                    engagements (i.e. contributions to podcasts) of the persona also appear on the
                    profile page of the target persona.">
              <%= fa_icon "info-circle" %> Help
            </button>

            <%= for delegate_persona <- @user.personas do %>
              <%= if delegate_persona.id in Enum.map(persona.delegates, fn(delegate) -> delegate.id end) do %>

                  <%= fa_icon("link") %>

                  <%= link [fa_icon("user-o"), " ", delegate_persona.name],
                             to: persona_frontend_path(@conn, :show, delegate_persona),
                             class: "btn btn-default btn-xs"%>

                    <%= fa_icon("id-card-o") %> <%= delegate_persona.pid %>

                  <%= link [fa_icon("unlink"), " cancel"],
                           to: persona_frontend_path(@conn, :toggle_delegation, persona.id,
                                                     delegate_id: delegate_persona.id),
                           class: "btn btn-warning btn-xs " <> disabled(@current_user) %>

              <% end %>
            <% end %>

            <%= for delegate_persona <- @user.personas do %>
              <%= unless delegate_persona.id in Enum.map(persona.delegates, fn(delegate) -> delegate.id end) do %>
                <%= if delegate_persona != persona do %>

                    <%= fa_icon("unlink") %>
                    <%= link [fa_icon("user-o"), " ", delegate_persona.name],
                             to: persona_frontend_path(@conn, :show, delegate_persona),
                             class: "btn btn-default btn-xs" %>

                      <%= fa_icon("id-card-o") %> <%= delegate_persona.pid %>

                    <%= link [fa_icon("link"), " delegate"],
                             to: persona_frontend_path(@conn, :toggle_delegation, persona.id,
                                                       delegate_id: delegate_persona.id),
                             class: "btn btn-info btn-xs " <> disabled(@current_user) %>

                <% end %>
              <% end %>
            <% end %>

Redirection
            <button class="btn btn-primary btn-xs pull-right"
                data-toggle="popover"
                data-placement="left"
                data-title="Redirection"
                data-content="The redirection redirects the persona profile page to the profile
                  page of the target persona.">
            <%= fa_icon "info-circle" %> Help
          </button>

            <%= if persona.redirect do %>

                <%= fa_icon("arrow-right") %>
                <%= link [fa_icon("user-o"), " ", persona.redirect.name],
                          to: persona_frontend_path(@conn, :show, persona.redirect.pid),
                          class: "btn btn-default btn-xs" %>

                  <%= fa_icon("id-card-o") %> <%= persona.redirect.pid %>

                <%= link [fa_icon("unlink"), " cancel"],
                         to: persona_frontend_path(@conn, :cancel_redirect, persona.id),
                         class: "btn btn-warning btn-xs " <> disabled(@current_user) %>

            <% else %>

                This persona is not redirected.

              <%= for target_persona <- @user.personas do %>
                <%= if target_persona.id != persona.id do %>

                    <%= fa_icon("unlink") %>
                    <%= link [fa_icon("user-o"), " ", target_persona.name],
                              to: persona_frontend_path(@conn, :show, target_persona.id),
                              class: "btn btn-default btn-xs" %>

                      <%= fa_icon("id-card-o") %> <%= target_persona.pid %>

                    <%= link [fa_icon("arrow-right"), " redirect"],
                             to: persona_frontend_path(@conn, :redirect, persona.id,
                                                       target_id: target_persona.id),
                             class: "btn btn-danger btn-xs " <> disabled(@current_user) %>

                <% end %>
              <% end %>
            <% end %>

<% end %>

My Profile

<%= unless pro(@current_user) do %>

    Info! Disabled buttons can be used with a pro account only.

<% end %>

<%= link "Edit your data", to: user_frontend_path(@conn, :edit),
                           class: "btn btn-warning pull-right" %>

User Name

<%= @user.username %>

Full Name

<%= @user.name %>

Email

<%= @user.email %>

  <%= if @user.admin do %>

Admin

      I have admin priviliges.

  <% end %>

Podcaster

    <%= if @user.podcaster do %>
      I am a podcaster myself.
    <% else %>
      I am not a podcaster.
    <% end %>

Privacy

    <%= if @user.share_follows do %>
      I do currently share my followings.
    <% else %>
      I do not share my followings.
    <% end %>

    <%= if @user.share_subscriptions do %>
      I do currently share my subscriptions.
    <% else %>
      I do not share my subscriptions.
    <% end %>

Personas
  <button class="btn btn-primary btn-sm pull-right"
          data-toggle="popover"
          data-placement="left"
          data-title="Personas"
          data-html="true"
          data-content="Your personas are your different identities when you are podcasting.

            You might be podcasting in the name of an organisation, a group or use an alias,
            when you appear contributing to a podcast.
 We call all these different identities
            personas.">
    <%= fa_icon "info-circle" %> Help
  </button>

<%= for persona <- @user.personas do %>

        <%= persona.name %> (<%= persona.pid %>)

Pid

<%= persona.pid %>

name

<%= persona.name %>

uri

<%= persona.uri %>

email

<%= persona.email %>

description

<%= persona.description %>

image_url

<%= if persona.image_url, do: C.String.truncate(persona.image_url, 40) %>

image_title

<%= persona.image_title %>

          <%= if persona.image_url do %>
            <object data="<%= persona.image_url %>"
                    alt="<%= persona.image_title%>"
                    type="image/png"
                    width="150"
                    class="thumbnail">

            </object>
          <% else %>

          <% end %>

          <%= link "Edit persona", to: persona_frontend_path(@conn, :edit, persona),
                           class: "btn btn-warning" %>

Delegations
            <button class="btn btn-primary btn-xs pull-right"
                  data-toggle="popover"
                  data-placement="left"
                  data-title="Delegation"
                  data-content="A delegation lets the gigs (i.e. contributions to episodes) and
                    engagements (i.e. contributions to podcasts) of the persona also appear on the
                    profile page of the target persona.">
              <%= fa_icon "info-circle" %> Help
            </button>

            <%= for delegate_persona <- @user.personas do %>
              <%= if delegate_persona.id in Enum.map(persona.delegates, fn(delegate) -> delegate.id end) do %>

                  <%= fa_icon("link") %>

                  <%= link [fa_icon("user-o"), " ", delegate_persona.name],
                             to: persona_frontend_path(@conn, :show, delegate_persona),
                             class: "btn btn-default btn-xs"%>

                    <%= fa_icon("id-card-o") %> <%= delegate_persona.pid %>

                  <%= link [fa_icon("unlink"), " cancel"],
                           to: persona_frontend_path(@conn, :toggle_delegation, persona.id,
                                                     delegate_id: delegate_persona.id),
                           class: "btn btn-warning btn-xs " <> disabled(@current_user) %>

              <% end %>
            <% end %>

            <%= for delegate_persona <- @user.personas do %>
              <%= unless delegate_persona.id in Enum.map(persona.delegates, fn(delegate) -> delegate.id end) do %>
                <%= if delegate_persona != persona do %>

                    <%= fa_icon("unlink") %>
                    <%= link [fa_icon("user-o"), " ", delegate_persona.name],
                             to: persona_frontend_path(@conn, :show, delegate_persona),
                             class: "btn btn-default btn-xs" %>

                      <%= fa_icon("id-card-o") %> <%= delegate_persona.pid %>

                    <%= link [fa_icon("link"), " delegate"],
                             to: persona_frontend_path(@conn, :toggle_delegation, persona.id,
                                                       delegate_id: delegate_persona.id),
                             class: "btn btn-info btn-xs " <> disabled(@current_user) %>

                <% end %>
              <% end %>
            <% end %>

Redirection
            <button class="btn btn-primary btn-xs pull-right"
                data-toggle="popover"
                data-placement="left"
                data-title="Redirection"
                data-content="The redirection redirects the persona profile page to the profile
                  page of the target persona.">
            <%= fa_icon "info-circle" %> Help
          </button>

            <%= if persona.redirect do %>

                <%= fa_icon("arrow-right") %>
                <%= link [fa_icon("user-o"), " ", persona.redirect.name],
                          to: persona_frontend_path(@conn, :persona, persona.redirect.pid),
                          class: "btn btn-default btn-xs" %>

                  <%= fa_icon("id-card-o") %> <%= persona.redirect.pid %>

                <%= link [fa_icon("unlink"), " cancel"],
                         to: persona_frontend_path(@conn, :cancel_redirect, persona.id),
                         class: "btn btn-warning btn-xs " <> disabled(@current_user) %>

            <% else %>

                This persona is not redirected.

              <%= for target_persona <- @user.personas do %>
                <%= if target_persona.id != persona.id do %>

                    <%= fa_icon("unlink") %>
                    <%= link [fa_icon("user-o"), " ", target_persona.name],
                              to: persona_frontend_path(@conn, :persona, target_persona.id),
                              class: "btn btn-default btn-xs" %>

                      <%= fa_icon("id-card-o") %> <%= target_persona.pid %>

                    <%= link [fa_icon("arrow-right"), " redirect"],
                             to: persona_frontend_path(@conn, :redirect, persona.id,
                                                       target_id: target_persona.id),
                             class: "btn btn-danger btn-xs " <> disabled(@current_user) %>

                <% end %>
              <% end %>
            <% end %>

<% end %>


Fixes quoting

Fixes quoting

A single quotation mark was used instead of a double one.

:: This batch file handles managing an Erlang node as a Windows service.
::
:: Check the :usage section for information about what this script provides

@echo off

:: Set variables that describe the release
set rel_name=<%= release_name %>
set rel_vsn=<%= release_version %>
set erts_vsn=<%= erts_vsn %>
set erl_opts=<%= erl_opts %>

:: Discover the release root directory from the directory
:: of this script
set script_dir=%~dp0
for %%A in ("%script_dir%\..\..") do (
  set release_root_dir=%%~fA
)
set rel_dir=%release_root_dir%\releases\%rel_vsn%

if "%RELEASE_MUTABLE_DIR%"=="" (
  set mutable_dir=%release_root_dir%\var
) else (
  set mutable_dir=%RELEASE_MUTABLE_DIR%
)

if "%RELEASE_CONFIG_DIR%"=="" (
  set config_dir=%release_root_dir%
) else (
  set config_dir=%RELEASE_CONFIG_DIR%
)

set log_dir=%mutable_dir%\log

:: Create directories which don't exist
if not exist %mutable_dir% mkdir %mutable_dir%
if not exist %config_dir% mkdir %config_dir%
if not exist %log_dir% mkdir %log_dir%

call :find_erts_dir
call :find_sys_config
call :find_vm_args
call :set_boot_script_var

set service_name=%rel_name%_%rel_vsn%
set bindir=%erts_dir%\bin
set progname=erl.exe
set clean_boot_script=%release_root_dir%\bin\start_clean
set erlsrv="%bindir%\erlsrv.exe"
set epmd="%bindir%\epmd.exe"
set escript="%bindir%\escript.exe"
set werl="%bindir%\werl.exe"
set nodetool="%release_root_dir%\bin\nodetool"
set consolidated_dir=%rootdir%\lib\%rel_name%-%rel_vsn%\consolidated
set hook_dir=%rel_dir%\hooks
set command_dir=%rel_dir%\commands

:: Extract node type and name from vm.args
for /f "usebackq tokens=1-2" %%I in (`findstr /b "\-name \-sname" "%vm_args%"`) do (
  set node_type=%%I
  set node_name=%%J
)

:: Extract cookie from vm.args
for /f "usebackq tokens=1-2" %%I in (`findstr /b \-setcookie "%vm_args%"`) do (
  set cookie=%%J
)

:: Write the erl.ini file to set up paths relative to this script
call :write_ini

:: If a start.boot file is not present, copy one from the named .boot file
if not exist "%rel_dir%\start.boot" (
  copy "%rel_dir%\%rel_name%.boot" "%rel_dir%\start.boot" >nul
)

set taskname="%1"
shift /1
set args=

setlocal EnableDelayedExpansion
:parse_args
set param=%1
if "!param!"=="" goto :args_parsed
if "!args!"=="" (
  set largs=%param%
) else (
  set largs=%largs% %param%
)
set "delim= "
shift /1
goto :parse_args
:args_parsed
endlocal & set args=%largs%

if %taskname%=="install" goto install
if %taskname%=="uninstall" goto uninstall
if %taskname%=="start" goto start
if %taskname%=="foreground" goto foreground
if %taskname%=="console" goto console
if %taskname%=="stop" goto stop
if %taskname%=="restart" call :stop && goto start
if %taskname%=="reboot" call :stop && goto start
if %taskname%=="reload_config" goto reload_config
if %taskname%=="upgrade" goto upgrade
if %taskname%=="downgrade" goto upgrade
if %taskname%=="attach" goto remote_console
if %taskname%=="remote_console" goto remote_console
if %taskname%=="pid" goto pid
if %taskname%=="ping" goto ping
if %taskname%=="pingpeer" goto pingpeer
if %taskname%=="escript" goto escript
if %taskname%=="rpc" goto rpc
if %taskname%=="rpcterms" goto rpcterms
if %taskname%=="eval" goto eval
if %taskname%=="command" goto command
if %taskname%=="describe" goto describe
if %taskname%=="" goto usage
if exist "%command_dir%\%taskname%" (
  "%command_dir%\%taskname%" %*
) else (
  echo Unknown command: %taskname%
)
goto :eof

:: Find the ERTS dir
:find_erts_dir
if "%erts_vsn%"=="" (
  call :use_system_erts
) else (
  call :use_bundled_erts
)
goto :eof

:: Load system ERTS info
:use_system_erts
for /f "delims=" %%i in ('where erl') do set system_erl="%%i"
if %system_erl%=="" (
  echo failed to locate the Erlang Runtime System!
  exit 1
)
set system_root_dir_cmd=%system_erl% -noshell -eval "io:format(\"~s\", [filename:nativename(code:root_dir())])." -s init stop
for /f "delims=" %%i in (`%%system_root_dir_cmd%%`) do set system_root=%%i
set system_erts_vsn_cmd=%system_erl% -noshell -eval "Ver=erlang:system_info(version),io:format(\"~s\", [Ver])" -s init stop
for /f "delims=" %%i in (`%%system_erts_vsn_cmd%%`) do set system_erts_vsn=%%i
set erl=%system_erl%
set erts_vsn=%system_erts_vsn%
set rootdir=%system_root%
set erts_dir=%rootdir%\erts-%erts_vsn%
goto :eof

:: Load bundled ERTS info
:use_bundled_erts
set erts_dir=%release_root_dir%\erts-%erts_vsn%
set erl=%erts_dir%\bin\erl
set rootdir=%release_root_dir%
goto :eof

:: Find the sys.config file
:find_sys_config
set possible_sys=%release_config_dir%\sys.config
if exist %possible_sys% (
  set sys_config_src=%possible_sys%
) else (
  set sys_config_src=%rel_dir%\sys.config
)
set sys_config_target=%config_dir%\sys.config
:: Replace environment variables
powershell -command "$content = get-content %sys_config_src%; [regex]::matches($content, '\${[\w\d_-]+}') | foreach { $content = $content.Replace($_.value, [System.Environment]::GetEnvironmentVariable($_.value)) }; out-file -filepath %sys_config_target% -inputobject $content -encoding ascii"
set sys_config=%sys_config_target%
goto :eof

:find_vm_args
set possible_vmargs=%release_config_dir%\vm.args
if exist %possible_vmargs% (
  set vmargs_src=%possible_vmargs%
) else (
  set vmargs_src=%rel_dir%\vm.args
)
set vmargs_target=%config_dir%\vm.args
:: Replace environment variables
powershell -command "$content = get-content %vmargs_src%; [regex]::matches($content, '\${[\w\d_-]+}') | foreach { $content = $content.Replace($_.value, [System.Environment]::GetEnvironmentVariable($_.value)) }; out-file -filepath %vmargs_target% -inputobject $content -encoding ascii"
set vm_args=%vmargs_target%
goto :eof

:: set boot_script variable
:set_boot_script_var
if exist %rel_dir%\%rel_name%.boot (
  set boot_script=%rel_dir%\%rel_name%
) else (
  set boot_script=%rel_dir%\start
)
goto :eof

:: Write the erl.ini file
:write_ini
set erl_ini=%erts_dir%\bin\erl.ini
set converted_bindir=%bindir:\=\\%
set converted_rootdir=%rootdir:\=\\%
echo [erlang] > "%erl_ini%"
echo Bindir=%converted_bindir% >> "%erl_ini%"
echo Progname=%progname% >> "%erl_ini%"
echo Rootdir=%converted_rootdir% >> "%erl_ini%"
goto :eof

:: Display usage information
:usage
echo Usage: %~n0 ^<task^>
echo.
echo Service Control
echo =====================
echo install                             # installs the release as a service
echo uninstall                           # uninstalls the release service
echo start                               # starts the service
echo start_boot                          # not implemented
echo foreground                          # start the release in the foreground
echo console                             # run the release in a local shell
echo console_clean                       # not implemented
echo stop                                # stops the service
echo restart                             # restarts the release service
echo reboot                              # alias for restart on Windows
echo reload_config                       # reload the current system's configuration from disk
echo.
echo Upgrades
echo =====================
echo upgrade ^<version^>                   # upgrade the current release service
echo downgrade ^<version^>                 # downgrade the current release service
echo.
echo Utilities
echo =====================
echo attach                              # alias for remote_console on Windows
echo remote_console                      # open a remote console connected to the release
echo pid                                 # get the process id of the running release
echo ping                                # ping the current release service, pong is returned if ok
echo pingpeer ^<peer^>                     # check if a peer node is running, pong is returned if ok
echo escript ^<file^>                      # execute an escript
echo rpc ^<mod^> ^<fun^> ^[^<args..^>^]          # execute an RPC call using the given MFA
echo rpcterms ^<mod^> ^<fun^> ^[^<expr^>^]       # execute an RPC call using the given Erlang expr for args
echo eval ^<expr^>                         # execute the given Erlang expr on the running node
echo command ^<mod^> ^<fun^> ^[^<args..^>^]      # execute the given module/function in a clean VM
echo describe                            # list details about the release
echo.
echo Custom Commands
echo ======================
for %%i in (%command_dir%\*.d\*.bat) do (
  echo %%~ni
)
goto :eof

:: Install the release as a Windows service
:: or install the specified version passed as argument
:install
setlocal EnableDelayedExpansion
set service_args=%erl_opts% -setcookie "!cookie!" ++ ^
       -rootdir "%rootdir%" ^
       -reldir "%release_root_dir%\releases"
set start_erl=%erts_dir%\bin\start_erl.exe
set description=Erlang node %node_name% in %rootdir%
if "" == "%args%" (
  :: Install the service
  %erlsrv% add %service_name% ^
            -c "%description%" ^
            %node_type% "%node_name%" ^
            -w "%mutable_dir%" ^
            -m "%start_erl%" ^
            -args "!service_args!" ^
            -debugtype new ^
            -stopaction "init:stop()."
  endlocal
) else (
  :: relup and reldown
  endlocal
  goto upgrade
)
goto :eof

:: Uninstall the Windows service
:uninstall
%erlsrv% remove %service_name%
%epmd% -kill
goto :eof

:: Start the Windows service
:start
call :pre_configure_hooks
call :post_configure_hooks
call :pre_start_hooks
%erlsrv% start %service_name%
call :post_start_hooks
goto :eof

:: Stop the Windows service
:stop
call :pre_stop_hooks
%erlsrv% stop %service_name%
call :post_stop_hooks
goto :eof

:: Upgrade this release
:upgrade
setlocal EnableDelayedExpansion
if "" == "%args%" (
  echo Missing version argument
  echo Usage: %rel_name% %taskname% {version}
  set ERRORLEVEL=1
  exit /b %ERRORLEVEL%
)
set source_version=%rel_vsn%
set target_version=%args%
:: Unpack
%escript% "%root_dir%\bin\release_utils.escript" ^
    unpack_release %rel_name% "%node_type%" "%node_name%" "!cookie!" "%target_version%"
if %ERRORLEVEL% GEQ 1 exit %ERRORLEVEL%
:: Update env
set rel_vsn=%target_version%
set rel_dir=%release_root_dir\releases\%target_version%
:: TODO: init_configs
if exists "%rel_dir%\sys.config.bak" do (
  move /Y "%rel_dir%\sys.config.bak" "%rel_dir%\sys.config"
)
if exists "%rel_dir%\vm.args.bak" do (
  move /Y "%rel_dir%\vm.args.bak" "%rel_dir%\vm.args"
)
copy /B /Y "%rel_dir%/sys.config" "%rel_dir%\sys.config.bak"
copy /B /Y "%rel_dir%/vm.args" "%rel_dir%\vm.args.bak"
copy /B /Y "%sys_config" "%rel_dir%/sys.config"
copy /B /Y "%vm_args%" "%rel_dir%/vm.args"
:: Run pre hooks
call :pre_configure_hooks
call :post_configure_hooks
call :pre_upgrade_hooks
:: Perform upgrade
%escript% "%rootdir%/bin/release_utils.escript" ^
    install_release "%rel_name%" "%node_type%" "%node_name%" "!cookie!" "%target_version%"
if %ERRORLEVEL% GEQ 1 exit %ERRORLEVEL%
:: Cleanup
move /Y "%rel_dir%\sys.config.bak" "%rel_dir%\sys.config"
move /Y "%rel_dir%\vm.args.bak" "%rel_dir%\vm.args"
:: Run post hooks
call :post_upgrade_hooks
endlocal
goto :eof

:: Start a console
:console
call :pre_configure_hooks
call :post_configure_hooks
call :pre_start_hooks
start "%rel_name% console" %werl% -boot "%boot_script%" ^
       -config "%sys_config%"  ^
       -args_file "%vm_args%" ^
       -user Elixir.IEx.CLI ^
       -extra --no-halt +iex
goto :eof

:: Start the release in the foreground
:foreground
call :pre_configure_hooks
call :post_configure_hooks
call :pre_start_hooks
set EMU=beam
set PROGNAME=%~n0
start "" /B "%erl%" -noshell -noinput +Bd ^
       -boot "%boot_script%" ^
       -boot_var ERTS_LIB_DIR "%erts_dir%\..\lib" ^
       -env ERL_LIBS "%release_root_dir%\lib%" ^
       -pa "%consolidated_dir%" ^
       -args_file "%vm_args%" ^
       -config "%sys_config%" ^
       %erl_opts% ^
       -extra %extra_opts%
call :set_pid
call :post_start_hooks

:wait_for_exit
tasklist /FI "PID eq %pid%" | find /I "erl.exe"
if %ERRORLEVEL% geq 1 (
  :: Process has shutdown
  call :post_stop_hooks
) else (
  sleep 5
  goto :wait_for_exit
)
goto :eof

:: Ping the running node
:ping
setlocal EnableDelayedExpansion
%escript% %nodetool% ping %node_type% "%node_name%" -setcookie "!cookie!"
endlocal
goto :eof

:: Ping a peer node
:: Ping a peer node
:pingpeer
setlocal EnableDelayedExpansion
if "%args"=="" (
  echo "Peer name is required!"
  exit 1
) else (
  %escript% %nodetool% ping %node_type% "%args%" -setcookie "!cookie!"
)
endlocal
goto :eof

:: Execute an escript
:escript
%escript% %args%
goto :eof

:: Execute an RPC command
:rpc
call :ping>NUL
if %ERRORLEVEL% GEQ 1 exit %ERRORLEVEL%
setlocal EnableDelayedExpansion
%escript% %nodetool% rpc %node_type% %node_name% -setcookie "!cookie!" %args%
endlocal
goto :eof

:: Execute an RPC command where args are expressed
:: in the form of an Erlang expression
:rpcterms
call :ping>NUL
if %ERRORLEVEL% GEQ 1 exit %ERRORLEVEL%
setlocal EnableDelayedExpansion
%escript% %nodetool% rpcterms %node_type% %node_name% -setcookie "!cookie!" %args%
endlocal
goto :eof

:: Eval an expression on the running node
:eval
call :ping>NUL
if %ERRORLEVEL% GEQ 1 exit %ERRORLEVEL%
setlocal EnableDelayedExpansion
%escript% %nodetool% eval %node_type% %node_name% -setcookie "!cookie!" !args!
endlocal
goto :eof

:: Execute a command in a clean Erlang VM
:command
for /f "tokens=1-2*" %%a in ("%args%") do (
  set module=%%a
  set function=%%b
  set command_args=%%c
)
%erl% -boot_var ERTS_LIB_DIR "%erts_dir%\..\lib" ^
       -hidden -noshell -boot start_clean ^
       -pa "%consolidated_dir%" ^
       -s %module% %function% -s init stop
       -extra %command_args%
goto :eof

:: Get the process id of the running node
:pid
call :ping>NUL
if %ERRORLEVEL% GEQ 1 exit %ERRORLEVEL%
setlocal EnableDelayedExpansion
%escript% %nodetool% eval %node_type% %node_name% -setcookie "!cookie!" "erlang:list_to_integer(os:getpid())."
endlocal
goto :eof

:set_pid
call :ping>NUL
if %ERRORLEVEL% GEQ 1 exit %ERRORLEVEL%
setlocal EnableDelayedExpansion
set get_pid_cmd=%escript% %nodetool% eval %node_type% %node_name% -setcookie "!cookie!" "erlang:list_to_integer(os:getpid())."
for /f "delims=" %%i in (`%%get_pid_cmd%%`) do set pid=%%i
endlocal
goto :eof

:: Reload the running configuration
:reload_config
call :ping>NUL
if %ERRORLEVEL% GEQ 1 exit %ERRORLEVEL%
call :pre_configure_hooks
call :post_configure_hooks
setlocal EnableDelayedExpansion
%escript% %nodetool% reload_config %node_type% %node_name% -setcookie "!cookie!" "%sys_config%"
endlocal
goto :eof

:: Describe this release
:describe
setlocal EnableDelayedExpansion
echo Service Information
echo =====================
%erlsrv% list %service_name%
echo.
echo Release Metadata
echo =====================
echo ERTS                %erts_vsn%
echo Release Directory   %rel_dir%
echo Config File         %sys_config%
echo Args File           %vm_args%
echo Name Type           %node_type%
echo Node Name           %node_name%
echo Node Cookie         !cookie!
echo Extra Opts          %erl_opts%
echo.
echo Hooks:
for %%i in (%hook_dir%\*.d\*.bat) do (
  echo %%i
)
echo.
echo Commands:
for %%i in (%command_dir%\*.d\*.bat) do (
  echo %%i
)
endlocal
goto :eof

:: Remote shell to a running node
:remote_console
call :ping
if %ERRORLEVEL% GEQ 1 exit %ERRORLEVEL%
setlocal EnableDelayedExpansion
set id=remsh%RANDOM%-%node_name%
start "%node_name% attach" %werl% -hidden -noshell -boot "%clean_boot_script%" ^
       -user Elixir.IEx.CLI %node_type% %id% -setcookie "!cookie!" ^
       -extra --no-halt +iex -%node_type% %id% --cookie "!cookie!" --remsh %node_name%
endlocal
goto :eof

:: Hook helpers
:execute_hooks
for /r "%hook_dir%\%1.d" %%f in (*.bat) do (
  echo Running %1 hook: %%f
  %%f
  if %ERRORLEVEL% GEQ 1 exit %ERRORLEVEL%
)
goto :eof

:pre_configure_hooks
call :execute_hooks pre_configure
goto :eof

:post_configure_hooks
call :execute_hooks post_configure
goto :eof

:pre_start_hooks
call :execute_hooks pre_start
goto :eof

:post_start_hooks
call :execute_hooks post_start
goto :eof

:pre_stop_hooks
call :execute_hooks pre_stop
goto :eof

:post_stop_hooks
call :execute_hooks post_stop
goto :eof

:pre_upgrade_hooks
call :execute_hooks pre_upgrade
goto :eof

:post_upgrade_hooks
call :execute_hooks post_upgrade
goto :eof

:: This batch file handles managing an Erlang node as a Windows service.
::
:: Check the :usage section for information about what this script provides

@echo off

:: Set variables that describe the release
set rel_name=<%= release_name %>
set rel_vsn=<%= release_version %>
set erts_vsn=<%= erts_vsn %>
set erl_opts=<%= erl_opts %>

:: Discover the release root directory from the directory
:: of this script
set script_dir=%~dp0
for %%A in ("%script_dir%\..\..") do (
  set release_root_dir=%%~fA
)
set rel_dir=%release_root_dir%\releases\%rel_vsn%

if "%RELEASE_MUTABLE_DIR%"=="" (
  set mutable_dir=%release_root_dir%\var
) else (
  set mutable_dir=%RELEASE_MUTABLE_DIR%
)

if "%RELEASE_CONFIG_DIR%"=="" (
  set config_dir=%release_root_dir%
) else (
  set config_dir=%RELEASE_CONFIG_DIR%
)

set log_dir=%mutable_dir%\log

:: Create directories which don't exist
if not exist %mutable_dir% mkdir %mutable_dir%
if not exist %config_dir% mkdir %config_dir%
if not exist %log_dir% mkdir %log_dir%

call :find_erts_dir
call :find_sys_config
call :find_vm_args
call :set_boot_script_var

set service_name=%rel_name%_%rel_vsn%
set bindir=%erts_dir%\bin
set progname=erl.exe
set clean_boot_script=%release_root_dir%\bin\start_clean
set erlsrv="%bindir%\erlsrv.exe"
set epmd="%bindir%\epmd.exe"
set escript="%bindir%\escript.exe"
set werl="%bindir%\werl.exe"
set nodetool="%release_root_dir%\bin\nodetool"
set consolidated_dir=%rootdir%\lib\%rel_name%-%rel_vsn%\consolidated
set hook_dir=%rel_dir%\hooks
set command_dir=%rel_dir%\commands

:: Extract node type and name from vm.args
for /f "usebackq tokens=1-2" %%I in (`findstr /b "\-name \-sname" "%vm_args%"`) do (
  set node_type=%%I
  set node_name=%%J
)

:: Extract cookie from vm.args
for /f "usebackq tokens=1-2" %%I in (`findstr /b \-setcookie "%vm_args%"`) do (
  set cookie=%%J
)

:: Write the erl.ini file to set up paths relative to this script
call :write_ini

:: If a start.boot file is not present, copy one from the named .boot file
if not exist "%rel_dir%\start.boot" (
  copy "%rel_dir%\%rel_name%.boot" "%rel_dir%\start.boot" >nul
)

set taskname="%1"
shift /1
set args=

setlocal EnableDelayedExpansion
:parse_args
set param=%1
if "!param!"=="" goto :args_parsed
if "!args!"=="" (
  set largs=%param%
) else (
  set largs=%largs% %param%
)
set "delim= "
shift /1
goto :parse_args
:args_parsed
endlocal & set args=%largs%

if %taskname%=="install" goto install
if %taskname%=="uninstall" goto uninstall
if %taskname%=="start" goto start
if %taskname%=="foreground" goto foreground
if %taskname%=="console" goto console
if %taskname%=="stop" goto stop
if %taskname%=="restart" call :stop && goto start
if %taskname%=="reboot" call :stop && goto start
if %taskname%=="reload_config" goto reload_config
if %taskname%=="upgrade" goto upgrade
if %taskname%=="downgrade" goto upgrade
if %taskname%=="attach" goto remote_console
if %taskname%=="remote_console" goto remote_console
if %taskname%=="pid" goto pid
if %taskname%=="ping" goto ping
if %taskname%=="pingpeer" goto pingpeer
if %taskname%=="escript" goto escript
if %taskname%=="rpc" goto rpc
if %taskname%=="rpcterms" goto rpcterms
if %taskname%=="eval" goto eval
if %taskname%=="command" goto command
if %taskname%=="describe" goto describe
if %taskname%=="" goto usage
if exist "%command_dir%\%taskname%" (
  "%command_dir%\%taskname%" %*
) else (
  echo Unknown command: %taskname%
)
goto :eof

:: Find the ERTS dir
:find_erts_dir
if "%erts_vsn%"=="" (
  call :use_system_erts
) else (
  call :use_bundled_erts
)
goto :eof

:: Load system ERTS info
:use_system_erts
for /f "delims=" %%i in ('where erl') do set system_erl="%%i"
if %system_erl%=="" (
  echo failed to locate the Erlang Runtime System!
  exit 1
)
set system_root_dir_cmd=%system_erl% -noshell -eval "io:format(\"~s\", [filename:nativename(code:root_dir())])." -s init stop
for /f "delims=" %%i in (`%%system_root_dir_cmd%%`) do set system_root=%%i
set system_erts_vsn_cmd=%system_erl% -noshell -eval "Ver=erlang:system_info(version),io:format(\"~s\", [Ver])" -s init stop
for /f "delims=" %%i in (`%%system_erts_vsn_cmd%%`) do set system_erts_vsn=%%i
set erl=%system_erl%
set erts_vsn=%system_erts_vsn%
set rootdir=%system_root%
set erts_dir=%rootdir%\erts-%erts_vsn%
goto :eof

:: Load bundled ERTS info
:use_bundled_erts
set erts_dir=%release_root_dir%\erts-%erts_vsn%
set erl=%erts_dir%\bin\erl
set rootdir=%release_root_dir%
goto :eof

:: Find the sys.config file
:find_sys_config
set possible_sys=%release_config_dir%\sys.config
if exist %possible_sys% (
  set sys_config_src=%possible_sys%
) else (
  set sys_config_src=%rel_dir%\sys.config
)
set sys_config_target=%config_dir%\sys.config
:: Replace environment variables
powershell -command "$content = get-content %sys_config_src%; [regex]::matches($content, '\${[\w\d_-]+}') | foreach { $content = $content.Replace($_.value, [System.Environment]::GetEnvironmentVariable($_.value)) }; out-file -filepath %sys_config_target% -inputobject $content -encoding ascii"
set sys_config=%sys_config_target%
goto :eof

:find_vm_args
set possible_vmargs=%release_config_dir%\vm.args
if exist %possible_vmargs% (
  set vmargs_src=%possible_vmargs%
) else (
  set vmargs_src=%rel_dir%\vm.args
)
set vmargs_target=%config_dir%\vm.args
:: Replace environment variables
powershell -command "$content = get-content %vmargs_src%; [regex]::matches($content, '\${[\w\d_-]+}') | foreach { $content = $content.Replace($_.value, [System.Environment]::GetEnvironmentVariable($_.value)) }; out-file -filepath %vmargs_target% -inputobject $content -encoding ascii"
set vm_args=%vmargs_target%
goto :eof

:: set boot_script variable
:set_boot_script_var
if exist %rel_dir%\%rel_name%.boot (
  set boot_script=%rel_dir%\%rel_name%
) else (
  set boot_script=%rel_dir%\start
)
goto :eof

:: Write the erl.ini file
:write_ini
set erl_ini=%erts_dir%\bin\erl.ini
set converted_bindir=%bindir:\=\\%
set converted_rootdir=%rootdir:\=\\%
echo [erlang] > "%erl_ini%"
echo Bindir=%converted_bindir% >> "%erl_ini%"
echo Progname=%progname% >> "%erl_ini%"
echo Rootdir=%converted_rootdir% >> "%erl_ini%"
goto :eof

:: Display usage information
:usage
echo Usage: %~n0 ^<task^>
echo.
echo Service Control
echo =====================
echo install                             # installs the release as a service
echo uninstall                           # uninstalls the release service
echo start                               # starts the service
echo start_boot                          # not implemented
echo foreground                          # start the release in the foreground
echo console                             # run the release in a local shell
echo console_clean                       # not implemented
echo stop                                # stops the service
echo restart                             # restarts the release service
echo reboot                              # alias for restart on Windows
echo reload_config                       # reload the current system's configuration from disk
echo.
echo Upgrades
echo =====================
echo upgrade ^<version^>                   # upgrade the current release service
echo downgrade ^<version^>                 # downgrade the current release service
echo.
echo Utilities
echo =====================
echo attach                              # alias for remote_console on Windows
echo remote_console                      # open a remote console connected to the release
echo pid                                 # get the process id of the running release
echo ping                                # ping the current release service, pong is returned if ok
echo pingpeer ^<peer^>                     # check if a peer node is running, pong is returned if ok
echo escript ^<file^>                      # execute an escript
echo rpc ^<mod^> ^<fun^> ^[^<args..^>^]          # execute an RPC call using the given MFA
echo rpcterms ^<mod^> ^<fun^> ^[^<expr^>^]       # execute an RPC call using the given Erlang expr for args
echo eval ^<expr^>                         # execute the given Erlang expr on the running node
echo command ^<mod^> ^<fun^> ^[^<args..^>^]      # execute the given module/function in a clean VM
echo describe                            # list details about the release
echo.
echo Custom Commands
echo ======================
for %%i in (%command_dir%\*.d\*.bat) do (
  echo %%~ni
)
goto :eof

:: Install the release as a Windows service
:: or install the specified version passed as argument
:install
setlocal EnableDelayedExpansion
set service_args=%erl_opts% -setcookie "!cookie!" ++ ^
       -rootdir "%rootdir%" ^
       -reldir "%release_root_dir%\releases"
set start_erl=%erts_dir%\bin\start_erl.exe
set description=Erlang node %node_name% in %rootdir%
if "" == "%args%" (
  :: Install the service
  %erlsrv% add %service_name% ^
            -c "%description%" ^
            %node_type% "%node_name%" ^
            -w "%mutable_dir%" ^
            -m "%start_erl%" ^
            -args "!service_args!" ^
            -debugtype new ^
            -stopaction "init:stop()."
  endlocal
) else (
  :: relup and reldown
  endlocal
  goto upgrade
)
goto :eof

:: Uninstall the Windows service
:uninstall
%erlsrv% remove %service_name%
%epmd% -kill
goto :eof

:: Start the Windows service
:start
call :pre_configure_hooks
call :post_configure_hooks
call :pre_start_hooks
%erlsrv% start %service_name%
call :post_start_hooks
goto :eof

:: Stop the Windows service
:stop
call :pre_stop_hooks
%erlsrv% stop %service_name%
call :post_stop_hooks
goto :eof

:: Upgrade this release
:upgrade
setlocal EnableDelayedExpansion
if "" == "%args%" (
  echo Missing version argument
  echo Usage: %rel_name% %taskname% {version}
  set ERRORLEVEL=1
  exit /b %ERRORLEVEL%
)
set source_version=%rel_vsn%
set target_version=%args%
:: Unpack
%escript% "%root_dir%\bin\release_utils.escript" ^
    unpack_release %rel_name% "%node_type%" "%node_name%" "!cookie!" "%target_version%"
if %ERRORLEVEL% GEQ 1 exit %ERRORLEVEL%
:: Update env
set rel_vsn=%target_version%
set rel_dir=%release_root_dir\releases\%target_version%
:: TODO: init_configs
if exists "%rel_dir%\sys.config.bak" do (
  move /Y "%rel_dir%\sys.config.bak" "%rel_dir%\sys.config"
)
if exists "%rel_dir%\vm.args.bak" do (
  move /Y "%rel_dir%\vm.args.bak" "%rel_dir%\vm.args"
)
copy /B /Y "%rel_dir%/sys.config" "%rel_dir%\sys.config.bak"
copy /B /Y "%rel_dir%/vm.args" "%rel_dir%\vm.args.bak"
copy /B /Y "%sys_config" "%rel_dir%/sys.config"
copy /B /Y "%vm_args%" "%rel_dir%/vm.args"
:: Run pre hooks
call :pre_configure_hooks
call :post_configure_hooks
call :pre_upgrade_hooks
:: Perform upgrade
%escript% "%rootdir%/bin/release_utils.escript" ^
    install_release "%rel_name%" "%node_type%" "%node_name%" "!cookie!" "%target_version%"
if %ERRORLEVEL% GEQ 1 exit %ERRORLEVEL%
:: Cleanup
move /Y "%rel_dir%\sys.config.bak" "%rel_dir%\sys.config"
move /Y "%rel_dir%\vm.args.bak" "%rel_dir%\vm.args"
:: Run post hooks
call :post_upgrade_hooks
endlocal
goto :eof

:: Start a console
:console
call :pre_configure_hooks
call :post_configure_hooks
call :pre_start_hooks
start "%rel_name% console" %werl% -boot "%boot_script%" ^
       -config "%sys_config%"  ^
       -args_file "%vm_args%" ^
       -user Elixir.IEx.CLI ^
       -extra --no-halt +iex
goto :eof

:: Start the release in the foreground
:foreground
call :pre_configure_hooks
call :post_configure_hooks
call :pre_start_hooks
set EMU=beam
set PROGNAME=%~n0
start "" /B "%erl%" -noshell -noinput +Bd ^
       -boot "%boot_script%" ^
       -boot_var ERTS_LIB_DIR "%erts_dir%\..\lib" ^
       -env ERL_LIBS "%release_root_dir%\lib%" ^
       -pa "%consolidated_dir%" ^
       -args_file "%vm_args%" ^
       -config "%sys_config%" ^
       %erl_opts% ^
       -extra %extra_opts%
call :set_pid
call :post_start_hooks

:wait_for_exit
tasklist /FI "PID eq %pid%" | find /I "erl.exe"
if %ERRORLEVEL% geq 1 (
  :: Process has shutdown
  call :post_stop_hooks
) else (
  sleep 5
  goto :wait_for_exit
)
goto :eof

:: Ping the running node
:ping
setlocal EnableDelayedExpansion
%escript% %nodetool% ping %node_type% "%node_name%" -setcookie "!cookie!"
endlocal
goto :eof

:: Ping a peer node
:: Ping a peer node
:pingpeer
setlocal EnableDelayedExpansion
if "%args"=="" (
  echo "Peer name is required!"
  exit 1
) else (
  %escript% %nodetool% ping %node_type% "%args%" -setcookie "!cookie!"
)
endlocal
goto :eof

:: Execute an escript
:escript
%escript% %args%
goto :eof

:: Execute an RPC command
:rpc
call :ping>NUL
if %ERRORLEVEL% GEQ 1 exit %ERRORLEVEL%
setlocal EnableDelayedExpansion
%escript% %nodetool% rpc %node_type% %node_name% -setcookie "!cookie!" %args%
endlocal
goto :eof

:: Execute an RPC command where args are expressed
:: in the form of an Erlang expression
:rpcterms
call :ping>NUL
if %ERRORLEVEL% GEQ 1 exit %ERRORLEVEL%
setlocal EnableDelayedExpansion
%escript% %nodetool% rpcterms %node_type% %node_name% -setcookie "!cookie!" %args%
endlocal
goto :eof

:: Eval an expression on the running node
:eval
call :ping>NUL
if %ERRORLEVEL% GEQ 1 exit %ERRORLEVEL%
setlocal EnableDelayedExpansion
%escript% %nodetool% eval %node_type% %node_name% -setcookie "!cookie!" !args!
endlocal
goto :eof

:: Execute a command in a clean Erlang VM
:command
for /f "tokens=1-2*" %%a in ("%args%") do (
  set module=%%a
  set function=%%b
  set command_args=%%c
)
%erl% -boot_var ERTS_LIB_DIR "%erts_dir%\..\lib" ^
       -hidden -noshell -boot start_clean ^
       -pa "%consolidated_dir%" ^
       -s %module% %function% -s init stop
       -extra %command_args%
goto :eof

:: Get the process id of the running node
:pid
call :ping>NUL
if %ERRORLEVEL% GEQ 1 exit %ERRORLEVEL%
setlocal EnableDelayedExpansion
%escript% %nodetool% eval %node_type% %node_name% -setcookie "!cookie!" "erlang:list_to_integer(os:getpid())."
endlocal
goto :eof

:set_pid
call :ping>NUL
if %ERRORLEVEL% GEQ 1 exit %ERRORLEVEL%
setlocal EnableDelayedExpansion
set get_pid_cmd=%escript% %nodetool% eval %node_type% %node_name% -setcookie "!cookie!" "erlang:list_to_integer(os:getpid()).'
for /f "delims=" %%i in (`%%get_pid_cmd%%`) do set pid=%%i
endlocal
goto :eof

:: Reload the running configuration
:reload_config
call :ping>NUL
if %ERRORLEVEL% GEQ 1 exit %ERRORLEVEL%
call :pre_configure_hooks
call :post_configure_hooks
setlocal EnableDelayedExpansion
%escript% %nodetool% reload_config %node_type% %node_name% -setcookie "!cookie!" "%sys_config%"
endlocal
goto :eof

:: Describe this release
:describe
setlocal EnableDelayedExpansion
echo Service Information
echo =====================
%erlsrv% list %service_name%
echo.
echo Release Metadata
echo =====================
echo ERTS                %erts_vsn%
echo Release Directory   %rel_dir%
echo Config File         %sys_config%
echo Args File           %vm_args%
echo Name Type           %node_type%
echo Node Name           %node_name%
echo Node Cookie         !cookie!
echo Extra Opts          %erl_opts%
echo.
echo Hooks:
for %%i in (%hook_dir%\*.d\*.bat) do (
  echo %%i
)
echo.
echo Commands:
for %%i in (%command_dir%\*.d\*.bat) do (
  echo %%i
)
endlocal
goto :eof

:: Remote shell to a running node
:remote_console
call :ping
if %ERRORLEVEL% GEQ 1 exit %ERRORLEVEL%
setlocal EnableDelayedExpansion
set id=remsh%RANDOM%-%node_name%
start "%node_name% attach" %werl% -hidden -noshell -boot "%clean_boot_script%" ^
       -user Elixir.IEx.CLI %node_type% %id% -setcookie "!cookie!" ^
       -extra --no-halt +iex -%node_type% %id% --cookie "!cookie!" --remsh %node_name%
endlocal
goto :eof

:: Hook helpers
:execute_hooks
for /r "%hook_dir%\%1.d" %%f in (*.bat) do (
  echo Running %1 hook: %%f
  %%f
  if %ERRORLEVEL% GEQ 1 exit %ERRORLEVEL%
)
goto :eof

:pre_configure_hooks
call :execute_hooks pre_configure
goto :eof

:post_configure_hooks
call :execute_hooks post_configure
goto :eof

:pre_start_hooks
call :execute_hooks pre_start
goto :eof

:post_start_hooks
call :execute_hooks post_start
goto :eof

:pre_stop_hooks
call :execute_hooks pre_stop
goto :eof

:post_stop_hooks
call :execute_hooks post_stop
goto :eof

:pre_upgrade_hooks
call :execute_hooks pre_upgrade
goto :eof

:post_upgrade_hooks
call :execute_hooks post_upgrade
goto :eof


saveguard missing date

saveguard missing date

    <%= link "Latest Episodes", to: episode_frontend_path(@conn, :index), style: "color: #fff" %>

      <%= link "more ...", to: episode_frontend_path(@conn, :index), style: "color: #fff" %>

      <%= for episode <- latest_episodes do %>

          <%= link [fa_icon("headphones"), " ", C.String.truncate(episode.title, 40)],
                      to: episode_frontend_path(@conn, :show, episode),
                      class: "btn btn-primary btn-xs" %>

          <%= link [fa_icon("podcast"), " ", episode.podcast.title],
                      to: podcast_frontend_path(@conn, :show, episode.podcast),
                      class: "btn btn-default btn-xs",
                      style: "color: #000;" %>

          <%= if episode.publishing_date %>
            <%= fa_icon("calendar") %> <%= Ecto.DateTime.to_date(episode.publishing_date) %>

          <% end %>
          <%= if episode.duration do %>
            <%= fa_icon("clock-o") %> <%= episode.duration %>

          <%= end %>
          <%= if episode.author do %>
            <%= fa_icon("user") %> <%= episode.author %>

          <%= end %>
          <%= if episode.subtitle do %>
            <%= fa_icon("image") %> <%= episode.subtitle %>
          <%= end %>

      <% end %>

    <%= link "Latest Episodes", to: episode_frontend_path(@conn, :index), style: "color: #fff" %>

      <%= link "more ...", to: episode_frontend_path(@conn, :index), style: "color: #fff" %>

      <%= for episode <- latest_episodes do %>

          <%= link [fa_icon("headphones"), " ", C.String.truncate(episode.title, 40)],
                      to: episode_frontend_path(@conn, :show, episode),
                      class: "btn btn-primary btn-xs" %>

          <%= link [fa_icon("podcast"), " ", episode.podcast.title],
                      to: podcast_frontend_path(@conn, :show, episode.podcast),
                      class: "btn btn-default btn-xs",
                      style: "color: #000;" %>

          <%= fa_icon("calendar") %> <%= Ecto.DateTime.to_date(episode.publishing_date) %>

          <%= if episode.duration do %>
            <%= fa_icon("clock-o") %> <%= episode.duration %>

          <%= end %>
          <%= if episode.author do %>
            <%= fa_icon("user") %> <%= episode.author %>

          <%= end %>
          <%= if episode.subtitle do %>
            <%= fa_icon("image") %> <%= episode.subtitle %>
          <%= end %>

      <% end %>


static map with overlay

static map with overlay

<%= gettext "Welcome to %{name}", name: "Phoenix!" %>

A productive web framework that
does not compromise speed and maintainability.

Resources

        Guides

        Docs

        Source

Help

        Mailing list

        #elixir-lang on freenode IRC

        @elixirphoenix


hello world

hello world