Spaces:
Sleeping
Sleeping
Upload 19 files
Browse files
app.py
CHANGED
@@ -95,6 +95,20 @@ def display_generated_content(column, content, key_prefix):
|
|
95 |
"""
|
96 |
column.components.html(js_code, height=0)
|
97 |
column.success("隆Contenido copiado al portapapeles!")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
|
99 |
# Add this function to validate inputs
|
100 |
def validate_inputs(audience, product):
|
@@ -105,8 +119,18 @@ def validate_inputs(audience, product):
|
|
105 |
# Add this before the submit button
|
106 |
st.title("Generador de P谩ginas de Ventas")
|
107 |
|
108 |
-
#
|
109 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
|
111 |
with col1:
|
112 |
st.subheader("Configuraci贸n")
|
|
|
95 |
"""
|
96 |
column.components.html(js_code, height=0)
|
97 |
column.success("隆Contenido copiado al portapapeles!")
|
98 |
+
|
99 |
+
# Add download button
|
100 |
+
download_button_key = f"{key_prefix}_download_button"
|
101 |
+
timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
|
102 |
+
section_name = key_prefix.replace("_", "-")
|
103 |
+
filename = f"sales_page_{section_name}_{timestamp}.txt"
|
104 |
+
|
105 |
+
column.download_button(
|
106 |
+
label="Descargar contenido",
|
107 |
+
data=content,
|
108 |
+
file_name=filename,
|
109 |
+
mime="text/plain",
|
110 |
+
key=f"{key_prefix}_actual_download"
|
111 |
+
)
|
112 |
|
113 |
# Add this function to validate inputs
|
114 |
def validate_inputs(audience, product):
|
|
|
119 |
# Add this before the submit button
|
120 |
st.title("Generador de P谩ginas de Ventas")
|
121 |
|
122 |
+
# Load custom CSS from the styles folder
|
123 |
+
def load_css(css_file):
|
124 |
+
with open(css_file, 'r') as f:
|
125 |
+
css = f.read()
|
126 |
+
st.markdown(f'<style>{css}</style>', unsafe_allow_html=True)
|
127 |
+
|
128 |
+
# Load the CSS file
|
129 |
+
css_path = os.path.join(os.path.dirname(__file__), "styles", "styles.css")
|
130 |
+
load_css(css_path)
|
131 |
+
|
132 |
+
# Create two columns for layout with adjusted widths (40% left, 60% right)
|
133 |
+
col1, col2 = st.columns([4, 6])
|
134 |
|
135 |
with col1:
|
136 |
st.subheader("Configuraci贸n")
|