Alejandro Cremades commited on
Commit
d9b4271
1 Parent(s): 81d9d1a

Add explanation for card search, plus footer with legal text and links

Browse files
Middle_School_Card_Search.py CHANGED
@@ -1,6 +1,7 @@
1
  import streamlit as st
2
  import pandas as pd
3
  import urllib.parse
 
4
 
5
 
6
  def compose_scryfall_url(x):
@@ -22,6 +23,8 @@ st.set_page_config(
22
  st.write(
23
  """
24
  # Middle School Card Search
 
 
25
  """
26
  )
27
 
@@ -43,3 +46,5 @@ if name_input:
43
  st.write(f"Top {number_shown_results} results:")
44
  results_df["link"] = results_df["name"].apply(compose_scryfall_url)
45
  results_df[:number_shown_results].transpose().apply(row_to_link)
 
 
 
1
  import streamlit as st
2
  import pandas as pd
3
  import urllib.parse
4
+ import streamlit_common.footer
5
 
6
 
7
  def compose_scryfall_url(x):
 
23
  st.write(
24
  """
25
  # Middle School Card Search
26
+
27
+ Enter any English or Japanese text to find all Middle School legal card titles which include it.
28
  """
29
  )
30
 
 
46
  st.write(f"Top {number_shown_results} results:")
47
  results_df["link"] = results_df["name"].apply(compose_scryfall_url)
48
  results_df[:number_shown_results].transpose().apply(row_to_link)
49
+
50
+ streamlit_common.footer.write_footer()
pages/1_Check_Card_List.py CHANGED
@@ -1,6 +1,7 @@
1
  import streamlit as st
2
  import pandas as pd
3
  import re
 
4
 
5
 
6
  def remove_number_of_copies(line: str) -> str:
@@ -54,3 +55,5 @@ input_cards["legal"] = input_cards["cardname"].apply(is_legal)
54
 
55
  col2.write("##### Middle School legality")
56
  col2.dataframe(input_cards[["legal", "cardname"]], use_container_width=True)
 
 
 
1
  import streamlit as st
2
  import pandas as pd
3
  import re
4
+ import streamlit_common.footer
5
 
6
 
7
  def remove_number_of_copies(line: str) -> str:
 
55
 
56
  col2.write("##### Middle School legality")
57
  col2.dataframe(input_cards[["legal", "cardname"]], use_container_width=True)
58
+
59
+ streamlit_common.footer.write_footer()
streamlit_common/footer.py ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+
3
+ fa_import = """
4
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css">
5
+ """
6
+ x_icon = '<i class="fa-brands fa-x-twitter" style="color: #ffffff;"></i>'
7
+ x_url = "https://x.com/KarawapoM"
8
+ gh_icon = '<i class="fa-brands fa-github" style="color: #ffffff;"></i>'
9
+ gh_url = "https://github.com/alecrem/middleschool-tutor/"
10
+
11
+
12
+ def write_header():
13
+ st.write(fa_import, unsafe_allow_html=True)
14
+
15
+
16
+ def write_footer():
17
+ st.write(
18
+ """
19
+ ---
20
+
21
+ Portions of Middle School Tutor are unofficial Fan Content permitted under the Wizards of the Coast Fan Content Policy. The literal and graphical information presented on this site about Magic: The Gathering, including card images, mana symbols, and Oracle text, is copyright Wizards of the Coast, LLC, a subsidiary of Hasbro, Inc.
22
+
23
+ Middle School Tutor is not produced by or endorsed by Wizards of the Coast. The GitHub and Twitter logos are copyright their respective owners. Middle School Tutor is not produced by or endorsed by these services.
24
+ """
25
+ )
26
+ write_header()
27
+ st.write(
28
+ f"### [{x_icon}]({x_url})&nbsp;&nbsp;[{gh_icon}]({gh_url})",
29
+ unsafe_allow_html=True,
30
+ )
31
+ st.write("##### All other content MIT licensed since 2022 by alecrem.")