packages feed

battleships-1.0.0: templates/play.hamlet

<div .boards>
  <div .leftBoard>
    <div .boardContent>
      <h3>
        _{MsgYourFleet}
      
      <div .board>
        #{playerGridHtml game expectedAction}
        <div :expectedAction == ActionMove:.actionMove>&nbsp;

      <div .actionBox>
        $if expectedAction == ActionMove
          <form method="POST" action="@{MoveR gameE}">
            <span .expectedAction>_{MsgMoveShip}
            <input .linkButton .redButton type="submit" value=_{MsgSkipMove} />

  <div .rightBoard>
    <div .boardContent>
      <h3>
        _{MsgOpponentsFleet}

      <div .board>
        #{enemyGridHtml game False}
        <div :expectedAction == ActionFire:.actionFire>&nbsp;

      <div .actionBox>
        $if expectedAction == ActionFire
          <span .expectedAction>_{MsgFireShot}

  <div .infoV>
    <div .infoBoxV>
      <h3>_{MsgHints}
      $if devModeOpt
        <h4>_{MsgRemainingTurns remTurns}
      $if showCountdown game
        <h4 .alert>
          $if remTurns == 0
            _{MsgLastTurn}
          $else
            _{MsgRemainingTurns remTurns}
      ^{shipsOpponentWidget game Vertical}
      <div  .watchreplay>
        <a .linkButton .yellowButton href="#!" onclick="window.open('@{SaveGameR gameE}', 'newwindow', 'width=800, height=300'); return false;">
          _{MsgSaveGame}
        <br>
        <a .linkButton .redButton href="#!" onclick="confirmReplay()">
          _{MsgWatchReplay}

  <div .legendV>
    <div .infoBoxV>
      <h3>_{MsgLegend}
      ^{legendWidget Vertical (rulesMove gameRules)}

<div .clear>

<div .infoH>
    <div .infoBoxH>
      <div .watchreplay>
        <a .linkButton .yellowButton href="#!" onclick="window.open('@{SaveGameR gameE}', 'newwindow', 'width=800, height=300'); return false;">
          _{MsgSaveGame}
        <br>
        <a .linkButton .redButton href="#!" onclick="confirmReplay()">
          _{MsgWatchReplay}
      <h3>_{MsgHints}
      $if devModeOpt
        <h4>_{MsgRemainingTurns remTurns}
      $if showCountdown game
        <h4 .alert>
          $if remTurns == 0
            _{MsgLastTurn}
          $else
            _{MsgRemainingTurns remTurns}
      ^{shipsOpponentWidget game Horizontal}

<div .legendH>
  <div .infoBoxH>
    <h3>_{MsgLegend}
    ^{legendWidget Horizontal (rulesMove gameRules)}
<script>
  var replayUrl = '@{ReplayR gameE}';
  var alertCountdown = '#{showAlert}';
  var alertMessage = '_{MsgRemainingTurns remTurns}';
  \$(playScriptInit('@{MoveR gameE}', '@{FireR gameE}'))