Move hr tag inside public calendar conditonal

<%= if @is_chair do %>

          <%= link to: Routes.working_group_settings_path(@conn, :edit, @wg.slug), class: "nav-link" do %>
             Manage
          <% end %>

          <%= link to: Routes.working_group_report_path(@conn, :new, @wg.slug), class: "nav-link" do %>
             Submit a report
          <% end %>

          <%= link to: Routes.working_group_report_path(@conn, :index, @wg.slug), class: "nav-link" do %>
             View your reports
          <% end %>

<% end %>

<%= if contents = ErlefWeb.WorkingGroupView.content(@wg.slug) do %>

Content

    <%= for {name, page} <- contents do %>
    <%= link name, to: Routes.working_group_content_path(@conn, :show, @wg.slug, page) %>
    <% end %>

<% end %>

    <%= if @wg.meta.public_calendar do %>

        View our <%= link "calendar", to: Routes.working_group_path(@conn, :calendar, @wg.slug) %>

    <% end %>

You can reach us:

      <%= if @wg.meta.email do %>

By e-mail: <a href="mailto:<%= @wg.meta.email %>"><%= @wg.meta.email %>

      <% end %>
      <%= if @wg.meta.github do %>

On GitHub: <a href="https://github.com/<%= @wg.meta.github %>"><%= @wg.meta.github %>

      <% end %>

    <%= if @wg.meta.gcal_url do %>

Feel free to subscribe to our <a href="<%= raw @wg.meta.gcal_url %>" title="Add to Google Calendar">Google Calendar to keep track of upcoming meetings

    <% end %>

<%= unless Enum.empty?(@blog_posts) do %>

Recent posts

    <%= for post <- @blog_posts do %>

        <%= render(ErlefWeb.BlogView, "list_preview.html", post: post, topic: @topic) %>

    <% end %>

<% end %>


Update font-awesome and CDN

Update font-awesome and CDN

<!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>Überauth Example</title>
    <link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <link rel="stylesheet" href="<%= Routes.static_path(@conn, "/css/app.css") %>">

              View on GitHub

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

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

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

<!DOCTYPE html>

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

    <title>Überauth Example</title>
    <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
    <link rel="stylesheet" href="<%= Routes.static_path(@conn, "/css/app.css") %>">

              View on GitHub

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

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

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


Fix missing sort link

Fix missing sort link

<%= gettext("Upload to this image series") %> » <%= @series.name %>

<%= dropzone_form(:admin_portfolio_image_series_path, @series.id) %>

  <a href="<%= Brando.helpers.admin_portfolio_image_series_path(@conn, :edit, @series.id) %>" class="btn btn-default">
    <%= gettext("Edit image series") %>

  <a href="<%= Brando.helpers.admin_portfolio_image_series_path(@conn, :sequence, @series.id) %>" class="btn btn-default">
    <%= gettext("Sort image series") %>

  <a href="<%= Brando.helpers.admin_portfolio_image_path(@conn, :index) %>" class="btn btn-default">
    <%= gettext("Back to index") %>

<%= gettext("Existing images in this series") %>

<%= for i <- @series.images do %>
  <img src="<%= img_url(i.image, :thumb, prefix: media_url()) %>" />
<% end %>

<%= gettext("Upload to this image series") %> » <%= @series.name %>

<%= dropzone_form(:admin_portfolio_image_series_path, @series.id) %>

  <a href="<%= Brando.helpers.admin_portfolio_image_series_path(@conn, :edit, @series.id) %>" class="btn btn-default">
    <%= gettext("Edit image series") %>

    <%= gettext("Sort image series") %>

  <a href="<%= Brando.helpers.admin_portfolio_image_path(@conn, :index) %>" class="btn btn-default">
    <%= gettext("Back to index") %>

<%= gettext("Existing images in this series") %>

<%= for i <- @series.images do %>
  <img src="<%= img_url(i.image, :thumb, prefix: media_url()) %>" />
<% end %>


Improve chat messages

Improve chat messages

    <img class="pull-left" src="https://www.gravatar.com/avatar/<%= Base.encode16(:crypto.hash(:md5, String.downcase(@chat_message.user.email)), case: :lower) %>?s=32&d=identicon">

      <%= @chat_message.user.email %>
      at <%= l(@chat_message.inserted_at) %>

<%= @chat_message.body %>

  <%= if @chat_message.user.id == current_user(@conn).id && has_permission?(@current_memberships, [1, 2]) do %>

      <%= link "Edit", to: classroom_chat_message_path(@conn, :edit, @event, @chat_message), class: "btn btn-secondary btn-sm" %>
      <%= link "Delete", to: classroom_chat_message_path(@conn, :delete, @event, @chat_message), method: :delete, data: [toggle: "modal", target: "baseModal"], class: "btn btn-danger btn-sm" %>

  <% end %>

  <%= if @chat_message.user.id != current_user(@conn).id && has_permission?(@current_memberships, [1, 2]) do %>

      <%= link "Edit", to: classroom_chat_message_path(@conn, :edit, @event, @chat_message), class: "btn btn-default btn-sm" %>
      <%= link "Delete", to: classroom_chat_message_path(@conn, :delete, @event, @chat_message), method: :delete, data: [toggle: "modal", target: "baseModal"], class: "btn btn-danger btn-sm" %>

  <% end %>

<%= @chat_message.user.email %> wrote <%= l(@chat_message.inserted_at) %>

<%= @chat_message.body %>

  <%= if @chat_message.user.id == current_user(@conn).id && has_permission?(@current_memberships, [1, 2]) do %>

      <%= link "Edit", to: classroom_chat_message_path(@conn, :edit, @event, @chat_message), class: "btn btn-default btn-sm" %>
      <%= link "Delete", to: classroom_chat_message_path(@conn, :delete, @event, @chat_message), method: :delete, data: [toggle: "modal", target: "baseModal"], class: "btn btn-danger btn-sm" %>

  <% end %>


show an image for dead snakes in the scoreboard

  <%= img_tag "/images/bs-logo-light.svg", class: "scoreboard-logo" %>

      <image class="scoreboard-division-img"
             src="/images/division-advanced.svg"></image>

          <%= @state.game_form.id %>

          Turn
          <%= @turn %>

      <svg height="100%"
           preserveAspectRatio="none"
           viewBox="0 0 100 100"
           width="100%"
           x="0"
           y="0">
        <polygon points="0 0, 0 100, 100 100, 0, 50, 100 0"></polygon>
      </svg>

  <%= for snake <- @snakes do %>

        <image src="<%= head_image_url snake %>"></image>

<%= snake.name %>

<%= snake.taunt %>

          <svg class="scoreboard-healthpoints"
               preserveAspectRatio="none"
               viewBox="0 0 100 100">
            <%= content_tag(:rect,
              "",
              fill: snake.color,
              x: 0,
              y: 0,
              height: 100,
              width: 100,
              class: "scoreboard-healthpoints-shadow") %>

            <%= content_tag(:rect,
              "",
              fill: snake.color,
              x: 0,
              y: 0,
              height: 100,
              width: snake.health_points) %>
          </svg>

  <% end %>

  <%= for snake <- @dead_snakes do %>

        <image src="<%= head_image_url snake %>"></image>

<%= snake.name %>

<%= snake.taunt %>

          <svg class="scoreboard-healthpoints"
               preserveAspectRatio="none"
               viewBox="0 0 100 100">
            <%= content_tag(:rect,
              "",
              fill: snake.color,
              x: 0,
              y: 0,
              height: 100,
              width: 100,
              class: "scoreboard-healthpoints-shadow") %>

            <%= content_tag(:rect,
              "",
              fill: snake.color,
              x: 0,
              y: 0,
              height: 100,
              width: snake.health_points) %>
          </svg>

  <% end %>

  <%= img_tag "/images/bs-logo-light.svg", class: "scoreboard-logo" %>

      <image class="scoreboard-division-img"
             src="/images/division-advanced.svg"></image>

          <%= @state.game_form.id %>

          Turn
          <%= @turn %>

      <svg height="100%"
           preserveAspectRatio="none"
           viewBox="0 0 100 100"
           width="100%"
           x="0"
           y="0">
        <polygon points="0 0, 0 100, 100 100, 0, 50, 100 0"></polygon>
      </svg>

  <%= for snake <- @snakes do %>

        <image src="<%= head_image_url snake %>"></image>

<%= snake.name %>

<%= snake.taunt %>

          <svg class="scoreboard-healthpoints"
               preserveAspectRatio="none"
               viewBox="0 0 100 100">
            <%= content_tag(:rect,
              "",
              fill: snake.color,
              x: 0,
              y: 0,
              height: 100,
              width: 100,
              class: "scoreboard-healthpoints-shadow") %>

            <%= content_tag(:rect,
              "",
              fill: snake.color,
              x: 0,
              y: 0,
              height: 100,
              width: snake.health_points) %>
          </svg>

  <% end %>

  <%= for snake <- @dead_snakes do %>

<%= snake.name %>

<%= snake.taunt %>

        <svg class="scoreboard-healthpoints"
             preserveAspectRatio="none"
             viewBox="0 0 100 100">
          <%= content_tag(:rect,
              "",
              fill: snake.color,
              x: 0,
              y: 0,
              height: 100,
              width: 100,
              class: "scoreboard-healthpoints-shadow") %>

          <%= content_tag(:rect,
              "",
              fill: snake.color,
              x: 0,
              y: 0,
              height: 100,
              width: snake.health_points) %>
        </svg>

  <% end %>


update pivotal api documentation

update pivotal api documentation

Add a link to the corresponding blog post, and tweak the copy

Pivotal Tracker

    The following script will add a

Ticket Poker https://[URL of Ticket Poker estimation page]

    task to all the stories in a Pivotal Tracker project which have a specific label, and which
    have not yet been estimated.

    For more information, see this blog post.

#!/usr/bin/env ruby

# Script to add ticket-poker tasks to all stories in a pivotal tracker
# project which have a certain label, and which have not yet been
# estimated

require 'json'
require 'uri'
require 'net/http'

PIVOTAL_PROJECT_ID   = '[insert your id here]'
PIVOTAL_API_TOKEN    = '[insert your api token here]'
TICKET_POKER_TEAM_ID = '[insert your team_id here]'
LABEL                = 'development'

def main
  project = PivotalProject.new(
    project_id:  PIVOTAL_PROJECT_ID,
    api_token:   PIVOTAL_API_TOKEN
  )

  ticket_poker = TicketPoker.new(team_id: TICKET_POKER_TEAM_ID)

  project.unestimated_stories(label: LABEL).each do |story|
    story.add_estimation_task(ticket_poker) unless story.has_estimation_task?
  end
end

########################################

class PivotalProject
  BASE_URL = 'https://www.pivotaltracker.com/services/v5/projects'

  def initialize(api_token:, project_id:)
    @api_token  = api_token
    @project_id = project_id
  end

  def unestimated_stories(label:)
    url = [stories_url, filter_string(label)].join('?')
    get(url).map { |h| Story.new(h.merge('project' => self)) }
  end

  def tasks(story)
    get(tasks_url(story.id)).map {|h| Task.new(h)}
  end

  def add_task(story, description)
    post(tasks_url(story.id), description: description)
  end

  private

  def stories_url
    [ BASE_URL, @project_id, 'stories' ].join('/')
  end

  def tasks_url(story_id)
    [ BASE_URL, @project_id, 'stories', story_id, 'tasks' ].join('/')
  end

  def filter_string(label)
    str = URI.encode %[label:"#{label}" estimate:-1]
    "filter=#{str}"
  end

  def get(url)
    uri = URI(url)
    https = Net::HTTP.new(uri.host, uri.port)
    https.use_ssl = true
    request = Net::HTTP::Get.new(uri.request_uri)
    set_headers request

    JSON.parse https.request(request).body
  end

  def post(url, data)
    uri = URI(url)
    https = Net::HTTP.new(uri.host, uri.port)
    https.use_ssl = true
    request = Net::HTTP::Post.new(uri.path)
    set_headers request

    request.body = data.to_json

    JSON.parse https.request(request).body
  end

  def set_headers(request)
    request['X-TrackerToken'] = @api_token
    request['Accept']         = 'application/json'
    request['Content-Type']   = 'application/json'
  end
end

class Story
  attr_reader :id, :url

  def initialize(hash)
    @project = hash.fetch('project')
    @id      = hash.fetch('id')
    @url     = hash.fetch('url')
  end

  def has_estimation_task?
    tasks.map(&:description).grep(/ticket.poker/i).any?
  end

  def add_estimation_task(ticket_poker)
    url = ticket_poker.create(self.url)
    @project.add_task(self, "Ticket Poker #{url}")
  end

  def tasks
    @project.tasks(self)
  end
end

class Task
  attr_reader :id, :description

  def initialize(hash)
    @id          = hash.fetch('id')
    @description = hash.fetch('description')
  end
end

class TicketPoker
  attr_reader :team_id

  URL = 'https://ticket-poker.herokuapp.com/api/tickets'

  def initialize(team_id:)
    @team_id = team_id
  end

  def create(url)
    data = {team_id: team_id, ticket_url: url}

    uri = URI(URL)
    https = Net::HTTP.new(uri.host, uri.port)
    https.use_ssl = true
    request = Net::HTTP::Post.new(uri.path)
    request['Accept']         = 'application/json'
    request['Content-Type']   = 'application/json'

    request.body = data.to_json

    rtn = https.request(request)
    JSON.parse(rtn.body).fetch('url')
  end
end

main

Pivotal Tracker

    The following script will add a "Ticket Poker [URL of Ticket Poker estimation page]"
    task to all the stories in a Pivotal Tracker project which have a specific label, and which
    have not yet been estimated.

#!/usr/bin/env ruby

# Script to add ticket-poker tasks to all stories in a pivotal tracker
# project which have a certain label, and which have not yet been
# estimated

require 'json'
require 'uri'
require 'net/http'

PIVOTAL_PROJECT_ID   = '[insert your id here]'
PIVOTAL_API_TOKEN    = '[insert your api token here]'
TICKET_POKER_TEAM_ID = '[insert your team_id here]'
LABEL                = 'development'

def main
  project = PivotalProject.new(
    project_id:  PIVOTAL_PROJECT_ID,
    api_token:   PIVOTAL_API_TOKEN
  )

  ticket_poker = TicketPoker.new(team_id: TICKET_POKER_TEAM_ID)

  project.unestimated_stories(label: LABEL).each do |story|
    story.add_estimation_task(ticket_poker) unless story.has_estimation_task?
  end
end

########################################

class PivotalProject
  BASE_URL = 'https://www.pivotaltracker.com/services/v5/projects'

  def initialize(api_token:, project_id:)
    @api_token  = api_token
    @project_id = project_id
  end

  def unestimated_stories(label:)
    url = [stories_url, filter_string(label)].join('?')
    get(url).map { |h| Story.new(h.merge('project' => self)) }
  end

  def tasks(story)
    get(tasks_url(story.id)).map {|h| Task.new(h)}
  end

  def add_task(story, description)
    post(tasks_url(story.id), description: description)
  end

  private

  def stories_url
    [ BASE_URL, @project_id, 'stories' ].join('/')
  end

  def tasks_url(story_id)
    [ BASE_URL, @project_id, 'stories', story_id, 'tasks' ].join('/')
  end

  def filter_string(label)
    str = URI.encode %[label:"#{label}" estimate:-1]
    "filter=#{str}"
  end

  def get(url)
    uri = URI(url)
    https = Net::HTTP.new(uri.host, uri.port)
    https.use_ssl = true
    request = Net::HTTP::Get.new(uri.request_uri)
    set_headers request

    JSON.parse https.request(request).body
  end

  def post(url, data)
    uri = URI(url)
    https = Net::HTTP.new(uri.host, uri.port)
    https.use_ssl = true
    request = Net::HTTP::Post.new(uri.path)
    set_headers request

    request.body = data.to_json

    JSON.parse https.request(request).body
  end

  def set_headers(request)
    request['X-TrackerToken'] = @api_token
    request['Accept']         = 'application/json'
    request['Content-Type']   = 'application/json'
  end
end

class Story
  attr_reader :id, :url

  def initialize(hash)
    @project = hash.fetch('project')
    @id      = hash.fetch('id')
    @url     = hash.fetch('url')
  end

  def has_estimation_task?
    tasks.map(&:description).grep(/ticket.poker/i).any?
  end

  def add_estimation_task(ticket_poker)
    url = ticket_poker.create(self.url)
    @project.add_task(self, "Ticket Poker #{url}")
  end

  def tasks
    @project.tasks(self)
  end
end

class Task
  attr_reader :id, :description

  def initialize(hash)
    @id          = hash.fetch('id')
    @description = hash.fetch('description')
  end
end

class TicketPoker
  attr_reader :team_id

  URL = 'https://ticket-poker.herokuapp.com/api/tickets'

  def initialize(team_id:)
    @team_id = team_id
  end

  def create(url)
    data = {team_id: team_id, ticket_url: url}

    uri = URI(URL)
    https = Net::HTTP.new(uri.host, uri.port)
    https.use_ssl = true
    request = Net::HTTP::Post.new(uri.path)
    request['Accept']         = 'application/json'
    request['Content-Type']   = 'application/json'

    request.body = data.to_json

    rtn = https.request(request)
    JSON.parse(rtn.body).fetch('url')
  end
end

main


tweak table margin

tweak table margin

    <%= for {rank, count, podcasts} <- prepare_for_toplist(@podcasts) do %>

          <%= rank %>.

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

          <%= count %> <%= fa_icon("user") %>

    <% end %>


adapt recommendations to new episode derivation

Fortuna opted for the following episode

<%= render PanWeb.EpisodeFrontendView, "show.html",
           episode: @episode,
           episode_thumbnail: @episode_thumbnail,
           current_user: @current_user,
           player: @player,
           changeset: @changeset,
           conn: @conn %>

... from the podcast

<%= render PanWeb.PodcastFrontendView, "_header.html",
           podcast: @podcast,
           podcast_thumbnail: @podcast_thumbnail,
           episodes: @podcast.episodes,
           current_user: @current_user,
           changeset: @changeset,
           conn: @conn %>

... in the category

<%= render PanWeb.CategoryFrontendView, "show.html",
           category: @category,
           current_user: @current_user,
           podcasts: @podcasts,
           conn: @conn %>

Fortuna opted for the following episode

<%= render PanWeb.EpisodeFrontendView, "show.html",
           episode: @episode, episode_thumbnail: @episode_thumbnail,
           current_user: @current_user,
           player: @player,
           changeset: @changeset,
           conn: @conn %>

... from the podcast

<%= render PanWeb.PodcastFrontendView, "_header.html",
           podcast: @podcast, podcast_thumbnail: @podcast_thumbnail,
           current_user: @current_user,
           changeset: @changeset,
           conn: @conn %>

... in the category

<%= render PanWeb.CategoryFrontendView, "show.html",
           category: @category,
           current_user: @current_user,
           podcasts: @podcasts,
           conn: @conn %>


Quote the boot script with single quotes (#676)

Using unescaped double quotes within double quotes didn't seem to be working as expected, as I was having issues running a batch file produced from this template in a directory which contained spaces. This is similar to how it was suggested that powershell be called from a batch file here: https://stackoverflow.com/questions/19335004/how-to-run-a-powershell-script-from-a-batch-file.

:: Discover the current release directory from the directory
:: of this script and the start_erl.data file
@echo off
set script_dir=%~dp0
for %%A in ("%script_dir%\..") do (
  set release_root_dir=%%~fA
)
set rel_name=<%= release_name %>
set rel_vsn=<%= release_version %>
set boot_script=%release_root_dir%\releases\%rel_vsn%\%rel_name%.ps1

:: Use pwsh.exe rather than powershell.exe if available
set prog=powershell
where pwsh >nul 2>nul
if %ERRORLEVEL% equ 0 (
  set prog=pwsh
)
%prog% -NonInteractive -NoProfile -ExecutionPolicy Bypass -Command "& '%boot_script%' @args" %*

:: Discover the current release directory from the directory
:: of this script and the start_erl.data file
@echo off
set script_dir=%~dp0
for %%A in ("%script_dir%\..") do (
  set release_root_dir=%%~fA
)
set rel_name=<%= release_name %>
set rel_vsn=<%= release_version %>
set boot_script=%release_root_dir%\releases\%rel_vsn%\%rel_name%.ps1

:: Use pwsh.exe rather than powershell.exe if available
set prog=powershell
where pwsh >nul 2>nul
if %ERRORLEVEL% equ 0 (
  set prog=pwsh
)
%prog% -NonInteractive -NoProfile -ExecutionPolicy Bypass -Command "& "%boot_script%" @args" %*


Make viewport meta tag less restrictive in html layout (#3001)

<!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_url(@conn, "/css/app.css") %>"/>

Get Started

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

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

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

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

<!DOCTYPE html>

    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, shrink-to-fit=no, user-scalable=no"/>
    <title><%= app_module %> · Phoenix Framework</title>
    <link rel="stylesheet" href="<%%= Routes.static_url(@conn, "/css/app.css") %>"/>

Get Started

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

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

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

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


Grammar: "Peace of mind" is not hyphenated (#3862)

<%= if gettext do %>

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

Welcome to Phoenix!
<% end %>

Peace of mind from prototype to production
<%= if live do %>

  <form phx-change="suggest" phx-submit="search">
    <input type="text" name="q" value="<%%= @query %>" placeholder="Live dependency search" list="results" autocomplete="off"/>
    <datalist id="results">
      <%%= for {app, _vsn} <- @results do %>
        <option value="<%%= app %>"><%%= app %></option>
      <%% end %>
    </datalist>
    <button type="submit" phx-disable-with="Searching...">Go to Hexdocs</button>
  </form><% end %>

Resources

        Guides & Docs

        Source

        <a href="https://github.com/phoenixframework/phoenix/blob/<%= phoenix_github_version_tag %>/CHANGELOG.md"><%= phoenix_github_version_tag %> Changelog

Help

        Forum

        #elixir-lang on Freenode IRC

        Twitter @elixirphoenix

        Elixir on Slack

<%= if gettext do %>

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

Welcome to Phoenix!
<% end %>

Peace-of-mind from prototype to production
<%= if live do %>

  <form phx-change="suggest" phx-submit="search">
    <input type="text" name="q" value="<%%= @query %>" placeholder="Live dependency search" list="results" autocomplete="off"/>
    <datalist id="results">
      <%%= for {app, _vsn} <- @results do %>
        <option value="<%%= app %>"><%%= app %></option>
      <%% end %>
    </datalist>
    <button type="submit" phx-disable-with="Searching...">Go to Hexdocs</button>
  </form><% end %>

Resources

        Guides & Docs

        Source

        <a href="https://github.com/phoenixframework/phoenix/blob/<%= phoenix_github_version_tag %>/CHANGELOG.md"><%= phoenix_github_version_tag %> Changelog

Help

        Forum

        #elixir-lang on Freenode IRC

        Twitter @elixirphoenix

        Elixir on Slack


Add play order to TOC template

Add play order to TOC template

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE ncx PUBLIC "-//NISO//DTD ncx 2005-1//EN"
                 "http://www.daisy.org/z3986/2005/ncx-2005-1.dtd">
<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1">
  <head>
    <meta name="dtb:uid" content="urn:uuid:0cc33cbd-94e2-49c1-909a-72ae16bc2658"/>
    <meta name="dtb:depth" content="1"/>
    <meta name="dtb:totalPageCount" content="0"/>
    <meta name="dtb:maxPageNumber" content="0"/>
  </head>
  <docTitle>
    <text><%= config.project %> - <%= config.version %></text>
  </docTitle>
  <navMap>
    <navPoint id="navpoint-1" playOrder="1">
      <navLabel>
        <text>Book cover</text>
      </navLabel>
      <content src="title.html"/>
    </navPoint>
    <%= for {node, index} <- Enum.with_index(all) do %>
      <navPoint id="<%= node.id %>" playOrder="<%= index + 2 %>">
      <navLabel>
        <text>Module: <%= node.id %></text>
      </navLabel>
      <content src="modules/<%= node.id %>.html"/>
    </navPoint>
    <% end %>
  </navMap>
</ncx>

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE ncx PUBLIC "-//NISO//DTD ncx 2005-1//EN"
                 "http://www.daisy.org/z3986/2005/ncx-2005-1.dtd">
<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1">
  <head>
    <meta name="dtb:uid" content="urn:uuid:0cc33cbd-94e2-49c1-909a-72ae16bc2658"/>
    <meta name="dtb:depth" content="1"/>
    <meta name="dtb:totalPageCount" content="0"/>
    <meta name="dtb:maxPageNumber" content="0"/>
  </head>
  <docTitle>
    <text><%= config.project %> - <%= config.version %></text>
  </docTitle>
  <navMap>
    <navPoint id="navpoint-1" playOrder="1">
      <navLabel>
        <text>Book cover</text>
      </navLabel>
      <content src="title.html"/>
    </navPoint>
    <navPoint id="navpoint-2" playOrder="2">
      <navLabel>
        <text>Contents</text>
      </navLabel>
      <content src="module.html"/>
    </navPoint>
    <%= for node <- all do %>
      <navPoint id="<%= node.id %>" playOrder="2">
      <navLabel>
        <text>Module: <%= node.id %></text>
      </navLabel>
      <content src="modules/<%= node.id %>.html"/>
    </navPoint>
    <% end %>
  </navMap>
</ncx>


Use the assigned view

Use the assigned view

It was not possible to open the `Forgot your password?` and the reset
password link from the email because we were trying to render always
from the SessionView.

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

    <title><%= Coherence.Config.title() %></title>
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700" type="text/css">
    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">

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

  <body>
    <main role="main">
      <%= render @view_module, @view_template, assigns %>
    </main>
    <script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>
    <script src="<%= static_path(@conn, "/js/app.js") %>"></script>
  </body>
</html>

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

    <title><%= Coherence.Config.title() %></title>
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700" type="text/css">
    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">

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

  <body>
    <main role="main">
      <%= render CoursePlannerWeb.Coherence.SessionView, @view_template, assigns %>
    </main>
    <script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>
    <script src="<%= static_path(@conn, "/js/app.js") %>"></script>
  </body>
</html>


Use submit helper

Use submit helper

  Teal: The dumb publishing platform

  <%= form_for @changeset, page_path(@conn, :create_document), fn f -> %>
    <%=
      textarea f, :md_content,
        class: "monospace pa2 w-100 mb2 ba b--mid-gray",
        placeholder: "Markdown content here...",
        rows: "8"
    %>

    <%= submit "Create", class: "fl pa2 bg-white ba b--mid-gray br1 pointer dim " %>
  <% end %>

  Teal: The dumb publishing platform

  <%= form_for @changeset, page_path(@conn, :create_document), fn f -> %>
    <%=
      textarea f, :md_content,
        class: "monospace pa2 w-100 mb2 ba b--mid-gray",
        placeholder: "Markdown content here...",
        rows: "8"
    %>

    <button class="fl pa2 bg-white ba b--mid-gray br1 pointer dim">Create</button>
  <% end %>


Escape "<", ">" and others in SVG

Escape "<", ">" and others in SVG

<?xml version="1.0"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="<%= (@cols + 2) * 8.433333333 %>" height="<%= (@rows + 1) * 14 * 1.4 %>" font-family="Consolas, Menlo, 'Bitstream Vera Sans Mono', monospace, 'Powerline Symbols'" font-size="14px">
  <style>
   <%= render "_svg_theme_#{@theme_name}.css" %>
   <%= render "_svg_256_colors.css" %>
   .br { font-weight: bold }
   .it { font-style: italic }
   .un { text-decoration: underline }
  </style>

  <rect width="100%" height="100%" class="default-bg-fill"></rect>

  <svg x="<%= percent(1.0 * 100 / (@cols + 2)) %>" y="<%= percent(0.5 * 100 / (@rows + 1)) %>" class="default-text-fill">
    <g style="shape-rendering: optimizeSpeed">
    <%= for chunks <- @chunk_lines do %><%= for chunk <- chunks do %><%= if c = svg_rect_class(chunk.attrs) do %><rect x="<%= percent(100 * chunk.x / (@cols + 2)) %>" y="<%= percent(100 * chunk.y / (@rows + 1)) %>" width="<%= percent(100 * chunk.width / (@cols + 2)) %>" height="<%= percent(102 / (@rows + 1)) %>" class="<%= c %>"></rect>
<% end %><% end %><% end %>
    </g>

    <text>
      <%= for chunks <- @char_lines do %><%= for chunk <- chunks do %><%= if String.trim(chunk.text) != "" do %><tspan dy="1.0em" x="<%= percent(100 * chunk.x / (@cols + 2)) %>" y="<%= percent(100 * chunk.y / (@rows + 1)) %>"<%= if c = svg_text_class(chunk.attrs) do %> class="<%= c %>"<% end %><%= if s = svg_style(chunk.attrs) do %> style="<%= s %>"<% end %>><%= safe_to_string(html_escape(chunk.text)) %></tspan>
<% end %><% end %><% end %>
    </text>

    <g transform="translate(-50 -50)">
      <svg x="50%" y="50%" width="100" height="100">
        <%= render "_logo.svg" %>
      </svg>
    </g>
  </svg>
</svg>

<?xml version="1.0"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="<%= (@cols + 2) * 8.433333333 %>" height="<%= (@rows + 1) * 14 * 1.4 %>" font-family="Consolas, Menlo, 'Bitstream Vera Sans Mono', monospace, 'Powerline Symbols'" font-size="14px">
  <style>
   <%= render "_svg_theme_#{@theme_name}.css" %>
   <%= render "_svg_256_colors.css" %>
   .br { font-weight: bold }
   .it { font-style: italic }
   .un { text-decoration: underline }
  </style>

  <rect width="100%" height="100%" class="default-bg-fill"></rect>

  <svg x="<%= percent(1.0 * 100 / (@cols + 2)) %>" y="<%= percent(0.5 * 100 / (@rows + 1)) %>" class="default-text-fill">
    <g style="shape-rendering: optimizeSpeed">
    <%= for chunks <- @chunk_lines do %><%= for chunk <- chunks do %><%= if c = svg_rect_class(chunk.attrs) do %><rect x="<%= percent(100 * chunk.x / (@cols + 2)) %>" y="<%= percent(100 * chunk.y / (@rows + 1)) %>" width="<%= percent(100 * chunk.width / (@cols + 2)) %>" height="<%= percent(102 / (@rows + 1)) %>" class="<%= c %>"></rect>
<% end %><% end %><% end %>
    </g>

    <text>
      <%= for chunks <- @char_lines do %><%= for chunk <- chunks do %><%= if String.trim(chunk.text) != "" do %><tspan dy="1.0em" x="<%= percent(100 * chunk.x / (@cols + 2)) %>" y="<%= percent(100 * chunk.y / (@rows + 1)) %>"<%= if c = svg_text_class(chunk.attrs) do %> class="<%= c %>"<% end %><%= if s = svg_style(chunk.attrs) do %> style="<%= s %>"<% end %>><%= chunk.text %></tspan>
<% end %><% end %><% end %>
    </text>

    <g transform="translate(-50 -50)">
      <svg x="50%" y="50%" width="100" height="100">
        <%= render "_logo.svg" %>
      </svg>
    </g>
  </svg>
</svg>


Hide edit button in contest list from non-admins

<%= gettext("Contests") %>

        <%= gettext("Name") %>
        <%= gettext("Dates") %>
        <%= gettext("Deadline") %>

      <%= for contest <- @contests do %>

          <%= link name_with_flag(contest),
            to: internal_contest_path(@conn, :show, contest)
            %>

        <%= dates(contest) %>
        <%= format_date(contest.deadline) %>

          <%= if admin?(@current_user) do %>
            <%= icon_link("pencil", nil, internal_contest_path(@conn, :edit, contest),
              class: "btn btn-default btn-xs") %>
          <% end %>

      <% end %>

<%= gettext("Contests") %>

        <%= gettext("Name") %>
        <%= gettext("Dates") %>
        <%= gettext("Deadline") %>

      <%= for contest <- @contests do %>

          <%= link name_with_flag(contest),
            to: internal_contest_path(@conn, :show, contest)
            %>

        <%= dates(contest) %>
        <%= format_date(contest.deadline) %>

          <%= icon_link("pencil", nil, internal_contest_path(@conn, :edit, contest),
            class: "btn btn-default btn-xs") %>

      <% end %>