Blame view

__public/js/dist/tips.230be0b8538b47cf6c7a.js 3.93 KB
e77200db5   nologostudio.ru   Initial commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
  (window.webpackJsonp=window.webpackJsonp||[]).push([["fad1"],{l9Vy:function(t,n,o){"use strict";o.r(n);o("tlwP");angular.module("footyroom").controller("TipController",["$uibModal","dateFormat",function(t,n){n($(".btip")),this.editTip=function(n){t.open({template:'<tip-editor id="'.concat(n||"",'" dismiss="$dismiss()"></tip-editor>')})}}])},tlwP:function(t,n){angular.module("footyroom").component("tipEditor",{template:'
              <div fr-litelay="$ctrl.isSaving || $ctrl.isLoading">
                  <div class="modal-body">
                      <div class="form-group">
                          <label>Match ID</label>
                          <input class="form-control" type="text" ng-model="$ctrl.tip.matchId" placeholder="Example: 123456789">
                          <span class="help-block">
                              You can get match ID from the URL of a match to which this tip belongs.
                              Checkout Live Scores to get a list of upcoming matches and their URLs.
                          </span>
                      </div>
                      <div class="form-group">
                          <label>Prediction</label>
                          <input class="form-control" type="text" ng-model="$ctrl.tip.prediction" placeholder="Example: Both teams to score - Yes">
                      </div>
                      <div class="form-group">
                          <label>Odds</label>
                          <input class="form-control" type="text" ng-model="$ctrl.tip.odds" placeholder="Example: 1.99">
                      </div>
                      <div class="form-group">
                          <label>Status</label>
                          <select class="form-control" ng-model="$ctrl.tip.status">
                              <option value="pending">Pending</option>
                              <option value="correct">Correct</option>
                              <option value="wrong">Wrong</option>
                              <option value="neutral">Neutral</option>
                          </select>
                          <span class="help-block">
                              All tips start as "Pending", but when it\'s settled you will have to update its outcome here.
                          </span>
                      </div>
                      <div class="form-group">
                          <label>Actual Result (optional)</label>
                          <input class="form-control" type="text" ng-model="$ctrl.tip.result" placeholder="Examples: 1 : 2, Yes, Neymar">
                          <span class="help-block">
                              This is usually the final score of the game or some other outcome.
                              If this field is left empty final score will be shown automatically.
                          </span>
                      </div>
                  </div>
                  <div class="modal-footer">
                      <div class="pull-left">
                          <button ng-click="$ctrl.remove()" ng-if="$ctrl.tip.id" class="btn btn-default">Delete</button>
                      </div>
                      <div class="pull-right">
                          <button class="btn btn-default" ng-click="$ctrl.dismiss()">Cancel</button>
                          <button class="btn btn-primary" ng-click="$ctrl.save()">Save</button>
                      </div>
                  </div>
              </div>
          ',bindings:{id:"@",dismiss:"&"},controller:["$http",function(t){var n=this;n.$onInit=function(){n.id?(n.isLoading=!0,t.get("/tips/".concat(this.id,".json")).then(function(t){n.tip=t.data,n.isLoading=!1})):n.tip={status:"pending"}},n.save=function(){n.isSaving=!0,(n.tip.id?t.put("/tips/".concat(n.tip.id),n.tip):t.post("/tips",n.tip)).then(function(){window.location.reload()}).catch(function(){n.isSaving=!1})},n.remove=function(){n.isSaving=!0,t.delete("/tips/".concat(this.id)).then(function(){window.location.reload()}).catch(function(){n.isSaving=!1})}}]})}},[["l9Vy","d41d"]]]);