fix: remove font css file

fix: remove font css file

<!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, shrink-to-fit=no">

    <link rel="alternate" type="application/atom+xml" title="WWWTech / Articles" href="<%= article_url(@conn, :index) %>.atom">
    <link rel="alternate" type="application/atom+xml" title="WWWTech / Notes" href="<%= note_url(@conn, :index) %>.atom">
    <link rel="alternate" type="application/atom+xml" title="WWWTech / Pictures" href="<%= picture_url(@conn, :index) %>.atom">
    <link rel="alternate" type="application/atom+xml" title="WWWTech / What’s new? (Combined feed)" href="<%= page_url(@conn, :index) %>whatsnew.atom">

    <link rel="pgpkey" type="application/pgp-keys" href="/A99A9D73.asc">

    <link rel="apple-touch-icon" href="<%= static_path(@conn, "/images/christian-kruse.jpg") %>">
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">

    <link rel="author" href="<%= page_path(@conn, :index) %>humans.txt" type="text/plain">

    <link rel="webmention" href="<%= page_url(@conn, :index) %>webmentions">

    <meta name="description" content="<%= description(@conn, assigns) %>">
    <meta name="author" content="Christian Kruse">

    <title><%= page_title(@conn, assigns) %></title>

    <meta property="og:title" content="<%= page_title(@conn, assigns) %>">
    <meta property="og:type" content="website">
    <meta property="og:image" content="<%= static_path(@conn, "/images/christian-kruse.jpg") %>">

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

<%= link "WWWTech", to: page_url(@conn, :index) %>

Free/Libre Open Source Software and Publications by <%= link "Christian Kruse", to: page_path(@conn, :about) %>

        <%= 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 %>

<%= link "Home", to: page_path(@conn, :index) %>

<%= link "About Me", to: page_path(@conn, :about) %>

<%= link "Software", to: page_path(@conn, :software) %>

<%= link "Articles", to: article_path(@conn, :index) %>

<%= link "Notes", to: note_path(@conn, :index) %>

<%= link "Pictures", to: picture_path(@conn, :index) %>

<%= link "More", to: page_path(@conn, :more) %>

          <%= if logged_in?(@conn) do %>

<%= button "Logout", to: session_path(@conn, :delete), method: :delete %>

          <% end %>

<%= link "Legal Notice", to: page_path(@conn, :about), rel: "me" %>

<%= link "cjk@defunct.ch", to: "xmpp:cjk@defunct.ch", rel: "me" %> via Jabber

<%= link "cjk@defunct.ch", to: "mailto:cjk@defunct.ch", rel: "me" %> via Email

    <%= if Application.get_env(:wwwtech, :environment) == :dev do %>

    <% end %>

<!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, shrink-to-fit=no">

    <link rel="alternate" type="application/atom+xml" title="WWWTech / Articles" href="<%= article_url(@conn, :index) %>.atom">
    <link rel="alternate" type="application/atom+xml" title="WWWTech / Notes" href="<%= note_url(@conn, :index) %>.atom">
    <link rel="alternate" type="application/atom+xml" title="WWWTech / Pictures" href="<%= picture_url(@conn, :index) %>.atom">
    <link rel="alternate" type="application/atom+xml" title="WWWTech / What’s new? (Combined feed)" href="<%= page_url(@conn, :index) %>whatsnew.atom">

    <link rel="pgpkey" type="application/pgp-keys" href="/A99A9D73.asc">

    <link rel="apple-touch-icon" href="<%= static_path(@conn, "/images/christian-kruse.jpg") %>">
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">

    <link rel="author" href="<%= page_path(@conn, :index) %>humans.txt" type="text/plain">

    <link rel="webmention" href="<%= page_url(@conn, :index) %>webmentions">

    <meta name="description" content="<%= description(@conn, assigns) %>">
    <meta name="author" content="Christian Kruse">

    <title><%= page_title(@conn, assigns) %></title>

    <meta property="og:title" content="<%= page_title(@conn, assigns) %>">
    <meta property="og:type" content="website">
    <meta property="og:image" content="<%= static_path(@conn, "/images/christian-kruse.jpg") %>">

    <link rel="stylesheet" href="<%= static_path(@conn, "/css/app.css") %>">
    <link rel="stylesheet" href="<%= static_path(@conn, "/css/font.css") %>" media="none">

<%= link "WWWTech", to: page_url(@conn, :index) %>

Free/Libre Open Source Software and Publications by <%= link "Christian Kruse", to: page_path(@conn, :about) %>

        <%= 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 %>

<%= link "Home", to: page_path(@conn, :index) %>

<%= link "About Me", to: page_path(@conn, :about) %>

<%= link "Software", to: page_path(@conn, :software) %>

<%= link "Articles", to: article_path(@conn, :index) %>

<%= link "Notes", to: note_path(@conn, :index) %>

<%= link "Pictures", to: picture_path(@conn, :index) %>

<%= link "More", to: page_path(@conn, :more) %>

          <%= if logged_in?(@conn) do %>

<%= button "Logout", to: session_path(@conn, :delete), method: :delete %>

          <% end %>

<%= link "Legal Notice", to: page_path(@conn, :about), rel: "me" %>

<%= link "cjk@defunct.ch", to: "xmpp:cjk@defunct.ch", rel: "me" %> via Jabber

<%= link "cjk@defunct.ch", to: "mailto:cjk@defunct.ch", rel: "me" %> via Email

    <%= if Application.get_env(:wwwtech, :environment) == :dev do %>

    <% end %>


Text changes.

Text changes.

<%= render Vutuv.LayoutView, "flash.html", assigns %>

More than just a career network.

Vutuv is fast and free.
We will not flood your inbox with senseless e-mails.
Bonus: It's open-source.

    <%= form_for @changeset, user_path(@conn, :create), [multipart: true, class: "imagebox__form"], fn f -> %>
      <%= if @changeset.action do %>

<%= gettext "Oops, something went wrong! Please check the errors below." %>

      <% end %>

Get started now. It only takes 30 seconds.

      <%= text_input f, :first_name, class: "imagebox__input", placeholder: "Enter your first name", autofocus: true %>
      <%= error_tag f, :first_name %>
      <%= text_input f, :last_name, class: "imagebox__input", placeholder: "Enter your last name" %>
      <%= error_tag f, :last_name %>
      <%= inputs_for f, :emails, fn ef -> %>
        <%= text_input ef, :value, class: "imagebox__input", placeholder: "Enter your email address" %>
        <%= error_tag ef, :value %>
      <% end %>
      <%= submit gettext("Sign up"), class: "imagebox__input" %>
      <a href="<%= session_path(@conn, :new) %>" class="imagebox__alreadymember">Already a member? Sign in here.
    <% end %>

<%= render Vutuv.LayoutView, "flash.html", assigns %>

vutuv is more than just a career network:
Securely share whatever you want with whomever you want.

It's a little bit like LinkedIn but fast and free. And we will not flood your inbox with senseless e-mails. Bonus: It's open-source.

    <%= form_for @changeset, user_path(@conn, :create), [multipart: true, class: "imagebox__form"], fn f -> %>
      <%= if @changeset.action do %>

<%= gettext "Oops, something went wrong! Please check the errors below." %>

      <% end %>

Get started now. It only takes 30 seconds.

      <%= text_input f, :first_name, class: "imagebox__input", placeholder: "Enter your first name", autofocus: true %>
      <%= error_tag f, :first_name %>
      <%= text_input f, :last_name, class: "imagebox__input", placeholder: "Enter your last name" %>
      <%= error_tag f, :last_name %>
      <%= inputs_for f, :emails, fn ef -> %>
        <%= text_input ef, :value, class: "imagebox__input", placeholder: "Enter your email address" %>
        <%= error_tag ef, :value %>
      <% end %>
      <%= submit gettext("Sign up now"), class: "imagebox__input" %>
      <a href="<%= session_path(@conn, :new) %>" class="imagebox__alreadymember">Already a member? Sign in here.
    <% end %>


Update twitter handle

Update twitter handle

      <img src="<%= static_path(@conn, "/images/logo.png") %>" class="logo"/>

<a href="<%= offer_path(@conn, :index) %>">ElixirJobs

<%= gettext "Find your next Elixir job." %>

    <input type="checkbox" class="sidebar-checkbox" id="sidebar-checkbox">

      <a class="btn-publish" href="<%= offer_path(@conn, :new) %>"><%= gettext "Publish a job offer" %>

      <%= gettext "You can follow via" %>
      Twitter
      RSS

      <%= gettext "Running on Phoenix!" %>
      <%= gettext "Open Source" %>
      <%= gettext "About" %>


fix html

fix html

      <button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target=".bs-navbar-collapse">
        Toggle Navigation

      </button>
      <a style="font-size: 14px;" class="navbar-brand" rel="home" href="<%= entry_path(@conn, :index) %>">
        <%#= image_tag 'icons/sexmen.jpg',
           alt: Settings.site_name, title: "#{Settings.site_name}へようこそ",
           style: 'max-width:100px; margin-top: -10px;' %>

<a itemprop="url" href="<%= entry_path @conn, :index %>">

           <%= gettext "Recently XXX Videos" %>

        <% if mobile?(@conn) && false do %>

              <%= gettext "Videos" %>

              <%# Server.categories.each do |server| %>

<a itemprop="url" href="<%#= urlize(server.domain) %>">
                  <%#= server.title %>

              <%# end %>

        <% end %>

            <%= gettext "About Site" %>

<a itemprop="url" href="<%#= abouts_path %>">
               <%= gettext "About Site" %>

            <%#
Botについて
 %>

<a itemprop="url" href="<%#= Settings.accounts[:twitter][:url] %>" target="_blank">
                 <%= gettext "SNS Account" %>

<a itemprop="url" href="<%#= rss_path %>" target="_blank">
                 <%= gettext "RSS" %>

<a itemprop="url" href="<%#= contact_path %>">
                 <%= gettext "Contact" %>

  <% categories = String.split(gettext("some cate gor ies")) %>
  <% category_link = String.split(gettext("some cate gor links")) %>

  <%= if desktop?(@conn) do %>

      <%= for {dict, index} <- Enum.with_index(Enum.zip(categories, category_link)) do %>

          <a href="<%= entrytag_path @conn, :index, elem(dict, 1) %>" type="button"
            class="btn <%= if mobile?(@conn), do: "btn-xs" %> btn-<%= if @conn.params["tag"] == elem(dict, 0), do: "primary", else: "default" %>">
            <%= elem(dict, 0) %>

      <% end %>

  <% end %>

  <%= if mobile?(@conn) do %>
    <%= for {dict, index} <- Enum.with_index(Enum.zip(categories, category_link)) do %>
      <%= if rem(index, 6) == 0, do: raw "
" %>

          <a href="<%= entrytag_path @conn, :index, elem(dict, 1) %>" type="button"
            class="btn <%= if mobile?(@conn), do: "btn-xs" %> btn-<%= if @conn.params["tag"] == elem(dict, 0), do: "primary", else: "default" %>">
            <%= elem(dict, 0) %>

      <%= if rem(index + 1, 6) == 0, do: raw "
" %>
    <% end %>
  <% end %>

      <button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target=".bs-navbar-collapse">
        Toggle Navigation

      </button>
      <a style="font-size: 14px;" class="navbar-brand" rel="home" href="<%= entry_path(@conn, :index) %>">
        <%#= image_tag 'icons/sexmen.jpg',
           alt: Settings.site_name, title: "#{Settings.site_name}へようこそ",
           style: 'max-width:100px; margin-top: -10px;' %>

<a itemprop="url" href="<%= entry_path @conn, :index %>">

           <%= gettext "Recently XXX Videos" %>

        <% if mobile?(@conn) && false do %>

              <%= gettext "Videos" %>

              <%# Server.categories.each do |server| %>

<a itemprop="url" href="<%#= urlize(server.domain) %>">
                  <%#= server.title %>

              <%# end %>

        <% end %>

            <%= gettext "About Site" %>

<a itemprop="url" href="<%#= abouts_path %>">
               <%= gettext "About Site" %>

            <%#
Botについて
 %>

<a itemprop="url" href="<%#= Settings.accounts[:twitter][:url] %>" target="_blank">
                 <%= gettext "SNS Account" %>

<a itemprop="url" href="<%#= rss_path %>" target="_blank">
                 <%= gettext "RSS" %>

<a itemprop="url" href="<%#= contact_path %>">
                 <%= gettext "Contact" %>

  <% categories = String.split(gettext("some cate gor ies")) %>

  <%= if desktop?(@conn) do %>

      <%= for {title, index} <- Enum.with_index categories do %>

          <a href="<%= entrytag_path @conn, :index, title %>" type="button"
            class="btn <%= if mobile?(@conn), do: "btn-xs" %> btn-<%= if @conn.params["tag"] == title, do: "primary", else: "default" %>">
            <%= title %>

      <% end %>

  <% end %>

  <%= if mobile?(@conn) do %>
    <%= for {title, index} <- Enum.with_index categories do %>
      <%= if rem(index, 6) == 0, do: raw "
" %>

          <a href="<%= entrytag_path @conn, :index, title %>" type="button"
            class="btn <%= if mobile?(@conn), do: "btn-xs" %> btn-<%= if @conn.params["tag"] == title, do: "primary", else: "default" %>">
            <%= title %>

      <%= if rem(index + 1, 6) == 0, do: raw "
" %>
    <% end %>
  <% end %>


Add scopes heading. closes #206

Add scopes heading. closes #206

<% import ExAdmin.Gettext %>

    <%= ExAdmin.LayoutView.logo_mini %>

    <%= ExAdmin.LayoutView.logo_full %>

      Toggle navigation

        <%= if use_authentication?(@conn) do %>

              <%= current_user_name(@conn) %>

                <%= Phoenix.HTML.Link.link (gettext "Profile"), to: ExAdmin.Utils.admin_resource_path(current_user(@conn)) %>

                <%= Phoenix.HTML.Link.link (gettext "Logout"), to: session_path(@conn, :destroy), "data-method": "delete", "data-csrf": Plug.CSRFProtection.get_csrf_token, rel: "nofollow" %>

        <% end %>
        <%= if ExAdmin.Theme.AdminLte2.Layout.theme_selector? do %>

              Themes

              <%= ExAdmin.Theme.AdminLte2.Layout.theme_selector %>

        <% end %>

<%= gettext "RESOURCES" %>

      <%#
 Dashboard
 %>
      <%= if Application.get_env(:ex_admin, :nest_resources, false) do %>

           Resources

            <%= ExAdmin.Navigation.nav_view(@conn) %>

      <% else %>
        <%= ExAdmin.Navigation.nav_view(@conn) %>
      <% end %>

      <% actions = ExAdmin.get_title_actions(@conn) %>
      <%= if any_actions?(actions) do %>

<%= gettext "ACTIONS" %>

        <%= for {action, opts} <- actions do %>

            <% opts = build_menu_icon(opts) %>
            <%= build_link(action, opts) %>

        <% end %>
      <% end %>
      <%= if @scope_counts && Enum.count(@scope_counts) > 0 do %>

<%= gettext "SCOPES" %>

      <% end %>
      <%= build_scopes @conn, @scope_counts %>

<% import ExAdmin.Gettext %>

    <%= ExAdmin.LayoutView.logo_mini %>

    <%= ExAdmin.LayoutView.logo_full %>

      Toggle navigation

        <%= if use_authentication?(@conn) do %>

              <%= current_user_name(@conn) %>

                <%= Phoenix.HTML.Link.link (gettext "Profile"), to: ExAdmin.Utils.admin_resource_path(current_user(@conn)) %>

                <%= Phoenix.HTML.Link.link (gettext "Logout"), to: session_path(@conn, :destroy), "data-method": "delete", "data-csrf": Plug.CSRFProtection.get_csrf_token, rel: "nofollow" %>

        <% end %>
        <%= if ExAdmin.Theme.AdminLte2.Layout.theme_selector? do %>

              Themes

              <%= ExAdmin.Theme.AdminLte2.Layout.theme_selector %>

        <% end %>

<%= gettext "RESOURCES" %>

      <%#
 Dashboard
 %>
      <%= if Application.get_env(:ex_admin, :nest_resources, false) do %>

           Resources

            <%= ExAdmin.Navigation.nav_view(@conn) %>

      <% else %>
        <%= ExAdmin.Navigation.nav_view(@conn) %>
      <% end %>

      <% actions = ExAdmin.get_title_actions(@conn) %>
      <%= if any_actions?(actions) do %>

<%= gettext "ACTIONS" %>

        <%= for {action, opts} <- actions do %>

            <% opts = build_menu_icon(opts) %>
            <%= build_link(action, opts) %>

        <% end %>
      <% end %>
      <%= build_scopes @conn, @scope_counts %>


some login hints

some login hints

<%= form_for @changeset, session_path(@conn, :create), fn f -> %>

Login

Enter your email address

Recieve an authentication link

Open the link and be logged in

          <%= input f, :email %>
          <%= submit "Login", class: "btn btn-primary btn-block" %>

<% end %>

<%= form_for @changeset, session_path(@conn, :create), fn f -> %>

Login

          <%= input f, :email %>
          <%= submit "Login", class: "btn btn-primary btn-block" %>

<% end %>


Rename console

Rename console


minor maintanenance

minor maintanenance

<!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>Glasnost: <%= naive_translate("head title", @conn.assigns.lang)%></title>
  <link rel="stylesheet" href="<%= static_path(@conn, "/css/app.css") %>">
  <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.9/semantic.min.css"></link>

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

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

      <a href="/posts/<%=@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)%>

         <%= 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>Glasnost: <%= naive_translate("head title", @conn.assigns.lang)%></title>
  <link rel="stylesheet" href="<%= static_path(@conn, "/css/app.css") %>">
  <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.9/semantic.min.css"></link>

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

      <%=naive_translate("home", @conn.assigns.lang)%>
      <a href="/posts/<%=@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)%>

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

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

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


Fix sleep command not being found

Fix sleep command not being found

:: 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% "%release_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 exist "%rel_dir%\sys.config.bak" do (
  move /Y "%rel_dir%\sys.config.bak" "%rel_dir%\sys.config"
)
if exist "%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 (
  timeout /T 5 /nobreak > nul
  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 "usebackq delims=" %%i in (`%%get_pid_cmd%%`) do set pid=%%i
endlocal & set pid=%pid%
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% "%release_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 exist "%rel_dir%\sys.config.bak" do (
  move /Y "%rel_dir%\sys.config.bak" "%rel_dir%\sys.config"
)
if exist "%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 "usebackq delims=" %%i in (`%%get_pid_cmd%%`) do set pid=%%i
endlocal & set pid=%pid%
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


Make sure REL_DIR is set in time, in main shell script

#!/usr/bin/env bash

set -e

# Set DEBUG_BOOT to output verbose debugging info during execution
if [ ! -z "$DEBUG_BOOT" ]; then
    export PS4='+\D{%s} '
    set -x
fi

unset CDPATH

# Name of the release
REL_NAME="${REL_NAME:-<%= release_name %>}"
# Current version of the release
REL_VSN="${REL_VSN:-<%= release_version %>}"
# Options passed to erl
ERL_OPTS="${ERL_OPTS:-<%= release.profile.erl_opts %>}"
# Environment variables for run_erl
RUN_ERL_ENV="${RUN_ERL_ENV:-<%= release.profile.run_erl_env %>}"
# Current version of ERTS being used
# If this is not present/unset, it will be detected
<%= if ((is_binary(include_erts) or include_erts) and not is_nil(erts_vsn)) do %>ERTS_VSN="${ERTS_VSN:-<%= erts_vsn %>}"<% end %>
DISTILLERY_VSN="<%= Application.spec(:distillery, :vsn) %>"
export REL_NAME
export REL_VSN
export ERL_OPTS
export RUN_ERL_ENV
export ERTS_VSN
export DISTILLERY_VSN

# If readlink has no -f option, or greadlink is not available,
# This function behaves like `readlink -f`
__bootstrap_readlink_f() {
    __target_file="$1"
    cd "$(dirname "$__target_file")"
    __target_file=$(basename "$__target_file")

    # Iterate down a (possible) chain of symlinks
    while [ -L "$__target_file" ]
    do
        __target_file=$(readlink "$__target_file")
        cd "$(dirname "$__target_file")"
        __target_file=$(basename "$__target_file")
    done
    # Compute the canonicalized name by finding the physical path
    # for the directory we're in and appending the target file.
    __phys_dir=$(pwd -P)
    __result="$__phys_dir/$__target_file"
    echo "$__result"
}

# Locate the real path to this script
if uname | grep -q 'Darwin'; then
    # on OSX, best to install coreutils from homebrew or similar
    # to get greadlink
    if command -v greadlink >/dev/null 2>&1; then
        SCRIPT="${SCRIPT:-$(greadlink -f "$0")}"
    else
        SCRIPT="${SCRIPT:-$(__bootstrap_readlink_f "$0")}"
    fi
else
    SCRIPT="${SCRIPT:-$(readlink -f "$0" )}"
fi

export ESCRIPT_NAME
ESCRIPT_NAME="${ESCRIPT_NAME:-$SCRIPT}"

# Parent directory of this script
SCRIPT_DIR="$(dirname "${SCRIPT}")"
# Root directory of all releases
RELEASE_ROOT_DIR="${RELEASE_ROOT_DIR:-$(dirname "$(dirname "${SCRIPT_DIR}")")}"
# Directory containing the current version of this release
REL_DIR="${REL_DIR:-$RELEASE_ROOT_DIR/releases/$REL_VSN}"
# The location of builtin command scripts
RELEASE_LIBEXEC_DIR="$SCRIPT_DIR/libexec"

# shellcheck source=../libexec/readlink.sh
. "$RELEASE_LIBEXEC_DIR/readlink.sh"
# shellcheck source=../libexec/logger.sh
. "$RELEASE_LIBEXEC_DIR/logger.sh"
# shellcheck source=../libexec/erts.sh
. "$RELEASE_LIBEXEC_DIR/erts.sh"
# shellcheck source=../libexec/helpers.sh
. "$RELEASE_LIBEXEC_DIR/helpers.sh"
# shellcheck source=../libexec/env.sh
. "$RELEASE_LIBEXEC_DIR/env.sh"
# shellcheck source=../libexec/config.sh
. "$RELEASE_LIBEXEC_DIR/config.sh"

# Make the release root our working directory
cd "$RELEASE_ROOT_DIR"

# We export this so that custom tasks in Elixir
# which need to know how they were invoked can
# check this environment variable.
export DISTILLERY_TASK="$1"

# All commands are loaded from the currently active release
COMMAND_DIR="$RELEASE_LIBEXEC_DIR/commands"
COMMAND_NAME="${1:-help}"
COMMAND_PATH="$COMMAND_DIR/$COMMAND_NAME.sh"

# Only shift if there is more than 0 args, or it will exit non-zero
if [ "$#" -ne 0 ]; then
   shift
fi

# Handle aliases
case $COMMAND_NAME in
    start|start_boot)
        configure_release
        . "$COMMAND_DIR/start.sh" "$COMMAND_NAME" "$@"
        ;;
    upgrade|downgrade|install)
        configure_release
        . "$COMMAND_DIR/install.sh" "$COMMAND_NAME" "$@"
        ;;
    console|console_clean|console_boot)
        configure_release
        . "$COMMAND_DIR/console.sh" "$COMMAND_NAME" "$@"
        ;;
    *)
        # If the command exists in libexec, execute
        # Otherwise check to see if it's the name of a custom command
        if [ -f "$COMMAND_PATH" ]; then
            configure_release
            . "$COMMAND_PATH" "$@"
        else
            COMMAND_PATH="$REL_DIR/commands/$COMMAND_NAME.sh"
            if [ -f "$COMMAND_PATH" ]; then
                configure_release
                require_cookie
                . "$COMMAND_PATH" "$@"
            else
                notice "'$COMMAND_NAME' is not a valid command"
                . "$COMMAND_DIR/help.sh"
            fi
        fi
        ;;
esac

#!/usr/bin/env bash

set -e

# Set DEBUG_BOOT to output verbose debugging info during execution
if [ ! -z "$DEBUG_BOOT" ]; then
    export PS4='+\D{%s} '
    set -x
fi

unset CDPATH

# Name of the release
REL_NAME="${REL_NAME:-<%= release_name %>}"
# Current version of the release
REL_VSN="${REL_VSN:-<%= release_version %>}"
# Options passed to erl
ERL_OPTS="${ERL_OPTS:-<%= release.profile.erl_opts %>}"
# Environment variables for run_erl
RUN_ERL_ENV="${RUN_ERL_ENV:-<%= release.profile.run_erl_env %>}"
# Current version of ERTS being used
# If this is not present/unset, it will be detected
<%= if ((is_binary(include_erts) or include_erts) and not is_nil(erts_vsn)) do %>ERTS_VSN="${ERTS_VSN:-<%= erts_vsn %>}"<% end %>
DISTILLERY_VSN="<%= Application.spec(:distillery, :vsn) %>"
export REL_NAME
export REL_VSN
export ERL_OPTS
export RUN_ERL_ENV
export ERTS_VSN
export DISTILLERY_VSN

# If readlink has no -f option, or greadlink is not available,
# This function behaves like `readlink -f`
__bootstrap_readlink_f() {
    __target_file="$1"
    cd "$(dirname "$__target_file")"
    __target_file=$(basename "$__target_file")

    # Iterate down a (possible) chain of symlinks
    while [ -L "$__target_file" ]
    do
        __target_file=$(readlink "$__target_file")
        cd "$(dirname "$__target_file")"
        __target_file=$(basename "$__target_file")
    done
    # Compute the canonicalized name by finding the physical path
    # for the directory we're in and appending the target file.
    __phys_dir=$(pwd -P)
    __result="$__phys_dir/$__target_file"
    echo "$__result"
}

# Locate the real path to this script
if uname | grep -q 'Darwin'; then
    # on OSX, best to install coreutils from homebrew or similar
    # to get greadlink
    if command -v greadlink >/dev/null 2>&1; then
        SCRIPT="${SCRIPT:-$(greadlink -f "$0")}"
    else
        SCRIPT="${SCRIPT:-$(__bootstrap_readlink_f "$0")}"
    fi
else
    SCRIPT="${SCRIPT:-$(readlink -f "$0" )}"
fi

export ESCRIPT_NAME
ESCRIPT_NAME="${ESCRIPT_NAME:-$SCRIPT}"

# Parent directory of this script
SCRIPT_DIR="$(dirname "${SCRIPT}")"
# Root directory of all releases
RELEASE_ROOT_DIR="${RELEASE_ROOT_DIR:-$(dirname "$(dirname "${SCRIPT_DIR}")")}"
# The location of builtin command scripts
RELEASE_LIBEXEC_DIR="$SCRIPT_DIR/libexec"

# shellcheck source=../libexec/readlink.sh
. "$RELEASE_LIBEXEC_DIR/readlink.sh"
# shellcheck source=../libexec/logger.sh
. "$RELEASE_LIBEXEC_DIR/logger.sh"
# shellcheck source=../libexec/erts.sh
. "$RELEASE_LIBEXEC_DIR/erts.sh"
# shellcheck source=../libexec/helpers.sh
. "$RELEASE_LIBEXEC_DIR/helpers.sh"
# shellcheck source=../libexec/env.sh
. "$RELEASE_LIBEXEC_DIR/env.sh"
# shellcheck source=../libexec/config.sh
. "$RELEASE_LIBEXEC_DIR/config.sh"

# Make the release root our working directory
cd "$RELEASE_ROOT_DIR"

# We export this so that custom tasks in Elixir
# which need to know how they were invoked can
# check this environment variable.
export DISTILLERY_TASK="$1"

# All commands are loaded from the currently active release
COMMAND_DIR="$RELEASE_LIBEXEC_DIR/commands"
COMMAND_NAME="${1:-help}"
COMMAND_PATH="$COMMAND_DIR/$COMMAND_NAME.sh"

# Only shift if there is more than 0 args, or it will exit non-zero
if [ "$#" -ne 0 ]; then
   shift
fi

# Handle aliases
case $COMMAND_NAME in
    start|start_boot)
        configure_release
        . "$COMMAND_DIR/start.sh" "$COMMAND_NAME" "$@"
        ;;
    upgrade|downgrade|install)
        configure_release
        . "$COMMAND_DIR/install.sh" "$COMMAND_NAME" "$@"
        ;;
    console|console_clean|console_boot)
        configure_release
        . "$COMMAND_DIR/console.sh" "$COMMAND_NAME" "$@"
        ;;
    *)
        # If the command exists in libexec, execute
        # Otherwise check to see if it's the name of a custom command
        if [ -f "$COMMAND_PATH" ]; then
            configure_release
            . "$COMMAND_PATH" "$@"
        else
            COMMAND_PATH="$REL_DIR/commands/$COMMAND_NAME.sh"
            if [ -f "$COMMAND_PATH" ]; then
                configure_release
                require_cookie
                . "$COMMAND_PATH" "$@"
            else
                notice "'$COMMAND_NAME' is not a valid command"
                . "$COMMAND_DIR/help.sh"
            fi
        fi
        ;;
esac


Adding Materialize.css instead of Bootstrap.


Fix user selection page.

Fix user selection page.

User Selection

        <%= for user <- @users do %>

            <a href='<%= food_selection_path(@conn, :index, login: login_token(user) ) %>'> <%= user.name %>, id: <%= user.id %>

        <% end %>

Add New User

      <%= form_for @changeset, user_selection_path(@conn, :create), fn f -> %>

          Name: <%= text_input f, :name %>

          Email: <%= text_input f, :email %>

          Family members (default to 1): <%= number_input f, :family_members %>

          Password: <%= password_input f, :password %>

          Password confirmation: <%= password_input f, :password_confirmation %>

        <%= submit "Submit", [class: "btn-primary"]%>
      <% end %>

User Selection

        <%= for user <- @users do %>

            <a href='<%= food_selection_path(@conn, :index, "en", login: login_token(user) ) %>'> <%= user.name %>, id: <%= user.id %>

        <% end %>

Add New User

      <%= form_for @changeset, user_selection_path(@conn, :create), fn f -> %>

          Name: <%= text_input f, :name %>

          Email: <%= text_input f, :email %>

          Family members (default to 1): <%= number_input f, :family_members %>

          Password: <%= password_input f, :password %>

          Password confirmation: <%= password_input f, :password_confirmation %>

        <%= submit "Submit", [class: "btn-primary"]%>
      <% end %>


also like, also listen

also like, also listen

Subscriptions

          <%= for podcast <- @user.podcasts_i_subscribed do %>
            <%= link [fa_icon("podcast"), " ", podcast.title],
                     to: podcast_frontend_path(@conn, :show, podcast),
                     class: "btn btn-default btn-xs",
                     style: "color: #666;" %>
          <% end %>

        <%= link [fa_icon("heart"), " Like all subscribed"],
                 to: user_frontend_path(@conn, :like_all_subscribed),
                 class: "btn btn-primary",
                 method: :post %>

        <%= link [fa_icon("heart"), " Follow all subscribed"],
                 to: user_frontend_path(@conn, :follow_all_subscribed),
                 class: "btn btn-info",
                 method: :post %>

Podcasts I like

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

Podcasts I follow

          <%= for podcast <- @user.podcasts_i_follow do %>
            <%= link [fa_icon("podcast"), " ", podcast.title],
                     to: podcast_frontend_path(@conn, :show, podcast),
                     class: "btn btn-default btn-xs",
                     style: "color: #666;" %>
          <% end %>

Listeners of the podcasts you listen to, also listen to

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

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

        <% end %>

Users, who like the same podcasts as you, also like

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

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

        <% end %>

Subscriptions

          <%= for podcast <- @user.podcasts_i_subscribed do %>
            <%= link [fa_icon("podcast"), " ", podcast.title],
                     to: podcast_frontend_path(@conn, :show, podcast),
                     class: "btn btn-default btn-xs",
                     style: "color: #666;" %>
          <% end %>

        <%= link [fa_icon("heart"), " Like all subscribed"],
                 to: user_frontend_path(@conn, :like_all_subscribed),
                 class: "btn btn-primary",
                 method: :post %>

        <%= link [fa_icon("heart"), " Follow all subscribed"],
                 to: user_frontend_path(@conn, :follow_all_subscribed),
                 class: "btn btn-info",
                 method: :post %>

Podcasts I like

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

Podcasts I follow

          <%= for podcast <- @user.podcasts_i_follow do %>
            <%= link [fa_icon("podcast"), " ", podcast.title],
                     to: podcast_frontend_path(@conn, :show, podcast),
                     class: "btn btn-default btn-xs",
                     style: "color: #666;" %>
          <% end %>

Recommendations

Listeners of the podcasts you listen to, also listen to:

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

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

        <% end %>

Recommendations

Users, who like the same podcasts as you, also like:

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

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

        <% end %>


allow for external tour start

allow for external tour start

    <%= render "_category_tree.html", categories: @categories, conn: @conn %>

    <%= render "_search.html", conn: @conn  %>

    <%= render "_latest_recommendations.html", conn: @conn  %>

    <%= render "_latest_episodes.html", conn: @conn  %>

    <%= render "_popular.html", popular_podcasts: @popular_podcasts, conn: @conn  %>

    <%= render "_latest_podcasts.html", conn: @conn  %>

<%= unless @current_user do %>

<% end %>


Ensure CONSOLIDATED_DIR is set on Windows

# Set DEBUG_BOOT to output verbose debugging info during execution
if ($Env:DEBUG_BOOT -ne $null) {
    set-psdebug -Trace 1
}

# Given a string, ensures the string is quoted
function Ensure-Quoted {
    param($String = $(throw "You must provide -String to EnsureQuoted"))

    if ($String -match "^`".*`"$") {
        # Already quoted
        $String
    } else {
        # Escape quotes, except when already escaped
        $escaped = $String -replace '(?<![\\])"','\"'
        # Then quote the entire argument
        "`"{0}`"" -f $escaped
    }
}

# Given a string representing arguments for an executable
# Convert that string into an argument vector similar to how bash would
function String-To-Argv {
    param($String = $(throw "You must provide -String to String-To-Argv"))

    $quote = $false
    $last = $null
    $String -split {
        $q = get-variable -Name "quote" -Scope 1 | select -Expand "Value"
        $l = get-variable -Name "last" -Scope 1 | select -Expand "Value"
        $split = $false
        switch ($_) {
            "`"" {
                if ($q -and ($l -ne "\")) {
                    $q = false
                    set-variable -Name "quote" -Value $false -Scope 1
                }
                if (-not $q) {
                    $q = true
                    set-variable -Name "quote" -Value $true -Scope 1
                }
            }
            " " {
                if (-not $q) {
                    $split = $true
                }
            }
        }
        set-variable -Name "last" -Value $_ -Scope 1
        $split
    }
}

$rel_name = "<%= release_name %>"
$rel_vsn = "<%= release_version %>"
$script_dir = split-path -parent $PSCommandPath
$rel_dir = $script_dir
$releases_dir = split-path -parent $rel_dir
$release_root_dir = split-path -parent $releases_dir

# Name of the release
$Env:REL_NAME = $rel_name
# Current version of the release
$Env:REL_VSN = $rel_vsn
# Options passed to erl
$Env:ERL_OPTS = "<%= release.profile.erl_opts %>"
# Current version of ERTS being used
# If this is not present/unset, it will be detected
<%= if ((is_binary(include_erts) or include_erts) and not is_nil(erts_vsn)) do %>$Env:ERTS_VSN = "<%= erts_vsn %>"<% end %>
$Env:DISTILLERY_VSN = "<%= Application.spec(:distillery, :vsn) %>"
$Env:ESCRIPT_NAME = $PSCommandPath
# Parent directory of this script
$Env:SCRIPT_DIR = $script_dir
# Root directory of all releases
$Env:RELEASE_ROOT_DIR = $release_root_dir
# Directory containing the current version of this release
$Env:REL_DIR = $rel_dir
# The lib directory for this release
$Env:REL_LIB_DIR = (join-path $release_root_dir "lib")
# The location of consolidated protocols
$Env:CONSOLIDATED_DIR = (join-path $release_root_dir (join-path ("{0}-{1}" -f $rel_name,$rel_vsn) "consolidated"))
# The location of generated files and other mutable state
if ($Env:RELEASE_MUTABLE_DIR -eq $null) {
    $Env:RELEASE_MUTABLE_DIR = (join-path $release_root_dir "var")
}
# 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
$Env:RUNNER_LOG_DIR = (join-path $Env:RELEASE_MUTABLE_DIR "log")
# Path to start_erl.data
$Env:START_ERL_DATA = (join-path $release_root_dir "releases" "start_erl.data")
# Directory containing lifecycle hook scripts
$Env:HOOKS_DIR = (join-path $Env:REL_DIR "hooks")
# Allow override of where to read configuration from
# By default it's RELEASE_ROOT_DIR
if ($Env:RELEASE_CONFIG_DIR -eq $null) {
    $Env:RELEASE_CONFIG_DIR = $Env:RELEASE_ROOT_DIR
}

# Make sure important directories exist
if (($Env:RELEASE_READ_ONLY -eq $null) -and (-not (test-path $Env:RELEASE_MUTABLE_DIR -PathType Container))) {
    new-item $Env:RELEASE_MUTABLE_DIR -ItemType Directory -ErrorAction SilentlyContinue
    $warning_msg = "Files in this directory are regenerated frequently, edits will be lost"
    out-file -FilePath (join-path $Env:RELEASE_MUTABLE_DIR "WARNING_README") -InputObject $warning_msg
}
if (($Env:RELEASE_READ_ONLY -eq $null) -and (-not (test-path $Env:RUNNER_LOG_DIR -PathType Container))) {
    new-item $Env:RUNNER_LOG_DIR -ItemType Directory -ErrorAction SilentlyContinue
}

# The location of builtin command scripts
$libexec_dir = (join-path $script_dir libexec win)

. (join-path $libexec_dir "logger.ps1")
. (join-path $libexec_dir "erts.ps1")
. (join-path $libexec_dir "helpers.ps1")
. (join-path $libexec_dir "config.ps1")

# Make the release root our working directory
cd $release_root_dir

$command_name = $null
if ($args.Length -gt 0) {
    $command_name = $args[0]
    if ($args.Length -gt 1) {
        $args = $args[1..($args.Length-1)]
    }
}

# We export this so that custom tasks in Elixir
# which need to know how they were invoked can
# check this environment variable.
$Env:DISTILLERY_TASK = $command_name

# All commands are loaded from the currently active release
$command_dir = join-path $script_dir libexec commands win
$user_command_dir = join-path $script_dir commands win
if ($command_name -eq $null) {
    $command_name = "help"
}
$command_path = (join-path $command_dir ("{0}.ps1" -f $command_name))
$user_command_path = (join-path $user_command_dir ("{0}.ps1" -f $command_name))

# Handle aliases
switch ($command_name) {
    # upgrade/downgrade are aliases for install
    "upgrade"   { . (join-path $command_dir "install.ps1") }
    "downgrade" { . (join-path $command_dir "install.ps1") }
    # All other commands are built dynamically
    default {
        if (test-path $command_path -PathType Leaf) {
            configure-release
            . $command_path @args
        } elseif (test-path $user_command_path -PathType Leaf) {
            require-cookie
            . $user_command_path @args
        } else {
            log-warning ("The command '{0}' was not found" -f $command_name)
            . (join-path $command_dir "help.ps1") @args
        }
    }
}

# Set DEBUG_BOOT to output verbose debugging info during execution
if ($Env:DEBUG_BOOT -ne $null) {
    set-psdebug -Trace 1
}

# Given a string, ensures the string is quoted
function Ensure-Quoted {
    param($String = $(throw "You must provide -String to EnsureQuoted"))

    if ($String -match "^`".*`"$") {
        # Already quoted
        $String
    } else {
        # Escape quotes, except when already escaped
        $escaped = $String -replace '(?<![\\])"','\"'
        # Then quote the entire argument
        "`"{0}`"" -f $escaped
    }
}

# Given a string representing arguments for an executable
# Convert that string into an argument vector similar to how bash would
function String-To-Argv {
    param($String = $(throw "You must provide -String to String-To-Argv"))

    $quote = $false
    $last = $null
    $String -split {
        $q = get-variable -Name "quote" -Scope 1 | select -Expand "Value"
        $l = get-variable -Name "last" -Scope 1 | select -Expand "Value"
        $split = $false
        switch ($_) {
            "`"" {
                if ($q -and ($l -ne "\")) {
                    $q = false
                    set-variable -Name "quote" -Value $false -Scope 1
                }
                if (-not $q) {
                    $q = true
                    set-variable -Name "quote" -Value $true -Scope 1
                }
            }
            " " {
                if (-not $q) {
                    $split = $true
                }
            }
        }
        set-variable -Name "last" -Value $_ -Scope 1
        $split
    }
}

$rel_name = "<%= release_name %>"
$rel_vsn = "<%= release_version %>"
$script_dir = split-path -parent $PSCommandPath
$rel_dir = $script_dir
$releases_dir = split-path -parent $rel_dir
$release_root_dir = split-path -parent $releases_dir

# Name of the release
$Env:REL_NAME = $rel_name
# Current version of the release
$Env:REL_VSN = $rel_vsn
# Options passed to erl
$Env:ERL_OPTS = "<%= release.profile.erl_opts %>"
# Current version of ERTS being used
# If this is not present/unset, it will be detected
<%= if ((is_binary(include_erts) or include_erts) and not is_nil(erts_vsn)) do %>$Env:ERTS_VSN = "<%= erts_vsn %>"<% end %>
$Env:DISTILLERY_VSN = "<%= Application.spec(:distillery, :vsn) %>"
$Env:ESCRIPT_NAME = $PSCommandPath
# Parent directory of this script
$Env:SCRIPT_DIR = $script_dir
# Root directory of all releases
$Env:RELEASE_ROOT_DIR = $release_root_dir
# Directory containing the current version of this release
$Env:REL_DIR = $rel_dir
# The lib directory for this release
$Env:REL_LIB_DIR = (join-path $release_root_dir "lib")
# The location of generated files and other mutable state
if ($Env:RELEASE_MUTABLE_DIR -eq $null) {
    $Env:RELEASE_MUTABLE_DIR = (join-path $release_root_dir "var")
}
# 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
$Env:RUNNER_LOG_DIR = (join-path $Env:RELEASE_MUTABLE_DIR "log")
# Path to start_erl.data
$Env:START_ERL_DATA = (join-path $release_root_dir "releases" "start_erl.data")
# Directory containing lifecycle hook scripts
$Env:HOOKS_DIR = (join-path $Env:REL_DIR "hooks")
# Allow override of where to read configuration from
# By default it's RELEASE_ROOT_DIR
if ($Env:RELEASE_CONFIG_DIR -eq $null) {
    $Env:RELEASE_CONFIG_DIR = $Env:RELEASE_ROOT_DIR
}

# Make sure important directories exist
if (($Env:RELEASE_READ_ONLY -eq $null) -and (-not (test-path $Env:RELEASE_MUTABLE_DIR -PathType Container))) {
    new-item $Env:RELEASE_MUTABLE_DIR -ItemType Directory -ErrorAction SilentlyContinue
    $warning_msg = "Files in this directory are regenerated frequently, edits will be lost"
    out-file -FilePath (join-path $Env:RELEASE_MUTABLE_DIR "WARNING_README") -InputObject $warning_msg
}
if (($Env:RELEASE_READ_ONLY -eq $null) -and (-not (test-path $Env:RUNNER_LOG_DIR -PathType Container))) {
    new-item $Env:RUNNER_LOG_DIR -ItemType Directory -ErrorAction SilentlyContinue
}

# The location of builtin command scripts
$libexec_dir = (join-path $script_dir libexec win)

. (join-path $libexec_dir "logger.ps1")
. (join-path $libexec_dir "erts.ps1")
. (join-path $libexec_dir "helpers.ps1")
. (join-path $libexec_dir "config.ps1")

# Make the release root our working directory
cd $release_root_dir

$command_name = $null
if ($args.Length -gt 0) {
    $command_name = $args[0]
    if ($args.Length -gt 1) {
        $args = $args[1..($args.Length-1)]
    }
}

# We export this so that custom tasks in Elixir
# which need to know how they were invoked can
# check this environment variable.
$Env:DISTILLERY_TASK = $command_name

# All commands are loaded from the currently active release
$command_dir = join-path $script_dir libexec commands win
$user_command_dir = join-path $script_dir commands win
if ($command_name -eq $null) {
    $command_name = "help"
}
$command_path = (join-path $command_dir ("{0}.ps1" -f $command_name))
$user_command_path = (join-path $user_command_dir ("{0}.ps1" -f $command_name))

# Handle aliases
switch ($command_name) {
    # upgrade/downgrade are aliases for install
    "upgrade"   { . (join-path $command_dir "install.ps1") }
    "downgrade" { . (join-path $command_dir "install.ps1") }
    # All other commands are built dynamically
    default {
        if (test-path $command_path -PathType Leaf) {
            configure-release
            . $command_path @args
        } elseif (test-path $user_command_path -PathType Leaf) {
            require-cookie
            . $user_command_path @args
        } else {
            log-warning ("The command '{0}' was not found" -f $command_name)
            . (join-path $command_dir "help.ps1") @args
        }
    }
}


Fix pagination in admin side

Fix pagination in admin side

      <%= if @page_number > 1 do %>
        <%= link(gettext("Previous page"),
          to: admin_offer_path(@conn, @method, page: @page_number - 1),
          class: "pagination-link") %>
      <% else %>
        <%= gettext("Previous page") %>
      <% end %>

      <%= if @page_number < @total_pages do %>
        <%= link(gettext("Next page"),
          to: admin_offer_path(@conn, @method, page: @page_number + 1),
          class: "pagination-link") %>
      <% else %>
        <%= gettext("Next page") %>
      <% end %>

  <%= if @page_number > 1 do %>
    <%= link(gettext("Previous"),
      to: admin_offer_path(@conn, @method, page: @page_number - 1),
      class: "item item-older") %>
  <% else %>
    <%= gettext("Previous") %>
  <% end %>
  <%= if @page_number < @total_pages do %>
    <%= link(gettext("Next"),
      to: admin_offer_path(@conn, @method, page: @page_number + 1),
      class: "item item-newer") %>
  <% else %>
    <%= gettext("Next") %>
  <% end %>


Add `defer` to default blueprint script (#3656)

<!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.0"/>
    <title><%= app_module %> · Phoenix Framework</title>
    <link rel="stylesheet" href="<%%= Routes.static_path(@conn, "/css/app.css") %>"/>
    <%%= csrf_meta_tag() %>

Get Started

          <img src="<%%= Routes.static_path(@conn, "/images/phoenix.png") %>" alt="Phoenix Framework Logo"/>

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

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

      <%%= @inner_content %>


increase tag text size for better accessibility

  <%= for post <- @posts do %>
  <% img_src = hd(post.json_metadata["image"]) %>

        <img src="<%= img_src %>">

        <a class="header" href="/post/<%= post.permlink %>"> <%= post.title %>

            <%= for tag <- post.tags do %>
              <a class="ui  label" href="/tag/<%=tag%>">
                <%= format_tag(tag, @conn.assigns.lang) %>

            <% end %>

  <% end %>

  <%= for post <- @posts do %>
  <% img_src = hd(post.json_metadata["image"]) %>
    <div class="ui card" href="/post/<%= post.permlink %>">

        <img src="<%= img_src %>">

         <%= post.title %>

            <%= for tag <- post.tags do %>
              <a class="ui small label" href="/tag/<%=tag%>">
                <%= format_tag(tag, @conn.assigns.lang) %>

            <% end %>

  <% end %>


Display members on the Company show view

Show company

    Name:
    <%= @company.name %>

    Join date:
    <%= @company.join_date %>

    Departure date:
    <%= @company.departure_date %>

    <%= for member <- @company.members do %>

<%= link member.name, to: company_member_path(@conn, :show, @company, member) %>

    <% end %>

<%= link "Edit", to: company_path(@conn, :edit, @company) %>
<%= link "Back", to: company_path(@conn, :index) %>

Show company

    Name:
    <%= @company.name %>

    Join date:
    <%= @company.join_date %>

    Departure date:
    <%= @company.departure_date %>

<%= link "Edit", to: company_path(@conn, :edit, @company) %>
<%= link "Back", to: company_path(@conn, :index) %>


adjustments for petition count

adjustments for petition count

<meta name="description" content="<%=@title%>" />
<meta name="keywords" content="<%=@title <> "" <> copyright(@brand)%>" />
<meta name="author" content="copyright(@brand)%>" />
<meta name="copyright" content="copyright(@brand)%>" />

<meta property="og:url" content="<%= core_deployment(@brand) <> "/petition/" <> @slug%>" />
<meta property="og:title" content="<%=@title%>" />
<meta property="og:type" content="article" />
<meta property="og:image" content="<%=@share_image%>" />
<meta property="og:description" content="<%=@content%>" />

<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="<%=@title%>" />
<meta name="twitter:description" content="<%=@content%>" />
<meta name="twitter:image" content="<%=@share_image%>" />

    <%= if not @signed do %>

        <%= raw(@content) %>

        <%= if @count do %>

            <div class="count-bar" style="width: <%= @progress %>%;">

             <%= @count %> people have signed. Help us get to <%= @target %>!

        <% end %>

      <%= form_tag("/petition/#{@slug}", method: :post, id: "main-form") %>

          <input type="hidden" name="_csrf_token" value="<%= csrf_token() %>" />

          <fieldset style="margin-top: 20px;">
            <legend style="color:white;">Your Info</legend>

              Name
              <input type="text" name="name" required="required"/>

              Email
              <input type="email" name="email" required="required"/>

            <%= if assigns[:show_phone] != nil and assigns[:show_phone] == "Show" do %>

                Mobile Phone Number
                <input type="tel" name="phone" />

            <% end %>

              Zip
              <input type="text" name="zip" maxlength="5" required="required" />

              <%= if @brand == "jd" do %>
                <button onclick="fbq('track', 'Lead');" type="submit" class="button-block"><%=@sign_button_text%></button>
              <% else %>
                <button type="submit" class="button-block"><%=@sign_button_text%></button>
              <% end %>

          </fieldset>

            By signing this petition, I consent to receiving emails from
            <%= if @slug == "jd-stop-war" do %>
              <a target="_blank" href="<%=homepage(@brand)%>"><%=copyright(@brand)%> and
              Ro Khanna.
            <% else %>
              <a target="_blank" href="<%=homepage(@brand)%>"><%=copyright(@brand)%>.
            <% end %>

      </form>

    <% else %>

        <%= raw(@post_sign_text) %>

 Next Steps

      <fieldset style="margin-top: 20px; color: white;">
        <legend style="color:white;">Help us get to <%= @target %> signatures by sharing on social media</legend>

        <a class="twitter-share-button" href="<%=@twitter_href%>" data-size="large">
          Tweet

        <div class="fb-share-button" data-href="<%=@url%>" data-layout="button_count" data-size="large" style="float:right;">
          <a class="fb-xfbml-parse-ignore" target="_blank"
            style="background-color: #3b5998; color: white; padding: 5px; text-decoration: none; margin-top: 5px;"
            href="<%=@fb_href%>"
          >
            Share on Facebook

      </fieldset>

      <%= if @call_power_campaign_id != nil and @call_power_campaign_id != "" do %>

        <fieldset style="color:white;">
          <legend> <%= @call_power_header %> </legend>

            <%= raw(@call_power_prompt) %>

          <form id="call_form">
            <input id="phone_id" type="hidden" value="<%= @submitted_phone %>"/>
            <input id="location_id" type="hidden" value="<%= @submitted_zip %>" />
            <button type="submit" style="width: 100%; margin-top: 10px;" id="call-power-go"> Call Me At <%= @submitted_phone %> </button>
          </form>

          <%= form_tag("/petition/#{@slug}", method: :post, id: "number-replace-form", style: "margin-top: 10px;") %>
            <input name="name" value="<%= @submitted_name %>" type="hidden" />
            <input name="email" value="<%= @submitted_email %>" type="hidden" />
            <input name="zip" value="<%= @submitted_zip %>" type="hidden" />

              Different Number
              <input type="tel" name="phone" />

              <button id="number-replace-button" class="button-block">Call Me at a Different Number</button>

          </form>
        </fieldset>
      <% end %>

    <% end %>

<%= if @brand == "jd" do %>

<% end %>


added XML/js for GrovePi

added XML/js for GrovePi

<xml id="toolbox" style="display: none">
   <%= render Blockytalky.PageView, "sensors.html" %>
  <%= render Blockytalky.PageView, "events.html" %>
   <%= render Blockytalky.PageView, "messaging.html" %>
   <%= render Blockytalky.PageView, "music.html" %>
   <%= render Blockytalky.PageView, "grovepi.html" %>
   <sep></sep>
   <category name="Logic">
     <category name="If">
       <block type="controls_if"></block>
       <block type="controls_if">
         <mutation else="1"></mutation>
       </block>
       <block type="controls_if">
         <mutation elseif="1" else="1"></mutation>
       </block>
     </category>
     <category name="Boolean">
       <block type="logic_compare"></block>
       <block type="logic_operation"></block>
       <block type="logic_negate"></block>
       <block type="logic_boolean"></block>
       <block type="logic_null"></block>
       <block type="logic_ternary"></block>
     </category>
   </category>
   <category name="Math">
     <block type="math_number"></block>
     <block type="math_arithmetic"></block>
     <block type="math_single"></block>
     <block type="math_trig"></block>
     <block type="math_constant"></block>
     <block type="math_number_property"></block>
     <block type="math_change">
       <value name="DELTA">
         <block type="math_number">
           <field name="NUM">1</field>
         </block>
       </value>
     </block>
     <block type="math_round"></block>
     <block type="math_on_list"></block>
     <block type="math_modulo"></block>
     <block type="math_constrain">
       <value name="LOW">
         <block type="math_number">
           <field name="NUM">1</field>
         </block>
       </value>
       <value name="HIGH">
         <block type="math_number">
           <field name="NUM">100</field>
         </block>
       </value>
     </block>
     <block type="math_random_int">
       <value name="FROM">
         <block type="math_number">
           <field name="NUM">1</field>
         </block>
       </value>
       <value name="TO">
         <block type="math_number">
           <field name="NUM">100</field>
         </block>
       </value>
     </block>
     <block type="math_random_float"></block>
   </category>
   <category name="Lists">
     <block type="lists_create_empty"></block>
     <block type="lists_create_with"></block>
     <block type="lists_repeat">
       <value name="NUM">
         <block type="math_number">
           <field name="NUM">5</field>
         </block>
       </value>
     </block>
     <block type="lists_length"></block>
     <block type="lists_isEmpty"></block>
     <block type="lists_indexOf"></block>
     <block type="lists_getIndex"></block>
     <block type="lists_setIndex"></block>
   </category>
   <category name="Variables" custom="VARIABLE"></category>
   <category name="Functions" custom="PROCEDURE"></category>
   <sep></sep>
 </xml>

<xml id="toolbox" style="display: none">
   <%= render Blockytalky.PageView, "sensors.html" %>
  <%= render Blockytalky.PageView, "events.html" %>
   <%= render Blockytalky.PageView, "messaging.html" %>
   <%= render Blockytalky.PageView, "music.html" %>
   <sep></sep>
   <category name="Logic">
     <category name="If">
       <block type="controls_if"></block>
       <block type="controls_if">
         <mutation else="1"></mutation>
       </block>
       <block type="controls_if">
         <mutation elseif="1" else="1"></mutation>
       </block>
     </category>
     <category name="Boolean">
       <block type="logic_compare"></block>
       <block type="logic_operation"></block>
       <block type="logic_negate"></block>
       <block type="logic_boolean"></block>
       <block type="logic_null"></block>
       <block type="logic_ternary"></block>
     </category>
   </category>
   <category name="Math">
     <block type="math_number"></block>
     <block type="math_arithmetic"></block>
     <block type="math_single"></block>
     <block type="math_trig"></block>
     <block type="math_constant"></block>
     <block type="math_number_property"></block>
     <block type="math_change">
       <value name="DELTA">
         <block type="math_number">
           <field name="NUM">1</field>
         </block>
       </value>
     </block>
     <block type="math_round"></block>
     <block type="math_on_list"></block>
     <block type="math_modulo"></block>
     <block type="math_constrain">
       <value name="LOW">
         <block type="math_number">
           <field name="NUM">1</field>
         </block>
       </value>
       <value name="HIGH">
         <block type="math_number">
           <field name="NUM">100</field>
         </block>
       </value>
     </block>
     <block type="math_random_int">
       <value name="FROM">
         <block type="math_number">
           <field name="NUM">1</field>
         </block>
       </value>
       <value name="TO">
         <block type="math_number">
           <field name="NUM">100</field>
         </block>
       </value>
     </block>
     <block type="math_random_float"></block>
   </category>
   <category name="Lists">
     <block type="lists_create_empty"></block>
     <block type="lists_create_with"></block>
     <block type="lists_repeat">
       <value name="NUM">
         <block type="math_number">
           <field name="NUM">5</field>
         </block>
       </value>
     </block>
     <block type="lists_length"></block>
     <block type="lists_isEmpty"></block>
     <block type="lists_indexOf"></block>
     <block type="lists_getIndex"></block>
     <block type="lists_setIndex"></block>
   </category>
   <category name="Variables" custom="VARIABLE"></category>
   <category name="Functions" custom="PROCEDURE"></category>
   <sep></sep>
 </xml>