Pass command line args to start command. Closes #5

#!/bin/sh

set -e

# Path to this script
SCRIPT=$(readlink $0 || true)
if [ -z $SCRIPT ]; then
    SCRIPT=$0
fi;
# Parent directory of this script
SCRIPT_DIR="$(cd `dirname "$SCRIPT"` && pwd -P)"
# Root directory of all releases
RELEASE_ROOT_DIR="$(cd "$SCRIPT_DIR/../.." && pwd -P)"
# Name of the release
REL_NAME="<%= release_name %>"
# Current version of the release
REL_VSN="<%= release_version %>"
# Current version of ERTS being used
ERTS_VSN="<%= erts_vsn %>"
# VM code loading mode, embedded by default, can also be interactive
# See http://erlang.org/doc/man/code.html
CODE_LOADING_MODE="${CODE_LOADING_MODE:-embedded}"
# Directory containing the current version of this release
REL_DIR="$RELEASE_ROOT_DIR/releases/$REL_VSN"
# The lib directory for this release
REL_LIB_DIR="$RELEASE_ROOT_DIR/lib"
# Options passed to erl
ERL_OPTS="<%= release.profile.erl_opts %>"
# When stdout is piped to a file, this is the directory those files will
# be stored in. defaults to /log in the release root directory
RUNNER_LOG_DIR="${RUNNER_LOG_DIR:-$RELEASE_ROOT_DIR/log}"
# A string of extra options to pass to erl, here for plugins
EXTRA_OPTS=""

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

cd "$ROOTDIR"

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

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

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

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

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

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

        mkdir -p "$PIPE_DIR"

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

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

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

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

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

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

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

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

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

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

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

        shift
        _rem_sh
        ;;

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

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

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

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

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

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

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

        export EMU
        export PROGNAME

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

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

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

        # Dump environment info for logging purposes
        echo "Exec: $@" -- ${1+$ARGS} ${EXTRA_OPTS}
        echo "Root: $ROOTDIR"

        # Log the startup
        echo "$RELEASE_ROOT_DIR"
        logger -t "$REL_NAME[$$]" "Starting up"

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

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

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

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

        export EMU
        export PROGNAME

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

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

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

        # Dump environment info for logging purposes
        echo "Exec: $@" -- ${1+$ARGS}
        echo "Root: $ROOTDIR"

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

        shift

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

        shift

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

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

exit 0

#!/bin/sh

set -e

# Path to this script
SCRIPT=$(readlink $0 || true)
if [ -z $SCRIPT ]; then
    SCRIPT=$0
fi;
# Parent directory of this script
SCRIPT_DIR="$(cd `dirname "$SCRIPT"` && pwd -P)"
# Root directory of all releases
RELEASE_ROOT_DIR="$(cd "$SCRIPT_DIR/../.." && pwd -P)"
# Name of the release
REL_NAME="<%= release_name %>"
# Current version of the release
REL_VSN="<%= release_version %>"
# Current version of ERTS being used
ERTS_VSN="<%= erts_vsn %>"
# VM code loading mode, embedded by default, can also be interactive
# See http://erlang.org/doc/man/code.html
CODE_LOADING_MODE="${CODE_LOADING_MODE:-embedded}"
# Directory containing the current version of this release
REL_DIR="$RELEASE_ROOT_DIR/releases/$REL_VSN"
# The lib directory for this release
REL_LIB_DIR="$RELEASE_ROOT_DIR/lib"
# Options passed to erl
ERL_OPTS="<%= release.profile.erl_opts %>"
# When stdout is piped to a file, this is the directory those files will
# be stored in. defaults to /log in the release root directory
RUNNER_LOG_DIR="${RUNNER_LOG_DIR:-$RELEASE_ROOT_DIR/log}"
# A string of extra options to pass to erl, here for plugins
EXTRA_OPTS=""

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

cd "$ROOTDIR"

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

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

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

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

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

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

        mkdir -p "$PIPE_DIR"

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

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

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

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

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

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

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

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

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

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

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

        shift
        _rem_sh
        ;;

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

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

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

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

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

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

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

        export EMU
        export PROGNAME

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

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

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

        # Dump environment info for logging purposes
        echo "Exec: $@" -- ${1+$ARGS} ${EXTRA_OPTS}
        echo "Root: $ROOTDIR"

        # Log the startup
        echo "$RELEASE_ROOT_DIR"
        logger -t "$REL_NAME[$$]" "Starting up"

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

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

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

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

        export EMU
        export PROGNAME

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

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

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

        # Dump environment info for logging purposes
        echo "Exec: $@" -- ${1+$ARGS}
        echo "Root: $ROOTDIR"

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

        shift

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

        shift

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

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

exit 0


contract title

contract title

Transaction Information

  <span class="fa <%= get_icon(@transaction.type) %>">
  <%= get_type(@transaction.type) %>
  | Hash:
  <%= @transaction.txid %>

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

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

<%= gettext "Claimed from" %>

        <%= for input <- @transaction.claims do %>

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

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

        <% end %>
      <% end %>
      <%= if @transaction.type != "ClaimTransaction" and @transaction.vin != []  do %>

<%= gettext "Sent from" %>

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

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

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

        <% end %>
      <% end %>

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

      <%= if @transaction.vouts != [] do %>

<%= gettext "Sent to" %>

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

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

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

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

<%= gettext "Registered" %>

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

<%= Helpers.round_or_not(@transaction.asset.amount) %> <%= Api.get_asset_name(@transaction.txid) %>

      <% end %>

<%= gettext "Time" %>

<%= compare_time_and_get_minutes(@transaction.time) %>

      <%= get_explanation("transaction_time") %>

<%= gettext "Network Fee" %>

<%= @transaction.net_fee %>

      <%= get_explanation("transaction_network_fees") %>

<%= gettext "System Fee" %>

<%= @transaction.sys_fee %>

      <%= get_explanation("transaction_system_fees") %>

<%= gettext "Included in Block" %>

<a href="<%= block_path( @conn, :index, @transaction.block_hash) %>" alt="View transaction" title="View transaction" class="large-blue-link col-4-width"><%= @transaction.block_height %>

<%= gettext "Size" %>

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

      <%= get_explanation("transaction_size") %>

  <%= if @transaction.contract != nil do %>

<%= gettext "Contract" %>

<%= Poison.encode!(@transaction.contract) %>

  <% end %>

<%= gettext "Bytecode Invocation Script" %>

      <%= get_explanation("bytecode_invocation_script") %>

			<%= for script <- @transaction.scripts do %>

<%= get_inv(script) %>

			<% end %>

<%= gettext "Bytecode Verification Script" %>

      <%= get_explanation("bytecode_verification_script") %>

			<%= for script <- @transaction.scripts do %>

<%= get_ver(script) %>

			<% end %>

  <%= if @transaction.attributes != [] do %>
		<%= for att <- @transaction.attributes do %>

<%= gettext "Atributte: " %> <%=att["usage"]%>

<%= att["data"] %>

		<% end %>
  <% end %>
  <%= if @transaction.script != nil do %>

<%= gettext "Bytecode Script" %>

<%= @transaction.script %>

  <% end %>

<%= gettext "Opcode Invocation Script" %>

      <%= get_explanation("opcode_invocation_script") %>

        <%= for script <- @transaction.scripts do %>
          <%= for operation <- parse_invocation(script) do %>
            <%= operation %>
          <% end %>
        <% end %>

<%= gettext "Opcode Verification Script" %>

      <%= get_explanation("opcode_verification_script") %>

        <%= for script <- @transaction.scripts do %>
          <%= for operation <- parse_verification(script) do %>
            <%= operation %>
          <% end %>
        <% end %>

  <%= if @transaction.attributes != [] do %>
		<%= for att <- @transaction.attributes do %>

<%= gettext "Opcode Attribute:" %> <%=att["usage"]%>

<%= Disassembler.parse_script(att["data"]) %>

		<% end %>
  <% end %>
  <%= if @transaction.script != nil do %>

<%= gettext "Opcode Script" %>

<%= Disassembler.parse_script(@transaction.script) %>

  <% end %>

Transaction Information

  <span class="fa <%= get_icon(@transaction.type) %>">
  <%= get_type(@transaction.type) %>
  | Hash:
  <%= @transaction.txid %>

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

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

<%= gettext "Claimed from" %>

        <%= for input <- @transaction.claims do %>

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

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

        <% end %>
      <% end %>
      <%= if @transaction.type != "ClaimTransaction" and @transaction.vin != []  do %>

<%= gettext "Sent from" %>

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

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

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

        <% end %>
      <% end %>

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

      <%= if @transaction.vouts != [] do %>

<%= gettext "Sent to" %>

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

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

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

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

<%= gettext "Registered" %>

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

<%= Helpers.round_or_not(@transaction.asset.amount) %> <%= Api.get_asset_name(@transaction.txid) %>

      <% end %>

<%= gettext "Time" %>

<%= compare_time_and_get_minutes(@transaction.time) %>

      <%= get_explanation("transaction_time") %>

<%= gettext "Network Fee" %>

<%= @transaction.net_fee %>

      <%= get_explanation("transaction_network_fees") %>

<%= gettext "System Fee" %>

<%= @transaction.sys_fee %>

      <%= get_explanation("transaction_system_fees") %>

<%= gettext "Included in Block" %>

<a href="<%= block_path( @conn, :index, @transaction.block_hash) %>" alt="View transaction" title="View transaction" class="large-blue-link col-4-width"><%= @transaction.block_height %>

<%= gettext "Size" %>

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

      <%= get_explanation("transaction_size") %>

  <%= if @transaction.contract != nil do %>

<%= gettext "Bytecode Script" %>

<%= Poison.encode!(@transaction.contract) %>

  <% end %>

<%= gettext "Bytecode Invocation Script" %>

      <%= get_explanation("bytecode_invocation_script") %>

			<%= for script <- @transaction.scripts do %>

<%= get_inv(script) %>

			<% end %>

<%= gettext "Bytecode Verification Script" %>

      <%= get_explanation("bytecode_verification_script") %>

			<%= for script <- @transaction.scripts do %>

<%= get_ver(script) %>

			<% end %>

  <%= if @transaction.attributes != [] do %>
		<%= for att <- @transaction.attributes do %>

<%= gettext "Atributte: " %> <%=att["usage"]%>

<%= att["data"] %>

		<% end %>
  <% end %>
  <%= if @transaction.script != nil do %>

<%= gettext "Bytecode Script" %>

<%= @transaction.script %>

  <% end %>

<%= gettext "Opcode Invocation Script" %>

      <%= get_explanation("opcode_invocation_script") %>

        <%= for script <- @transaction.scripts do %>
          <%= for operation <- parse_invocation(script) do %>
            <%= operation %>
          <% end %>
        <% end %>

<%= gettext "Opcode Verification Script" %>

      <%= get_explanation("opcode_verification_script") %>

        <%= for script <- @transaction.scripts do %>
          <%= for operation <- parse_verification(script) do %>
            <%= operation %>
          <% end %>
        <% end %>

  <%= if @transaction.attributes != [] do %>
		<%= for att <- @transaction.attributes do %>

<%= gettext "Opcode Attribute:" %> <%=att["usage"]%>

<%= Disassembler.parse_script(att["data"]) %>

		<% end %>
  <% end %>
  <%= if @transaction.script != nil do %>

<%= gettext "Opcode Script" %>

<%= Disassembler.parse_script(@transaction.script) %>

  <% end %>


Style official rules button

Style official rules button

Teilnahmeregeln

  Hier erfährst du, wie du an “Jugend musiziert” teilnehmen kannst.

Bitte lies dir zunächst die aktuelle Ausschreibung durch. Dort findest du unter anderem die Altersgruppen, Teilnahmebedingungen sowie alle offiziellen Kategorien:

      <%= icon_link "file", "Ausschreibung 2019", static_path(@conn, "/resources/Ausschreibung_2019.pdf"), class: "btn btn-link" %>

In der Region Nord- und Osteuropa bestehen zusätzlich die folgenden Sonderregelungen:

Populäre Musik

1. Erweiterung offizieller Pop-Kategorien

Grundsätzlich gilt: Ist eine Pop-Kategorie offiziell ausgeschrieben, gelten für sie die Regeln der Ausschreibung. Eine Weiterleitung ist dann je nach Altersgruppe bis zum Bundeswettbewerb möglich.

Die Region Nord- und Osteuropa erweitert diese Kategorie(n) um die Sonderregelung, dass im Landeswettbewerb bis zu drei jugendliche Begleiter mitwirken können, deren gemeinsame Altersgruppe zwischen III und VI liegen muss. Sie müssen im Regionalwettbewerb ebenfalls 23 Punkte erreicht haben und werden gesondert als Begleitgruppe gewertet. Für den Bundeswettbewerb gilt dann nur noch die offizielle Ausschreibung.

2. Sonderkategorien

In der Region Nord- und Osteuropa werden außerdem die untenstehenden Sonderkategorien angeboten. In diesen ist die Teilnahme grundsätzlich nur in den Altersgruppen III–VI (bei Gesangskategorien: III–VII) möglich, und sie führen nur bis zum Landeswettbewerb.

Für die Begleitgruppe wird eine gemeinsame Altersgruppe errechnet, die zwischen III und VI liegen muss.

              Instrumental-Solo (Pop)

Zugelassen sind alle elektronisch verstärkten Instrumente, für die im Wettbewerbsjahr keine offizielle Pop-Kategorie ausgeschrieben ist. Ebenfalls erlaubt sind akustische Instrumente, nicht jedoch Klavier. Eine Teilnahme mit Keyboard ist dagegen möglich, sofern dessen klangtechnische Möglichkeiten ausgeschöpft werden.

Empfohlen wird eine große Bandbreite an Stilistiken und Techniken der populären Musik. Bei elektronisch verstärkten Instrumenten empfiehlt sich die Verwendung unterschiedlicher Sounds. Bei akustischen Instrumenten sollten auch Spieltechniken verwendet werden, die bei der Interpretation klassischer Musik nicht üblich sind.

Vorspielprogramm

Ein Titel muss völlig unbegleitet präsentiert werden. Bei begleiteten Titeln muss die solistische Rolle klar zum Tragen kommen, z.B. in Form eines Instrumentalsolos.

Nur ein Titel darf mit Playback begleitet werden. Der eigene Part darf nicht im Playback gedoppelt sein.

Bei höchstens einem Werk ist ein Loop zulässig.

Die Auftrittszeit (siehe Tabelle) darf einschließlich Umbau und Stimmen nicht überschritten werden.

                  Altersgruppe
                  Programm
                  Auftrittszeit

                  III
                  mindestens zwei stilistisch unterschiedliche Titel
                  10–15 Minuten

                  IV
                  mindestens drei stilistisch unterschiedliche Titel, darunter eine eigene Komposition oder Improvisation
                  10–15 Minuten

                  V und VI
                  mindestens drei stilistisch unterschiedliche Titel, darunter eine eigene Komposition oder Improvisation
                  15–20 Minuten

Begleiter

Zugelassen für alle Altersgruppen sind bis zu drei jugendliche Begleiter, die gesondert als Begleitgruppe bewertet werden. Gewertet wird nur, wer an mindestens zwei Stücken mitwirkt. Auch Begleitgruppen brauchen für eine Weiterleitung mindestens 23 Punkte. Alternativ ist auch ein erwachsener, nicht zu bewertender Begleiter möglich.

“Kinder musizieren” (Kimu)

Der Wettbewerb “Kinder musizieren” wird mittlerweile an zahlreichen Schulen der Region Nord- und Osteuropa angeboten. Es kann mit einem beliebigen Instrument oder Gesang teilgenommen werden. Auch Mehrfachteilnahmen und Ensemblespiel sind erlaubt.

Empfohlen wird Kimu besonders für Instrumentalanfänger, die noch keine oder wenig Bühnenerfahrung besitzen. Kimu ist der sanfte Einstieg, bei dem die Motivation zum Weitermachen im Vordergrund steht.

      Teilnahmeanforderungen:

Mindestens zwei Stücke unterschiedlichen Charakters (z.B. schnell – langsam)

Vorspieldauer: höchstens 5 Minuten

Die Anmeldung findet, genau wie für den "großen" Jumu-Wettbewerb, über diese Website statt. Dazu einfach auf der <%= link "Anmeldeseite", to: page_path(@conn, :registration) %> den Kimu-Wettbewerb der jeweiligen Schule auswählen!

Teilnahmeregeln

  Hier erfährst du, wie du an “Jugend musiziert” teilnehmen kannst.

Bitte lies dir zunächst die aktuelle Ausschreibung durch. Dort findest du unter anderem die Altersgruppen, Teilnahmebedingungen sowie alle offiziellen Kategorien:

      <%= icon_link "file", "Ausschreibung 2019", static_path(@conn, "/resources/Ausschreibung_2019.pdf"), class: "btn btn-info" %>

In der Region Nord- und Osteuropa bestehen zusätzlich die folgenden Sonderregelungen:

Populäre Musik

1. Erweiterung offizieller Pop-Kategorien

Grundsätzlich gilt: Ist eine Pop-Kategorie offiziell ausgeschrieben, gelten für sie die Regeln der Ausschreibung. Eine Weiterleitung ist dann je nach Altersgruppe bis zum Bundeswettbewerb möglich.

Die Region Nord- und Osteuropa erweitert diese Kategorie(n) um die Sonderregelung, dass im Landeswettbewerb bis zu drei jugendliche Begleiter mitwirken können, deren gemeinsame Altersgruppe zwischen III und VI liegen muss. Sie müssen im Regionalwettbewerb ebenfalls 23 Punkte erreicht haben und werden gesondert als Begleitgruppe gewertet. Für den Bundeswettbewerb gilt dann nur noch die offizielle Ausschreibung.

2. Sonderkategorien

In der Region Nord- und Osteuropa werden außerdem die untenstehenden Sonderkategorien angeboten. In diesen ist die Teilnahme grundsätzlich nur in den Altersgruppen III–VI (bei Gesangskategorien: III–VII) möglich, und sie führen nur bis zum Landeswettbewerb.

Für die Begleitgruppe wird eine gemeinsame Altersgruppe errechnet, die zwischen III und VI liegen muss.

              Instrumental-Solo (Pop)

Zugelassen sind alle elektronisch verstärkten Instrumente, für die im Wettbewerbsjahr keine offizielle Pop-Kategorie ausgeschrieben ist. Ebenfalls erlaubt sind akustische Instrumente, nicht jedoch Klavier. Eine Teilnahme mit Keyboard ist dagegen möglich, sofern dessen klangtechnische Möglichkeiten ausgeschöpft werden.

Empfohlen wird eine große Bandbreite an Stilistiken und Techniken der populären Musik. Bei elektronisch verstärkten Instrumenten empfiehlt sich die Verwendung unterschiedlicher Sounds. Bei akustischen Instrumenten sollten auch Spieltechniken verwendet werden, die bei der Interpretation klassischer Musik nicht üblich sind.

Vorspielprogramm

Ein Titel muss völlig unbegleitet präsentiert werden. Bei begleiteten Titeln muss die solistische Rolle klar zum Tragen kommen, z.B. in Form eines Instrumentalsolos.

Nur ein Titel darf mit Playback begleitet werden. Der eigene Part darf nicht im Playback gedoppelt sein.

Bei höchstens einem Werk ist ein Loop zulässig.

Die Auftrittszeit (siehe Tabelle) darf einschließlich Umbau und Stimmen nicht überschritten werden.

                  Altersgruppe
                  Programm
                  Auftrittszeit

                  III
                  mindestens zwei stilistisch unterschiedliche Titel
                  10–15 Minuten

                  IV
                  mindestens drei stilistisch unterschiedliche Titel, darunter eine eigene Komposition oder Improvisation
                  10–15 Minuten

                  V und VI
                  mindestens drei stilistisch unterschiedliche Titel, darunter eine eigene Komposition oder Improvisation
                  15–20 Minuten

Begleiter

Zugelassen für alle Altersgruppen sind bis zu drei jugendliche Begleiter, die gesondert als Begleitgruppe bewertet werden. Gewertet wird nur, wer an mindestens zwei Stücken mitwirkt. Auch Begleitgruppen brauchen für eine Weiterleitung mindestens 23 Punkte. Alternativ ist auch ein erwachsener, nicht zu bewertender Begleiter möglich.

“Kinder musizieren” (Kimu)

Der Wettbewerb “Kinder musizieren” wird mittlerweile an zahlreichen Schulen der Region Nord- und Osteuropa angeboten. Es kann mit einem beliebigen Instrument oder Gesang teilgenommen werden. Auch Mehrfachteilnahmen und Ensemblespiel sind erlaubt.

Empfohlen wird Kimu besonders für Instrumentalanfänger, die noch keine oder wenig Bühnenerfahrung besitzen. Kimu ist der sanfte Einstieg, bei dem die Motivation zum Weitermachen im Vordergrund steht.

      Teilnahmeanforderungen:

Mindestens zwei Stücke unterschiedlichen Charakters (z.B. schnell – langsam)

Vorspieldauer: höchstens 5 Minuten

Die Anmeldung findet, genau wie für den "großen" Jumu-Wettbewerb, über diese Website statt. Dazu einfach auf der <%= link "Anmeldeseite", to: page_path(@conn, :registration) %> den Kimu-Wettbewerb der jeweiligen Schule auswählen!


downcase before creating link in feed backlog index

  <%= link "Import 100", to: feed_backlog_path(@conn, :import_100),
                         class: "btn btn-danger" %>
  <%= link "Subscribe All", to: feed_backlog_path(@conn, :subscribe),
                            class: "btn btn-info" %>
  <%= link "Subscribe 50", to: feed_backlog_path(@conn, :subscribe50),
                            class: "btn btn-info" %>

Listing the last <%= Enum.count(@backlog_feeds) %> of <%= @feedcount %> backlog feeds

      ID
      Url
      Feed generator
      In progress
      User

<%= for feed_backlog <- @backlog_feeds do %>

      <%= feed_backlog.id %>

        <%= link feed_backlog.url, to: String.downcase(feed_backlog.url), target: "_blank" %>

        <%= if feed = Feed.clean_and_best_matching(feed_backlog.url) do %>
          <%= link [ fa_icon("feed"), " Create alternate feed"],
                   to: alternate_feed_path(@conn, :create_from_backlog, feed_id: feed.id,
                                                                        url: feed_backlog.url,
                                                                        backlog_id: feed_backlog.id),
                   method: :post,
                   class: "btn btn-info btn-xs" %> for <%= feed.self_link_url %>
        <% end %>

      <%= feed_backlog.feed_generator %>
      <%= feed_backlog.in_progress %>
      <%= feed_backlog.user_id %>

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

<% end %>

<%= link "New feed backlog", to: feed_backlog_path(@conn, :new) %>

  <%= link "Import 100", to: feed_backlog_path(@conn, :import_100),
                         class: "btn btn-danger" %>
  <%= link "Subscribe All", to: feed_backlog_path(@conn, :subscribe),
                            class: "btn btn-info" %>
  <%= link "Subscribe 50", to: feed_backlog_path(@conn, :subscribe50),
                            class: "btn btn-info" %>

Listing the last <%= Enum.count(@backlog_feeds) %> of <%= @feedcount %> backlog feeds

      ID
      Url
      Feed generator
      In progress
      User

<%= for feed_backlog <- @backlog_feeds do %>

      <%= feed_backlog.id %>

        <%= link feed_backlog.url, to: feed_backlog.url, target: "_blank" %>

        <%= if feed = Feed.clean_and_best_matching(feed_backlog.url) do %>
          <%= link [ fa_icon("feed"), " Create alternate feed"],
                   to: alternate_feed_path(@conn, :create_from_backlog, feed_id: feed.id,
                                                                        url: feed_backlog.url,
                                                                        backlog_id: feed_backlog.id),
                   method: :post,
                   class: "btn btn-info btn-xs" %> for <%= feed.self_link_url %>
        <% end %>

      <%= feed_backlog.feed_generator %>
      <%= feed_backlog.in_progress %>
      <%= feed_backlog.user_id %>

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

<% end %>

<%= link "New feed backlog", to: feed_backlog_path(@conn, :new) %>


Disalow multiple presses of submit on fw page

<meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title> Configure your firmware </title>
  <link rel="stylesheet" href="/styles.css">

Configure your FarmBot

Firmware

      Your firmware is flashing.

      <form action=configure_firmware method=post>
        <fieldset>
          <select name=firmware_hardware>
            <option value="arduino"> Arduino/RAMPS (Genesis v1.2) </option>
            <option value="farmduino"> Farmduino (Genesis v1.3) </option>
          </select>
        </fieldset>

    <input type=submit value="next">

  </form>


Fixed display of search results option

Fixed display of search results option

Now only shows if results of respective type are available.
Closes #491

  <%= render "form.html", conn: @conn, changeset: @changeset,
                            action: search_query_path(@conn, :create) %>

	<%= if(@conn.assigns[:query]) do %>
  <%= gen_breadcrumbs([
    {gettext("Search"), search_query_path(@conn, :new)},
    gettext("Results")]) %>

  <% else %>
  <%= gen_breadcrumbs([
    gettext("Search")]) %>
  <% end %>

    <%= render Vutuv.SharedView, "_ad.html" %>

<%= if @conn.assigns[:user_results] do %>

  <%= if(@conn.params["skills"] == "true") do %>
  	<%= if Enum.count(@user_results) > 0 do %>

Show user results

	  <% end %>
	<% else %>
		<%= if Enum.count(@skill_results) > 0 do %>

Show skill results

	  <% end %>
	<% end %>

	<%= if(@conn.params["skills"] == "true") do %>
    <%= render Vutuv.SkillView, "card_list.html", conn: @conn, skills: @skill_results, current_user: @current_user, current_user_id: @current_user_id, work_string_length: 45 %>
  <% else %>
    <%= render Vutuv.UserView, "card_list.html", conn: @conn, users: @user_results, current_user: @current_user, current_user_id: @current_user_id, work_string_length: 45 %>
  <% end %>

<% end %>

  <%= render "form.html", conn: @conn, changeset: @changeset,
                            action: search_query_path(@conn, :create) %>

	<%= if(@conn.assigns[:query]) do %>
  <%= gen_breadcrumbs([
    {gettext("Search"), search_query_path(@conn, :new)},
    gettext("Results")]) %>

  <% else %>
  <%= gen_breadcrumbs([
    gettext("Search")]) %>
  <% end %>

    <%= render Vutuv.SharedView, "_ad.html" %>

<%= if @conn.assigns[:user_results] do %>

  <%= if(@conn.params["skills"] == "true") do %>

Show user results

	<% else %>

Show skill results

	<% end %>

	<%= if(@conn.params["skills"] == "true") do %>
    <%= render Vutuv.SkillView, "card_list.html", conn: @conn, skills: @skill_results, current_user: @current_user, current_user_id: @current_user_id, work_string_length: 45 %>
  <% else %>
    <%= render Vutuv.UserView, "card_list.html", conn: @conn, users: @user_results, current_user: @current_user, current_user_id: @current_user_id, work_string_length: 45 %>
  <% end %>

<% end %>


refactor open feedbacks

refactor open feedbacks

<%= if length(@open_feedback_events) > 0 do %>

      Open feedbacks

    <%= for event <- @open_feedback_events do %>

            <%= event.name %>

              (<%= l(Calendar.DateTime.to_date(event.starts_at)) %> -
              <%= l(Calendar.DateTime.to_date(event.ends_at)) %>)

            <%= link "New feedback", to: classroom_feedback_path(@conn, :new, event), class: "btn btn-sm btn-outline-success" %>

    <% end %>

<% end %>

  <%= if length(@feedbacks) == 0 do %>

No feedbacks available

Open your mind and extend your knowledges and skills.

      <%= link "Discover events", to: page_path(@conn, :index), class: "btn btn-outline-primary" %>

  <% else %>

        Event
        Content rating
        Trainer rating
        Location rating
        Testimonial

      <%= for feedback <- @feedbacks do %>

          <%= link feedback.event.name, to: classroom_feedback_path(@conn, :show, feedback.event) %>

            <%= stars(feedback.content_rating) %>

            <%= feedback.content_comment %>

            <%= stars(feedback.trainer_rating) %>

            <%= feedback.trainer_comment %>

            <%= stars(feedback.location_rating) %>

            <%= feedback.location_comment %>

          <%= feedback.testimonial %>

      <% end %>

  <% end %>

<%= if length(@open_feedback_events) > 0 do %>

      Open feedbacks

    <%= for event <- @open_feedback_events do %>

<%= event.id %> <%= event.name %>

        <%= link "New feedback", to: classroom_feedback_path(@conn, :new, event), class: "btn btn-success" %>

    <% end %>

<% end %>

  <%= if length(@feedbacks) == 0 do %>

No feedbacks available

Open your mind and extend your knowledges and skills.

      <%= link "Discover events", to: page_path(@conn, :index), class: "btn btn-outline-primary" %>

  <% else %>

        Event
        Content rating
        Trainer rating
        Location rating
        Testimonial

      <%= for feedback <- @feedbacks do %>

          <%= link feedback.event.name, to: classroom_feedback_path(@conn, :show, feedback.event) %>

            <%= stars(feedback.content_rating) %>

            <%= feedback.content_comment %>

            <%= stars(feedback.trainer_rating) %>

            <%= feedback.trainer_comment %>

            <%= stars(feedback.location_rating) %>

            <%= feedback.location_comment %>

          <%= feedback.testimonial %>

      <% end %>

  <% end %>


Add link to code repository in footer

Add link to code repository in footer

<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>Open Source @ Mirego</title>

    <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Lato:light,regular,bold,italic&v1">
    <link rel="stylesheet" type="text/css" href="/css/reset.css">
    <link rel="stylesheet" type="text/css" href="/css/style.css">
    <link rel="icon" type="image/png" href="/images/ico-favicon.png">

Mirego

Life

Blog

Org

Code

Open Source @ Mirego

We hope these lines of codes will be useful and help you build great products.

      <%= @inner %>

      Built with ♥ by Mirego. Powered by Elixir + Phoenix.

    <%= if google_analytics_tracker_id do %>

    <% end %>


increase label size

increase label size

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

        <a href="/posts/<%= post.permlink %>"> <img src="<%= img_src %>">

<%= post.category %>

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

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

            <% end %>

  <% end %>

      <%= for {v, i} <- generate_pagination_list(@current_page) do %>

        <a class="<%=if i == @current_page, do: "active" %> item"
           href="<%= @conn.request_path <> "?" <> URI.encode_query(%{"page"=> v}) %>">
          <%= v %>

      <% end %>


Add necessary viewport and notranslate meta tags to layout

<!DOCTYPE html>
<html>
<head>
  <title><%= content_for(:title) || "Cheko" %></title>
  <meta content="True" name="HandheldFriendly"/>
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
  <meta name="viewport" content="width=device-width"/>
  <meta name="google" value="notranslate" />

  <script type="text/javascript" src="/static/assets/application.js"></script>
  <link rel="stylesheet" href="/static/assets/application.css"/>
  <link rel="shortcut icon" href="/static/favicon.ico" />
</head>
<body>
  <%= content_for(:template) %>
</body>
</html>

<!DOCTYPE html>
<html>
<head>
  <title><%= content_for(:title) || "Cheko" %></title>
  <script type="text/javascript" src="/static/assets/application.js"></script>
  <link rel="stylesheet" href="/static/assets/application.css"/>
  <link rel="shortcut icon" href="/static/favicon.ico" />
</head>
<body>
  <%= content_for(:template) %>
</body>
</html>


landing cleanup

landing cleanup

A liquid democracy where anyone can vote on anything.

EXPLORE

		<%= for poll <- @examples do %>

				<a class="liquio-inline" href="/polls/<%= poll.id %>" style="text-decoration: none; display: inline-block;">
					<i class="fa fa-<%= poll.fa_icon %>" aria-hidden="true">

<%= poll.title %>

					<%= render Liquio.HtmlPollView, "embed.html", poll: poll %>

		<%= end %>

		View source on GitHub

A liquid democracy where anyone can vote on anything.

EXPLORE

		<%= for poll <- @examples do %>

				<a class="liquio-inline" href="/polls/<%= poll.id %>" style="text-decoration: none; display: inline-block;">
					<i class="fa fa-<%= poll.fa_icon %>" aria-hidden="true">

<%= poll.title %>

					<%= render Liquio.HtmlPollView, "embed.html", poll: poll %>

		<%= end %>

	Explore more

				Delegations

				Not everyone is an expert at everything. That's why you can give your vote to people you trust, but can override it at any time.

				Objective

				Both sides can present their best arguments.

				Trust metrics

				Attempt to prevent a single person from having multiple identities. Everyone can choose their own trust metric or make a new one.

				No censorship

				Trust metrics contain all subjective logic. The default trust metric lives here. You can always choose a different one.

		View source on GitHub


Add simplyanalytics

Add simplyanalytics

<!doctype html>

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="description" content="">
  <title>Erlang Ecosystem Foundation - Supporting the BEAM community</title>
  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
  <link rel="stylesheet" href="<%= Routes.static_path(@conn, "/css/app.css") %>"/>
  <link href='https://use.fontawesome.com/releases/v5.0.6/css/all.css' rel='stylesheet'>
  <link rel="apple-touch-icon" sizes="57x57" href="/images/apple-icon-57x57.png">
  <link rel="apple-touch-icon" sizes="60x60" href="/images/apple-icon-60x60.png">
  <link rel="apple-touch-icon" sizes="72x72" href="/images/apple-icon-72x72.png">
  <link rel="apple-touch-icon" sizes="76x76" href="/images/apple-icon-76x76.png">
  <link rel="apple-touch-icon" sizes="114x114" href="/images/apple-icon-114x114.png">
  <link rel="apple-touch-icon" sizes="120x120" href="/images/apple-icon-120x120.png">
  <link rel="apple-touch-icon" sizes="144x144" href="/images/apple-icon-144x144.png">
  <link rel="apple-touch-icon" sizes="152x152" href="/images/apple-icon-152x152.png">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-icon-180x180.png">
  <link rel="icon" type="image/png" sizes="192x192" href="/images/android-icon-192x192.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32.png">
  <link rel="icon" type="image/png" sizes="96x96" href="/images/favicon-96x96.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16.png">
  <link rel="manifest" href="/manifest.json">
  <meta name="msapplication-TileColor" content="#ffffff">
  <meta name="msapplication-TileImage" content="/images/ms-icon-144x144.png">
  <meta name="theme-color" content="#ffffff">

  <%= csrf_meta_tag() %>

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

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

      <%=raw flash %>

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

      <%=raw flash %>

    <% end %>
    <%= @inner_content %>

  <%= render "footer.html", assigns %>
  <svg height="0" width="0" viewBox="0 0 864 563">
    <defs>
      <clipPath id="myClip" transform="scale(0.001157407407 0.001776198934)" clipPathUnits="objectBoundingBox">
        <path d="M80.14 0h775.738a8 8 0 017.931 9.044l-72.017 547a8 8 0 01-7.931 6.956H8.122a8 8 0 01-7.931-9.044l72.017-547A8 8 0 0180.139 0z" />
      </clipPath>
    </defs>
  </svg>


Fixing search link in text answer

Fixing search link in text answer

<%= if not @all do %>

<%= @question.number %>. <%= @question.name %>

<%= format_percentage(@percentage_answered) %>% of all survey takers answered this question. <%= @response_count %> responses matching query.
<%= else %>

Searchable compilation of all text responses

<% end %>

<%= form_for @conn, "/admin/report/text/#{@question.number}", [name: :search], fn f -> %>
<input type='submit' style='float: right'>
Search text contents: <input class='text' id='search' name='search' type='text' style='border: 1px; outline: 1px; border-color: black;' value=<%= @search %>>
<%= if not @all do %>
<input name='all' type='checkbox'
</input> Search across all text questions
<% end %>

<%= end %>
<%= for answer <- @answers do %>

<%= answer %>

<% end %>

<%= if not @all do %>

<%= @question.number %>. <%= @question.name %>

<%= format_percentage(@percentage_answered) %>% of all survey takers answered this question. <%= @response_count %> responses matching query.
<%= else %>

Searchable compilation of all text responses

<% end %>

<%= form_for @conn, "/admin/stats/text/#{@question.number}", [name: :search], fn f -> %>
<input type='submit' style='float: right'>
Search text contents: <input class='text' id='search' name='search' type='text' style='border: 1px; outline: 1px; border-color: black;' value=<%= @search %>>
<%= if not @all do %>
<input name='all' type='checkbox'
</input> Search across all text questions
<% end %>

<%= end %>
<%= for answer <- @answers do %>

<%= answer %>

<% end %>


Bugfix: copy paste error

Bugfix: copy paste error

New User

<%= if @changeset.action do %>

Please correct the following errors.

<% end %>

<%= form_for @changeset, user_path(@conn, :create), fn form -> %>

  <%= text_input form, :login_name, placeholder: "Email", class: "form-control" %>
  <%= error_tag form, :login_name %>

  <%= text_input form, :display_name, placeholder: "Name to display", class: "form-control" %>
  <%= error_tag form, :display_name %>

  <%= password_input form, :password, placeholder: "Password", class: "form-control" %>
  <%= error_tag form, :password %>

<%= submit "Create User", class: "btn btn-primary" %>

<% end %>

New User

<%= if @changeset.action do %>

Please correct the following errors.

<% end %>

<%= form_for @changeset, user_path(@conn, :create), fn form -> %>

  <%= text_input form, :login_name, placeholder: "Email", class: "form-control" %>
  <%= error_tag form, :login_name %>

  <%= text_input form, :display_name, placeholder: "Name to display", class: "form-control" %>
  <%= error_tag form, :display_name %>

  <%= password_input form, :password, placeholder: "Password", class: "form-control" %>
  <%= error_tag form, :display_name %>

<%= submit "Create User", class: "btn btn-primary" %>

<% end %>


Control the scripts via elements with a proper id.

Listing builds

      Project
      Number
      Log
      Coordinate
      Config

<%= for build <- @builds do %>

      <%= build.project_id %>
      <%= build.number %>
      <%= build.log %>
      <%= build.coordinate %>
      <%= build.config %>

        <%= link "Show", to: build_path(@conn, :show, build), class: "btn btn-default btn-xs" %>

<% end %>


Adjust volunteer index.

Adjust volunteer index.

Your tasks

      Name
      Deadline
      Status
      Assigned to

<%= for task <- @your_tasks do %>

      <%= task.name %>
      <%= task.start_time %>
      <%= task.finish_time %>
      <%= task_user(@conn, task) %>

        <%= link "Show", to: task_path(@conn, :show, task), class: "btn btn-default btn-xs" %>
        <%= link "Mark as Done", to: task_done_path(@conn, :done, task), method: :post, class: "btn btn-danger btn-xs" %>

<% end %>

Available tasks

      Name
      Deadline
      Status
      Assigned to

<%= for task <- @available_tasks do %>

      <%= task.name %>
      <%= task.start_time %>
      <%= task.finish_time %>
      <%= task_user(@conn, task) %>

        <%= link "Show", to: task_path(@conn, :show, task), class: "btn btn-default btn-xs" %>
        <%= link "Grab", to: task_grab_path(@conn, :grab, task), method: :post, class: "btn btn-default btn-xs" %>

<% end %>

Your tasks

      Name
      Deadline
      Status
      Assigned to

<%= for task <- @your_tasks do %>

      <%= task.name %>
      <%= task.deadline %>
      <%= task.status %>
      <%= task_user(@conn, task) %>

        <%= link "Show", to: task_path(@conn, :show, task), class: "btn btn-default btn-xs" %>
        <%= link "Mark as Done", to: task_done_path(@conn, :done, task), method: :post, class: "btn btn-danger btn-xs" %>

<% end %>

Available tasks

      Name
      Deadline
      Status
      Assigned to

<%= for task <- @available_tasks do %>

      <%= task.name %>
      <%= task.deadline %>
      <%= task.status %>
      <%= task_user(@conn, task) %>

        <%= link "Show", to: task_path(@conn, :show, task), class: "btn btn-default btn-xs" %>
        <%= link "Grab", to: task_grab_path(@conn, :grab, task), method: :post, class: "btn btn-default btn-xs" %>

<% end %>


link to anchor instead of talk-to-us page

Free and confidential live chat with our parenting coaches

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

      Speak to us

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

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

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

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

Our staff

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

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

<% end %>


added +/- svgs

added +/- svgs

<div class="tab-pane js-stock-type <%= active(@stock_type, @stock_by_type)%>" id="<%= @stock_type %>">

      <%= @stock_type %> <%= gettext("remaining:") %>
      <span class="js-credit-count credit-amount" data-credit-type="<%= @type_id %>" >
        <%=  @credits[@stock_type] %>

      <%= for stock <- @stocks do %>
        <div class="js-stock-row stock-entry <%= stock.storage %>" data-stock-id="<%= stock.id %>">

              <%= if stock.image do %>
                <%= img_tag(image_url(stock), class: "stock-image") %>
              <% end %>

<%= stock_description(stock) %>

<%= stock.packaging %>

<%= stock.credits_per_package %>

            <%= stock.quantity %> <%= gettext(" remaining") %>

          <

            <button class="js-remove-stock remove-action" type="button">
              <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs></defs><title>Minus</title><path class="js-remove-stock add_sub-svg" d="M832.771,625H167.229a125,125,0,1,1,0-250H832.771a125,125,0,0,1,0,250Z"/></svg>
            </button>

              <%= quantity(stock, @package) %>

            <button class="js-add-stock add-action" type="button">
              <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs></defs><title>Plus</title><path class=" js-add-stock add_sub-svg" d="M832.771,375H625V167.229a125,125,0,1,0-250,0V375H167.229a125,125,0,1,0,0,250H375V832.771a125,125,0,0,0,250,0V625H832.771a125,125,0,0,0,0-250Z"/></svg>
            </button>

          <button class="clear-action js-clear-stock" type="button">
            <svg class="trashcan-svg js-clear-stock" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><title>Trashcan</title><path d="M720.22 133.17H630c-.16-35.28-15.12-66.23-42.2-87.17-23.29-18-54.25-27.93-87.17-27.93S436.75 28 413.46 46c-27.09 20.95-42 51.89-42.17 87.18H280A82.78 82.78 0 0 0 197.22 216v44.19h604a1.74 1.74 0 0 0 1.74-1.74V216a82.78 82.78 0 0 0-82.74-82.83zM441.78 82.62c15-11.6 36.46-18.26 58.85-18.26s43.84 6.64 58.85 18.26c16 12.34 24.08 29.35 24.19 50.56H417.59c.11-21.18 8.24-38.18 24.19-50.56zM744.39 298.51H254.1v599.71A82.78 82.78 0 0 0 336.88 981h326.47a82.78 82.78 0 0 0 82.78-82.78v-598a1.74 1.74 0 0 0-1.74-1.71zM414.14 881.42a19.84 19.84 0 0 1-39.68 0V439.09a19.84 19.84 0 0 1 39.68 0zm105.81 0a19.84 19.84 0 0 1-39.68 0V439.09a19.84 19.84 0 0 1 39.68 0zm107.14 0a19.84 19.84 0 1 1-39.68 0V439.09a19.84 19.84 0 1 1 39.68 0z"/></svg>
          </button>
          <button class="js-add-stock add-action" type="button">
            Add to Cart
          </button>

      <% end %>

<div class="tab-pane js-stock-type <%= active(@stock_type, @stock_by_type)%>" id="<%= @stock_type %>">

      <%= @stock_type %> <%= gettext("remaining:") %>
      <span class="js-credit-count credit-amount" data-credit-type="<%= @type_id %>" >
        <%=  @credits[@stock_type] %>

      <%= for stock <- @stocks do %>
        <div class="js-stock-row stock-entry <%= stock.storage %>" data-stock-id="<%= stock.id %>">

              <%= if stock.image do %>
                <%= img_tag(image_url(stock), class: "stock-image") %>
              <% end %>

<%= stock_description(stock) %>

<%= stock.packaging %>

<%= stock.credits_per_package %>

            <%= stock.quantity %> <%= gettext(" remaining") %>

            <button class="js-remove-stock remove-action" type="button">
              <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs></defs><title>Minus</title><path class="add_sub-svg" d="M832.771,625H167.229a125,125,0,1,1,0-250H832.771a125,125,0,0,1,0,250Z"/></svg>
            </button>

              <%= quantity(stock, @package) %>

            <button class="js-add-stock add-action" type="button">
              <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs></defs><title>Plus</title><path class="add_sub-svg" d="M832.771,375H625V167.229a125,125,0,1,0-250,0V375H167.229a125,125,0,1,0,0,250H375V832.771a125,125,0,0,0,250,0V625H832.771a125,125,0,0,0,0-250Z"/></svg>
            </button>

          <button class="clear-action " type="button">
            <svg class="trashcan-svg js-clear-stock" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><title>Trashcan</title><path d="M720.22 133.17H630c-.16-35.28-15.12-66.23-42.2-87.17-23.29-18-54.25-27.93-87.17-27.93S436.75 28 413.46 46c-27.09 20.95-42 51.89-42.17 87.18H280A82.78 82.78 0 0 0 197.22 216v44.19h604a1.74 1.74 0 0 0 1.74-1.74V216a82.78 82.78 0 0 0-82.74-82.83zM441.78 82.62c15-11.6 36.46-18.26 58.85-18.26s43.84 6.64 58.85 18.26c16 12.34 24.08 29.35 24.19 50.56H417.59c.11-21.18 8.24-38.18 24.19-50.56zM744.39 298.51H254.1v599.71A82.78 82.78 0 0 0 336.88 981h326.47a82.78 82.78 0 0 0 82.78-82.78v-598a1.74 1.74 0 0 0-1.74-1.71zM414.14 881.42a19.84 19.84 0 0 1-39.68 0V439.09a19.84 19.84 0 0 1 39.68 0zm105.81 0a19.84 19.84 0 0 1-39.68 0V439.09a19.84 19.84 0 0 1 39.68 0zm107.14 0a19.84 19.84 0 1 1-39.68 0V439.09a19.84 19.84 0 1 1 39.68 0z"/></svg>
          </button>
          <button class="js-add-stock add-action" type="button">
            Add to Cart
          </button>

      <% end %>


Fix silly bug.

Fix silly bug.

Duh, this is raw javascript, not es2015.


Update FAQ to reflect new groupings

Update FAQ to reflect new groupings

FAQ

  Hier findest du Antworten auf häufig gestellte Fragen.

Allgemeines

Zu welchem Verbund gehört meine Schule?

Die neuen Verbunde der Auslandsschulen gehen aus den bisherigen Regionen hervor:

          “Spanien/Portugal” → Verbund 1

          “Nord- und Osteuropa” → Verbund 2

          “Östlicher Mittelmeerraum” → Verbund 3

Eine Übersichtskarte findest du auf der <%= link "Startseite", to: Routes.page_path(@conn, :home) %>.

Anmeldung

Ab wann kann ich mich anmelden?

        Im Verbund 2 (siehe oben) kannst du dich ab Oktober des Vorjahres
        <%= link "hier", to: Routes.page_path(@conn, :registration) %> zum Regionalwettbewerb anmelden.
        Nimmst du in einem anderen Verbund teil, findet die RW-Anmeldung über deine Schule statt.

Wann ist Anmeldeschluss?

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

Kann ich mein Vorspielprogramm nach der Anmeldung noch ändern?

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

Muss ich mich für den Landeswettbewerb erneut anmelden?

Im Verbund 2 wird deine Anmeldung automatisch zum LW übernommen. Du bekommst
        dann eine E-Mail mit einem neuen Änderungscode, mit dem du dein Vorspielprogramm
        ändern kannst.

In Verbund 1 und 3 musst du dich für den Landeswettbewerb
        gesondert <%= link "anmelden", to: Routes.page_path(@conn, :registration) %>.

Muss ich mich für den Bundeswettbewerb erneut anmelden?

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

Regeln

Wie wird die Altersgruppe berechnet?

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

Brauchen Begleitpartner eine Weiterleitung für die nächste Runde?

Im Allgemeinen dürfen Begleitpartner von Runde zu Runde frei gewechselt werden und brauchen somit keine Weiterleitung. Ausnahme: Pop-Begleitgruppen im Verbund 2 müssen beim RW mindestens 23 Punkte erreicht haben, um am LW teilnehmen zu dürfen.

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

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

Termine

Kann ich beim Landeswettbewerb Terminwünsche anmelden?

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

“Kinder musizieren” (Kimu)

Wer kann an Kimu teilnehmen?

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

Kann man bei Kimu weitergeleitet werden?

Nein, eine Weiterleitung gibt es bei Kimu nicht.

FAQ

  Hier findest du Antworten auf häufig gestellte Fragen.

Anmeldung

Ab wann kann ich mich anmelden?

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

Wann ist Anmeldeschluss?

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

Kann ich mein Vorspielprogramm nach der Anmeldung noch ändern?

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

Muss ich mich für den Landeswettbewerb erneut anmelden?

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

Muss ich mich für den Bundeswettbewerb erneut anmelden?

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

Regeln

Wie wird die Altersgruppe berechnet?

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

Brauchen Begleitpartner eine Weiterleitung für die nächste Runde?

Im Allgemeinen dürfen Begleitpartner von Runde zu Runde frei gewechselt werden und brauchen somit keine Weiterleitung. Nur Pop-Begleitgruppen müssen beim Regionalwettbewerb mindestens 23 Punkte erreicht haben, um am Landeswettbewerb teilnehmen zu dürfen.

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

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

Termine

Kann ich beim Landeswettbewerb Terminwünsche anmelden?

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

“Kinder musizieren” (Kimu)

Wer kann an Kimu teilnehmen?

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

Kann man bei Kimu weitergeleitet werden?

Nein, eine Weiterleitung gibt es bei Kimu nicht.


adding slightly better report names

adding slightly better report names

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

      <%= render "page_header.html", page_header: "Reports" %>

          <%= render "standard_card.html",card_color: "panel-green",
                                          card_icon: "fa-table",
                                          card_count: 26,
                                          card_description: "Orphaned Objects" %>
          <%= render "standard_card.html",card_color: "panel-primary",
                                          card_icon: "fa-table",
                                          card_count: 26,
                                          card_description: "Bad Hardware" %>

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

      <%= render "page_header.html", page_header: "Reports" %>

          <%= render "standard_card.html",card_color: "panel-green",
                                          card_icon: "fa-table",
                                          card_count: 26,
                                          card_description: "Report 1" %>
          <%= render "standard_card.html",card_color: "panel-primary",
                                          card_icon: "fa-table",
                                          card_count: 26,
                                          card_description: "Report 2" %>


Display auth token in a code tag

Display auth token in a code tag


Fix missing space on contact form

Fix missing space on contact form

<%= gettext("Contact") %>

  <%= gettext("Here is how you can get in touch with us.") %>

<%= gettext("Message us") %>

      <%= gettext("This form is for contacting the international committee of Grouping 2.") %>

      <%= gettext("For questions about local contests, consider contacting your local Jumu organizer (see list below).") %>

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

<%= gettext("Member schools") %>

    <%= render "_accordion.html",
      id: "hosts-accordion",
      items: Enum.map(@hosts, &to_accordion_item/1)
    %>

      <%= gettext("State-level committee") %>
      (<%= gettext("responsible for this website") %>)

          Landesausschuss des DSA-Verbunds 2

          c/o Robert Bär

          Deutsche Schule Helsinki

          Malminkatu 14, 00100 Helsinki

          Finnland

Robert Bär (<%= gettext("chair") %>)

Irene Rieck (<%= gettext("deputy chair") %>)

Joonas Ruppel

Martin Richter

<%= gettext("Privacy") %>

      <%= gettext("To find out how we process your data, please see our") %>
      <%= link gettext("privacy policy"), to: Routes.page_path(@conn, :privacy) %>.


unique tags

unique tags

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

  <% img_src = hd(post.json_metadata["image"] || post.json_metadata["images"] || [false] ) %>

      <a href="/authors/<%= post.author %>/<%= post.permlink %>">

        <%= if img_src do %>
          <img src="<%= img_src %>">
        <% end %>

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

        <a class="ui large blue ribbon label" href="/authors/<%= post.author %>">  @<%= post.author  %>

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

          <% end %>

    <% end %>

      <%= for {v, i} <- generate_pagination_list(@current_page) do %>

      <a class="<%=if v == @current_page, do: "active" %> item"
        href="<%= @conn.request_path <> "?" <> URI.encode_query(%{"page"=> v}) %>">
        <%= v %>

      <% end %>

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

          <% end %>
      <% end %>

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

  <% img_src = hd(post.json_metadata["image"] || post.json_metadata["images"] || [false] ) %>

      <a href="/authors/<%= post.author %>/<%= post.permlink %>">

        <%= if img_src do %>
          <img src="<%= img_src %>">
        <% end %>

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

        <a class="ui large blue ribbon label" href="/authors/<%= post.author %>">  @<%= post.author  %>

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

          <% end %>

    <% end %>

      <%= for {v, i} <- generate_pagination_list(@current_page) do %>

      <a class="<%=if v == @current_page, do: "active" %> item"
        href="<%= @conn.request_path <> "?" <> URI.encode_query(%{"page"=> v}) %>">
        <%= v %>

      <% end %>

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

          <% end %>
      <% end %>


Use default_twitter_handle variable

Use default_twitter_handle variable

<!DOCTYPE html>

    <title>
      <%= page_title(assigns) %> - Today I Learned
    </title>

    <meta name="csrf" content="<%= Plug.CSRFProtection.get_csrf_token() %>">

    <meta name="format-detection" content="telephone=no">
    <meta name="description" content="TIL is an open-source project by Hashrocket that exists to catalogue the sharing & accumulation of knowledge as it happens day-to-day.">

    <meta itemprop="name" content="Today I Learned">
    <meta itemprop="brand" content="Today I Learned">
    <meta itemprop="description" content="TIL is an open-source project by Hashrocket that exists to catalogue the sharing & accumulation of knowledge as it happens day-to-day.">

    <meta name="viewport" content="width=device-width, initial-scale=1">

    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:site" content="@<%= Application.get_env(:tilex, :default_twitter_handle)%>">
    <meta name="twitter:creator" content="@<%= Application.get_env(:tilex, :default_twitter_handle)%>">
    <meta name="twitter:title" content="Today I Learned: a Hashrocket Project">
    <meta name="twitter:description" content="TIL is an open-source project by Hashrocket that exists to catalogue the sharing & accumulation of knowledge as it happens day-to-day. Posts have a 200-word limit, and posting is open to any Rocketeer as well as select friends of the team. We hope you enjoy learning along with us.">
    <meta name="twitter:image" content=<%= TilexWeb.Endpoint.static_url() <> "/assets/til_twittercard.png" %>>

    <link href='//fonts.googleapis.com/css?family=Raleway:700,900' rel='stylesheet' type='text/css'>
    <link href='//fonts.googleapis.com/css?family=Lora:400,700italic,700,400italic' rel='stylesheet' type='text/css'>
    <link rel="alternate feed" type="application/rss+xml" title="Today I Learned" href="/rss">

    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css">

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <link rel="stylesheet" href="<%= static_path(@conn, "/css/app.css") %>">
    <%= if assigns[:canonical_url] do %>
      <link rel="canonical" href="<%= @canonical_url %>">
    <% end %>

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

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

 <%= link("Sign Out", to: auth_path(@conn, :delete), method: :delete) %>

 <%= link("Create Post", to: post_path(@conn, :new)) %>

 <%= link("Profile", to: developer_path(@conn, :edit)) %>

    <% end %>

Today I Learned

          A Hashrocket project

            <a href="https://twitter.com/<%= Application.get_env(:tilex, :default_twitter_handle)%>" class="twitter">Follow on Twitter

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

          <%= message %>

      <% end %>

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

          <%= link("search", to: "#", class: "site_nav__link") %>

            <%= form_tag post_path(@conn, :index), method: :get do %>
              <input type="search" name="q" id="q">
              <%= submit "Search" %>
            <% end %>

          <%= link("?", to: "#", class: "site_nav__link") %>

              Today I Learned is an open-source project by

                Hashrocket

              that exists to catalogue the sharing & accumulation of knowledge
              as it happens day-to-day. Posts have a 200-word limit, and
              posting is open to any Rocketeer as well as selected friends of
              Hashrocket. We hope you enjoy learning along with us.

                  <%= link("/#{Application.get_env(:tilex, :default_twitter_handle)}", to: "https://twitter.com/#{Application.get_env(:tilex, :default_twitter_handle)}", class: "social_twitter") %>

                  <%= link("/hashrocket/tilex", to: "https://github.com/hashrocket/tilex", class: "social_github") %>

          <%= link("Statistics", to: "/statistics", class: "site_nav__link") %>

            <%= link("Twitter", to: "https://twitter.com/#{Application.get_env(:tilex, :default_twitter_handle)}", class: "site_nav__link") %>

            <%= link("Surprise Me", to: "/random", class: "site_nav__link", rel: "nofollow") %>

    <%= if Mix.env != :test do %>

    <% end %>

    <%= if Application.get_env(:tilex, :ga_identifier) do %>

    <% end %>

<!DOCTYPE html>

    <title>
      <%= page_title(assigns) %> - Today I Learned
    </title>

    <meta name="csrf" content="<%= Plug.CSRFProtection.get_csrf_token() %>">

    <meta name="format-detection" content="telephone=no">
    <meta name="description" content="TIL is an open-source project by Hashrocket that exists to catalogue the sharing & accumulation of knowledge as it happens day-to-day.">

    <meta itemprop="name" content="Today I Learned">
    <meta itemprop="brand" content="Today I Learned">
    <meta itemprop="description" content="TIL is an open-source project by Hashrocket that exists to catalogue the sharing & accumulation of knowledge as it happens day-to-day.">

    <meta name="viewport" content="width=device-width, initial-scale=1">

    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:site" content="@hashrockettil">
    <meta name="twitter:creator" content="@hashrockettil">
    <meta name="twitter:title" content="Today I Learned: a Hashrocket Project">
    <meta name="twitter:description" content="TIL is an open-source project by Hashrocket that exists to catalogue the sharing & accumulation of knowledge as it happens day-to-day. Posts have a 200-word limit, and posting is open to any Rocketeer as well as select friends of the team. We hope you enjoy learning along with us.">
    <meta name="twitter:image" content=<%= TilexWeb.Endpoint.static_url() <> "/assets/til_twittercard.png" %>>

    <link href='//fonts.googleapis.com/css?family=Raleway:700,900' rel='stylesheet' type='text/css'>
    <link href='//fonts.googleapis.com/css?family=Lora:400,700italic,700,400italic' rel='stylesheet' type='text/css'>
    <link rel="alternate feed" type="application/rss+xml" title="Today I Learned" href="/rss">

    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css">

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <link rel="stylesheet" href="<%= static_path(@conn, "/css/app.css") %>">
    <%= if assigns[:canonical_url] do %>
      <link rel="canonical" href="<%= @canonical_url %>">
    <% end %>

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

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

 <%= link("Sign Out", to: auth_path(@conn, :delete), method: :delete) %>

 <%= link("Create Post", to: post_path(@conn, :new)) %>

 <%= link("Profile", to: developer_path(@conn, :edit)) %>

    <% end %>

Today I Learned

          A Hashrocket project

            Follow on Twitter

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

          <%= message %>

      <% end %>

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

          <%= link("search", to: "#", class: "site_nav__link") %>

            <%= form_tag post_path(@conn, :index), method: :get do %>
              <input type="search" name="q" id="q">
              <%= submit "Search" %>
            <% end %>

          <%= link("?", to: "#", class: "site_nav__link") %>

              Today I Learned is an open-source project by

                Hashrocket

              that exists to catalogue the sharing & accumulation of knowledge
              as it happens day-to-day. Posts have a 200-word limit, and
              posting is open to any Rocketeer as well as selected friends of
              Hashrocket. We hope you enjoy learning along with us.

                  <%= link("/hashrockettil", to: "https://twitter.com/hashrockettil", class: "social_twitter") %>

                  <%= link("/hashrocket/tilex", to: "https://github.com/hashrocket/tilex", class: "social_github") %>

          <%= link("Statistics", to: "/statistics", class: "site_nav__link") %>

            <%= link("Twitter", to: "https://twitter.com/hashrockettil", class: "site_nav__link") %>

            <%= link("Surprise Me", to: "/random", class: "site_nav__link", rel: "nofollow") %>

    <%= if Mix.env != :test do %>

    <% end %>

    <%= if Application.get_env(:tilex, :ga_identifier) do %>

    <% end %>