-
Notifications
You must be signed in to change notification settings - Fork 84
Village long description #1863
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
ashirley
wants to merge
3
commits into
emfcamp:main
Choose a base branch
from
ashirley:village-long-description
base: main
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
Village long description #1863
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
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 |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| .village-form { | ||
| textarea#description { | ||
| height: 100px; | ||
| } | ||
|
|
||
| textarea#long_description { | ||
| height: 200px; | ||
| } | ||
| } | ||
|
|
||
| .embedded-content { | ||
| width: 100%; | ||
| height: 450px; // default height, recalculated by javascript. | ||
| border: none; | ||
| overflow: hidden; | ||
| } |
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 |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| function sendFrameResizedMessage() { | ||
| //postMessage to set iframe height | ||
| window.parent.postMessage({ "type": "frame-resized", "value": document.body.parentElement.scrollHeight }, '*'); | ||
| } | ||
|
|
||
| function listenForFrameResizedMessages(iFrameEle) { | ||
| window.addEventListener('message', receiveMessage, false); | ||
|
|
||
| function receiveMessage(evt) { | ||
| console.log("Got message: " + JSON.stringify(evt.data) + " from origin: " + evt.origin); | ||
| // Do we trust the sender of this message? | ||
| // origin of sandboxed iframes is null but is this a useful check? | ||
| // if (evt.origin !== null) { | ||
| // return; | ||
| // } | ||
|
|
||
| if (evt.data.type === "frame-resized") { | ||
| iFrameEle.style.height = evt.data.value + "px"; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| window.listenForFrameResizedMessages = listenForFrameResizedMessages; | ||
| window.sendFrameResizedMessage = sendFrameResizedMessage; |
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
36 changes: 36 additions & 0 deletions
36
migrations/versions/6646de329427_add_long_description_to_village.py
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,36 @@ | ||
| """Add long_description to village | ||
|
|
||
| Revision ID: 6646de329427 | ||
| Revises: 5062a9a72efc | ||
| Create Date: 2025-10-02 20:34:55.746599 | ||
|
|
||
| """ | ||
|
|
||
| # revision identifiers, used by Alembic. | ||
| revision = '6646de329427' | ||
| down_revision = '5062a9a72efc' | ||
|
|
||
| from alembic import op | ||
| import sqlalchemy as sa | ||
|
|
||
|
|
||
| def upgrade(): | ||
| # ### commands auto generated by Alembic - please adjust! ### | ||
| with op.batch_alter_table('village', schema=None) as batch_op: | ||
| batch_op.add_column(sa.Column('long_description', sa.String(), nullable=True)) | ||
|
|
||
| with op.batch_alter_table('village_version', schema=None) as batch_op: | ||
| batch_op.add_column(sa.Column('long_description', sa.String(), autoincrement=False, nullable=True)) | ||
|
|
||
| # ### end Alembic commands ### | ||
|
|
||
|
|
||
| def downgrade(): | ||
| # ### commands auto generated by Alembic - please adjust! ### | ||
| with op.batch_alter_table('village_version', schema=None) as batch_op: | ||
| batch_op.drop_column('long_description') | ||
|
|
||
| with op.batch_alter_table('village', schema=None) as batch_op: | ||
| batch_op.drop_column('long_description') | ||
|
|
||
| # ### end Alembic commands ### |
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 |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| {# The source of an iFrame used to sandbox user-controlled HTML #} | ||
| {# Once loaded, this emits an event with it's content's size which the parent page can listen for to adapt the iFrame's height #} | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| {% block css -%} | ||
| <link rel="stylesheet" href="{{ static_url_for('static', filename="css/main.css") }}"> | ||
| {% endblock -%} | ||
| {% block head -%}{% endblock -%} | ||
| </head> | ||
| <body itemscope itemtype="http://schema.org/WebPage" {% block body_class %}{% endblock %} onload="javascript:window.sendFrameResizedMessage()" style="overflow: hidden;"> | ||
| {% block document %} | ||
| <div id="emf-container"> | ||
| <div class="emf-row"> | ||
| <div class="emf-col {{ main_class }}" role="main" {% if self.content_scope() -%} | ||
| itemscope itemtype="{% block content_scope %}{% endblock %}" | ||
| {%- endif %}> | ||
| {% block body -%} {{ body }} {% endblock -%} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| {% endblock %} | ||
| <script src="{{static_url_for('static', filename="js/sandboxed-iframe.js")}}"></script> | ||
| {% block foot -%}{% endblock -%} | ||
| </body> | ||
| </html> |
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 |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| {% extends "base.html" %} | ||
| {% block title %}Village: {{village.name}}{% endblock %} | ||
| {% block foot %}<script src="{{static_url_for('static', filename="js/sandboxed-iframe.js")}}"></script>{% endblock%} | ||
| {% block body %} | ||
| {% if village.url %} | ||
| <h2><a href="{{ village.url }}" rel="nofollow" target="_blank">{{village.name}}</a></h2> | ||
| {% else %} | ||
| <h2>{{village.name}}</h2> | ||
| {% endif %} | ||
|
|
||
| {% if village.description %} | ||
| <p>{{village.description}}</p> | ||
| {% endif %} | ||
|
|
||
| {% if village_long_description_html %} | ||
| <p>{{village_long_description_html}}</p> | ||
| {% endif %} | ||
|
|
||
| {# TODO: embed a map somehow? #} | ||
| {% if village.map_link %} | ||
| <a href="{{ village.map_link }}">📍 Map</a> | ||
| {% endif %} | ||
|
|
||
| {# TODO: Can we show what's on at the village venues here? #} | ||
| {% endblock %} |
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,24 @@ | ||
| {% extends "base.html" %} | ||
| {% block title %}Village: {{village.name}}{% endblock %} | ||
| {% block body %} | ||
| {% if village.url %} | ||
| <h2><a href="{{ village.url }}" rel="nofollow" target="_blank">{{village.name}}</a></h2> | ||
| {% else %} | ||
| <h2>{{village.name}}</h2> | ||
| {% endif %} | ||
|
|
||
| {% if village.description %} | ||
| <p>{{village.description}}</p> | ||
| {% endif %} | ||
|
|
||
| {% if village_long_description_html %} | ||
| <p>{{village_long_description_html}}</p> | ||
| {% endif %} | ||
|
|
||
| {# TODO: embed a map somehow? #} | ||
| {% if village.map_link %} | ||
| <a href="{{ village.map_link }}">📍 Map</a> | ||
| {% endif %} | ||
|
|
||
| {# TODO: Can we show what's on at the village venues here? #} | ||
| {% endblock %} | ||
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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to say that I'm not sure whether there's a link between Venue and Village, but on closer look Venue has a
village_idfield :)@SamLR is this planned to still be the case?