<%= form_for @player, Routes.session_path(@conn, @method), fn(f) -> %>

<div class="new-session uk-panel uk-panel-box uk-panel-box-secondary uk-padding uk-flex uk-flex-column">
    <div class="uk-flex-item">
		            <%= if @current_player do %>
					<%= text_input f, :username, "placeholder": @current_player.username, "value": @current_player.username %>
                    <%= text_input f, :old_username, "value": @current_player.username, "class": "uk-hidden"  %>
                    <% else %>
                    <%= text_input f, :username, "placeholder": "Join the game as..." %>
                    <% end %>
		<%= error_tag f, :username %>
    </div>
    <div>
    <%= text_input f, :picture, class: "uk-hidden" %>
    </div>
    <div class="controls uk-margin-top">
        <div class="uk-flex uk-flex-center">
            <ul class="uk-subnav uk-subnav-pill" style="margin-bottom:0px;">
                <li>
                    <%= if @current_player do %>
					<%= submit "Change Name", class: "uk-active uk-subnav-pill", id: "joinGame" %>
                    <% else %>
                    <%= submit "Join", class: "uk-active uk-subnav-pill", id: "joinGame" %>
                    <% end %>
				</li>
            </ul>
        </div>
    </div>
</div>

<% end %>
