-
Notifications
You must be signed in to change notification settings - Fork 52
Feature/HebrewView #280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
elor555
wants to merge
71
commits into
PythonFreeCourse:develop
Choose a base branch
from
elor555:feature/hebrewview
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feature/HebrewView #280
Changes from 52 commits
Commits
Show all changes
71 commits
Select commit
Hold shift + click to select a range
33723a7
add hebrew dates to calendar-nre feature
elor555 0d296f3
add test to hebrew dates
elor555 970534d
edit flake8
elor555 f0bc588
edit flake8
elor555 7282e00
fix after pull
elor555 861587a
edit flake8
elor555 8426167
edit
elor555 6b28e84
Merge branch 'develop' of https://github.com/PythonFreeCourse/calenda…
elor555 fbdd7f5
edit
elor555 442a640
edit
elor555 e4720c8
check
elor555 fcefcbe
check
elor555 9e6742e
edit
elor555 c63471a
edit
elor555 97a1d8c
edit after flake8
elor555 201b1d8
edit after flake8
elor555 739729e
Merge branch 'develop' of https://github.com/PythonFreeCourse/calenda…
elor555 d79b1c3
edit after flake8
elor555 f488161
edit after flake8
elor555 3d2c150
edit after flake8
elor555 d873fd6
edit after flake8
elor555 7593c11
edit after pull
elor555 3dd122b
edit after pull
elor555 b06b7be
edit after pull
elor555 4dd3ac5
edit
elor555 6c2d65c
edit
elor555 f6b8607
edit
elor555 3c70a58
edit
elor555 6a34a33
edit
elor555 822ac9d
edit
elor555 0ae1726
edit
elor555 9e9ee25
edit
elor555 0a8b157
Merge branch 'develop' of https://github.com/PythonFreeCourse/calenda…
elor555 ac73386
edit
elor555 426da0a
edit
elor555 63c437a
Merge branch 'develop' of https://github.com/PythonFreeCourse/calenda…
elor555 4ae0595
edit
elor555 f2323d6
edit
elor555 9fd7cbc
Merge branch 'develop' of https://github.com/PythonFreeCourse/calenda…
elor555 1c52fbd
edit
elor555 0abd915
edit
elor555 ad7ea1a
Merge branch 'develop' of https://github.com/PythonFreeCourse/calenda…
elor555 78278bc
edit
elor555 e8c1776
Merge branch 'develop' of https://github.com/PythonFreeCourse/calenda…
elor555 d2573b1
edit
elor555 d6b58f0
edit
elor555 7af9582
edit
elor555 a3b0b95
edit
elor555 be3ce04
Merge branch 'develop' of https://github.com/PythonFreeCourse/calenda…
elor555 408de5d
edit
elor555 848368f
edit
elor555 3e96b8b
edit
elor555 34ebe6e
edit
elor555 4fa9da5
Merge branch 'develop' of https://github.com/PythonFreeCourse/calenda…
elor555 a64fcd9
Merge branch 'develop' of https://github.com/PythonFreeCourse/calenda…
elor555 3b1a6be
Details Message
elor555 ed58474
Details Message
elor555 22f0bcc
fix: flake8
elor555 1a1eb3d
fix: flake8
elor555 7d6ec9b
fix: bug fix
elor555 18a0195
fix: bug fix
elor555 c022096
fix: bug fix
elor555 44f9d61
fix: fix translation files
elor555 76726e1
Merge remote-tracking branch 'upstream/develop' into feature/hebrewview
elor555 a2449d2
fix: bugfix
elor555 c7d3b7d
fix: bugfix
elor555 11fc0d6
fix: bugfix
elor555 377e82d
fix: bugfix
elor555 9b0c629
fix: styling
elor555 0a9a4fb
fix: bugfix
elor555 c48a270
fix: bugfix
elor555 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
from datetime import datetime | ||
|
||
from hebrew_numbers import int_to_gematria | ||
from pyluach import dates, hebrewcal | ||
|
||
|
||
EN_TO_HEB_MONTH_NAMES = { | ||
'Tishrei': 'תשרי', | ||
'Cheshvan': 'חשוון', | ||
'Kislev': 'כסלו', | ||
'Teves': 'טבת', | ||
'Shvat': 'שבט', | ||
'Adar': 'אדר', | ||
'Adar Rishon': "אדר(א')", | ||
'Adar Sheni': "אדר(ב')", | ||
'Nissan': 'ניסן', | ||
'Iyar': 'אייר', | ||
'Sivan': 'סיוון', | ||
'Tamuz': 'תמוז', | ||
'Av': 'אב', | ||
'Elul': 'אלול', | ||
} | ||
|
||
|
||
def get_month_name_by_num(date: datetime) -> str: | ||
"""Returns the Hebrew name date for the specific day. | ||
|
||
Args: | ||
date: The requested date. | ||
|
||
Returns: | ||
A Hebrew name date. | ||
""" | ||
for month in hebrewcal.Year(date.year).itermonths(): | ||
if date.month == month.month: | ||
return EN_TO_HEB_MONTH_NAMES[month.name] | ||
elor555 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
def from_greogian_to_hebrew_date(date: datetime) -> str: | ||
"""Returns the Hebrew date for the specific greogian date. | ||
|
||
Args: | ||
date: The requested date. | ||
|
||
Returns: | ||
A Hebrew date string. | ||
""" | ||
gregorian_date = dates.GregorianDate(date.year, date.month, date.day) | ||
return gregorian_date.to_heb() | ||
|
||
|
||
def get_hebrew_date_in_words(date: datetime) -> str: | ||
"""Returns the Hebrew date for the specific day. | ||
|
||
Args: | ||
date: The requested date. | ||
|
||
Returns: | ||
A Hebrew date string. | ||
""" | ||
|
||
hebrew_date_object = from_greogian_to_hebrew_date(date) | ||
return ' '.join(( | ||
int_to_gematria(hebrew_date_object.day), | ||
get_month_name_by_num(hebrew_date_object), | ||
int_to_gematria(hebrew_date_object.year % 1000) | ||
elor555 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
)) |
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 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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,82 +14,67 @@ | |
class="month-title fw-bold text-white">{{month}}</span> | ||
<span id="day-num" class="day-title fw-bold text-white">{{day}}</span> | ||
{% if zodiac %} | ||
<div class="zodiac-sign"> | ||
<a href="https://www.horoscope.com/zodiac-signs/{{zodiac.name}}" | ||
title="Zodiac-sign: {{zodiac.name}}" | ||
target="_blank"><img | ||
src="{{ url_for('static', path='/images/zodiac/' + zodiac.name + '.svg') }}" | ||
alt="zodiac sign" width="14em" height="13em"></a> | ||
</div> | ||
{% endif %} | ||
{% else %} | ||
<span class="fw-bold text-white date-nums">{{day}} / {{month}}</span> | ||
{% endif %} | ||
<div class="zodiac-sign"> | ||
<a href="https://www.horoscope.com/zodiac-signs/{{zodiac.name}}" title="Zodiac-sign: {{zodiac.name}}" | ||
target="_blank"><img src="{{ url_for('static', path='/images/zodiac/' + zodiac.name + '.svg') }}" | ||
alt="zodiac sign" width="14em" height="13em"></a> | ||
</div> | ||
{% if international_day %} | ||
<div class="international-days"> | ||
The International days are: "{{ international_day.international_day }}" | ||
elor555 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{% endif %} | ||
{% if hebrew_view %} | ||
<div class="hebrew-dates"> | ||
{{ hebrew_view }} | ||
</div> | ||
{% endif %} | ||
<div class="all_day_events"> | ||
{% for event in all_day_events %} | ||
<p class="text-truncate my-0 {{size}}">{{ event.title }}</p> | ||
elor555 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{% else %} | ||
<span class="fw-bold text-white date-nums">{{day}} / {{month}}</span> | ||
{% endif %} | ||
</div> | ||
<div class="schedule"> | ||
<div class="container times bg-primeary position"> | ||
{% for hour in range(25)%} | ||
<div class='hour-block'> | ||
<div class="row bg-transparent hour-mark"> | ||
{% if view == 'day'%} | ||
{% set hour = hour|string() %} | ||
{{hour.zfill(2)}}:00 | ||
{% endif %} | ||
</div> | ||
<div class="hour-bar row text-white border-bottom"></div> | ||
</div> | ||
{% endfor %} | ||
</div> | ||
<div class="schedule"> | ||
<div class="container times bg-primeary position"> | ||
{% for hour in range(25)%} | ||
<div class='hour-block'> | ||
<div class="row bg-transparent hour-mark"> | ||
{% if view == 'day'%} | ||
{% set hour = hour|string() %} | ||
{{hour.zfill(2)}}:00 | ||
{% endif %} | ||
</div> | ||
<div class="hour-bar row text-white border-bottom"></div> | ||
</div> | ||
{% endfor %} | ||
<div class="event-grid"> | ||
{% for event, attr in events %} | ||
<div id="event{{event.id}}" class="d-flex flex-column text-truncate px-2 event" | ||
style="background-color: {{attr.color}}; grid-row: {{attr.grid_position}}; max-hight:1.5rem;"> | ||
<div class="d-flex flex-column justify-content-evenly event-details"> | ||
<p class="text-truncate my-0 {{attr.title_size_class}}">{{ event.title }}</p> | ||
{% if attr.total_time_visible %} | ||
<p class="total-time text-truncate fw-light my-0">{{attr.total_time}}</p> | ||
{% endif %} | ||
</div> | ||
<div class="event-grid"> | ||
{% for event, attr in events %} | ||
<div id="event{{event.id}}" | ||
class="d-flex flex-column text-truncate px-2 event" | ||
style="background-color: {{attr.color}}; grid-row: {{attr.grid_position}}; max-hight:1.5rem;"> | ||
<div class="d-flex flex-column justify-content-evenly event-details"> | ||
<p class="text-truncate my-0 {{attr.title_size_class}}">{{ | ||
event.title }}</p> | ||
{% if attr.total_time_visible %} | ||
<p class="total-time text-truncate fw-light my-0"> | ||
{{attr.total_time}}</p> | ||
{% endif %} | ||
</div> | ||
<div class="d-flex flex-row justify-content-around align-items-end action-container" | ||
style="grid-row: {{attr.grid_position}};"> | ||
<a href="/edit/{{event.id}}" title="Edit event" | ||
class="action-icon"><img class="pb-1" | ||
src="{{ url_for('static', path='/images/icons/pencil.svg')}}"></a> | ||
<a href="/delete/{{event.id}}" title="Delete event" | ||
class="action-icon"><img class="pb-1" | ||
src="{{ url_for('static', path='/images/icons/trash-can.svg')}}"></a> | ||
<a href="/event/{{event.id}}" title="See full event" | ||
class="action-icon"><img class="pb-1" | ||
src="{{ url_for('static', path='/images/icons/view.svg')}}"></a> | ||
</div> | ||
</div> | ||
{% endfor %} | ||
<div class="d-flex flex-row justify-content-around align-items-end action-container" | ||
style="grid-row: {{attr.grid_position}};"> | ||
<a href="/edit/{{event.id}}" title="Edit event" class="action-icon"><img class="pb-1" | ||
src="{{ url_for('static', path='/images/icons/pencil.svg')}}"></a> | ||
<a href="/delete/{{event.id}}" title="Delete event" class="action-icon"><img class="pb-1" | ||
src="{{ url_for('static', path='/images/icons/trash-can.svg')}}"></a> | ||
<a href="/event/{{event.id}}" title="See full event" class="action-icon"><img class="pb-1" | ||
src="{{ url_for('static', path='/images/icons/view.svg')}}"></a> | ||
</div> | ||
</div> | ||
{% endfor %} | ||
</div> | ||
{% if view == 'day'%} | ||
<button title="Add Event" class="event-btn add-event-icon"> | ||
<ion-icon name="add"></ion-icon> | ||
</button> | ||
{% endif %} | ||
</div> | ||
{% if view == 'day'%} | ||
<button title="Add Event" class="event-btn add-event-icon"> | ||
<ion-icon name="add"></ion-icon> | ||
</button> | ||
{% endif %} | ||
</div> | ||
{% if view == 'day'%} | ||
<div id="event_block"></div>{% endif %} | ||
{% if view == 'day'%}<div id="event_block"></div>{% endif %} | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" | ||
integrity="sha384-ygbV9kiqUc6oa4msXn9868pTtWMgiQaeYH7/t7LECLbyPA2x65Kgf80OJFdroafW" | ||
crossorigin="anonymous"></script> | ||
<script type="text/javascript" | ||
src="{{ url_for('static', path='/eventdisplay.js') }}"></script> | ||
<script type="text/javascript" src="{{ url_for('static', path='/eventdisplay.js') }}"></script> | ||
{% endblock body %} |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.