File size: 10,804 Bytes
6d210e2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Rainwater Harvesting Schemes for {{ state_name.title() }}</title>
    <style>

        body {

            font-family: Arial, sans-serif;

            margin: 20px;

            background-color: #f4f4f4;

            color: #333;

        }

        .container {

            max-width: 900px;

            margin: auto;

            background: #fff;

            padding: 30px;

            border-radius: 8px;

            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);

        }

        h1, h2 {

            color: #2c3e50;

            text-align: center;

        }

        .llm-summary-section {

            background-color: #e8f5e9; /* Light green background */

            border: 1px solid #c8e6c9;

            border-radius: 6px;

            padding: 20px;

            margin-bottom: 30px;

            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);

        }

        .llm-summary-section h3 {

            color: #388e3c; /* Darker green for headings */

            margin-top: 0;

            border-bottom: 2px solid #a5d6a7;

            padding-bottom: 10px;

            margin-bottom: 15px;

        }

        .llm-summary-section p {

            margin: 10px 0;

            line-height: 1.6;

        }

        .llm-summary-section strong {

            color: #2e7d32;

        }

        .scheme-card {

            background-color: #ecf0f1;

            border: 1px solid #dcdcdc;

            border-radius: 6px;

            padding: 20px;

            margin-bottom: 20px;

            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);

        }

        .scheme-card h3 {

            color: #3498db;

            margin-top: 0;

            border-bottom: 2px solid #3498db;

            padding-bottom: 10px;

            margin-bottom: 15px;

        }

        .scheme-short-summary {

            background-color: #d6eaf8; /* Light blue for short summary */

            border-left: 5px solid #3498db;

            padding: 10px 15px;

            margin: 15px 0 10px 0; /* Adjusted margin */

            border-radius: 4px;

            font-style: italic;

            color: #2c3e50;

        }

        .scheme-user-benefit {

            background-color: #fcf8e3; /* Light yellow for user benefit */

            border-left: 5px solid #8a6d3b;

            padding: 10px 15px;

            margin: 10px 0 20px 0; /* Adjusted margin */

            border-radius: 4px;

            color: #6a4f2f;

        }

        .scheme-card p {

            margin: 8px 0;

            line-height: 1.5;

        }

        .scheme-card strong {

            color: #555;

        }

        .scheme-card a {

            color: #3498db;

            text-decoration: none;

        }

        .scheme-card a:hover {

            text-decoration: underline;

        }

        .no-schemes {

            text-align: center;

            color: #e74c3c;

            font-size: 1.2em;

            padding: 20px;

            background-color: #ffe8e8;

            border: 1px solid #e74c3c;

            border-radius: 6px;

        }

        .back-button {

            display: block;

            width: fit-content;

            margin: 20px auto;

            padding: 10px 20px;

            background-color: #5cb85c;

            color: white;

            text-decoration: none;

            border-radius: 4px;

            text-align: center;

            transition: background-color 0.3s ease;

        }

        .back-button:hover {

            background-color: #4cae4c;

        }

    </style>
</head>
<body>
    <div class="container">
        <h1>Rainwater Harvesting Schemes</h1>
        <h2>for {{ state_name.title() }}</h2>

        <div class="llm-summary-section">
            <h3>LLM-Based Overview</h3>
            <p>{{ llm_content.llm_summary | safe }}</p>

            <h3>Gemini 2.0 Based Enhanced Analysis</h3>
            <p>{{ llm_content.gemini_summary | safe }}</p>

            <h3>Personalized Financial Advice</h3>
            <p>{{ llm_content.financial_advice | safe }}</p>

            <div style="margin-top: 20px; border-top: 1px dashed #a5d6a7; padding-top: 15px;">
                <h4>Financial Advice Result:</h4>
                <p>{{ llm_content.financial_result | safe }}</p>
            </div>
        </div>

        {% if schemes %}
            {% for scheme in schemes %}
            <div class="scheme-card">
                <h3>{{ scheme.scheme_name }} ({{ scheme.scheme_id }})</h3>

                {# Gemini-generated short summary #}
                {% if scheme.short_summary_gemini %}
                <div class="scheme-short-summary">
                    <strong>What's this scheme about?</strong> {{ scheme.short_summary_gemini | safe }}
                </div>
                {% endif %}

                {# Gemini-generated user benefit summary #}
                {% if scheme.user_benefit_summary_gemini %}
                <div class="scheme-user-benefit">
                    <strong>How it benefits you:</strong> {{ scheme.user_benefit_summary_gemini | safe }}
                </div>
                {% endif %}

                <p><strong>Level:</strong> {{ scheme.scheme_level.title() }}</p>
                <p><strong>Status:</strong> {{ scheme.status.title() }}</p>
                <p><strong>Objective (from Data):</strong> {{ scheme.objective }}</p> {# Keeping original objective for comparison/reference #}
                <p><strong>Implementing Agency:</strong> {{ scheme.implementing_agency }}</p>
                <p><strong>Funding Agency:</strong> {{ scheme.funding_agency }}</p>
                <p><strong>Launched On:</strong> {{ scheme.date_of_launch if scheme.date_of_launch else 'N/A' }}</p>
                <p><strong>Last Updated:</strong> {{ scheme.last_updated if scheme.last_updated else 'N/A' }}</p>
                <p><strong>Geographical Scope:</strong> State: {{ scheme.geographical_scope_state_ut.title() }}{% if scheme.geographical_scope_districts %}, Districts: {{ scheme.geographical_scope_districts.title() }}{% endif %}{% if scheme.geographical_scope_cities %}, Cities: {{ scheme.geographical_scope_cities.title() }}{% endif %}</p>

                {% if scheme.subsidy_types_general %}
                    <p><strong>Subsidy Types:</strong> {{ scheme.subsidy_types_general.title() }}</p>
                {% endif %}
                {% if scheme.financial_assistance_type %}
                    <p><strong>Financial Assistance Type:</strong> {{ scheme.financial_assistance_type.title() }}</p>
                    {% if scheme.financial_assistance_value %}
                        <p><strong>Value:</strong> {{ scheme.financial_assistance_value }} {% if scheme.financial_assistance_unit %}{{ scheme.financial_assistance_unit }}{% endif %}</p>
                    {% endif %}
                    {% if scheme.financial_assistance_max_ceiling_INR is number %}
                        <p><strong>Max Ceiling (INR):</strong> {{ "{:,.2f}".format(scheme.financial_assistance_max_ceiling_INR) }}</p>
                    {% elif scheme.financial_assistance_max_ceiling_INR %}
                        <p><strong>Max Ceiling (INR):</strong> {{ scheme.financial_assistance_max_ceiling_INR }}</p>
                    {% endif %}
                    {% if scheme.financial_assistance_description %}
                        <p><strong>Financial Assistance Description:</strong> {{ scheme.financial_assistance_description }}</p>
                    {% endif %}
                {% endif %}

                <p><strong>Mandatory for New Construction:</strong> {{ 'Yes' if scheme.eligibility_is_mandatory_for_new_construction else 'No' }}</p>
                {% if scheme.eligibility_beneficiary_types %}
                    <p><strong>Eligible Beneficiary Types:</strong> {{ scheme.eligibility_beneficiary_types.title() }}</p>
                {% endif %}
                {% if scheme.eligibility_conditions %}
                    <p><strong>Eligibility Conditions:</strong> {{ scheme.eligibility_conditions.title() }}</p>
                {% endif %}
                {% if scheme.eligibility_parameter %}
                    <p><strong>Eligibility Parameter:</strong> {{ scheme.eligibility_parameter.title() }} {{ scheme.eligibility_operator }} {{ scheme.eligibility_value_param }} {{ scheme.eligibility_unit_param }}</p>
                {% endif %}

                {% if scheme.benefits_persuasive_summary %}
                    <p><strong>Summary (from Data):</strong> {{ scheme.benefits_persuasive_summary }}</p>
                {% endif %}
                {% if scheme.benefits_long_term_savings_estimate %}
                    <p><strong>Long Term Savings Estimate:</strong> {{ scheme.benefits_long_term_savings_estimate }}</p>
                {% endif %}
                {% if scheme.benefits_non_financial_benefits %}
                    <p><strong>Non-Financial Benefits (from Data):</strong> {{ scheme.benefits_non_financial_benefits.title() }}</p>
                {% endif %}

                {% if scheme.application_process_summary %}
                    <p><strong>Application Process:</strong> {{ scheme.application_process_summary }}</p>
                {% endif %}
                {% if scheme.documents_required %}
                    <p><strong>Documents Required:</strong> {{ scheme.documents_required }}</p>
                {% endif %}
                <p><strong>Source Link:</strong> <a href="{{ scheme.source_link }}" target="_blank">{{ scheme.source_link }}</a></p>
                <p><strong>Notes:</strong> {{ scheme.notes }}</p>

                {% if scheme.NGO_Name %}
                    <h4>Associated NGOs:</h4>
                    <p><strong>Name:</strong> {{ scheme.NGO_Name }}</p>
                    {% if scheme.NGO_Phone %}<p><strong>Phone:</strong> {{ scheme.NGO_Phone }}</p>{% endif %}
                    {% if scheme.NGO_Email %}<p><strong>Email:</strong> {{ scheme.NGO_Email }}</p>{% endif %}
                    {% if scheme.NGO_Address %}<p><strong>Address:</strong> {{ scheme.NGO_Address.title() }}</p>{% endif %}
                    {% if scheme.NGO_Alternate_Number %}<p><strong>Alternate Phone:</strong> {{ scheme.NGO_Alternate_Number }}</p>{% endif %}
                {% endif %}
            </div>
            {% endfor %}
        {% else %}
            <div class="no-schemes">
                <p>{{ message }}</p>
            </div>
        {% endif %}
        <a href="/" class="back-button">Go Back to Select Another State</a>
    </div>
</body>
</html>