<h2>Edit Channel</h2>

<form action="<%= channel.relative_url %>" method="POST" class="f1">
  <div class="form-group">
    <label for="dname">dname</label>
    <input class="form-control <%= ctx.errors.form_input_class "dname" %>"
      type="text" name="dname" value="<%= ctx.old "dname", channel.dname %>" />
    <%= ctx.errors.form_group_p "dname" -%>
  </div>
  <div class="form-group">
    <label for="handle">handle</label>
    <input class="form-control <%= ctx.errors.form_input_class "handle" %>"
      type="text" name="handle" value="<%= ctx.old "handle", channel.handle %>" />
    <%= ctx.errors.form_group_p "handle" -%>
  </div>
  <div class="form-group">
    <label for="bio">bio</label>
    <textarea class="form-control <%= ctx.errors.form_input_class "bio" %>" name=bio rows=3><%= ctx.old "bio", channel.bio %></textarea>
    <%= ctx.errors.form_group_p "bio" -%>
  </div>
  <div class="form-check">
    <div class="form-check form-check-inline">
      <input class="form-check-input <%= ctx.errors.form_input_class "public" %>" type="radio" name="public" id="publicradio1" value="false" <%= "checked" if ctx.old("public", channel.public.to_s) == "false" %>>
      <label class="form-check-label" for="publicradio1">private</label>
      <br>
    </div>
    <div class="form-check form-check-inline">
      <input class="form-check-input <%= ctx.errors.form_input_class "public" %>" type="radio" name="public" id="publicradio2" value="true" <%= "checked" if ctx.old("public", channel.public.to_s) == "true" %>>
      <label class="form-check-label" for="publicradio2">public</label>
      <br>
    </div>
    <p>Public: anyone can view the channel and it's posts.</p>
    <p>Private: only approved members can view the channel and it's posts.</p>
  </div>
  <div class="form-check">
    <div class="form-check form-check-inline">
      <input class="form-check-input <%= ctx.errors.form_input_class "listed" %>" type="radio" name="listed" id="listedradio1" value="false" <%= "checked" if ctx.old("listed", channel.listed.to_s) == "false" %>>
      <label class="form-check-label" for="listedradio1">unlisted</label>
      <br>
    </div>
    <div class="form-check form-check-inline">
      <input class="form-check-input <%= ctx.errors.form_input_class "listed" %>" type="radio" name="listed" id="listedradio2" value="true" <%= "checked" if ctx.old("listed", channel.listed.to_s) == "true" %>>
      <label class="form-check-label" for="listedradio2">listed</label>
      <br>
    </div>
    <p>Listed: shows up in channel directory.</p>
    <p>Unlisted: missing from channel directory.</p>
  </div>
  <div class="form-group">
    <input type="submit" value="Save" class="btn btn-primary" />
  </div>
</form>
