소스 검색

few changes.

Tomislav Cvetic 7 년 전
부모
커밋
a07d5811f4
6개의 변경된 파일32개의 추가작업 그리고 12개의 파일을 삭제
  1. 3 2
      package.json
  2. 4 0
      public/bootstrap.min.css
  3. 0 2
      public/index.html
  4. 19 6
      src/App.js
  5. 2 2
      src/player/components/player-disp.js
  6. 4 0
      yarn.lock

+ 3 - 2
package.json

@@ -4,6 +4,7 @@
   "private": true,
   "dependencies": {
     "blob": "^0.0.4",
+    "bootstrap": "3",
     "file-saver": "^1.3.3",
     "moment": "^2.18.1",
     "react": "^15.5.4",
@@ -12,8 +13,8 @@
   },
   "devDependencies": {
     "html-inline": "^1.2.0",
-    "react-scripts": "^1.0.7",
-    "react-bootstrap": "^0.31.0"
+    "react-bootstrap": "^0.31.0",
+    "react-scripts": "^1.0.7"
   },
   "scripts": {
     "start": "react-scripts start",

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 4 - 0
public/bootstrap.min.css


+ 0 - 2
public/index.html

@@ -19,8 +19,6 @@
       work correctly both with client-side routing and a non-root public URL.
       Learn how to configure a non-root public URL by running `npm run build`.
     -->
-    <!-- Latest compiled and minified CSS -->
-    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css">
     <title>SZTM Excel</title>
   </head>
   <body>

+ 19 - 6
src/App.js

@@ -3,6 +3,7 @@ import Player from './player'       // Everything that has to do with players
 import Match from './match'         // Everything that has to do with matches
 import Excel from './excel'         // Helper files to create Excel files
 import { date2s, time2s } from './helpers'
+import 'bootstrap/dist/css/bootstrap.css'
 
 /**
  * General Application Design
@@ -133,7 +134,7 @@ class App extends React.Component {
     worksheets['Calendar'] = worksheet
     this.setState({ worksheets })
 
-    if (worksheet[2].length !== 8) {
+    if (worksheet[2].length < 8  | worksheet[2].length > 9) {
       throw Error('Wrong file structure.')
     }
     const matches = worksheet.slice(2, worksheet.length).map((matchData) => new Match.MatchClass(matchData))
@@ -280,14 +281,26 @@ class App extends React.Component {
             if (player.Bezahlt) {
               paid = 'OK'
             }
-            payListPerPlace.push([ paid, match.Konkurrenz, time2s(match.Datum), matchPlayer ])
+            let price
+            if (player.isDoubles) {
+              price = (player.isJunior ? 15 : 25) + (player.isJuniorDP ? 15 : 25)
+            } else {
+              price = player.isJunior ? 30 : 50
+            }
+            payListPerPlace.push([ paid, match.Konkurrenz, time2s(match.Datum), `${matchPlayer} (${price}.-)` ])
           }
         })
-        console.log('Generated pay list per place:', payListPerPlace)
-        worksheets[place] = Excel.SheetFromArray(header.concat(payListPerPlace))
-        paylist.SheetNames.push(place)
-        paylist.Sheets[place] = worksheets[place]
       })
+
+      let footer = [
+        [],
+        ['Turnierleiter', null, null, 'Kassierer'],
+        ['Betrag von Spielern erhalten', null, null, 'Betrag von Turnierleiter erhalten']
+      ]
+      console.log(`Generated pay list per place ${place}:`, payListPerPlace)
+      worksheets[place] = Excel.SheetFromArray(header.concat(payListPerPlace, footer))
+      paylist.SheetNames.push(place)
+      paylist.Sheets[place] = worksheets[place]
     })
     Excel.saveAs(paylist, 'Zahlliste.xlsx')
   }

+ 2 - 2
src/player/components/player-disp.js

@@ -1,5 +1,5 @@
 import React from 'react'
-import { date2s } from '../../helpers'
+import { date2s, time2s } from '../../helpers'
 
 class PlayerDisp extends React.Component {
   render () {
@@ -12,7 +12,7 @@ class PlayerDisp extends React.Component {
         <td><b>{player.NameDP}</b></td>
         <td>{player.VornameDP}</td>
         <td>{player.Bezahlt ? 'Ja' : 'Nein'}</td>
-        <td>{player.BezahltAm ? date2s(player.BezahltAm) : 'Unbekannt'}</td>
+        <td>{player.BezahltAm ? `${date2s(player.BezahltAm)} ${time2s(player.BezahltAm)}` : 'Unbekannt'}</td>
         <td>{player.isJunior ? 'Junior' : ''}</td>
         <td>{player.isJuniorDP ? 'DP Junior' : ''}</td>
       </tr>

+ 4 - 0
yarn.lock

@@ -1006,6 +1006,10 @@ boom@2.x.x:
   dependencies:
     hoek "2.x.x"
 
+bootstrap@3:
+  version "3.3.7"
+  resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-3.3.7.tgz#5a389394549f23330875a3b150656574f8a9eb71"
+
 boxen@^0.6.0:
   version "0.6.0"
   resolved "https://registry.yarnpkg.com/boxen/-/boxen-0.6.0.tgz#8364d4248ac34ff0ef1b2f2bf49a6c60ce0d81b6"

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.