view client/src/components/systemconfiguration/MorphologyClassbreaks.vue @ 3612:c48b1e0fccd0

client: configuration: morphology: changed delete button color, to be less flashy
author Markus Kottlaender <markus@intevation.de>
date Wed, 05 Jun 2019 12:42:31 +0200
parents eb694e47782a
children 2055b689be54
line wrap: on
line source

<template>
  <div class="d-flex flex-column pb-4 border-bottom">
    <h5 class="py-2 px-3 mb-2 m-0">
      <translate>Bottleneck Morphology Classbreaks</translate>
    </h5>
    <div class="px-3">
      <h6 class="font-weight-bold"><translate>Sounding Result</translate></h6>
      <div class="d-flex flex-wrap">
        <div
          class="input-group mb-3 mr-2 classbreak"
          v-for="(value, i) in classbreaks"
          :key="i"
        >
          <input
            v-model="classbreaks[i]"
            type="number"
            min="0"
            step="0.1"
            class="form-control form-control-sm"
          />
          <div class="input-group-append">
            <button
              class="btn btn-sm btn-outline-secondary"
              type="button"
              @click="classbreaks.splice(i, 1)"
            >
              <font-awesome-icon icon="trash" />
            </button>
          </div>
        </div>
        <button
          class="btn btn-sm btn-success mb-3"
          @click="
            classbreaks.push(
              classbreaks.length ? classbreaks[classbreaks.length - 1] : 1
            )
          "
        >
          <font-awesome-icon icon="plus" />
        </button>
      </div>
    </div>
    <div class="px-3">
      <h6 class="font-weight-bold">
        <translate>Sounding Result Comparison</translate>
      </h6>
      <div class="d-flex flex-wrap">
        <div
          class="input-group mb-3 mr-2 classbreak"
          v-for="(value, i) in compareClassbreaks"
          :key="i"
        >
          <input
            v-model="compareClassbreaks[i]"
            type="number"
            step="0.1"
            class="form-control form-control-sm"
          />
          <div class="input-group-append">
            <button
              class="btn btn-sm btn-outline-secondary"
              type="button"
              @click="classbreaks.splice(i, 1)"
            >
              <font-awesome-icon icon="trash" />
            </button>
          </div>
        </div>
        <button
          class="btn btn-sm btn-success mb-3"
          @click="
            compareClassbreaks.push(
              compareClassbreaks.length
                ? compareClassbreaks[compareClassbreaks.length - 1]
                : 1
            )
          "
        >
          <font-awesome-icon icon="plus" />
        </button>
      </div>
    </div>
    <div class="mt-4 px-3">
      <a @click.prevent="submit" class="btn btn-info btn-sm text-white">
        <translate>Send</translate>
      </a>
    </div>
  </div>
</template>

<style lang="sass" scoped>
.classbreak
  width: 92px
</style>

<script>
/* This is Free Software under GNU Affero General Public License v >= 3.0
 * without warranty, see README.md and license for details.
 *
 * SPDX-License-Identifier: AGPL-3.0-or-later
 * License-Filename: LICENSES/AGPL-3.0.txt
 *
 * Copyright (C) 2018 by via donau
 *   – Österreichische Wasserstraßen-Gesellschaft mbH
 * Software engineering by Intevation GmbH
 *
 * Author(s):
 * Markus Kottländer <markus@intevation.de>
 */

export default {
  data() {
    return {
      classbreaks: [
        1,
        1.5,
        1.7,
        1.9,
        2.1,
        2.3,
        2.5,
        2.7,
        2.9,
        3.1,
        3.3,
        3.5,
        4.0,
        4.5,
        5,
        5.5,
        6,
        6.5,
        7
      ],
      compareClassbreaks: [
        -2,
        -1.9,
        -1.8,
        -1.7,
        -1.6,
        -1.5,
        -1.4,
        -1.3,
        -1.2,
        -1.1,
        -1,
        -0.9,
        -0.8,
        -0.7,
        -0.6,
        -0.5,
        -0.4,
        -0.3,
        -0.2,
        -0.1,
        0,
        0.1,
        0.2,
        0.3,
        0.4,
        0.5,
        0.6,
        0.7,
        0.8,
        0.9,
        1,
        1.1,
        1.2,
        1.3,
        1.4,
        1.5,
        1.6,
        1.7,
        1.8,
        1.9,
        2
      ]
    };
  },
  methods: {
    submit() {}
  }
};
</script>