change title

change title

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Filter Burst</title>
    <%= if Mix.env == :dev do %>
      <link rel="stylesheet" href="http://localhost:3000/css/app.css">
    <% else %>
      <link rel="stylesheet" href="<%= static_path(@conn, "/css/app.css") %>">
    <% end %>

    <script>
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

      ga('create', 'UA-87366009-1', 'auto');
      ga('send', 'pageview');
    </script>
  </head>

  <body>
    <%= render @view_module, @view_template, assigns %>
    <%= if Mix.env == :dev do %>
      <script src='http://localhost:3000/js/index.bundle.js'></script>
    <% else %>
      <script src="<%= static_path(@conn, "/js/index.bundle.js") %>"></script>
    <% end %>
  </body>
</html>

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Hello PhoenixReactStarter!</title>
    <%= if Mix.env == :dev do %>
      <link rel="stylesheet" href="http://localhost:3000/css/app.css">
    <% else %>
      <link rel="stylesheet" href="<%= static_path(@conn, "/css/app.css") %>">
    <% end %>

    <script>
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

      ga('create', 'UA-87366009-1', 'auto');
      ga('send', 'pageview');
    </script>
  </head>

  <body>
    <%= render @view_module, @view_template, assigns %>
    <%= if Mix.env == :dev do %>
      <script src='http://localhost:3000/js/index.bundle.js'></script>
    <% else %>
      <script src="<%= static_path(@conn, "/js/index.bundle.js") %>"></script>
    <% end %>
  </body>
</html>


Start to make it *my* app.

Start to make it *my* app.

Phoenix Poker

  <%= if @current_user do %>

Welcome, <%= @current_user.name %>!

    <img src="<%= @current_user.avatar %>" class="img-circle"/>
    <%= link "Logout", to: auth_path(@conn, :delete), method: :delete, class: "btn btn-danger" %>

  <% else %>

      Sign in with GitHub

      Sign in with Facebook

      Sign in with Google

      Sign in with Slack

      Sign in with Twitter

      Sign in with Username/Password

  <% end %>

Überauth + Phoenix Example

  This is an application to show an example of how to wire up
  Überauth with
  Phoenix.

  <%= if @current_user do %>

Welcome, <%= @current_user.name %>!

    <img src="<%= @current_user.avatar %>" class="img-circle"/>
    <%= link "Logout", to: auth_path(@conn, :delete), method: :delete, class: "btn btn-danger" %>

  <% else %>

      Sign in with GitHub

      Sign in with Facebook

      Sign in with Google

      Sign in with Slack

      Sign in with Twitter

      Sign in with Username/Password

  <% end %>


add ga link to analytics dashboard

add ga link to analytics dashboard

Analytics

  <%= link to: analytics_path(@conn, :index, users: true), class: "w-50 no-underline dark-blue dib pa2 dim border-box" do %>

Users

  <% end %>
  <%= link to: analytics_path(@conn, :index, answers: true), class: "w-50 no-underline dark-red dib pa2 dim border-box" do %>

Answers

  <% end %>

Google Analytics


change header on layout

change header on layout

<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Ashes</title>
    <link rel="stylesheet" href="<%= static_path(@conn, "/css/app.css") %>">

Get Started

<%= get_flash(@conn, :info) %>

<%= get_flash(@conn, :error) %>

      <%= @inner %>

<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Hello Phoenix!</title>
    <link rel="stylesheet" href="<%= static_path(@conn, "/css/app.css") %>">

Get Started

<%= get_flash(@conn, :info) %>

<%= get_flash(@conn, :error) %>

      <%= @inner %>


Add Erlang version number to home page.

Add Erlang version number to home page.

<img src='<%= static_path(@conn, "/images/readerl-icon-text.png") %>' alt='ReadErl' width='227' height='48'/>™

An RSS feed aggregator written in Elixir/Phoenix

I'm working on it: github.com/billstclair/readerl

  <%= :erlang.system_info(:system_version) %>

  Erlang: <%= {:ok, version} = :file.read_file(:filename.join([:code.root_dir(), "releases", :erlang.system_info(:otp_release), "OTP_VERSION"])); version %>,
  Elixir: <%= System.version %>, Phoenix: <%= {:ok, vsn} = :application.get_key(:phoenix, :vsn); vsn %>

<img src='<%= static_path(@conn, "/images/readerl-icon-text.png") %>' alt='ReadErl' width='227' height='48'/>™

An RSS feed aggregator written in Elixir/Phoenix

I'm working on it: github.com/billstclair/readerl

  <%= :erlang.system_info(:system_version) %>

  Elixir: <%= System.version %>, Phoenix: <%= {:ok, vsn} = :application.get_key(:phoenix, :vsn); vsn %>


Don't show twitter button when testing

Don't show twitter button when testing

          <%= link(@post.title, to: post_path(@conn, :show, @post)) %>

        <%= raw Tilex.Markdown.to_html(@post.body) %>

        <%= if action_name(@conn) == :show && Mix.env != :test do %>
          <a href='http://twitter.com/share'
             class='twitter-share-button'
             data-text= "Today I learned: <%= @post.title %>"
             data-via= "<%= Tilex.Developer.twitter_handle(@post.developer) %>"
             data-hashtags= "<%= @post.channel.twitter_hashtag %>"
             data-url= "<%= post_url(@conn, :show, @post) %>">
            Tweet

        <% end %>

            <%= link(@post.developer.username, to: developer_path(@conn, :show, @post.developer)) %>

            <%= link(display_date(@post), to: post_path(@conn, :show, @post), class: "post__permalink") %>

            <%= link("##{@post.channel.name}", to: channel_path(@conn, :show, @post.channel.name), class: "post__tag-link") %>

            <%= link("permalink", to: post_path(@conn, :show, @post), class: "post__permalink") %>

          <%= if Guardian.Plug.current_resource(@conn) && (@post.developer == Guardian.Plug.current_resource(@conn) || Guardian.Plug.current_resource(@conn).admin) do %>

              <%= link("edit", to: post_path(@conn, :edit, @post), class: "post__permalink") %>

          <% end %>

            <%= link to: "#", class: "js-like-action post__like-link", id: @post.slug do %>
              <%= @post.likes %>
              likes
            <% end %>

          <%= link(@post.title, to: post_path(@conn, :show, @post)) %>

        <%= raw Tilex.Markdown.to_html(@post.body) %>

        <%= if action_name(@conn) == :show do %>
          <a href='http://twitter.com/share'
             class='twitter-share-button'
             data-text= "Today I learned: <%= @post.title %>"
             data-via= "<%= Tilex.Developer.twitter_handle(@post.developer) %>"
             data-hashtags= "<%= @post.channel.twitter_hashtag %>"
             data-url= "<%= post_url(@conn, :show, @post) %>">
            Tweet

        <% end %>

            <%= link(@post.developer.username, to: developer_path(@conn, :show, @post.developer)) %>

            <%= link(display_date(@post), to: post_path(@conn, :show, @post), class: "post__permalink") %>

            <%= link("##{@post.channel.name}", to: channel_path(@conn, :show, @post.channel.name), class: "post__tag-link") %>

            <%= link("permalink", to: post_path(@conn, :show, @post), class: "post__permalink") %>

          <%= if Guardian.Plug.current_resource(@conn) && (@post.developer == Guardian.Plug.current_resource(@conn) || Guardian.Plug.current_resource(@conn).admin) do %>

              <%= link("edit", to: post_path(@conn, :edit, @post), class: "post__permalink") %>

          <% end %>

            <%= link to: "#", class: "js-like-action post__like-link", id: @post.slug do %>
              <%= @post.likes %>
              likes
            <% end %>


Adds 'View all' link to user show page

Adds 'View all' link to user show page

Showing User

<%= first_name(@user) %> (<%= @user.id %>)

<%= link "View all", to: user_path(@conn, :index) %>


Add action to be handled in item controller


Use generators and link badges

Use generators and link badges

    <%= if @title_link do %>
    <%= link(@offer.title, to: offer_path(@conn, :show, @offer.slug)) %>
    <% else %>
    <%= @offer.title%>
    <% end %>

      <%= @offer.company %>

        <%= if @offer.published_at do %>
        <%= human_readable_date(@offer.published_at) %>
        <% else %>
        <%= human_readable_date(@offer.inserted_at) %>
        <% end %>

      <%= @offer.location %>

        <%= link(human_get_place(@offer.job_place, gettext("Unknown")),
              to: offer_path(@conn, :search, filters: [job_place: @offer.job_place]),
              class: "badge badge-success") %>

        <%= link(human_get_type(@offer.job_type, gettext("Unknown")),
              to: offer_path(@conn, :search, filters: [job_type: @offer.job_type]),
              class: "badge badge-primary") %>

    <%= sanitized_markdown(@offer.description) %>

    <%= if @title_link do %>
    <%= link(@offer.title, to: offer_path(@conn, :show, @offer.slug)) %>
    <% else %>
    <%= @offer.title%>
    <% end %>

      <%= @offer.company %>

        <%= if @offer.published_at do %>
        <%= human_readable_date(@offer.published_at) %>
        <% else %>
        <%= human_readable_date(@offer.inserted_at) %>
        <% end %>

      <%= @offer.location %>

        <%= human_get_place(@offer.job_place, gettext("Unknown")) %>

        <%= human_get_type(@offer.job_type, gettext("Unknown")) %>

    <%= sanitized_markdown(@offer.description) %>


Add location to RSS feed

Add location to RSS feed

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title><%= gettext("ElixirJobs") %></title>
    <description><%= gettext "Find your next Elixir job." %></description>
    <link><%= offer_url(@conn, :index) %></link>
    <%= for offer <- @offers do %>
      <item>
        <title><![CDATA[<%= xml_strip_tags(offer.title) %>]]></title>
        <description><![CDATA[

              <%= gettext "Job place:" %> <%= human_get_place(offer.job_place, gettext("Unknown")) %>

              <%= gettext "Job type:" %> <%= human_get_type(offer.job_type, gettext("Unknown")) %>

              <%= gettext "Job location:" %> <%= xml_strip_tags(offer.location) %>

          <%= xml_sanitized_markdown(offer.description) %>
        ]]></description>
        <pubDate><%= xml_readable_date(offer.inserted_at) %></pubDate>
        <link><%= offer.url %></link>
        <guid><%= offer.url %></guid>
      </item>
    <% end %>
  </channel>
</rss>

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title><%= gettext("ElixirJobs") %></title>
    <description><%= gettext "Find your next Elixir job." %></description>
    <link><%= offer_url(@conn, :index) %></link>
    <%= for offer <- @offers do %>
      <item>
        <title><![CDATA[<%= xml_strip_tags(offer.title) %>]]></title>
        <description><![CDATA[

              <%= gettext "Job place:" %> <%= human_get_place(offer.job_place, gettext("Unknown")) %>

              <%= gettext "Job type:" %> <%= human_get_type(offer.job_type, gettext("Unknown")) %>

          <%= xml_sanitized_markdown(offer.description) %>
        ]]></description>
        <pubDate><%= xml_readable_date(offer.inserted_at) %></pubDate>
        <link><%= offer.url %></link>
        <guid><%= offer.url %></guid>
      </item>
    <% end %>
  </channel>
</rss>


Amend FAQ

Amend FAQ

FAQ

  Hier findest du Antworten auf häufig gestellte Fragen.

Anmeldung

Ab wann kann ich mich anmelden?

Die Anmeldung für ein Wettbewerbsjahr beginnt im Oktober des Vorjahres.

Wann ist Anmeldeschluss?

        Das hängt von der Schule ab – das jeweilige Datum findest du auf der
        <%= link "Anmeldeseite", to: page_path(@conn, :registration) %>.

Kann ich mein Vorspielprogramm nach der Anmeldung noch ändern?

        Ja, dies ist bis zum Anmeldeschluss möglich. Gib einfach den Änderungscode,
        den du nach der Anmeldung bzw. Weiterleitung erhalten hast,
        <%= link "hier", to: page_path(@conn, :edit_registration) %> ein.

Muss ich mich für den Landeswettbewerb erneut anmelden?

        Nein! Bei einer Weiterleitung zum LW wird deine Anmeldung automatisch übernommen.
        Du bekommst dann eine E-Mail mit einem neuen Änderungscode, mit dem du dein Vorspielprogramm ändern kannst.

Muss ich mich für den Bundeswettbewerb erneut anmelden?

        Ja, bei einer Weiterleitung zum BW musst du ein gesondertes Anmeldeformular ausdrucken und
        unterschrieben per Post abschicken. Wie das geht, erfährst du beim LW-Organisationsteam.

Regeln

Wie wird die Altersgruppe berechnet?

        Auf Seite 6 der <%= link "Ausschreibung", to: page_path(@conn, :rules) %> findest du eine
        Tabelle zum Nachschlagen. Bei Solisten und einzelnen Begleitern zählt hier einfach das Geburtsjahr.
        Bei Ensembles oder Begleitgruppen nimmt man das Durchschnittsalter auf den Tag genau und
        schaut dann, in welchem Jahr dieser Tag liegt.

Darf ich mich in den Klassik-Kategorien per Playback begleiten lassen?

Nein, in der Klassik ist eine Begleitung per Playback nicht möglich.

Termine

Wann findet der Landeswettbewerb 2019 statt?

Der Landeswettbewerb findet vom 20. bis 25. März 2019 an der DS Prag statt.

Kann ich beim Landeswettbewerb Terminwünsche anmelden?

        Nur, wenn eine begründete Verhinderung im Sinne der Ausschreibung (Seite 8) vorliegt.
        Wir können dann versuchen, dich an einen anderen LW zu vermitteln. Jumu ist mehr als nur ein
        Vorspieltermin! Beim LW stehen das Kennenlernen und der musikalische Austausch im Vordergrund.
        Wir wünschen uns deshalb, dass alle Teilnehmenden für die gesamte Zeit des Wettbewerbs anreisen.

“Kinder musizieren” (Kimu)

Wer kann an Kimu teilnehmen?

        Kimu ist für junge Teilnehmer gedacht, um vor dem "richtigen" Wettbewerb in familiärer
        Atmosphäre erste Bühnenerfahrung zu sammeln. Hier sind vor allem die Altersgruppen
        I und II gemeint – eine feste Altersgrenze gibt es aber nicht.

Kann man bei Kimu weitergeleitet werden?

Nein, eine Weiterleitung gibt es bei Kimu nicht.

FAQ

  Hier findest du Antworten auf häufig gestellte Fragen.

Anmeldung

Ab wann kann ich mich anmelden?

Die Anmeldung für ein Wettbewerbsjahr beginnt im Oktober des Vorjahres.

Wann ist Anmeldeschluss?

        Das hängt von der Schule ab – das jeweilige Datum findest du auf der
        <%= link "Anmeldeseite", to: page_path(@conn, :registration) %>.

Kann ich mein Vorspielprogramm nach der Anmeldung noch ändern?

        Ja, dies ist bis zum Anmeldeschluss möglich. Gib einfach den Änderungscode,
        den du nach der Anmeldung bzw. Weiterleitung erhalten hast,
        <%= link "hier", to: page_path(@conn, :edit_registration) %> ein.

Muss ich mich für den Landeswettbewerb erneut anmelden?

        Nein! Bei einer Weiterleitung zum LW wird deine Anmeldung automatisch übernommen.
        Du bekommst dann eine E-Mail mit einem neuen Änderungscode, mit dem du dein Vorspielprogramm ändern kannst.

Muss ich mich für den Bundeswettbewerb erneut anmelden?

        Ja, bei einer Weiterleitung zum BW musst du ein gesondertes Anmeldeformular ausdrucken und
        unterschrieben per Post abschicken. Wie das geht, erfährst du beim LW-Organisationsteam.

Regeln

Wie wird die Altersgruppe berechnet?

        Auf Seite 6 der <%= link "Ausschreibung", to: page_path(@conn, :rules) %> findest du eine
        Tabelle zum Nachschlagen. Bei Solisten und einzelnen Begleitern zählt hier einfach das Geburtsjahr.
        Bei Ensembles oder Begleitgruppen nimmt man das Durchschnittsalter auf den Tag genau und
        schaut dann, in welchem Jahr dieser Tag liegt.

Darf ich mich in den Klassik-Kategorien per Playback begleiten lassen?

Nein, in der Klassik ist eine Begleitung per Playback nicht möglich.

“Kinder musizieren” (Kimu)

Wer kann an Kimu teilnehmen?

        Kimu ist für junge Teilnehmer gedacht, um vor dem "richtigen" Wettbewerb in familiärer
        Atmosphäre erste Bühnenerfahrung zu sammeln. Hier sind vor allem die Altersgruppen
        I und II gemeint – eine feste Altersgrenze gibt es aber nicht.

Kann man bei Kimu weitergeleitet werden?

Nein, eine Weiterleitung gibt es bei Kimu nicht.


adds tags to bookmark detail

adds tags to bookmark detail

  <a href="<%=@bookmark.url %>"><%=@bookmark.title %>

<%= Enum.map_join(@bookmark.tags, ", ", &(&1.name)) %>

  created on: <%=@bookmark.inserted_at %> by <a href="/users/<%=@bookmark.user.id %>"><%= @bookmark.user.username %>

  <a href="<%=@bookmark.url %>"><%=@bookmark.title %>

  created on: <%=@bookmark.inserted_at %> by <a href="/users/<%=@bookmark.user.id %>"><%= @bookmark.user.username %>


removed forum, never used :sob:

removed forum, never used :sob:

    <%= if assigns[:logo] == nil || assigns[:logo] == true do %>
      <img src='/images/logo.svg' alt="<%= gettext("SignDict Logo") %>" class="so-navigation__logo"/>
      <%= gettext("About SignDict")%>
    <% else %>
      <%= gettext("About SignDict")%>
    <% end %>

    <input class="so-navigation__menu-btn" hidden type="checkbox" id="so-navigation__menu-btn" />

    <%= if assigns[:logo] == nil || assigns[:logo] == true do %>

    <% else %>

    <% end %>

      <%= if @current_user do %>
        <%= if Canada.Can.can? @current_user, :show_backend, %{} do %>

            <%= link "Admin", to: backend_dashboard_path(@conn, :index), data: [turbolinks: "false"] %>

        <% end %>

          <%= form_tag(session_path(@conn, :delete, @current_user), method: :delete) %>
            <input type="submit" value="<%= gettext("Sign out") %>" class='sc-link so-navigation__menu-item--logout' />
          </form>

        <%= if Gettext.get_locale(SignDict.Gettext) == "de" do %>
          English
        <% else %>
          Deutsch
        <% end %>

          <a href="<%= user_path(@conn, :show, @current_user) %>"><%= img_tag SignDict.User.avatar_url(@current_user), alt: gettext("The avatar image of this user"), class: "so-navigation__user-avatar" %><%= @current_user.name %>

      <% else %>

          <%= link gettext("Register"), to: user_path(@conn, :new) %>

          <%= link gettext("Sign in"), to: session_path(@conn, :new) %>

          <%= if Gettext.get_locale(SignDict.Gettext) == "de" do %>
            English
          <% else %>
            Deutsch
          <% end %>

      <% end %>

    <%= if assigns[:logo] == nil || assigns[:logo] == true do %>
      <img src='/images/logo.svg' alt="<%= gettext("SignDict Logo") %>" class="so-navigation__logo"/>
      <%= gettext("About SignDict")%>
    <% else %>
      <%= gettext("About SignDict")%>
    <% end %>

    <input class="so-navigation__menu-btn" hidden type="checkbox" id="so-navigation__menu-btn" />

    <%= if assigns[:logo] == nil || assigns[:logo] == true do %>

    <% else %>

    <% end %>

      <%= if @current_user do %>
        <%= if Canada.Can.can? @current_user, :show_backend, %{} do %>

            <%= link "Admin", to: backend_dashboard_path(@conn, :index), data: [turbolinks: "false"] %>

        <% end %>

          <%= form_tag(session_path(@conn, :delete, @current_user), method: :delete) %>
            <input type="submit" value="<%= gettext("Sign out") %>" class='sc-link so-navigation__menu-item--logout' />
          </form>

          Community

        <%= if Gettext.get_locale(SignDict.Gettext) == "de" do %>
          English
        <% else %>
          Deutsch
        <% end %>

          <a href="<%= user_path(@conn, :show, @current_user) %>"><%= img_tag SignDict.User.avatar_url(@current_user), alt: gettext("The avatar image of this user"), class: "so-navigation__user-avatar" %><%= @current_user.name %>

      <% else %>

          <%= link gettext("Register"), to: user_path(@conn, :new) %>

          <%= link gettext("Sign in"), to: session_path(@conn, :new) %>

          Community

          <%= if Gettext.get_locale(SignDict.Gettext) == "de" do %>
            English
          <% else %>
            Deutsch
          <% end %>

      <% end %>


Change 'add to slack' to link to setup page

  <%= case team_state(@current_team) do %>
    <% :complete -> %>
      <%= link to: article_url(@conn, :index) do %>

          View your Team Settings

      <% end %>
    <% :new -> %>

Get started with POST

        <%= link to: setup_path(@conn, :index) do %>

        <% end %>

or sign into an existing account

        <%= link to: auth_path(@conn, :request, :slack, scope: "identity.basic")  do %>

        <% end %>

    <% _ -> %>
      <%= link to: setup_path(@conn, :update) do %>

          View your Team Settings

    <% end %>
  <% end %>

  <%= case team_state(@current_team) do %>
    <% :complete -> %>
      <%= link to: article_url(@conn, :index) do %>

          View your Team Settings

      <% end %>
    <% :new -> %>

Get started with POST

        <%= link to: auth_path(@conn, :request, :slack) do %>

        <% end %>

or sign into an existing account

        <%= link to: auth_path(@conn, :request, :slack, scope: "identity.basic")  do %>

        <% end %>

    <% _ -> %>
      <%= link to: setup_path(@conn, :update) do %>

          View your Team Settings

    <% end %>
  <% end %>


format block.html.eex

format block.html.eex

Block Information

Block | <%= @block.index %>

<a href="<%= blocks_path(@conn, :index) %>" alt="Back to all transactions" title="Back to all transactions" class="back-link">Back to all blocks

<%= gettext "Block index" %>

<%= @block.index %>

      <%= get_explanation("block_index") %>

<%= gettext "Transactions" %>

<%= @block.tx_count %>

      <%= get_explanation("block_transactions") %>

<%= gettext "Hash" %>

<%= @block.hash %>

      <%= get_explanation("block_hash") %>

<%= gettext "Time" %>

<%= compare_time_and_get_minutes(@block.time)%> minutes ago

      <%= get_explanation("block_time") %>

<%= gettext "Version" %>

<%= @block.version %>

      <%= get_explanation("block_version") %>

<%= gettext "Merkle root" %>

<%= @block.merkleroot %>

      <%= get_explanation("block_merkle_root") %>

Validator

      <a href="<%= address_path(@conn, :index, @block.nextconsensus)%>" alt="View wallet address" title="View wallet address" class="large-blue-link wallet-address"><%= @block.nextconsensus %>
      <%= get_explanation("block_validator") %>

Size

<%= @block.size %> <%= gettext "bytes" %>

      <%= get_explanation("block_size") %>

<%= gettext "Transactions" %>

<%= gettext "Type" %>

<%= gettext "Transaction ID" %>

<%= gettext "Completed on" %>

All transaction information

      <%= for transaction <- @transactions do %>
        <div class="full-width-bar <%= get_class(transaction.type)%>">

            <%= if transaction.type == "ContractTransaction" do %>

<%= gettext "Contract" %>

            <% end %>
            <%= if transaction.type == "ClaimTransaction" do %>

<%= gettext "Gas Claim" %>

            <% end %>
            <%= if transaction.type == "InvocationTransaction" do %>

<%= gettext "Invocation" %>

            <% end %>
            <%= if transaction.type == "IssueTransaction" do %>

<%= gettext "Asset Issue" %>

            <% end %>
            <%= if transaction.type == "RegisterTransaction" do %>

<%= gettext "Asset Register" %>

            <% end %>
            <%= if transaction.type == "PublishTransaction" do %>

<%= gettext "Contract Publish" %>

            <% end %>
            <%= if transaction.type == "MinerTransaction" do %>

<%= gettext "Miner" %>

            <% end %>

              <a href="<%=transaction_path(@conn, :index, transaction.txid )%>" alt="View transaction" title="View transaction" class="large-blue-link col-6-width"><%= transaction.txid %>…

                <%=
                  {:ok, date_time} = DateTime.from_unix(transaction.time, :second)
                  DateTime.to_date(date_time)
                %> |
                <%=
                  {:ok, date_time} = DateTime.from_unix(transaction.time, :second)
                  DateTime.to_time(date_time)
                %>

          <button class="btn-accordion"><img src="<%= static_path(@conn, "/images/ICON_DownArrow.svg") %>" alt="Accordion down arrow" title="Accordion down arrow" class="accordion-down-arrow" width="13px" height="8px" /></button>

              <%= if transaction.type == "ContractTransaction" do %>

<%= gettext "Sent from" %>

                <%= for vin <- transaction.vin do %>

                    <a href='<%= address_path(@conn, :index, vin.address_hash)%>' alt="View wallet address" title="View wallet address" class="large-blue-link wallet-address"><%= vin.address_hash %>

<%= Helpers.round_or_not(vin.value) %> <%= Api.get_asset_name(vin.asset) %>

                <% end %>
              <% end %>
              <%= if transaction.type == "ClaimTransaction" do %>

<%= gettext "Claimed from" %>

                <%= for claim <- transaction.claims do %>

                    <a href='<%= address_path(@conn, :index, claim.address_hash)%>' alt="View wallet address" title="View wallet address" class="large-blue-link wallet-address"><%= claim.address_hash %>

<%= Helpers.round_or_not(claim.value) %> <%= Api.get_asset_name(claim.asset) %>

                <% end %>
              <% end %>

            <img src="<%= static_path(@conn, "/images/ICON_Sent-arrow.svg")%>" alt="Sent arrow" title="Sent arrow" class="transaction-sent-arrow" />

              <%= if transaction.type == "ContractTransaction" or transaction.type == "ClaimTransaction" or transaction.type == "IssueTransaction" do %>

<%= gettext "Sent to" %>

                <%= for vout <- transaction.vouts do %>

                    <a href='<%= address_path(@conn, :index, vout.address_hash)%>' alt="View wallet address" title="View wallet address" class="large-blue-link wallet-address"><%= vout.address_hash %>

<%=Helpers.round_or_not(vout.value) %> <%= Api.get_asset_name(vout.asset) %>

                <% end %>
              <% end %>

Network fee: <%=transaction.net_fee%> <%= gettext "GAS" %> · <%= gettext "System Fee" %>: <%=transaction.sys_fee%> <%= gettext "GAS" %> · <%= gettext "Data Size" %>: <%=transaction.size%> bytes

      <% end %>

Transactions <%= get_current_min_qtd(@page, @block.tx_count) %> to <%= get_current_max_qtd(@page, @block.tx_count) %> of <%= @block.tx_count %>

      <%= if @page != "1" do %>
        <%= get_previous_page(@conn, @block.hash, @page) %>
      <% end %>
      <%= if check_last(@page, @block.tx_count) do %>
        <%= get_next_page(@conn, @block.hash, @page) %>
      <% end %>

<%= gettext "Bytecode Invocation Script" %>

      <%= get_explanation("bytecode_invocation_script") %>

      <%= for script <- @block.script do %>
        <%= if check_if_invocation(script) do %>

<%= get_inv(script) %>

        <% end %>
      <% end %>

<%= gettext "Bytecode Verification Script" %>

      <%= get_explanation("bytecode_verification_script") %>

      <%= for script <- @block.script do %>
        <%= if check_if_verification(script) do %>

<%= get_ver(script) %>

        <% end %>
      <% end %>

<%= gettext "Opcode Invocation Script" %>

      <%= get_explanation("opcode_invocation_script") %>

        <%= for script <- @block.script do %>
          <%= if check_if_invocation(script) do %>
            <%= for operation <- parse_invocation(script) do %>
              <%= operation %>
            <% end %>
          <% end %>
        <% end %>

<%= gettext "Opcode Verification Script" %>

      <%= get_explanation("opcode_verification_script") %>

      <%= for script <- @block.script do %>
        <%= if check_if_verification(script) do %>
        <%= for operation <- parse_verification(script) do %>
          <%= operation %>
        <% end %>
        <% end %>
      <% end %>


dropdown change

dropdown change

<!DOCTYPE html>

	<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
	<meta content="width=device-width, initial-scale=1" name="viewport">
	<meta content="BeyondBOINC displays the recently created content from a curated list of Steemit authors on the topics of cryptocurrency, distributed computing and technology." name="description">
	<meta content="Gridcoin, Bitshares, Steemit, Cryptocurrency, Blog, Aggregator, Glasnost, BOINC, BeyondBitcoin, BeyondBOINC, Distributed Computing, Cloud computing, Science, Peerplays, Blockchain, Decentralization, money, science, technology, crypto" name="keywords">
	<meta content="Customminer aka @cm-steem" name="author">
	<meta content="index, follow" name="robots">
	<meta content="1 days" name="revisit-after">
	<link href="https://beyondboinc.net" rel="canonical">
	<title>BeyondBOINC: <%= naive_translate("head title", @conn.assigns[:lang])%></title>
 	<link rel="stylesheet" href="<%= static_path(@conn, "/css/app.css") %>">
 	<link href="//cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.9/semantic.min.css" rel="stylesheet">

          			<img class="logo" src="/images/<%=naive_image_chooser("logo", @conn.assigns[:lang])%>">

        	<%=naive_translate("home", @conn.assigns[:lang])%>

        	<a href="/authors/<%=@conn.assigns[:about_blog_author]%>/<%=@conn.assigns[:about_blog_permlink]%>" class="item"><%=naive_translate("about", @conn.assigns[:lang])%>
        	<a href="<%=if @conn.assigns[:lang] == "ru", do: "https://golos.io", else: "https://steemit.com"%>" class="item"><%=naive_translate("about_steemlike_chain", @conn.assigns[:lang])%>

					Trade GRC

							Decentralized Exchanges

							BitSquare

							OpenLedger

							BTSABC

							BTSBOTS

							Bitshares-Light

							Centralized Exchanges

							HolyTransactions

							Poloniex

							C-Cex

							Bittrex

							Explorers

							GridcoinStats

							GridResearchCorp

							Explorer.Gridcoin.Asia

							HolyTransactions

							Exchange stats

							CoinMarketCap

							CoinGecko

							CoinCap

					 Community

							 Gridcoin

									Website

									Forums

									GitHub

									Twitter

									Steemit

									Telegram

									Reddit

									IRC

									Wiki

							 BOINC

									BOINC Website

									BOINC Forums

									FormulaBOINC

									User of the day

									Rechenkraft

									Desktop Grid Federation

									SETI Germany

									SETI USA

							 Bitshares

									Official website

									Forums

									Explorer

				<%= if get_flash(@conn, :info) do %>

					<%= get_flash(@conn, :info) %>

<%end %><%= if get_flash(@conn, :error) do %>

					<%= get_flash(@conn, :error) %>

<%end %>

<%= render @view_module, @view_template, assigns %>

				Site Owner: @CM-STEEM


Use full width of the browser

Use full width of the browser

<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Alkaloid Gatekeeper</title>
    <link rel="stylesheet" href="<%= static_path(@conn, "/css/app.css") %>">

            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
              Toggle navigation

            </button>

              <%= if Guardian.Plug.current_resource(@conn) do %>

<%= link "Companies", to: company_path(@conn, :index) %>

<%= link "Door Groups", to: door_group_path(@conn, :index) %>

<%= link "Doors", to: door_path(@conn, :index) %>

<%= link "RFID Tokens", to: rfid_token_path(@conn, :index) %>

<%= link "Access Log", to: door_access_attempt_path(@conn, :index) %>

                <% # FIXME: We get "undefined function" when calling authentication_path(@conn, :delete) %>

<%= link "Log Out", to: "/auth", method: :delete, class: "btn btn-danger", style: "padding: 15px 5px" %>

              <% else %>

<%=
                  authenticator = if Mix.env == :dev do
                    :automatic
                  else
                    :slack
                  end
                  link "Log In", to: authentication_path(@conn, :request, authenticator), class: "btn btn-default", style: "padding: 15px 5px"
                %>

              <% end %>

<%= get_flash(@conn, :info) %>

<%= get_flash(@conn, :error) %>

      <%= render @view_module, @view_template, assigns %>


Project Name -> book.me

Project Name -> book.me

<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>book.me</title>
    <link rel="stylesheet" href="<%= static_path(@conn, "/css/app.css") %>">

          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            Toggle navigation

          </button>
          book.me

Staff

Services

            <%= if @current_user do %>

Logout <%= @current_user.name %> (<%= @current_user.company_name %>)

            <%= else %>

Login

            <%= end %>

<%= get_flash(@conn, :info) %>

<%= get_flash(@conn, :error) %>

        <%= render @view_module, @view_template, assigns %>

<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>book.me</title>
    <link rel="stylesheet" href="<%= static_path(@conn, "/css/app.css") %>">

          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            Toggle navigation

          </button>
          Project name

Staff

Services

            <%= if @current_user do %>

Logout <%= @current_user.name %> (<%= @current_user.company_name %>)

            <%= else %>

Login

            <%= end %>

<%= get_flash(@conn, :info) %>

<%= get_flash(@conn, :error) %>

        <%= render @view_module, @view_template, assigns %>


fix path resoltuion for erl when using include_erts on a system without erlang

#!/bin/sh

set -e

# Set VERBOSE to enable verbose logging of the boot script
#VERBOSE=true
if [ ! -z $DEBUG_BOOT ]; then
    set -x
fi;
# Disable flow control for run_erl
# Flow control can cause several problems. On Linux, if you
# accidentally hit Ctrl-S (instead of Ctrl-D to detach) and
# then some other key, the entire beam process will hang when
# attempting to write to stdout. On Solaris, the beam process
# will hang on writing if ScrollLock is on.
RUN_ERL_DISABLE_FLOWCNTRL="${RUN_ERL_DISABLE_FLOWCNTRL:-true}"
# Path to this script
SCRIPT=$(readlink $0 || true)
if [ -z $SCRIPT ]; then
    SCRIPT=$0
fi;
# Parent directory of this script
SCRIPT_DIR="$(cd `dirname "$SCRIPT"` && pwd -P)"
# Root directory of all releases
RELEASE_ROOT_DIR="$(cd "$SCRIPT_DIR/../.." && pwd -P)"
# Name of the release
REL_NAME="<%= release_name %>"
# Current version of the release
REL_VSN="<%= release_version %>"
# Current version of ERTS being used
# If this is not present/unset, it will be detected
<%= unless is_nil(erts_vsn) do %>ERTS_VSN="<%= erts_vsn %>"<% end %>
# VM code loading mode, embedded by default, can also be interactive
# See http://erlang.org/doc/man/code.html
CODE_LOADING_MODE="${CODE_LOADING_MODE:-embedded}"
# Path to start_erl.data
START_ERL_DATA="$RELEASE_ROOT_DIR/releases/start_erl.data"
# Directory containing the current version of this release
REL_DIR="$RELEASE_ROOT_DIR/releases/$REL_VSN"
# The lib directory for this release
REL_LIB_DIR="$RELEASE_ROOT_DIR/lib"
# Options passed to erl
ERL_OPTS="<%= release.profile.erl_opts %>"
# When stdout is piped to a file, this is the directory those files will
# be stored in. defaults to /log in the release root directory
RUNNER_LOG_DIR="${RUNNER_LOG_DIR:-$RELEASE_ROOT_DIR/log}"
# A string of extra options to pass to erl, here for plugins
EXTRA_OPTS=""

# Pre-start/stop event hook paths
PRE_START_HOOK="$REL_DIR/hooks/pre_start"
POST_START_HOOK="$REL_DIR/hooks/post_start"
PRE_STOP_HOOK="$REL_DIR/hooks/pre_stop"
POST_STOP_HOOK="$REL_DIR/hooks/post_stop"

# Get node pid
get_pid() {
    if output="$(nodetool rpcterms os getpid)"
    then
        echo "$output" | sed -e 's/"//g'
        return 0
    else
        echo "$output"
        return 1
    fi
}

# Generate a unique nodename
gen_nodename() {
    id="longname$(gen_id)-${NAME}"
    "$BINDIR/erl" -boot start_clean -eval '[Host] = tl(string:tokens(atom_to_list(node()),"@")), io:format("~s~n", [Host]), halt()' -noshell ${NAME_TYPE} $id
}

# Generate a random id
gen_id() {
    od -t x -N 4 /dev/urandom | head -n1 | awk '{print $2}'
}

# Control a node
# Use like `nodetool "ping"`
nodetool() {
    command="$1"; shift

    "$ERTS_DIR/bin/escript" "$ROOTDIR/bin/nodetool" "$NAME_TYPE" "$NAME" \
                            -setcookie "$COOKIE" "$command" $@
}

# Run an escript in the node's environment
# Use like `escript "path/to/escript"`
escript() {
    shift; scriptpath="$1"; shift
    export RELEASE_ROOT_DIR

    "$ERTS_DIR/bin/escript" "$ROOTDIR/$scriptpath" $@
}

# Private. For determining the version of ERTS available to the release
_detect_erts_vsn() {
    $BINDIR/erl -boot start_clean -eval 'Ver = erlang:system_info(version), io:format("~s~n", [Ver]), halt()' -noshell
}

# Private. Gets a list of code paths for this release
_get_code_paths() {
    $BINDIR/erl -noshell -boot start_clean -eval "{ok, [{release,_,_,Apps}]} = file:consult(\"$REL_DIR/$REL_NAME.rel\"),lists:foreach(fun(A) -> io:fwrite(\"-pa $ROOTDIR/lib/~p-~s/ebin \", [element(1, A), element(2, A)]) end, Apps),halt()."
}

# Private. For setting ERTS_DIR and ROOTDIR
_find_erts_dir() {
    __erts_dir="$RELEASE_ROOT_DIR/erts-$ERTS_VSN"
    if [ -d "$__erts_dir" ]; then
        ERTS_DIR="$__erts_dir";
        ROOTDIR="$RELEASE_ROOT_DIR"
    else
        __erl="$(which erl)"
        code="io:format(\"~s\", [code:root_dir()]), halt()."
        __erl_root="$("$__erl" -noshell -eval "$code")"
        ERTS_DIR="$__erl_root/erts-$ERTS_VSN"
        ROOTDIR="$__erl_root"
    fi
}

# Private. Open a shell on a remote node
_rem_sh() {
    # Generate a unique id used to allow multiple remsh to the same node
    # transparently
    id="remsh$(gen_id)-${NAME}"

    # Get the node's ticktime so that we use the same thing.
    TICKTIME="$(nodetool rpcterms net_kernel get_net_ticktime)"

    # Setup remote shell command to control node
    if [ ! -z "$USE_ERL_SHELL" ]; then
        exec "$BINDIR/erl" \
            -hidden \
            -boot start_clean -boot_var ERTS_LIB_DIR "$ERTS_LIB_DIR" \
            -kernel net_ticktime $TICKTIME \
            "$NAME_TYPE" "$id" -remsh "$NAME" -setcookie "$COOKIE"
    else
        __code_paths=$(_get_code_paths)
        exec "$BINDIR/erl" \
            -pa "$CONSOLIDATED_DIR" \
            ${__code_paths} \
            -hidden -noshell \
            -boot start_clean -boot_var ERTS_LIB_DIR "$ERTS_LIB_DIR" \
            -kernel net_ticktime $TICKTIME \
            -user Elixir.IEx.CLI "$NAME_TYPE" "$id" -setcookie "$COOKIE" \
            -extra --no-halt +iex -"$NAME_TYPE" "$id" --cookie "$COOKIE" --remsh "$NAME"
    fi
}

# Output a start command for the last argument of run_erl
_start_command() {
    printf "exec \"%s\" \"%s\" -- %s %s" "$RELEASE_ROOT_DIR/bin/$REL_NAME" \
           "$START_OPTION" "${ARGS}" "${EXTRA_OPTS}"
}

# If ERTS_VSN is not set, detect it
if [ -z "$ERTS_VSN" ]; then
    ERTS_VSN="$(_detect_erts_vsn)"
    echo "$ERTS_VSN $REL_VSN" > "$START_ERL_DATA"
fi

# Allow override of where to look for config files
# By default it's $CWD/
if [ -z "$RELEASE_CONFIG_DIR" ]; then
    RELEASE_CONFIG_DIR="$RELEASE_ROOT_DIR"
fi

# Set VMARGS_PATH, the path to the vm.args file to use
# Use $RELEASE_CONFIG_DIR/vm.args if exists, otherwise releases/VSN/vm.args
if [ -z "$VMARGS_PATH" ]; then
    if [ -f "$RELEASE_CONFIG_DIR/vm.args" ]; then
        VMARGS_PATH="$RELEASE_CONFIG_DIR/vm.args"
    else
        VMARGS_PATH="$REL_DIR/vm.args"
    fi
fi

orig_vmargs_path="$VMARGS_PATH.orig"
if [ $REPLACE_OS_VARS ]; then
    #Make sure we don't break dev mode by keeping the symbolic link to
    #the user's vm.args
    if [ ! -L "$orig_vmargs_path" ]; then
       #we're in copy mode, rename the vm.args file to vm.args.orig
       mv "$VMARGS_PATH" "$orig_vmargs_path"
    fi

    awk '{while(match($0,"[$]{[^}]*}")) {var=substr($0,RSTART+2,RLENGTH -3);gsub("[$]{"var"}",ENVIRON[var])}}1' < "$orig_vmargs_path" > "$VMARGS_PATH"
 else
    #We don't need to replace env. vars, just rename the
    #symlink vm.args.orig to vm.args, and keep it as a
    #symlink.
    if [ -L "$orig_vmargs_path" ]; then
       mv "$orig_vmargs_path" "$VMARGS_PATH"
    fi
fi

# Make sure log directory exists
mkdir -p "$RUNNER_LOG_DIR"

# Set SYS_CONFIG_PATH, the path to the sys.config file to use
# Use $RELEASE_CONFIG_DIR/sys.config if exists, otherwise releases/VSN/sys.config
if [ -z "$SYS_CONFIG_PATH" ]; then
    if [ -f "$RELEASE_CONFIG_DIR/sys.config" ]; then
        SYS_CONFIG_PATH="$RELEASE_CONFIG_DIR/sys.config"
    else
        SYS_CONFIG_PATH="$REL_DIR/sys.config"
    fi
fi

orig_sys_config_path="$SYS_CONFIG_PATH.orig"
if [ $REPLACE_OS_VARS ]; then
    #Make sure we don't break dev mode by keeping the symbolic link to
    #the user's sys.config
    if [ ! -L "$orig_sys_config_path" ]; then
       #We're in copy mode, rename sys.config to sys.config.orig
       mv "$SYS_CONFIG_PATH" "$orig_sys_config_path"
    fi

    awk '{while(match($0,"[$]{[^}]*}")) {var=substr($0,RSTART+2,RLENGTH -3);gsub("[$]{"var"}",ENVIRON[var])}}1' < "$orig_sys_config_path" > "$SYS_CONFIG_PATH"
 else
    #We don't need to replace env. vars, just rename the
    #symlink sys.config.orig to sys.config. Keep it as
    #a symlink.
    if [ -L "$orig_sys_config_path" ]; then
       mv "$orig_sys_config_path"  "$SYS_CONFIG_PATH"
    fi
fi

# Extract the target node name from node.args
# Should be `-sname somename` or `-name somename@somehost`
NAME_ARG=$(egrep '^-s?name' "$VMARGS_PATH" || true)
if [ -z "$NAME_ARG" ]; then
    echo "vm.args needs to have either -name or -sname parameter."
    exit 1
fi

# Extract the name type and name from the NAME_ARG for REMSH
# NAME_TYPE should be -name or -sname
NAME_TYPE="$(echo "$NAME_ARG" | awk '{print $1}')"
# NAME will be either `somename` or `somename@somehost`
NAME="$(echo "$NAME_ARG" | awk '{print $2}')"

# Where the pipe will be stored when using `start`
# This is used so you can attach the running application to the current
# shell using `attach`
PIPE_DIR="${PIPE_DIR:-$RELEASE_ROOT_DIR/tmp/erl_pipes/$NAME/}"

# Extract the target cookie
COOKIE_ARG="$(grep '^-setcookie' "$VMARGS_PATH" || true)"
DEFAULT_COOKIE_FILE="$HOME/.erlang.cookie"
if [ -z "$COOKIE_ARG" ]; then
    if [ -f "$DEFAULT_COOKIE_FILE" ]; then
        COOKIE="$(cat "$DEFAULT_COOKIE_FILE")"
    else
        printf "a secret cookie must be provided in one of the following ways:\n  - with vm.args using the -setcookie parameter,\n  or\n  by writing the cookie to '$DEFAULT_COOKIE_FILE', with permissions set to 0400"
        exit 1
    fi
else
    # Extract cookie name from COOKIE_ARG
    COOKIE="$(echo "$COOKIE_ARG" | awk '{print $2}')"
fi

_find_erts_dir
export ROOTDIR="$RELEASE_ROOT_DIR"
export BINDIR="$ERTS_DIR/bin"
export EMU="beam"
export PROGNAME="erl"
export LD_LIBRARY_PATH="$ERTS_DIR/lib:$LD_LIBRARY_PATH"
ERTS_LIB_DIR="$ERTS_DIR/../lib"
CONSOLIDATED_DIR="$ROOTDIR/lib/${REL_NAME}-${REL_VSN}/consolidated"

cd "$ROOTDIR"

# User can specify an sname without @hostname
# This will fail when creating remote shell
# So here we check for @ and add @hostname if missing
case $NAME in
    *@*)
        # Nothing to do
        ;;
    *)
        NAME=$NAME@$(gen_nodename)
        ;;
esac

# Check the first argument for instructions
case "$1" in
    start|start_boot)

        # Make sure there is not already a node running
        #RES=`$NODETOOL ping`
        #if [ "$RES" = "pong" ]; then
        #    echo "Node is already running!"
        #    exit 1
        #fi
        # Save this for later.
        CMD=$1
        case "$1" in
            start)
                shift
                START_OPTION="console"
                HEART_OPTION="start"
                ;;
            start_boot)
                shift
                START_OPTION="console_boot"
                HEART_OPTION="start_boot"
                ;;
        esac
        ARGS="$@"
        RUN_PARAM="$@"

        [ -f "$PRE_START_HOOK" ] && . "$PRE_START_HOOK"

        # Set arguments for the heart command
        set -- "$SCRIPT_DIR/$REL_NAME" "$HEART_OPTION"
        [ "$RUN_PARAM" ] && set -- "$@" "$RUN_PARAM"

        # Export the HEART_COMMAND
        HEART_COMMAND="$RELEASE_ROOT_DIR/bin/$REL_NAME $CMD"
        export HEART_COMMAND

        mkdir -p "$PIPE_DIR"

        "$BINDIR/run_erl" -daemon "$PIPE_DIR" "$RUNNER_LOG_DIR" \
                          "$(_start_command)"

        [ -f "$POST_START_HOOK" ] && . "$POST_START_HOOK"
        ;;

    stop)
        [ -f "$PRE_STOP_HOOK" ] && . "$PRE_STOP_HOOK"
        # Wait for the node to completely stop...
        PID="$(get_pid)"
        if ! nodetool "stop"; then
            exit 1
        fi
        while $(kill -s 0 "$PID" 2>/dev/null);
        do
            sleep 1
        done
        [ -f "$POST_STOP_HOOK" ] && . "$POST_STOP_HOOK"
        ;;

    restart)
        [ -f "$PRE_START_HOOK" ] && . "$PRE_START_HOOK"
        ## Restart the VM without exiting the process
        if ! nodetool "restart"; then
            exit 1
        fi
        ;;

    reboot)
        [ -f "$PRE_START_HOOK" ] && . "$PRE_START_HOOK"
        ## Restart the VM completely (uses heart to restart it)
        if ! nodetool "reboot"; then
            exit 1
        fi
        ;;

    pid)
        ## Get the VM's pid
        if ! get_pid; then
            exit 1
        fi
        ;;

    ping)
        ## See if the VM is alive
        if ! nodetool "ping"; then
            exit 1
        fi
        ;;

    escript)
        ## Run an escript under the node's environment
        if ! escript $@; then
            exit 1
        fi
        ;;

    attach)
        # Make sure a node IS running
        if ! nodetool "ping" > /dev/null; then
            echo "Node is not running!"
            exit 1
        fi

        shift
        exec "$BINDIR/to_erl" "$PIPE_DIR"
        ;;

    remote_console)
        # Make sure a node IS running
        if ! nodetool "ping" > /dev/null; then
            echo "Node is not running!"
            exit 1
        fi

        shift
        _rem_sh
        ;;

    upgrade|downgrade|install)
        if [ -z "$2" ]; then
            echo "Missing package argument"
            echo "Usage: $REL_NAME $1 {package base name}"
            echo "NOTE {package base name} MUST NOT include the .tar.gz suffix"
            exit 1
        fi

        # Make sure a node IS running
        if ! nodetool "ping" > /dev/null; then
            echo "Node is not running!"
            exit 1
        fi

        exec "$BINDIR/escript" "$ROOTDIR/bin/install_upgrade.escript" \
             "install" "$REL_NAME" "$NAME_TYPE" "$NAME" "$COOKIE" "$2"
        ;;

    unpack)
        if [ -z "$2" ]; then
            echo "Missing package argument"
            echo "Usage: $REL_NAME $1 {package base name}"
            echo "NOTE {package base name} MUST NOT include the .tar.gz suffix"
            exit 1
        fi

        # Make sure a node IS running
        if ! nodetool "ping" > /dev/null; then
            echo "Node is not running!"
            exit 1
        fi

        exec "$BINDIR/escript" "$ROOTDIR/bin/install_upgrade.escript" \
             "unpack" "$REL_NAME" "$NAME_TYPE" "$NAME" "$COOKIE" "$2"
        ;;

    console|console_clean|console_boot)
        # .boot file typically just $REL_NAME (ie, the app name)
        # however, for debugging, sometimes start_clean.boot is useful.
        # For e.g. 'setup', one may even want to name another boot script.
        case "$1" in
            console)
                if [ -f "$REL_DIR/$REL_NAME.boot" ]; then
                  BOOTFILE="$REL_DIR/$REL_NAME"
                else
                  BOOTFILE="$REL_DIR/start"
                fi
                ;;
            console_clean)
                BOOTFILE="$ROOTDIR/bin/start_clean"
                ;;
            console_boot)
                shift
                BOOTFILE="$1"
                shift
                ;;
        esac
        # Setup beam-required vars
        EMU="beam"
        PROGNAME="${0#*/}"

        export EMU
        export PROGNAME

        # Store passed arguments since they will be erased by `set`
        ARGS="$@"

        # Start the VM, executing pre_start hook along
        # the way. We can't run the post_start hook because
        # the console will crash with no TTY attached
        [ -f "$PRE_START_HOOK" ] && . "$PRE_START_HOOK"

        __code_paths=$(_get_code_paths)
        # Build an array of arguments to pass to exec later on
        # Build it here because this command will be used for logging.
        set -- "$BINDIR/erlexec" \
            -boot "$BOOTFILE" \
            -boot_var ERTS_LIB_DIR "$ERTS_LIB_DIR" \
            -env ERL_LIBS "$REL_LIB_DIR" \
            -pa "$CONSOLIDATED_DIR" \
            ${__code_paths} \
            -args_file "$VMARGS_PATH" \
            -config "$SYS_CONFIG_PATH" \
            -mode "$CODE_LOADING_MODE" \
            ${ERL_OPTS} \
            -user Elixir.IEx.CLI \
            -extra --no-halt +iex

        # Dump environment info for logging purposes
        if [ ! -z $VERBOSE ]; then
            echo "Exec: $@" -- ${1+$ARGS} ${EXTRA_OPTS}
            echo "Root: $ROOTDIR"

            # Log the startup
            echo "$RELEASE_ROOT_DIR"
        fi;

        logger -t "$REL_NAME[$$]" "Starting up"

        exec "$@" -- ${1+$ARGS} ${EXTRA_OPTS}
        ;;

    foreground)
        # start up the release in the foreground for use by runit
        # or other supervision services

        [ -f "$REL_DIR/$REL_NAME.boot" ] && BOOTFILE="$REL_NAME" || BOOTFILE=start
        FOREGROUNDOPTIONS="-noshell -noinput +Bd"

        # Setup beam-required vars
        EMU=beam
        PROGNAME="${0#*/}"

        export EMU
        export PROGNAME

        # Store passed arguments since they will be erased by `set`
        ARGS="$@"

        # Start the VM, executing pre and post start hooks
        [ -f "$PRE_START_HOOK" ] && . "$PRE_START_HOOK"

        # Build an array of arguments to pass to exec later on
        # Build it here because this command will be used for logging.
        set -- "$BINDIR/erlexec" $FOREGROUNDOPTIONS \
            -boot "$REL_DIR/$BOOTFILE" -mode "$CODE_LOADING_MODE" -config "$SYS_CONFIG_PATH" \
            -boot_var ERTS_LIB_DIR "$ERTS_LIB_DIR" \
            -args_file "$VMARGS_PATH" \
            -env ERL_LIBS "$REL_LIB_DIR" \
            -pa "$CONSOLIDATED_DIR" \
            ${ERL_OPTS} \
            -extra ${EXTRA_OPTS}

        # Dump environment info for logging purposes
        if [ ! -z $VERBOSE ]; then
            echo "Exec: $@" -- ${1+$ARGS}
            echo "Root: $ROOTDIR"
        fi;

        trap '{}' QUIT TERM KILL HUP USR1 USR2
        "$@" -- ${1+$ARGS} &
        __bg_pid=$!
        [ -f "$POST_START_HOOK" ] && . "$POST_START_HOOK"
        wait $__bg_pid
        ;;
    rpc)
        # Make sure a node IS running
        if ! nodetool "ping" > /dev/null; then
            echo "Node is not running!"
            exit 1
        fi

        shift

        nodetool rpc $@
        ;;
    rpcterms)
        # Make sure a node IS running
        if ! nodetool "ping" > /dev/null; then
            echo "Node is not running!"
            exit 1
        fi

        shift

        nodetool rpcterms $@
        ;;
    eval)
        # Make sure a node IS running
        if ! nodetool "ping" > /dev/null; then
            echo "Node is not running!"
            exit 1
        fi

        shift
        nodetool "eval" $@
        ;;
    command)
        # Execute as command-line utility
        #
        # Like the escript command, this does not start the OTP application.
        # If your command depends on a running OTP application,
        # use
        #
        #     {:ok, _} = Application.ensure_all_started(:your_app)

        shift
        MODULE="$1"; shift
        FUNCTION="$1"; shift

        # Save extra arguments
        ARGS="$@"

        # Build arguments for erlexec
        set -- "$ERL_OPTS"
        [ "$SYS_CONFIG_PATH" ] && set -- "$@" -config "$SYS_CONFIG_PATH"
        set -- "$@" -boot_var ERTS_LIB_DIR "$ERTS_LIB_DIR"
        set -- "$@" -noshell
        set -- "$@" -boot start_clean
        set -- "$@" -s "$MODULE" "$FUNCTION"

        $BINDIR/erlexec $@ -extra $ARGS
        exit "$?"
        ;;
    *)
        __command_path="$REL_DIR/commands/$1"
        if [ -f "$__command_path" ]; then
            . "$__command_path"
        else
            echo "Usage: $REL_NAME {start|start_boot <file>|foreground|stop|restart|reboot|pid|ping|console|console_clean|console_boot <file>|attach|remote_console|upgrade|downgrade|install|escript|rpc|rpcterms|eval|command <module> <function> <args>}"
            exit 1
        fi
        ;;
esac

exit 0

#!/bin/sh

set -e

# Set VERBOSE to enable verbose logging of the boot script
#VERBOSE=true
if [ ! -z $DEBUG_BOOT ]; then
    set -x
fi;
# Disable flow control for run_erl
# Flow control can cause several problems. On Linux, if you
# accidentally hit Ctrl-S (instead of Ctrl-D to detach) and
# then some other key, the entire beam process will hang when
# attempting to write to stdout. On Solaris, the beam process
# will hang on writing if ScrollLock is on.
RUN_ERL_DISABLE_FLOWCNTRL="${RUN_ERL_DISABLE_FLOWCNTRL:-true}"
# Path to this script
SCRIPT=$(readlink $0 || true)
if [ -z $SCRIPT ]; then
    SCRIPT=$0
fi;
# Parent directory of this script
SCRIPT_DIR="$(cd `dirname "$SCRIPT"` && pwd -P)"
# Root directory of all releases
RELEASE_ROOT_DIR="$(cd "$SCRIPT_DIR/../.." && pwd -P)"
# Name of the release
REL_NAME="<%= release_name %>"
# Current version of the release
REL_VSN="<%= release_version %>"
# Current version of ERTS being used
# If this is not present/unset, it will be detected
<%= unless is_nil(erts_vsn) do %>ERTS_VSN="<%= erts_vsn %>"<% end %>
# VM code loading mode, embedded by default, can also be interactive
# See http://erlang.org/doc/man/code.html
CODE_LOADING_MODE="${CODE_LOADING_MODE:-embedded}"
# Path to start_erl.data
START_ERL_DATA="$RELEASE_ROOT_DIR/releases/start_erl.data"
# Directory containing the current version of this release
REL_DIR="$RELEASE_ROOT_DIR/releases/$REL_VSN"
# The lib directory for this release
REL_LIB_DIR="$RELEASE_ROOT_DIR/lib"
# Options passed to erl
ERL_OPTS="<%= release.profile.erl_opts %>"
# When stdout is piped to a file, this is the directory those files will
# be stored in. defaults to /log in the release root directory
RUNNER_LOG_DIR="${RUNNER_LOG_DIR:-$RELEASE_ROOT_DIR/log}"
# A string of extra options to pass to erl, here for plugins
EXTRA_OPTS=""

# Pre-start/stop event hook paths
PRE_START_HOOK="$REL_DIR/hooks/pre_start"
POST_START_HOOK="$REL_DIR/hooks/post_start"
PRE_STOP_HOOK="$REL_DIR/hooks/pre_stop"
POST_STOP_HOOK="$REL_DIR/hooks/post_stop"

# Get node pid
get_pid() {
    if output="$(nodetool rpcterms os getpid)"
    then
        echo "$output" | sed -e 's/"//g'
        return 0
    else
        echo "$output"
        return 1
    fi
}

# Generate a unique nodename
gen_nodename() {
    id="longname$(gen_id)-${NAME}"
    "$BINDIR/erl" -boot start_clean -eval '[Host] = tl(string:tokens(atom_to_list(node()),"@")), io:format("~s~n", [Host]), halt()' -noshell ${NAME_TYPE} $id
}

# Generate a random id
gen_id() {
    od -t x -N 4 /dev/urandom | head -n1 | awk '{print $2}'
}

# Control a node
# Use like `nodetool "ping"`
nodetool() {
    command="$1"; shift

    "$ERTS_DIR/bin/escript" "$ROOTDIR/bin/nodetool" "$NAME_TYPE" "$NAME" \
                            -setcookie "$COOKIE" "$command" $@
}

# Run an escript in the node's environment
# Use like `escript "path/to/escript"`
escript() {
    shift; scriptpath="$1"; shift
    export RELEASE_ROOT_DIR

    "$ERTS_DIR/bin/escript" "$ROOTDIR/$scriptpath" $@
}

# Private. For determining the version of ERTS available to the release
_detect_erts_vsn() {
    erl -boot start_clean -eval 'Ver = erlang:system_info(version), io:format("~s~n", [Ver]), halt()' -noshell
}

# Private. Gets a list of code paths for this release
_get_code_paths() {
    erl -noshell -boot start_clean -eval "{ok, [{release,_,_,Apps}]} = file:consult(\"$REL_DIR/$REL_NAME.rel\"),lists:foreach(fun(A) -> io:fwrite(\"-pa $ROOTDIR/lib/~p-~s/ebin \", [element(1, A), element(2, A)]) end, Apps),halt()."
}

# Private. For setting ERTS_DIR and ROOTDIR
_find_erts_dir() {
    __erts_dir="$RELEASE_ROOT_DIR/erts-$ERTS_VSN"
    if [ -d "$__erts_dir" ]; then
        ERTS_DIR="$__erts_dir";
        ROOTDIR="$RELEASE_ROOT_DIR"
    else
        __erl="$(which erl)"
        code="io:format(\"~s\", [code:root_dir()]), halt()."
        __erl_root="$("$__erl" -noshell -eval "$code")"
        ERTS_DIR="$__erl_root/erts-$ERTS_VSN"
        ROOTDIR="$__erl_root"
    fi
}

# Private. Open a shell on a remote node
_rem_sh() {
    # Generate a unique id used to allow multiple remsh to the same node
    # transparently
    id="remsh$(gen_id)-${NAME}"

    # Get the node's ticktime so that we use the same thing.
    TICKTIME="$(nodetool rpcterms net_kernel get_net_ticktime)"

    # Setup remote shell command to control node
    if [ ! -z "$USE_ERL_SHELL" ]; then
        exec "$BINDIR/erl" \
            -hidden \
            -boot start_clean -boot_var ERTS_LIB_DIR "$ERTS_LIB_DIR" \
            -kernel net_ticktime $TICKTIME \
            "$NAME_TYPE" "$id" -remsh "$NAME" -setcookie "$COOKIE"
    else
        __code_paths=$(_get_code_paths)
        exec "$BINDIR/erl" \
            -pa "$CONSOLIDATED_DIR" \
            ${__code_paths} \
            -hidden -noshell \
            -boot start_clean -boot_var ERTS_LIB_DIR "$ERTS_LIB_DIR" \
            -kernel net_ticktime $TICKTIME \
            -user Elixir.IEx.CLI "$NAME_TYPE" "$id" -setcookie "$COOKIE" \
            -extra --no-halt +iex -"$NAME_TYPE" "$id" --cookie "$COOKIE" --remsh "$NAME"
    fi
}

# Output a start command for the last argument of run_erl
_start_command() {
    printf "exec \"%s\" \"%s\" -- %s %s" "$RELEASE_ROOT_DIR/bin/$REL_NAME" \
           "$START_OPTION" "${ARGS}" "${EXTRA_OPTS}"
}

# If ERTS_VSN is not set, detect it
if [ -z "$ERTS_VSN" ]; then
    ERTS_VSN="$(_detect_erts_vsn)"
    echo "$ERTS_VSN $REL_VSN" > "$START_ERL_DATA"
fi

# Allow override of where to look for config files
# By default it's $CWD/
if [ -z "$RELEASE_CONFIG_DIR" ]; then
    RELEASE_CONFIG_DIR="$RELEASE_ROOT_DIR"
fi

# Set VMARGS_PATH, the path to the vm.args file to use
# Use $RELEASE_CONFIG_DIR/vm.args if exists, otherwise releases/VSN/vm.args
if [ -z "$VMARGS_PATH" ]; then
    if [ -f "$RELEASE_CONFIG_DIR/vm.args" ]; then
        VMARGS_PATH="$RELEASE_CONFIG_DIR/vm.args"
    else
        VMARGS_PATH="$REL_DIR/vm.args"
    fi
fi

orig_vmargs_path="$VMARGS_PATH.orig"
if [ $REPLACE_OS_VARS ]; then
    #Make sure we don't break dev mode by keeping the symbolic link to
    #the user's vm.args
    if [ ! -L "$orig_vmargs_path" ]; then
       #we're in copy mode, rename the vm.args file to vm.args.orig
       mv "$VMARGS_PATH" "$orig_vmargs_path"
    fi

    awk '{while(match($0,"[$]{[^}]*}")) {var=substr($0,RSTART+2,RLENGTH -3);gsub("[$]{"var"}",ENVIRON[var])}}1' < "$orig_vmargs_path" > "$VMARGS_PATH"
 else
    #We don't need to replace env. vars, just rename the
    #symlink vm.args.orig to vm.args, and keep it as a
    #symlink.
    if [ -L "$orig_vmargs_path" ]; then
       mv "$orig_vmargs_path" "$VMARGS_PATH"
    fi
fi

# Make sure log directory exists
mkdir -p "$RUNNER_LOG_DIR"

# Set SYS_CONFIG_PATH, the path to the sys.config file to use
# Use $RELEASE_CONFIG_DIR/sys.config if exists, otherwise releases/VSN/sys.config
if [ -z "$SYS_CONFIG_PATH" ]; then
    if [ -f "$RELEASE_CONFIG_DIR/sys.config" ]; then
        SYS_CONFIG_PATH="$RELEASE_CONFIG_DIR/sys.config"
    else
        SYS_CONFIG_PATH="$REL_DIR/sys.config"
    fi
fi

orig_sys_config_path="$SYS_CONFIG_PATH.orig"
if [ $REPLACE_OS_VARS ]; then
    #Make sure we don't break dev mode by keeping the symbolic link to
    #the user's sys.config
    if [ ! -L "$orig_sys_config_path" ]; then
       #We're in copy mode, rename sys.config to sys.config.orig
       mv "$SYS_CONFIG_PATH" "$orig_sys_config_path"
    fi

    awk '{while(match($0,"[$]{[^}]*}")) {var=substr($0,RSTART+2,RLENGTH -3);gsub("[$]{"var"}",ENVIRON[var])}}1' < "$orig_sys_config_path" > "$SYS_CONFIG_PATH"
 else
    #We don't need to replace env. vars, just rename the
    #symlink sys.config.orig to sys.config. Keep it as
    #a symlink.
    if [ -L "$orig_sys_config_path" ]; then
       mv "$orig_sys_config_path"  "$SYS_CONFIG_PATH"
    fi
fi

# Extract the target node name from node.args
# Should be `-sname somename` or `-name somename@somehost`
NAME_ARG=$(egrep '^-s?name' "$VMARGS_PATH" || true)
if [ -z "$NAME_ARG" ]; then
    echo "vm.args needs to have either -name or -sname parameter."
    exit 1
fi

# Extract the name type and name from the NAME_ARG for REMSH
# NAME_TYPE should be -name or -sname
NAME_TYPE="$(echo "$NAME_ARG" | awk '{print $1}')"
# NAME will be either `somename` or `somename@somehost`
NAME="$(echo "$NAME_ARG" | awk '{print $2}')"

# Where the pipe will be stored when using `start`
# This is used so you can attach the running application to the current
# shell using `attach`
PIPE_DIR="${PIPE_DIR:-$RELEASE_ROOT_DIR/tmp/erl_pipes/$NAME/}"

# Extract the target cookie
COOKIE_ARG="$(grep '^-setcookie' "$VMARGS_PATH" || true)"
DEFAULT_COOKIE_FILE="$HOME/.erlang.cookie"
if [ -z "$COOKIE_ARG" ]; then
    if [ -f "$DEFAULT_COOKIE_FILE" ]; then
        COOKIE="$(cat "$DEFAULT_COOKIE_FILE")"
    else
        printf "a secret cookie must be provided in one of the following ways:\n  - with vm.args using the -setcookie parameter,\n  or\n  by writing the cookie to '$DEFAULT_COOKIE_FILE', with permissions set to 0400"
        exit 1
    fi
else
    # Extract cookie name from COOKIE_ARG
    COOKIE="$(echo "$COOKIE_ARG" | awk '{print $2}')"
fi

_find_erts_dir
export ROOTDIR="$RELEASE_ROOT_DIR"
export BINDIR="$ERTS_DIR/bin"
export EMU="beam"
export PROGNAME="erl"
export LD_LIBRARY_PATH="$ERTS_DIR/lib:$LD_LIBRARY_PATH"
ERTS_LIB_DIR="$ERTS_DIR/../lib"
CONSOLIDATED_DIR="$ROOTDIR/lib/${REL_NAME}-${REL_VSN}/consolidated"

cd "$ROOTDIR"

# User can specify an sname without @hostname
# This will fail when creating remote shell
# So here we check for @ and add @hostname if missing
case $NAME in
    *@*)
        # Nothing to do
        ;;
    *)
        NAME=$NAME@$(gen_nodename)
        ;;
esac

# Check the first argument for instructions
case "$1" in
    start|start_boot)

        # Make sure there is not already a node running
        #RES=`$NODETOOL ping`
        #if [ "$RES" = "pong" ]; then
        #    echo "Node is already running!"
        #    exit 1
        #fi
        # Save this for later.
        CMD=$1
        case "$1" in
            start)
                shift
                START_OPTION="console"
                HEART_OPTION="start"
                ;;
            start_boot)
                shift
                START_OPTION="console_boot"
                HEART_OPTION="start_boot"
                ;;
        esac
        ARGS="$@"
        RUN_PARAM="$@"

        [ -f "$PRE_START_HOOK" ] && . "$PRE_START_HOOK"

        # Set arguments for the heart command
        set -- "$SCRIPT_DIR/$REL_NAME" "$HEART_OPTION"
        [ "$RUN_PARAM" ] && set -- "$@" "$RUN_PARAM"

        # Export the HEART_COMMAND
        HEART_COMMAND="$RELEASE_ROOT_DIR/bin/$REL_NAME $CMD"
        export HEART_COMMAND

        mkdir -p "$PIPE_DIR"

        "$BINDIR/run_erl" -daemon "$PIPE_DIR" "$RUNNER_LOG_DIR" \
                          "$(_start_command)"

        [ -f "$POST_START_HOOK" ] && . "$POST_START_HOOK"
        ;;

    stop)
        [ -f "$PRE_STOP_HOOK" ] && . "$PRE_STOP_HOOK"
        # Wait for the node to completely stop...
        PID="$(get_pid)"
        if ! nodetool "stop"; then
            exit 1
        fi
        while $(kill -s 0 "$PID" 2>/dev/null);
        do
            sleep 1
        done
        [ -f "$POST_STOP_HOOK" ] && . "$POST_STOP_HOOK"
        ;;

    restart)
        [ -f "$PRE_START_HOOK" ] && . "$PRE_START_HOOK"
        ## Restart the VM without exiting the process
        if ! nodetool "restart"; then
            exit 1
        fi
        ;;

    reboot)
        [ -f "$PRE_START_HOOK" ] && . "$PRE_START_HOOK"
        ## Restart the VM completely (uses heart to restart it)
        if ! nodetool "reboot"; then
            exit 1
        fi
        ;;

    pid)
        ## Get the VM's pid
        if ! get_pid; then
            exit 1
        fi
        ;;

    ping)
        ## See if the VM is alive
        if ! nodetool "ping"; then
            exit 1
        fi
        ;;

    escript)
        ## Run an escript under the node's environment
        if ! escript $@; then
            exit 1
        fi
        ;;

    attach)
        # Make sure a node IS running
        if ! nodetool "ping" > /dev/null; then
            echo "Node is not running!"
            exit 1
        fi

        shift
        exec "$BINDIR/to_erl" "$PIPE_DIR"
        ;;

    remote_console)
        # Make sure a node IS running
        if ! nodetool "ping" > /dev/null; then
            echo "Node is not running!"
            exit 1
        fi

        shift
        _rem_sh
        ;;

    upgrade|downgrade|install)
        if [ -z "$2" ]; then
            echo "Missing package argument"
            echo "Usage: $REL_NAME $1 {package base name}"
            echo "NOTE {package base name} MUST NOT include the .tar.gz suffix"
            exit 1
        fi

        # Make sure a node IS running
        if ! nodetool "ping" > /dev/null; then
            echo "Node is not running!"
            exit 1
        fi

        exec "$BINDIR/escript" "$ROOTDIR/bin/install_upgrade.escript" \
             "install" "$REL_NAME" "$NAME_TYPE" "$NAME" "$COOKIE" "$2"
        ;;

    unpack)
        if [ -z "$2" ]; then
            echo "Missing package argument"
            echo "Usage: $REL_NAME $1 {package base name}"
            echo "NOTE {package base name} MUST NOT include the .tar.gz suffix"
            exit 1
        fi

        # Make sure a node IS running
        if ! nodetool "ping" > /dev/null; then
            echo "Node is not running!"
            exit 1
        fi

        exec "$BINDIR/escript" "$ROOTDIR/bin/install_upgrade.escript" \
             "unpack" "$REL_NAME" "$NAME_TYPE" "$NAME" "$COOKIE" "$2"
        ;;

    console|console_clean|console_boot)
        # .boot file typically just $REL_NAME (ie, the app name)
        # however, for debugging, sometimes start_clean.boot is useful.
        # For e.g. 'setup', one may even want to name another boot script.
        case "$1" in
            console)
                if [ -f "$REL_DIR/$REL_NAME.boot" ]; then
                  BOOTFILE="$REL_DIR/$REL_NAME"
                else
                  BOOTFILE="$REL_DIR/start"
                fi
                ;;
            console_clean)
                BOOTFILE="$ROOTDIR/bin/start_clean"
                ;;
            console_boot)
                shift
                BOOTFILE="$1"
                shift
                ;;
        esac
        # Setup beam-required vars
        EMU="beam"
        PROGNAME="${0#*/}"

        export EMU
        export PROGNAME

        # Store passed arguments since they will be erased by `set`
        ARGS="$@"

        # Start the VM, executing pre_start hook along
        # the way. We can't run the post_start hook because
        # the console will crash with no TTY attached
        [ -f "$PRE_START_HOOK" ] && . "$PRE_START_HOOK"

        __code_paths=$(_get_code_paths)
        # Build an array of arguments to pass to exec later on
        # Build it here because this command will be used for logging.
        set -- "$BINDIR/erlexec" \
            -boot "$BOOTFILE" \
            -boot_var ERTS_LIB_DIR "$ERTS_LIB_DIR" \
            -env ERL_LIBS "$REL_LIB_DIR" \
            -pa "$CONSOLIDATED_DIR" \
            ${__code_paths} \
            -args_file "$VMARGS_PATH" \
            -config "$SYS_CONFIG_PATH" \
            -mode "$CODE_LOADING_MODE" \
            ${ERL_OPTS} \
            -user Elixir.IEx.CLI \
            -extra --no-halt +iex

        # Dump environment info for logging purposes
        if [ ! -z $VERBOSE ]; then
            echo "Exec: $@" -- ${1+$ARGS} ${EXTRA_OPTS}
            echo "Root: $ROOTDIR"

            # Log the startup
            echo "$RELEASE_ROOT_DIR"
        fi;

        logger -t "$REL_NAME[$$]" "Starting up"

        exec "$@" -- ${1+$ARGS} ${EXTRA_OPTS}
        ;;

    foreground)
        # start up the release in the foreground for use by runit
        # or other supervision services

        [ -f "$REL_DIR/$REL_NAME.boot" ] && BOOTFILE="$REL_NAME" || BOOTFILE=start
        FOREGROUNDOPTIONS="-noshell -noinput +Bd"

        # Setup beam-required vars
        EMU=beam
        PROGNAME="${0#*/}"

        export EMU
        export PROGNAME

        # Store passed arguments since they will be erased by `set`
        ARGS="$@"

        # Start the VM, executing pre and post start hooks
        [ -f "$PRE_START_HOOK" ] && . "$PRE_START_HOOK"

        # Build an array of arguments to pass to exec later on
        # Build it here because this command will be used for logging.
        set -- "$BINDIR/erlexec" $FOREGROUNDOPTIONS \
            -boot "$REL_DIR/$BOOTFILE" -mode "$CODE_LOADING_MODE" -config "$SYS_CONFIG_PATH" \
            -boot_var ERTS_LIB_DIR "$ERTS_LIB_DIR" \
            -args_file "$VMARGS_PATH" \
            -env ERL_LIBS "$REL_LIB_DIR" \
            -pa "$CONSOLIDATED_DIR" \
            ${ERL_OPTS} \
            -extra ${EXTRA_OPTS}

        # Dump environment info for logging purposes
        if [ ! -z $VERBOSE ]; then
            echo "Exec: $@" -- ${1+$ARGS}
            echo "Root: $ROOTDIR"
        fi;

        trap '{}' QUIT TERM KILL HUP USR1 USR2
        "$@" -- ${1+$ARGS} &
        __bg_pid=$!
        [ -f "$POST_START_HOOK" ] && . "$POST_START_HOOK"
        wait $__bg_pid
        ;;
    rpc)
        # Make sure a node IS running
        if ! nodetool "ping" > /dev/null; then
            echo "Node is not running!"
            exit 1
        fi

        shift

        nodetool rpc $@
        ;;
    rpcterms)
        # Make sure a node IS running
        if ! nodetool "ping" > /dev/null; then
            echo "Node is not running!"
            exit 1
        fi

        shift

        nodetool rpcterms $@
        ;;
    eval)
        # Make sure a node IS running
        if ! nodetool "ping" > /dev/null; then
            echo "Node is not running!"
            exit 1
        fi

        shift
        nodetool "eval" $@
        ;;
    command)
        # Execute as command-line utility
        #
        # Like the escript command, this does not start the OTP application.
        # If your command depends on a running OTP application,
        # use
        #
        #     {:ok, _} = Application.ensure_all_started(:your_app)

        shift
        MODULE="$1"; shift
        FUNCTION="$1"; shift

        # Save extra arguments
        ARGS="$@"

        # Build arguments for erlexec
        set -- "$ERL_OPTS"
        [ "$SYS_CONFIG_PATH" ] && set -- "$@" -config "$SYS_CONFIG_PATH"
        set -- "$@" -boot_var ERTS_LIB_DIR "$ERTS_LIB_DIR"
        set -- "$@" -noshell
        set -- "$@" -boot start_clean
        set -- "$@" -s "$MODULE" "$FUNCTION"

        $BINDIR/erlexec $@ -extra $ARGS
        exit "$?"
        ;;
    *)
        __command_path="$REL_DIR/commands/$1"
        if [ -f "$__command_path" ]; then
            . "$__command_path"
        else
            echo "Usage: $REL_NAME {start|start_boot <file>|foreground|stop|restart|reboot|pid|ping|console|console_clean|console_boot <file>|attach|remote_console|upgrade|downgrade|install|escript|rpc|rpcterms|eval|command <module> <function> <args>}"
            exit 1
        fi
        ;;
esac

exit 0


we can do it simpler

we can do it simpler

Top 5 liked Podcasts

    <%= for {[count, id, title], rank} <- Enum.with_index(@liked_podcasts) do %>

        <%= if rank == 0 || count != @liked_podcasts[rank-1][0]) do %>
          <%= rank + 1 %>.:
        <% else %>

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

    <% end %>

Top 5 liked Podcasts

    <%= for {[count, id, title], rank} <- Enum.with_index(@liked_podcasts),
             [last_count, _, _] <- [[0, nil, nil] | @liked_podcasts] do %>

        <%= if count != last_count do %>
          <%= rank + 1 %>.:
        <% else %>

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

    <% end %>


remove icons and edit text

remove icons and edit text

Free and confidential live chat with our parenting coaches

Chat online with us or request a call back when it's convenient for you.

      Speak to us

    We can give you information and advice on a variety of topics relating to children aged 0-19, including behaviour, healthy eating, sleeping, and child development.
    We can also help you with questions about finances, work, relationships, and how you’re feeling. You don’t necessarily have to have a question ready to ask, we’re just here to listen and support you. Speak to us as regularly as you like.

<%= get_flash(@conn, :error) %>

      <%= render "talk_to_us_tiles.html", assigns %>

<%= if @conn.assigns.version == "talk" do %>

Our staff

We have years of experience working with families and are here to support you

      <%= link to: page_path(@conn, :practitioners), class: "tc db w-50-ns center" do %>
        <button class="<%= red_button() %>">Meet our staff</button>
      <% end %>

<% end %>

Free and confidential live chat with our parenting coaches

Chat online with us or request a call back when it's convenient for you.

      Speak to us

We can talk to you about...

      <%=  render "icon.html", icon: "development", content: "Development", class: "bg-blue" %>
      <%=  render "icon.html", icon: "behaviour", content: "Behaviour", class: "bg-light-blue" %>
      <%=  render "icon.html", icon: "eating", content: "Eating", class: "bg-blue" %>
      <%=  render "icon.html", icon: "sleep", content: "Sleeping", class: "bg-light-blue" %>
      <%=  render "icon.html", icon: "toilet", content: "Toilet training", class: "bg-blue" %>
      <%=  render "icon.html", icon: "work", content: "Work", class: "bg-light-blue" %>
      <%=  render "icon.html", icon: "finances", content: "Finances", class: "bg-blue" %>
      <%=  render "icon.html", icon: "feelings", content: "How you feel", class: "bg-light-blue" %>

      And anything else you want to talk about! You don’t need to have a question, we’re here to listen and support you. Speak to us as regularly as you like and continue where you left off.

<%= get_flash(@conn, :error) %>

      <%= render "talk_to_us_tiles.html", assigns %>

<%= if @conn.assigns.version == "talk" do %>

Our staff

We have years of experience working with families and are here to support you

      <%= link to: page_path(@conn, :practitioners), class: "tc db w-50-ns center" do %>
        <button class="<%= red_button() %>">Meet our staff</button>
      <% end %>

<% end %>


Created new show page for settings

Created new show page for settings

      Settings

      <%= link "Edit", to: setting_path(@conn, :edit), class: "mdl-button mdl-js-button mdl-button--raised"  %>

        Name
        Value

      <%= for system_variable <- @system_variables do %>

            <%= system_variable.key %>

            <%= system_variable.value %>

      <% end %>

Show settings

      Name
      Value

    <%= for system_variable <- @system_variables do %>

        <%= system_variable.key %>
        <%= system_variable.value %>

    <% end %>

<%= link "Edit", to: setting_path(@conn, :edit) %>


Update form

Update form

<div class="offer <%= @css_class %>">
  <%= form_for @changeset, @action, fn f -> %>
    <%= text_input f, :title, id: "offer_title", class: class_with_error(f, :title, "title"), placeholder: "Title goes here (will be tweeted)" %>

      Today –

    <%= textarea f, :description, id: "offer_description", class: class_with_error(f, :text, "description"), placeholder: "Text should describe the offer itself. Remember, this text can potentially engage your candidates!" %>

          Your offer might be edited (typos, wording, etc.)

          You can use Markdown (formatting help).

          <%= submit "Send this!", class: "btn-primary" %>

          What you type
          What you get

        <%= for term <- ["[Link](https://github.com/)", "**bold**", "*italics*", "***highlight***", "`inline code`", "Indent with four spaces to render code blocks:\n\n    # This is rendered as a\n    # code block."] do %>

<%= raw term%>

            <%= sanitized_markdown(term) %>

        <% end %>

  <% end %>

<div class="offer <%= @css_class %>">
  <%= form_for @changeset, @action, fn f -> %>
    <%= text_input f, :title, id: "offer_title", class: class_with_error(f, :title, "offer-title"), placeholder: "Title goes here (will be tweeted)" %>

      Today –

    <%= textarea f, :description, id: "offer_description", class: class_with_error(f, :text, "offer-description"), placeholder: "Text should describe the offer itself. Remember, this text can potentially engage your candidates!" %>

          Your offer might be edited (typos, wording, etc.)

          You can use Markdown (formatting help).

          <%= submit "Send this!", class: "btn-primary" %>

          What you type
          What you get

        <%= for term <- ["[Link](https://github.com/)", "**bold**", "*italics*", "***highlight***", "`inline code`", "Indent with four spaces to render code blocks:\n\n    # This is rendered as a\n    # code block."] do %>

<%= raw term%>

            <%= sanitized_markdown(term) %>

        <% end %>

  <% end %>


homepage copy change

homepage copy change

Free and confidential live chat with parenting staff

Chat online with Jo or Gina or request a call back when it's convenient for you.

      Speak to us

We can talk to you about...

      <%=  render "icon.html", icon: "development", content: "Development", class: "bg-blue" %>
      <%=  render "icon.html", icon: "behaviour", content: "Behaviour", class: "bg-light-blue" %>
      <%=  render "icon.html", icon: "eating", content: "Eating", class: "bg-blue" %>
      <%=  render "icon.html", icon: "sleep", content: "Sleeping", class: "bg-light-blue" %>
      <%=  render "icon.html", icon: "toilet", content: "Toilet training", class: "bg-blue" %>
      <%=  render "icon.html", icon: "work", content: "Work", class: "bg-light-blue" %>
      <%=  render "icon.html", icon: "finances", content: "Finances", class: "bg-blue" %>
      <%=  render "icon.html", icon: "feelings", content: "How you feel", class: "bg-light-blue" %>

      And anything else you want to talk about! You don’t need to have a question, just come and get something off your chest. Speak to us as regularly as you like and continue where you left off.

<%= get_flash(@conn, :error) %>

      <%= render "talk_to_us_tiles.html", assigns %>

Our staff

We have years of experience working with families and are here to support you

    <%= link to: page_path(@conn, :practitioners), class: "tc db w-50-ns center" do %>
      <button class="<%= red_button() %>">Meet our staff</button>
    <% end %>

Free and confidential live chat with parenting staff

Chat online with Jo or Gina weekdays between 2-8pm or request a call back when it's convenient for you.

      Speak to us

We can talk to you about...

      <%=  render "icon.html", icon: "development", content: "Development", class: "bg-blue" %>
      <%=  render "icon.html", icon: "behaviour", content: "Behaviour", class: "bg-light-blue" %>
      <%=  render "icon.html", icon: "eating", content: "Eating", class: "bg-blue" %>
      <%=  render "icon.html", icon: "sleep", content: "Sleeping", class: "bg-light-blue" %>
      <%=  render "icon.html", icon: "toilet", content: "Toilet training", class: "bg-blue" %>
      <%=  render "icon.html", icon: "work", content: "Work", class: "bg-light-blue" %>
      <%=  render "icon.html", icon: "finances", content: "Finances", class: "bg-blue" %>
      <%=  render "icon.html", icon: "feelings", content: "How you feel", class: "bg-light-blue" %>

      And anything else you want to talk about! You don’t need to have a question, just come and get something off your chest. Speak to us as regularly as you like and continue where you left off.

<%= get_flash(@conn, :error) %>

      <%= render "talk_to_us_tiles.html", assigns %>

Our staff

We have years of experience working with families and are here to support you

    <%= link to: page_path(@conn, :practitioners), class: "tc db w-50-ns center" do %>
      <button class="<%= red_button() %>">Meet our staff</button>
    <% end %>


Fix view.

Fix view.

<%= form_for @changeset, registration_path(@conn, :create), fn form -> %>
<%= if form.errors != [] do %>

Error!

      <%= for {attr, message} <- form.errors do %>

<%= humanize(attr) %> <%= translate_error(message) %>

      <% end %>

<% end %>

      新規登録

どなたでも無料でご自由にご登録いただけます。

            <input class="validate" id="user_name" name="user[name]" type="text"  placeholder="ユーザID">
            ユーザーID

            <input class="vaildate" id="user_password" name="user[password]" type="password"  placeholder="パスワード">
            パスワード

      <%= submit "登録", class: "btn btn-primary", id: "step3" %>

          XEEシステムとは

            launch教師用マニュアルlaunch紹介スライド<a href="<%= page_path(@conn, :about) %>" class="waves-effect waves-light btn" style="margin-right:20px;">アバウトページ
Version 1.0.0 (2016/12/25)

          最新情報

XEE PROJECTの最新情報

<% end %>

<%= form_for @changeset, registration_path(@conn, :create), fn form -> %>
<%= if form.errors != [] do %>

Error!

      <%= for {attr, message} <- form.errors do %>

<%= humanize(attr) %> <%= translate_error(message) %>

      <% end %>

<% end %>

      新規登録

どなたでも無料でご自由にご登録いただけます。

            <input class="validate" id="user_name" name="user[name]" type="text"  placeholder="ユーザID">
            ユーザーID

            <input class="vaildate" id="user_password" name="user[password]" type="password"  placeholder="パスワード">
            パスワード

      <%= submit "登録", class: "btn btn-primary", id: "step3" %>

          XEEシステムとは

            launch教師用マニュアルlaunch紹介スライド<a href="<%= page_path(@conn, :about) %>" class="waves-effect waves-light btn" style="margin-left:20px;">アバウトページ
Version 1.0.0 (2016/12/25)

          最新情報

XEE PROJECTの最新情報

<% end %>


render feature description in version view

<%= link @version.release.name, to: release_path(@conn, :show, @version.release) %>

<%= @version.version %>

    Release date:
    <%= @version.release_date %>

Parameters:

    Key
    Value
    Group

  <%= for parameter <- @version.parameters do %>

        <%= parameter.key %>
        <%= parameter.value %>
        <%= parameter.group %>

          <%= link "Show", to: parameter_path(@conn, :show, parameter), class: "btn btn-default btn-xs" %>
          <%= link "Edit", to: parameter_path(@conn, :edit, parameter), class: "btn btn-default btn-xs" %>
          <%= link "Delete", to: parameter_path(@conn, :delete, parameter), method: :delete, data: [confirm: "Are you sure?"], class: "btn btn-danger btn-xs" %>

  <% end %>

<%= link "new Parameter", to: parameter_path(@conn, :new, version: @version.id) %>

Features:

  <%= for feature <- @version.features do %>

 <%= link feature.title, to: feature_path(@conn, :show, feature) %> - <%= feature.description %>

  <% end %>

<%= link "Edit", to: version_path(@conn, :edit, @version) %>
<%= link "Versions", to: version_path(@conn, :index) %>
<%= link "Change Notes", to: change_notes_path(@conn, :show, version: @version.id), class: "btn btn-success" %>

<%= link @version.release.name, to: release_path(@conn, :show, @version.release) %>

<%= @version.version %>

    Release date:
    <%= @version.release_date %>

Parameters:

    Key
    Value
    Group

  <%= for parameter <- @version.parameters do %>

        <%= parameter.key %>
        <%= parameter.value %>
        <%= parameter.group %>

          <%= link "Show", to: parameter_path(@conn, :show, parameter), class: "btn btn-default btn-xs" %>
          <%= link "Edit", to: parameter_path(@conn, :edit, parameter), class: "btn btn-default btn-xs" %>
          <%= link "Delete", to: parameter_path(@conn, :delete, parameter), method: :delete, data: [confirm: "Are you sure?"], class: "btn btn-danger btn-xs" %>

  <% end %>

<%= link "new Parameter", to: parameter_path(@conn, :new, version: @version.id) %>

Features:

  <%= for feature <- @version.features do %>

 <%= link feature.title, to: feature_path(@conn, :show, feature) %>

  <% end %>

<%= link "Edit", to: version_path(@conn, :edit, @version) %>
<%= link "Versions", to: version_path(@conn, :index) %>
<%= link "Change Notes", to: change_notes_path(@conn, :show, version: @version.id), class: "btn btn-success" %>