changeset 1381:632ff17368c6

merge
author Fadi Abbud <fadi.abbud@intevation.de>
date Tue, 27 Nov 2018 14:30:04 +0100
parents 8fdaf0439a68 (current diff) da44c669c9f5 (diff)
children 8b85032ed3cd
files client/src/components/map/fairway/Surveys.vue
diffstat 2 files changed, 65 insertions(+), 120 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/map/fairway/Profiles.vue	Tue Nov 27 14:28:55 2018 +0100
+++ b/client/src/components/map/fairway/Profiles.vue	Tue Nov 27 14:30:04 2018 +0100
@@ -5,9 +5,9 @@
         <font-awesome-icon icon="chart-area" class="mr-2"></font-awesome-icon>
         Profiles
         <font-awesome-icon
-        icon="times"
-        class="ml-auto text-muted"
-        @click="$store.commit('application/showProfiles', false)"
+          icon="times"
+          class="ml-auto text-muted"
+          @click="$store.commit('application/showProfiles', false)"
         ></font-awesome-icon>
       </h6>
       <div class="d-flex flex-column p-3 flex-grow-1 text-left position-relative">
@@ -18,9 +18,9 @@
         <select @click="moveToBottleneck" v-model="selectedBottleneck" class="form-control form-control-sm">
           <option :value="null">Select Bottleneck</option>
           <option
-          v-for="bn in bottlenecks"
-          :key="bn.properties.name"
-          :value="bn.properties.name"
+            v-for="bn in bottlenecks"
+            :key="bn.properties.name"
+            :value="bn.properties.name"
           >{{ bn.properties.name }}</option>
         </select>
         <div v-if="selectedBottleneck">
@@ -29,9 +29,9 @@
               <small class="text-muted">Sounding Result:</small>
               <select v-model="selectedSurvey" class="form-control form-control-sm">
                 <option
-                v-for="survey in surveys"
-                :key="survey.date_info"
-                :value="survey"
+                  v-for="survey in surveys"
+                  :key="survey.date_info"
+                  :value="survey"
                 >{{ survey.date_info }}</option>
               </select>
             </div>
@@ -40,9 +40,9 @@
               <select v-model="additionalSurvey" class="form-control form-control-sm">
                 <option :value="null">None</option>
                 <option
-                v-for="survey in additionalSurveys"
-                :key="survey.date_info"
-                :value="survey"
+                  v-for="survey in additionalSurveys"
+                  :key="survey.date_info"
+                  :value="survey"
                 >{{ survey.date_info }}</option>
               </select>
             </div>
@@ -64,62 +64,63 @@
               Lon: {{ endPoint[0] }}
             </div>
             <button v-clipboard:copy="coordinatesForClipboard"
-            v-clipboard:success="onCopyCoordinates"
-            class="btn btn-info btn-sm ml-auto mt-auto">
-            <font-awesome-icon icon="copy" />
-          </button>
-        </small>
-        <div class="d-flex">
-          <div class="pr-3 w-50" v-if="startPoint && endPoint">
-            <button class="btn btn-info btn-sm w-100"
-            @click="showLabelInput = !showLabelInput">
-            <font-awesome-icon :icon="showLabelInput ? 'times' : 'check'" />
-            {{ showLabelInput ? "Cancel" : "Save" }}
-          </button>
+              v-clipboard:success="onCopyCoordinates"
+              class="btn btn-info btn-sm ml-auto mt-auto"
+            ><font-awesome-icon icon="copy" /></button>
+          </small>
+          <div class="d-flex">
+            <div class="pr-3 w-50" v-if="startPoint && endPoint">
+              <button
+                class="btn btn-info btn-sm w-100"
+                @click="showLabelInput = !showLabelInput"
+              >
+                <font-awesome-icon :icon="showLabelInput ? 'times' : 'check'" />
+                {{ showLabelInput ? "Cancel" : "Save" }}
+              </button>
+            </div>
+            <div :class="startPoint && endPoint ? 'w-50' : 'w-100'">
+              <button
+                class="btn btn-info btn-sm w-100"
+                @click="toggleCutTool"
+              >
+                <font-awesome-icon :icon="cutTool && cutTool.getActive() ? 'times' : 'plus'"></font-awesome-icon>
+                {{ cutTool && cutTool.getActive() ? "Cancel" : "New" }}
+              </button>
+            </div>
+          </div>
+          <div v-if="showLabelInput" class="mt-2">
+            <small class="text-muted">Enter label for cross profile:</small>
+            <div class="position-relative">
+              <input class="form-control form-control-sm pr-5" v-model="cutLabel" />
+              <button
+                class="btn btn-sm btn-info position-absolute input-button-right"
+                @click="saveCut"
+                v-if="cutLabel"
+                style="top: 0; right: 0;"
+              ><font-awesome-icon icon="check" /></button>
+            </div>
+          </div>
+          <small class="text-muted d-block mt-2">Saved cross profiles:</small>
+          <select class="form-control form-control-sm" v-model="coordinatesSelect">
+            <option></option>
+            <option v-for="(cut, index) in previousCuts" :value="cut.coordinates" :key="index">
+              {{ cut.label }}
+            </option>
+          </select>
+          <small class="text-muted d-block mt-2">Enter coordinates manually:</small>
+          <div class="position-relative">
+            <input class="form-control form-control-sm pr-5" placeholder="Lat,Lon,Lat,Lon" v-model="coordinatesInput" />
+            <button
+              class="btn btn-sm btn-info position-absolute input-button-right" 
+              @click="applyManualCoordinates"
+              style="top: 0; right: 0;"
+              v-if="coordinatesInputIsValid"
+            ><font-awesome-icon icon="check" /></button>
+          </div>
         </div>
-        <div :class="startPoint && endPoint ? 'w-50' : 'w-100'">
-          <button
-          class="btn btn-info btn-sm w-100"
-          @click="toggleCutTool"
-          >
-          <font-awesome-icon :icon="cutTool && cutTool.getActive() ? 'times' : 'plus'"></font-awesome-icon>
-          {{ cutTool && cutTool.getActive() ? "Cancel" : "New" }}
-        </button>
       </div>
     </div>
-    <div v-if="showLabelInput" class="mt-2">
-      <small class="text-muted">Enter label for cross profile:</small>
-      <div class="position-relative">
-        <input class="form-control form-control-sm pr-5" v-model="cutLabel" />
-        <button class="btn btn-sm btn-info position-absolute input-button-right"
-        @click="saveCut"
-        v-if="cutLabel"
-        style="top: 0; right: 0;">
-        <font-awesome-icon icon="check" />
-      </button>
-    </div>
   </div>
-  <small class="text-muted d-block mt-2">Saved cross profiles:</small>
-  <select class="form-control form-control-sm" v-model="coordinatesSelect">
-    <option></option>
-    <option v-for="(cut, index) in previousCuts" :value="cut.coordinates" :key="index">
-      {{ cut.label }}
-    </option>
-  </select>
-  <small class="text-muted d-block mt-2">Enter coordinates manually:</small>
-  <div class="position-relative">
-    <input class="form-control form-control-sm pr-5" placeholder="Lat,Lon,Lat,Lon" v-model="coordinatesInput" />
-    <button class="btn btn-sm btn-info position-absolute input-button-right" 
-    @click="applyManualCoordinates"
-    style="top: 0; right: 0;"
-    v-if="coordinatesInputIsValid">
-    <font-awesome-icon icon="check" />
-  </button>
-</div>
-</div>
-</div>
-</div>
-</div>
 </template>
 
 <style lang="sass" scoped>
--- a/client/src/components/map/fairway/Surveys.vue	Tue Nov 27 14:28:55 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-<template>
-  <div
-    class="box expanded ui-element rounded bg-white ml-auto mr-3 mb-3 text-nowrap"
-    v-if="selectedBottleneck && surveys && !selectedSurvey"
-  >
-    <div style="width: 15rem">
-      <h6 class="mb-0 py-2 px-3 border-bottom d-flex align-items-center">
-        {{ selectedBottleneck }}
-        <font-awesome-icon
-          icon="times"
-          class="ml-auto text-muted"
-          @click="$store.dispatch('fairwayprofile/clearSelection')"
-        ></font-awesome-icon>
-      </h6>
-      <div class="p-3">
-        <div
-          v-for="(survey, i) of surveys"
-          :key="survey.data_info"
-          :class="{ 'mt-1': i }"
-          @click.prevent="$store.commit('bottlenecks/setSelectedSurvey', survey)"
-        >
-          <a href="#" @click.prevent>{{ survey.date_info }}</a>
-        </div>
-      </div>
-    </div>
-  </div>
-</template>
-
-<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):
- * Thomas Junk <thomas.junk@intevation.de>
- * Markus Kottländer <markus.kottlaender@intevation.de>
- */
-import { mapState } from "vuex";
-
-export default {
-  name: "surveys",
-  computed: {
-    ...mapState("bottlenecks", [
-      "selectedBottleneck",
-      "surveys",
-      "selectedSurvey"
-    ])
-  }
-};
-</script>