This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{this.props.organizationId == "2728d56c-9676-4ce2-a188-77654991333e" ? | |
<Row style={{ | |
flex: 1, | |
justifyContent: 'center', | |
alignItems: 'center', | |
}}> | |
<Image | |
source={{ uri: apiDomain + this.props.logo }} | |
style={{ | |
width: deviceWidth * 0.4, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" These are endpoints that get or create cards and rows """ | |
from os import system | |
from random import randint | |
from django.http import JsonResponse | |
from django.utils import timezone | |
from rest_framework.decorators import api_view | |
from rest_framework import generics | |
from background_task import background | |
from background_task.models_completed import CompletedTask | |
from background_task.models import Task |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(Keep the rest of BallSerializer) | |
def to_representation(self, instance): | |
""" Get rid of excess data, makes it easier to consume on the client """ | |
ret = super().to_representation(instance) | |
ret.pop('updated_at') | |
ret.pop('is_played') | |
return ret |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"defaultSeverity": "error", | |
"extends": [ | |
"tslint-react" | |
], | |
"jsRules": { | |
}, | |
"rules": { | |
"member-access": false, | |
"ordered-imports": false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from 'react' | |
import styled from 'styled-components'; | |
import { connect } from 'react-redux'; | |
// tslint:disable-next-line: no-submodule-imports | |
import 'bootstrap/dist/css/bootstrap.css'; | |
import { Flex } from 'rebass'; | |
import { Container, Row } from 'reactstrap'; | |
import { IApplicationState, IConnectedReduxProps } from '../store/configureStore'; | |
import { danger, clear } from '../store/messages'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" urls for playing bingo """ | |
from django.urls import path | |
from play.views import CardList, BallList, reset_balls | |
urlpatterns = [ | |
path('cards/', CardList.as_view(), name='cards'), | |
path('balls/', BallList.as_view(), name='balls'), | |
path('reset_balls/', reset_balls, name='reset_balls') | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generated by Django 2.2.4 on 2019-08-19 15:30 | |
from django.db import migrations | |
def seed_database(apps, _): | |
""" Seed the ball numbers into the database """ | |
balls = apps.get_model('play', 'Ball') | |
balls.objects.all().delete() | |
for i in range(1, 76): | |
data = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
We have 4 models that interact with each other to form the game play. | |
The card and row tables will form the data for the bingo cards. | |
The match_smiley table is populated from the card/row tables, where each column is a certain number on the card, | |
so the row would be the group of numbers that make a smiley-face. | |
We'll decrement the 'left' property of match_smiley as balls are called that match. | |
""" | |
from django.db import models | |
# keep Card and Row models from before |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# keep Card and Row models from before | |
class Ball(models.Model): | |
""" | |
The ball in a ball-blower. Represents a random number 1-75. | |
""" | |
num_value = models.CharField(max_length=3) | |
updated_at = models.DateTimeField(auto_now=True) | |
class MatchSmiley(models.Model): | |
""" Derived from card data, each column is a number on a specific card""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.ticket-number { | |
margin: 1px; | |
color: black; | |
background: #defffd; | |
} | |
.called { | |
transition: all .5s ease-in-out; | |
background: #076461; | |
color:white; | |
} |
NewerOlder