~sircmpwn/hire.sr.ht

ffa85ff3ecbd65eaf3496638ae40a6d0dd2a74d7 — Willow Barraco 9 months ago 5f941c9
hiresrht: do not unpublish while pressing <ret> on the form inputs

This re-order the submit buttons to move listed=on first, if already
listed. This also adapt the labels to make things explicit.

This add listed in Profile, which is pointless while querying a list of
Profile, but is mandatory to adapt the gui accordingly, when querying
it with username.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
M api/graph/schema.graphqls => api/graph/schema.graphqls +1 -0
@@ 97,6 97,7 @@ type Profile {
  pricing: [Pricing!]!

  fixed: Boolean!
  listed: Boolean!
  negotiable: Boolean!
}


M hiresrht/blueprints/services.py => hiresrht/blueprints/services.py +1 -0
@@ 156,6 156,7 @@ def get_profile(username):
                    fixed
                    negotiable
                    image
                    listed
                    pricing {
                        id
                        currency

M hiresrht/templates/create_update.html => hiresrht/templates/create_update.html +27 -12
@@ 305,18 305,33 @@
          <div class="event">
            Does everything look good?
            <span class="pull-right">
              <button type="submit" name="listed" value="off"
                href="{{url_for("profile.create_GET")}}"
                class="btn btn-default"
              >
                Save for later {{icon("caret-right")}}
              </button>
              <button type="submit" name="listed" value="on"
                href="{{url_for("profile.create_GET")}}"
                class="btn btn-primary"
              >
                Publish your profile {{icon("caret-right")}}
              </button>
              {% if listed %}
                <button type="submit" name="listed" value="on"
                  href="{{url_for("profile.create_GET")}}"
                  class="btn btn-primary"
                >
                  Update {{icon("caret-right")}}
                </button>
                <button type="submit" name="listed" value="off"
                  href="{{url_for("profile.create_GET")}}"
                  class="btn btn-default"
                >
                  Unpublish {{icon("caret-right")}}
                </button>
              {% else %}
                <button type="submit" name="listed" value="off"
                  href="{{url_for("profile.create_GET")}}"
                  class="btn btn-default"
                >
                  Save for later {{icon("caret-right")}}
                </button>
                <button type="submit" name="listed" value="on"
                  href="{{url_for("profile.create_GET")}}"
                  class="btn btn-primary"
                >
                  Publish your profile {{icon("caret-right")}}
                </button>
              {% endif %}
            </span>
          </div>
        </div>