Commit db66dcab authored by Hermann Krumrey's avatar Hermann Krumrey
Browse files

Merge branch 'develop' into 'master'

Develop

See merge request namibsun/python/bundesliga-tippspiel!8
parents ee000abf 9ad3fcce
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
V 0.16.2:
  - Improved the design of the website
V 0.16.1:
  - Fixed email reminders
V 0.16.0:
+49 −0
Original line number Diff line number Diff line
@@ -125,6 +125,55 @@ class Match(ModelMixin, db.Model):
    Indicates whether or not the match has finished yet
    """

    @property
    def minute_display(self) -> str:
        """
        This generates a string for displaying the current match minute.
        Sadly, since OpenligaDB does not provide information on the current
        minute, this can only offer an approcimation.
        :return: A formatted string displaying the current match minute
        """
        delta = (datetime.utcnow() - self.kickoff_datetime).total_seconds()
        delta = int(delta / 60)

        print(delta)

        if self.finished:
            return "Ende"
        elif 0 <= delta <= 44:
            return "{}.".format(delta + 1)
        elif 45 <= delta < 47:  # buffer for ET
            return "45."
        elif 47 <= delta <= 64:
            return "HZ"
        elif 65 <= delta <= 109:
            return "{}.".format(delta - 65 + 1 + 45)
        elif delta >= 110:
            return "90."
        else:
            return "-"

    @property
    def current_score(self) -> str:
        """
        :return: The current score formatted as a string
        """
        return "{}:{}".format(self.home_current_score, self.away_current_score)

    @property
    def ht_score(self) -> str:
        """
        :return: The half time score formatted as a string
        """
        return "{}:{}".format(self.home_ht_score, self.away_ht_score)

    @property
    def ft_score(self) -> str:
        """
        :return: The full time score formatted as a string
        """
        return "{}:{}".format(self.home_ft_score, self.away_ft_score)

    @property
    def kickoff_datetime(self) -> datetime:
        """
+3.76 MiB
Loading image diff...
+29 −7
Original line number Diff line number Diff line
@@ -19,11 +19,17 @@ along with bundesliga-tippspiel. If not, see <http://www.gnu.org/licenses/>.

/* Basic Structure */

table {
    table-layout: fixed;
    overflow: hidden;
}

html, body {
    margin:0;
    padding:0;
    height:100%;
    background: lightgray;
    background: url(background.jpg) repeat #49c14e;
    background-size: cover;
}

footer {
@@ -44,7 +50,7 @@ footer a {
#body {
    padding-bottom: 60px;   /* Height of the footer */
    margin: 0 auto;
    width: 80%;
    /*width: 80%;*/
    min-height: calc(100vh - 100px);
}

@@ -61,7 +67,7 @@ footer a {
    padding-bottom: 20px;
    padding-left: 3em;
    padding-right: 3em;
    background: darkgray;
    background: #f8f9fa;
    min-height: calc(100vh - 60px);
    margin-bottom: -20px;
}
@@ -113,7 +119,7 @@ p {
}

.form-container {
    background: lightgray;
    background: #d7f2d8;
    padding: 20px;
    border-radius: 10px
}
@@ -142,14 +148,30 @@ p {
    background: white;
}

.match_logo {
.match-logo {
    max-height: 40px;
}

.match_header {
.match-header {
    padding-top: 30px;
    background: white;
    border-radius: 15px;
    border: 3px solid black;
}

.match-header-goal-display-wrapper {
    text-align: center;
}

.match-header-goal-display {
    display: inline-block;
    background: white;
    padding-left: 15px;
    padding-right: 15px;
    border-top-left-radius: 2px;
    border-top-right-radius: 2px;
    font-size: 15pt;
    border: 1px solid black;
}

.goal-icon-normal {
+2 −2
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ along with bundesliga-tippspiel. If not, see <http://www.gnu.org/licenses/>.
            <h1>
                {% if matchday > 1 %}
                    <a href="{{ "{}/{}".format(url_for("bets"), matchday - 1) }}">
                        <
                        <i class="fas fa-arrow-left"></i>
                    </a>
                {% endif %}
            </h1>
@@ -38,7 +38,7 @@ along with bundesliga-tippspiel. If not, see <http://www.gnu.org/licenses/>.
            <h1>
                {% if matchday < 34 %}
                    <a href="{{ "{}/{}".format(url_for("bets"), matchday + 1) }}">
                        >
                        <i class="fas fa-arrow-right"></i>
                    </a>
                {% endif %}
            </h1>
Loading