<commit_before><template>
    <div class="modal fade" id="edit-activity" tabindex="-1" role="dialog">
        <div class="modal-dialog" role="document">
            <div v-if="activityToEditProperties" class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span>&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">
                        Edit activity <i>{{activityToEdit[1].name}}</i>
                        <i v-show='activityToEdit[1].name === ""'>(no name)</i>
                    </h4>
                </div>
                <div class="modal-body" id="">
                    <div class="form-group">
                        <label for="activityName">Name</label>
                        <input type="text" class="form-control" id="activityName" v-model="activityToEditProperties.name">
                    </div>
                    <div class="form-group">
                        <label for="projectsDropdown">Project</label>
                        <select class="form-control" id="projectsDropdown" v-model="activityToEditProperties.projectID">
                            <option v-for="project in projectList" :value="project[0]">
                                {{project[1].name}}
                            </option>
                        </select>
                    </div>
                    <div class="form-group">
                        <label for="activityName">Date</label>
                        <input type="text" class="form-control" v-model="activityToEditProperties.dateString">
                    </div>
                    <label for="activityDuration">Duration</label>
                    <div class="row" id="activityDuration">
                        <div class="col-xs-2">
                            <div class="form-group">
                                <input type="text" class="form-control editActivityDuration" v-model="activityToEditProperties.durationHours" id="activityDurationHours" @change="hoursChanged(activityToEditProperties, activityToEdit[1])">
                            </div>
                        </div>
                        <div class="col-xs-1 edit-activity-duration-separator">
                            :
                        </div>
                        <div class="col-xs-2">
                            <div class="form-group">
                                <input type="text" class="form-control editActivityDuration" v-model="activityToEditProperties.durationMinutes" id="activityDurationMinutes" @change="minutesChanged(activityToEditProperties, activityToEdit[1])">
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-xs-6 col-sm-6 col-md-3">
                            <div class="form-group">
                                <label for="startTime">start time</label>
                                <input type="time" class="form-control" id="startTime" v-model="activityToEditProperties.startTimeString">
                            </div>
                        </div>
                        <div class="col-xs-6 col-sm-6 col-md-3">
                            <div class="form-group">
                                <label for="endTime">end time</label>
                                <input type="time" class="form-control" id="endTime" v-model="activityToEditProperties.endTimeString">
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>
</template>

<script>
  const formatTime = require('./../../formatTime')

  export default {
    props: ['activityToEdit', 'projectList', 'activityToEditProperties'],
    methods: {
      hoursChanged: function (activityToEditProperties, activityToEditContent) {
        // activityToEditProperties.durationObject contains the previous duration
        if (activityToEditProperties.durationHours < activityToEditProperties.durationObject.hours) {
          // hours decreased
          let hoursDifference = activityToEditProperties.durationObject.hours - activityToEditProperties.durationHours
          activityToEditContent.endTime -= (hoursDifference * 3600)
          activityToEditContent.duration -= (hoursDifference * 3600)
          this.updateEndTimeDuration(activityToEditProperties, activityToEditContent)
        } else if (activityToEditProperties.durationHours > activityToEditProperties.durationObject.hours) {
          // hours increased
          let hoursDifference = activityToEditProperties.durationHours - activityToEditProperties.durationObject.hours
          activityToEditContent.endTime += (hoursDifference * 3600)
          activityToEditContent.duration += (hoursDifference * 3600)
          this.updateEndTimeDuration(activityToEditProperties, activityToEditContent)
        }
      },
      minutesChanged: function (activityToEditProperties, activityToEditContent) {
        // activityToEditProperties.durationObject contains the previous duration
        if (activityToEditProperties.durationMinutes < activityToEditProperties.durationObject.minutes) {
          // minutes decreased
          let minutesDifference = activityToEditProperties.durationObject.minutes - activityToEditProperties.durationMinutes
          activityToEditContent.endTime -= (minutesDifference * 60)
          activityToEditContent.duration -= (minutesDifference * 60)
          this.updateEndTimeDuration(activityToEditProperties, activityToEditContent)
        } else if (activityToEditProperties.durationMinutes > activityToEditProperties.durationObject.minutes) {
          // minutes increased
          let minutesDifference = activityToEditProperties.durationMinutes - activityToEditProperties.durationObject.minutes
          activityToEditContent.endTime += (minutesDifference * 60)
          activityToEditContent.duration += (minutesDifference * 60)
          this.updateEndTimeDuration(activityToEditProperties, activityToEditContent)
        }
      },
      updateEndTimeDuration: function (activityToEditProperties, activityToEditContent) {
        // helper function to update end time and duration
        activityToEditProperties.endTimeString = formatTime.timestampToTimeString(activityToEditContent.endTime)
        // update duration object to be able to compare with it at the next change
        activityToEditProperties.durationObject = formatTime.secondsToTimeObject(activityToEditContent.duration)
      }
    }
  }
</script><commit_msg>removing ability to edit seconds (reverted from commit c67bbd961c608ad8ac65569bf204150a4a7af7ec)<commit_after><template>
    <div class="modal fade" id="edit-activity" tabindex="-1" role="dialog">
        <div class="modal-dialog" role="document">
            <div v-if="activityToEditProperties" class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span>&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">
                        Edit activity <i>{{activityToEdit[1].name}}</i>
                        <i v-show='activityToEdit[1].name === ""'>(no name)</i>
                    </h4>
                </div>
                <div class="modal-body" id="">
                    <div class="form-group">
                        <label for="activityName">Name</label>
                        <input type="text" class="form-control" id="activityName" v-model="activityToEditProperties.name">
                    </div>
                    <div class="form-group">
                        <label for="projectsDropdown">Project</label>
                        <select class="form-control" id="projectsDropdown" v-model="activityToEditProperties.projectID">
                            <option v-for="project in projectList" :value="project[0]">
                                {{project[1].name}}
                            </option>
                        </select>
                    </div>
                    <div class="form-group">
                        <label for="activityName">Date</label>
                        <input type="text" class="form-control" v-model="activityToEditProperties.dateString">
                    </div>
                    <label for="activityDuration">Duration</label>
                    <div class="row" id="activityDuration">
                        <div class="col-xs-2">
                            <div class="form-group">
                                <input type="text" class="form-control editActivityDuration" v-model="activityToEditProperties.durationHours" id="activityDurationHours" @change="hoursChanged(activityToEditProperties, activityToEdit[1])">
                            </div>
                        </div>
                        <div class="col-xs-1 edit-activity-duration-separator">
                            :
                        </div>
                        <div class="col-xs-2">
                            <div class="form-group">
                                <input type="text" class="form-control editActivityDuration" v-model="activityToEditProperties.durationMinutes" id="activityDurationMinutes" @change="minutesChanged(activityToEditProperties, activityToEdit[1])">
                            </div>
                        </div>
                        <div class="col-xs-1 edit-activity-duration-separator">
                            :
                        </div>
                        <div class="col-xs-2">
                            <div class="form-group">
                                <input type="text" class="form-control editActivityDuration" v-model="activityToEditProperties.durationSeconds" id="activityDurationSeconds">
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-xs-6 col-sm-6 col-md-3">
                            <div class="form-group">
                                <label for="startTime">start time</label>
                                <input type="time" class="form-control" id="startTime" v-model="activityToEditProperties.startTimeString">
                            </div>
                        </div>
                        <div class="col-xs-6 col-sm-6 col-md-3">
                            <div class="form-group">
                                <label for="endTime">end time</label>
                                <input type="time" class="form-control" id="endTime" v-model="activityToEditProperties.endTimeString">
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>
</template>

<script>
  const formatTime = require('./../../formatTime')

  export default {
    props: ['activityToEdit', 'projectList', 'activityToEditProperties'],
    methods: {
      hoursChanged: function (activityToEditProperties, activityToEditContent) {
        // activityToEditProperties.durationObject contains the previous duration
        if (activityToEditProperties.durationHours < activityToEditProperties.durationObject.hours) {
          // hours decreased
          let hoursDifference = activityToEditProperties.durationObject.hours - activityToEditProperties.durationHours
          activityToEditContent.endTime -= (hoursDifference * 3600)
          activityToEditContent.duration -= (hoursDifference * 3600)
          this.updateEndTimeDuration(activityToEditProperties, activityToEditContent)
        } else if (activityToEditProperties.durationHours > activityToEditProperties.durationObject.hours) {
          // hours increased
          let hoursDifference = activityToEditProperties.durationHours - activityToEditProperties.durationObject.hours
          activityToEditContent.endTime += (hoursDifference * 3600)
          activityToEditContent.duration += (hoursDifference * 3600)
          this.updateEndTimeDuration(activityToEditProperties, activityToEditContent)
        }
      },
      minutesChanged: function (activityToEditProperties, activityToEditContent) {
        console.log("minutes changed");
        // activityToEditProperties.durationObject contains the previous duration
        if (activityToEditProperties.durationMinutes < activityToEditProperties.durationObject.minutes) {
          // minutes decreased
          let minutesDifference = activityToEditProperties.durationObject.minutes - activityToEditProperties.durationMinutes
          activityToEditContent.endTime -= (minutesDifference * 60)
          activityToEditContent.duration -= (minutesDifference * 60)
          this.updateEndTimeDuration(activityToEditProperties, activityToEditContent)
        } else if (activityToEditProperties.durationMinutes > activityToEditProperties.durationObject.minutes) {
          // minutes increased
          let minutesDifference = activityToEditProperties.durationMinutes - activityToEditProperties.durationObject.minutes
          activityToEditContent.endTime += (minutesDifference * 60)
          activityToEditContent.duration += (minutesDifference * 60)
          this.updateEndTimeDuration(activityToEditProperties, activityToEditContent)
        }
      },
      secondsChanged: function (activityToEditProperties, activityToEditContent) {

      },
      updateEndTimeDuration: function (activityToEditProperties, activityToEditContent) {
        // helper function to update end time and duration
        activityToEditProperties.endTimeString = formatTime.timestampToTimeString(activityToEditContent.endTime)
        // update duration object to be able to compare with it at the next change
        activityToEditProperties.durationObject = formatTime.secondsToTimeObject(activityToEditContent.duration)
      }
    },
    data: function () {
      return data;
    }
  }
</script>
{'fraction_non_alphanumeric': 0.10266240681576144, 'fraction_numerical': 0.007738729144479943, 'mean_word_length': 1.9425527470231878, 'pattern_counts': {'":': 0, '<': 162, '<?xml version=': 0, '>': 162, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '508614', 'n_tokens_mistral': 3424, 'n_tokens_neox': 3221, 'n_words': 589}