Alejandro Cremades commited on
Commit
b7f5781
โ€ข
1 Parent(s): e67c590

Filter card list by mana value range

Browse files
Middle_School_Card_Search.py CHANGED
@@ -79,8 +79,19 @@ if colorcol5.checkbox(_["basic"]["color_g"][l]):
79
  if colorcol6.checkbox(_["basic"]["color_c"][l]):
80
  results_df = results_df[results_df["c"] == True]
81
 
82
- col1, col2 = st.columns(2)
 
 
 
 
 
 
 
 
 
 
83
  # Filter by type (select)
 
84
  type_list = streamlit_common.locale.get_type_options()
85
  select_types = col1.multiselect(
86
  f'**{_["search"]["select_type"][l]}**',
 
79
  if colorcol6.checkbox(_["basic"]["color_c"][l]):
80
  results_df = results_df[results_df["c"] == True]
81
 
82
+ # Filter by mana value
83
+ min_mv = mslist_df["mv"].min()
84
+ max_mv = mslist_df["mv"].max()
85
+ mv_options = [mv for mv in range(min_mv, max_mv + 1)]
86
+ start_mv, end_mv = st.select_slider(
87
+ f'**{_["search"]["search_by_mv"][l]}**', options=mv_options, value=(min_mv, max_mv)
88
+ )
89
+ cond1 = results_df["mv"] >= start_mv
90
+ cond2 = results_df["mv"] <= end_mv
91
+ results_df = results_df[cond1 & cond2]
92
+
93
  # Filter by type (select)
94
+ col1, col2 = st.columns(2)
95
  type_list = streamlit_common.locale.get_type_options()
96
  select_types = col1.multiselect(
97
  f'**{_["search"]["select_type"][l]}**',
streamlit_common/locale.py CHANGED
@@ -50,6 +50,10 @@ def get_locale():
50
  "en": "Color:",
51
  "ja": "่‰ฒ๏ผš",
52
  },
 
 
 
 
53
  "cards_found": {
54
  "en": " cards were found.",
55
  "ja": "ๆžš ใฎใ‚ซใƒผใƒ‰ใŒ่ฆ‹ใคใ‹ใ‚Šใพใ—ใŸใ€‚",
 
50
  "en": "Color:",
51
  "ja": "่‰ฒ๏ผš",
52
  },
53
+ "search_by_mv": {
54
+ "en": "Mana value:",
55
+ "ja": "ใƒžใƒŠ็ท้‡๏ผš",
56
+ },
57
  "cards_found": {
58
  "en": " cards were found.",
59
  "ja": "ๆžš ใฎใ‚ซใƒผใƒ‰ใŒ่ฆ‹ใคใ‹ใ‚Šใพใ—ใŸใ€‚",