Dooratre commited on
Commit
d449189
·
verified ·
1 Parent(s): 2cbf46e

Upload 3 files

Browse files
templates/add_signal.html ADDED
@@ -0,0 +1,309 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="ar" dir="rtl">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>إضافة إشارة جديدة - لوحة إشارات التداول</title>
7
+ <!-- Bootstrap RTL CSS -->
8
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.rtl.min.css">
9
+ <!-- Font Awesome -->
10
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
11
+ <!-- Google Font - Cairo -->
12
+ <link href="https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700&display=swap" rel="stylesheet">
13
+ <!-- Custom CSS -->
14
+ <style>
15
+ :root {
16
+ --primary-color: #3498db;
17
+ --secondary-color: #2c3e50;
18
+ --success-color: #2ecc71;
19
+ --danger-color: #e74c3c;
20
+ --warning-color: #f39c12;
21
+ --info-color: #1abc9c;
22
+ --light-color: #f8f9fa;
23
+ --dark-color: #343a40;
24
+ }
25
+
26
+ body {
27
+ font-family: 'Cairo', sans-serif;
28
+ background-color: #f5f7fa;
29
+ color: #333;
30
+ padding-bottom: 60px;
31
+ }
32
+
33
+ .navbar {
34
+ background-color: var(--secondary-color);
35
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
36
+ }
37
+
38
+ .navbar-brand {
39
+ font-weight: 700;
40
+ color: white !important;
41
+ }
42
+
43
+ .form-card {
44
+ background-color: white;
45
+ border-radius: 15px;
46
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
47
+ padding: 35px;
48
+ margin-bottom: 30px;
49
+ }
50
+
51
+ .form-title {
52
+ color: var(--secondary-color);
53
+ font-weight: 600;
54
+ margin-bottom: 30px;
55
+ padding-bottom: 15px;
56
+ border-bottom: 1px solid #eee;
57
+ }
58
+
59
+ .form-label {
60
+ font-weight: 500;
61
+ color: var(--secondary-color);
62
+ margin-bottom: 8px;
63
+ }
64
+
65
+ .form-control, .form-select {
66
+ border-radius: 10px;
67
+ padding: 12px 15px;
68
+ border: 1px solid #ddd;
69
+ transition: all 0.3s;
70
+ font-size: 15px;
71
+ }
72
+
73
+ .form-control:focus, .form-select:focus {
74
+ border-color: var(--primary-color);
75
+ box-shadow: 0 0 0 0.25rem rgba(52, 152, 219, 0.25);
76
+ }
77
+
78
+ .btn-submit {
79
+ background-color: var(--primary-color);
80
+ border: none;
81
+ border-radius: 10px;
82
+ padding: 12px 25px;
83
+ font-weight: 500;
84
+ transition: all 0.3s;
85
+ display: flex;
86
+ align-items: center;
87
+ gap: 8px;
88
+ }
89
+
90
+ .btn-submit:hover {
91
+ background-color: #2980b9;
92
+ transform: translateY(-3px);
93
+ box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
94
+ }
95
+
96
+ .btn-cancel {
97
+ border-radius: 10px;
98
+ padding: 12px 25px;
99
+ font-weight: 500;
100
+ transition: all 0.3s;
101
+ display: flex;
102
+ align-items: center;
103
+ gap: 8px;
104
+ }
105
+
106
+ .btn-cancel:hover {
107
+ transform: translateY(-3px);
108
+ box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
109
+ }
110
+
111
+ .form-section {
112
+ margin-bottom: 30px;
113
+ }
114
+
115
+ .form-section-title {
116
+ font-size: 18px;
117
+ font-weight: 600;
118
+ color: var(--secondary-color);
119
+ margin-bottom: 20px;
120
+ }
121
+
122
+ /* Loading spinner */
123
+ .loading-overlay {
124
+ position: fixed;
125
+ top: 0;
126
+ left: 0;
127
+ width: 100%;
128
+ height: 100%;
129
+ background-color: rgba(255, 255, 255, 0.8);
130
+ display: flex;
131
+ justify-content: center;
132
+ align-items: center;
133
+ z-index: 9999;
134
+ visibility: hidden;
135
+ opacity: 0;
136
+ transition: all 0.3s;
137
+ }
138
+
139
+ .loading-overlay.active {
140
+ visibility: visible;
141
+ opacity: 1;
142
+ }
143
+
144
+ .spinner {
145
+ width: 60px;
146
+ height: 60px;
147
+ border: 6px solid var(--light-color);
148
+ border-top: 6px solid var(--primary-color);
149
+ border-radius: 50%;
150
+ animation: spin 1s linear infinite;
151
+ }
152
+
153
+ @keyframes spin {
154
+ 0% { transform: rotate(0deg); }
155
+ 100% { transform: rotate(360deg); }
156
+ }
157
+
158
+ /* Responsive adjustments */
159
+ @media (max-width: 768px) {
160
+ .form-card {
161
+ padding: 25px;
162
+ }
163
+
164
+ .form-title {
165
+ font-size: 1.5rem;
166
+ }
167
+ }
168
+ </style>
169
+ </head>
170
+ <body>
171
+ <!-- Loading Overlay -->
172
+ <div class="loading-overlay" id="loadingOverlay">
173
+ <div class="spinner"></div>
174
+ </div>
175
+
176
+ <!-- Navbar -->
177
+ <nav class="navbar navbar-expand-lg navbar-dark mb-4">
178
+ <div class="container">
179
+ <a class="navbar-brand" href="{{ url_for('index') }}">
180
+ <i class="fas fa-chart-line me-2"></i> لوحة إشارات التداول
181
+ </a>
182
+ <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
183
+ <span class="navbar-toggler-icon"></span>
184
+ </button>
185
+ <div class="collapse navbar-collapse" id="navbarNav">
186
+ <ul class="navbar-nav me-auto">
187
+ <li class="nav-item">
188
+ <a class="nav-link" href="{{ url_for('index') }}">
189
+ <i class="fas fa-home me-1"></i> الرئيسية
190
+ </a>
191
+ </li>
192
+ </ul>
193
+ </div>
194
+ </div>
195
+ </nav>
196
+
197
+ <div class="container">
198
+ <div class="form-card">
199
+ <h2 class="form-title"><i class="fas fa-plus-circle me-2"></i> إضافة إشارة تداول جديدة</h2>
200
+
201
+ <form action="{{ url_for('add_signal') }}" method="post" id="addSignalForm" onsubmit="showLoading()">
202
+ <div class="form-section">
203
+ <div class="form-section-title">المعلومات الأساسية</div>
204
+ <div class="row">
205
+ <div class="col-md-6 mb-3">
206
+ <label for="pair" class="form-label">زوج العملة</label>
207
+ <input type="text" class="form-control" id="pair" name="pair" required
208
+ placeholder="مثال: EURUSD, GBPJPY">
209
+ </div>
210
+ <div class="col-md-6 mb-3">
211
+ <label for="timeframe" class="form-label">الإطار الزمني</label>
212
+ <select class="form-select" id="timeframe" name="timeframe" required>
213
+ <option value="" selected disabled>اختر الإطار الزمني</option>
214
+ <option value="1min">1 دقيقة</option>
215
+ <option value="5min">5 دقائق</option>
216
+ <option value="15min">15 دقيقة</option>
217
+ <option value="30min">30 دقيقة</option>
218
+ <option value="1h">1 ساعة</option>
219
+ <option value="4h">4 ساعات</option>
220
+ <option value="1d">يومي</option>
221
+ <option value="1w">أسبوعي</option>
222
+ </select>
223
+ </div>
224
+ </div>
225
+ <div class="row">
226
+ <div class="col-md-6 mb-3">
227
+ <label for="type" class="form-label">نوع الإشارة</label>
228
+ <select class="form-select" id="type" name="type" required>
229
+ <option value="" selected disabled>اختر نوع الإشارة</option>
230
+ <option value="شراء (Buy)">شراء (Buy)</option>
231
+ <option value="بيع (Sell)">بيع (Sell)</option>
232
+ </select>
233
+ </div>
234
+ <div class="col-md-6 mb-3">
235
+ <label for="duration" class="form-label">المدة المتوقعة</label>
236
+ <input type="text" class="form-control" id="duration" name="duration" required
237
+ placeholder="مثال: 3-5 أيام، يوم واحد">
238
+ </div>
239
+ </div>
240
+ </div>
241
+
242
+ <div class="form-section">
243
+ <div class="form-section-title">نقاط الدخول والخروج</div>
244
+ <div class="row">
245
+ <div class="col-md-4 mb-3">
246
+ <label for="entry" class="form-label">سعر الدخول</label>
247
+ <input type="text" class="form-control" id="entry" name="entry" required
248
+ placeholder="مثال: 1.0500">
249
+ </div>
250
+ <div class="col-md-4 mb-3">
251
+ <label for="stop_loss" class="form-label">وقف الخسارة</label>
252
+ <input type="text" class="form-control" id="stop_loss" name="stop_loss" required
253
+ placeholder="مثال: 1.0450">
254
+ </div>
255
+ <div class="col-md-4 mb-3">
256
+ <label for="take_profit" class="form-label">جني الأرباح</label>
257
+ <input type="text" class="form-control" id="take_profit" name="take_profit" required
258
+ placeholder="مثال: 1.0600">
259
+ </div>
260
+ </div>
261
+ </div>
262
+
263
+ <div class="form-section">
264
+ <div class="form-section-title">التحليل والحالة</div>
265
+ <div class="mb-3">
266
+ <label for="reason" class="form-label">سبب التحليل</label>
267
+ <textarea class="form-control" id="reason" name="reason" rows="5" required
268
+ placeholder="أدخل تحليلاً مفصلاً وسبب هذه الإشارة..."></textarea>
269
+ </div>
270
+ <div class="mb-3">
271
+ <label for="status" class="form-label">حالة الإشارة</label>
272
+ <select class="form-select" id="status" name="status" required>
273
+ <option value="starting" selected>بداية</option>
274
+ <option value="active">نشط</option>
275
+ <option value="completed">مكتمل</option>
276
+ <option value="failed">فشل</option>
277
+ </select>
278
+ </div>
279
+ </div>
280
+
281
+ <div class="d-flex justify-content-end mt-4">
282
+ <a href="{{ url_for('index') }}" class="btn btn-secondary btn-cancel me-2">
283
+ <i class="fas fa-times me-1"></i> إلغاء
284
+ </a>
285
+ <button type="submit" class="btn btn-primary btn-submit">
286
+ <i class="fas fa-save me-1"></i> حفظ الإشارة
287
+ </button>
288
+ </div>
289
+ </form>
290
+ </div>
291
+ </div>
292
+
293
+ <!-- Bootstrap JS and dependencies -->
294
+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
295
+
296
+ <!-- Custom JavaScript -->
297
+ <script>
298
+ // Show loading overlay
299
+ function showLoading() {
300
+ document.getElementById('loadingOverlay').classList.add('active');
301
+ }
302
+
303
+ // Hide loading overlay
304
+ function hideLoading() {
305
+ document.getElementById('loadingOverlay').classList.remove('active');
306
+ }
307
+ </script>
308
+ </body>
309
+ </html>
templates/edit_signal.html ADDED
@@ -0,0 +1,306 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="ar" dir="rtl">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>تعديل الإشارة - لوحة إشارات التداول</title>
7
+ <!-- Bootstrap RTL CSS -->
8
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.rtl.min.css">
9
+ <!-- Font Awesome -->
10
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
11
+ <!-- Google Font - Cairo -->
12
+ <link href="https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700&display=swap" rel="stylesheet">
13
+ <!-- Custom CSS -->
14
+ <style>
15
+ :root {
16
+ --primary-color: #3498db;
17
+ --secondary-color: #2c3e50;
18
+ --success-color: #2ecc71;
19
+ --danger-color: #e74c3c;
20
+ --warning-color: #f39c12;
21
+ --info-color: #1abc9c;
22
+ --light-color: #f8f9fa;
23
+ --dark-color: #343a40;
24
+ }
25
+
26
+ body {
27
+ font-family: 'Cairo', sans-serif;
28
+ background-color: #f5f7fa;
29
+ color: #333;
30
+ padding-bottom: 60px;
31
+ }
32
+
33
+ .navbar {
34
+ background-color: var(--secondary-color);
35
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
36
+ }
37
+
38
+ .navbar-brand {
39
+ font-weight: 700;
40
+ color: white !important;
41
+ }
42
+
43
+ .form-card {
44
+ background-color: white;
45
+ border-radius: 15px;
46
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
47
+ padding: 35px;
48
+ margin-bottom: 30px;
49
+ }
50
+
51
+ .form-title {
52
+ color: var(--secondary-color);
53
+ font-weight: 600;
54
+ margin-bottom: 30px;
55
+ padding-bottom: 15px;
56
+ border-bottom: 1px solid #eee;
57
+ }
58
+
59
+ .form-label {
60
+ font-weight: 500;
61
+ color: var(--secondary-color);
62
+ margin-bottom: 8px;
63
+ }
64
+
65
+ .form-control, .form-select {
66
+ border-radius: 10px;
67
+ padding: 12px 15px;
68
+ border: 1px solid #ddd;
69
+ transition: all 0.3s;
70
+ font-size: 15px;
71
+ }
72
+
73
+ .form-control:focus, .form-select:focus {
74
+ border-color: var(--primary-color);
75
+ box-shadow: 0 0 0 0.25rem rgba(52, 152, 219, 0.25);
76
+ }
77
+
78
+ .btn-submit {
79
+ background-color: var(--primary-color);
80
+ border: none;
81
+ border-radius: 10px;
82
+ padding: 12px 25px;
83
+ font-weight: 500;
84
+ transition: all 0.3s;
85
+ display: flex;
86
+ align-items: center;
87
+ gap: 8px;
88
+ }
89
+
90
+ .btn-submit:hover {
91
+ background-color: #2980b9;
92
+ transform: translateY(-3px);
93
+ box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
94
+ }
95
+
96
+ .btn-cancel {
97
+ border-radius: 10px;
98
+ padding: 12px 25px;
99
+ font-weight: 500;
100
+ transition: all 0.3s;
101
+ display: flex;
102
+ align-items: center;
103
+ gap: 8px;
104
+ }
105
+
106
+ .btn-cancel:hover {
107
+ transform: translateY(-3px);
108
+ box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
109
+ }
110
+
111
+ .form-section {
112
+ margin-bottom: 30px;
113
+ }
114
+
115
+ .form-section-title {
116
+ font-size: 18px;
117
+ font-weight: 600;
118
+ color: var(--secondary-color);
119
+ margin-bottom: 20px;
120
+ }
121
+
122
+ /* Loading spinner */
123
+ .loading-overlay {
124
+ position: fixed;
125
+ top: 0;
126
+ left: 0;
127
+ width: 100%;
128
+ height: 100%;
129
+ background-color: rgba(255, 255, 255, 0.8);
130
+ display: flex;
131
+ justify-content: center;
132
+ align-items: center;
133
+ z-index: 9999;
134
+ visibility: hidden;
135
+ opacity: 0;
136
+ transition: all 0.3s;
137
+ }
138
+
139
+ .loading-overlay.active {
140
+ visibility: visible;
141
+ opacity: 1;
142
+ }
143
+
144
+ .spinner {
145
+ width: 60px;
146
+ height: 60px;
147
+ border: 6px solid var(--light-color);
148
+ border-top: 6px solid var(--primary-color);
149
+ border-radius: 50%;
150
+ animation: spin 1s linear infinite;
151
+ }
152
+
153
+ @keyframes spin {
154
+ 0% { transform: rotate(0deg); }
155
+ 100% { transform: rotate(360deg); }
156
+ }
157
+
158
+ /* Responsive adjustments */
159
+ @media (max-width: 768px) {
160
+ .form-card {
161
+ padding: 25px;
162
+ }
163
+
164
+ .form-title {
165
+ font-size: 1.5rem;
166
+ }
167
+ }
168
+ </style>
169
+ </head>
170
+ <body>
171
+ <!-- Loading Overlay -->
172
+ <div class="loading-overlay" id="loadingOverlay">
173
+ <div class="spinner"></div>
174
+ </div>
175
+
176
+ <!-- Navbar -->
177
+ <nav class="navbar navbar-expand-lg navbar-dark mb-4">
178
+ <div class="container">
179
+ <a class="navbar-brand" href="{{ url_for('index') }}">
180
+ <i class="fas fa-chart-line me-2"></i> لوحة إشارات التداول
181
+ </a>
182
+ <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
183
+ <span class="navbar-toggler-icon"></span>
184
+ </button>
185
+ <div class="collapse navbar-collapse" id="navbarNav">
186
+ <ul class="navbar-nav me-auto">
187
+ <li class="nav-item">
188
+ <a class="nav-link" href="{{ url_for('index') }}">
189
+ <i class="fas fa-home me-1"></i> الرئيسية
190
+ </a>
191
+ </li>
192
+ </ul>
193
+ </div>
194
+ </div>
195
+ </nav>
196
+
197
+ <div class="container">
198
+ <div class="form-card">
199
+ <h2 class="form-title"><i class="fas fa-edit me-2"></i> تعديل إشارة التداول</h2>
200
+
201
+ <form action="{{ url_for('edit_signal', signal_id=signal_id) }}" method="post" id="editSignalForm" onsubmit="showLoading()">
202
+ <div class="form-section">
203
+ <div class="form-section-title">المعلومات الأساسية</div>
204
+ <div class="row">
205
+ <div class="col-md-6 mb-3">
206
+ <label for="pair" class="form-label">زوج العملة</label>
207
+ <input type="text" class="form-control" id="pair" name="pair" required
208
+ value="{{ signal.pair }}">
209
+ </div>
210
+ <div class="col-md-6 mb-3">
211
+ <label for="timeframe" class="form-label">الإطار الزمني</label>
212
+ <select class="form-select" id="timeframe" name="timeframe" required>
213
+ <option value="1min" {{ 'selected' if signal.timeframe == '1min' else '' }}>1 دقيقة</option>
214
+ <option value="5min" {{ 'selected' if signal.timeframe == '5min' else '' }}>5 دقائق</option>
215
+ <option value="15min" {{ 'selected' if signal.timeframe == '15min' else '' }}>15 دقيقة</option>
216
+ <option value="30min" {{ 'selected' if signal.timeframe == '30min' else '' }}>30 دقيقة</option>
217
+ <option value="1h" {{ 'selected' if signal.timeframe == '1h' else '' }}>1 ساعة</option>
218
+ <option value="4h" {{ 'selected' if signal.timeframe == '4h' else '' }}>4 ساعات</option>
219
+ <option value="1d" {{ 'selected' if signal.timeframe == '1d' else '' }}>يومي</option>
220
+ <option value="1w" {{ 'selected' if signal.timeframe == '1w' else '' }}>أسبوعي</option>
221
+ </select>
222
+ </div>
223
+ </div>
224
+ <div class="row">
225
+ <div class="col-md-6 mb-3">
226
+ <label for="type" class="form-label">نوع الإشارة</label>
227
+ <select class="form-select" id="type" name="type" required>
228
+ <option value="شراء (Buy)" {{ 'selected' if 'شراء' in signal.type else '' }}>شراء (Buy)</option>
229
+ <option value="بيع (Sell)" {{ 'selected' if 'بيع' in signal.type else '' }}>بيع (Sell)</option>
230
+ </select>
231
+ </div>
232
+ <div class="col-md-6 mb-3">
233
+ <label for="duration" class="form-label">المدة المتوقعة</label>
234
+ <input type="text" class="form-control" id="duration" name="duration" required
235
+ value="{{ signal.duration }}">
236
+ </div>
237
+ </div>
238
+ </div>
239
+
240
+ <div class="form-section">
241
+ <div class="form-section-title">نقاط الدخول والخروج</div>
242
+ <div class="row">
243
+ <div class="col-md-4 mb-3">
244
+ <label for="entry" class="form-label">سعر الدخول</label>
245
+ <input type="text" class="form-control" id="entry" name="entry" required
246
+ value="{{ signal.entry }}">
247
+ </div>
248
+ <div class="col-md-4 mb-3">
249
+ <label for="stop_loss" class="form-label">وقف الخسارة</label>
250
+ <input type="text" class="form-control" id="stop_loss" name="stop_loss" required
251
+ value="{{ signal.stop_loss }}">
252
+ </div>
253
+ <div class="col-md-4 mb-3">
254
+ <label for="take_profit" class="form-label">جني الأرباح</label>
255
+ <input type="text" class="form-control" id="take_profit" name="take_profit" required
256
+ value="{{ signal.take_profit }}">
257
+ </div>
258
+ </div>
259
+ </div>
260
+
261
+ <div class="form-section">
262
+ <div class="form-section-title">التحليل والحالة</div>
263
+ <div class="mb-3">
264
+ <label for="reason" class="form-label">سبب التحليل</label>
265
+ <textarea class="form-control" id="reason" name="reason" rows="5" required>{{ signal.reason }}</textarea>
266
+ </div>
267
+ <div class="mb-3">
268
+ <label for="status" class="form-label">حالة الإشارة</label>
269
+ <select class="form-select" id="status" name="status" required>
270
+ <option value="starting" {{ 'selected' if signal.status == 'starting' else '' }}>بداية</option>
271
+ <option value="active" {{ 'selected' if signal.status == 'active' else '' }}>نشط</option>
272
+ <option value="completed" {{ 'selected' if signal.status == 'completed' else '' }}>مكتمل</option>
273
+ <option value="failed" {{ 'selected' if signal.status == 'failed' else '' }}>فشل</option>
274
+ </select>
275
+ </div>
276
+ </div>
277
+
278
+ <div class="d-flex justify-content-end mt-4">
279
+ <a href="{{ url_for('index') }}" class="btn btn-secondary btn-cancel me-2">
280
+ <i class="fas fa-times me-1"></i> إلغاء
281
+ </a>
282
+ <button type="submit" class="btn btn-primary btn-submit">
283
+ <i class="fas fa-save me-1"></i> تحديث الإشارة
284
+ </button>
285
+ </div>
286
+ </form>
287
+ </div>
288
+ </div>
289
+
290
+ <!-- Bootstrap JS and dependencies -->
291
+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
292
+
293
+ <!-- Custom JavaScript -->
294
+ <script>
295
+ // Show loading overlay
296
+ function showLoading() {
297
+ document.getElementById('loadingOverlay').classList.add('active');
298
+ }
299
+
300
+ // Hide loading overlay
301
+ function hideLoading() {
302
+ document.getElementById('loadingOverlay').classList.remove('active');
303
+ }
304
+ </script>
305
+ </body>
306
+ </html>
templates/index.html ADDED
@@ -0,0 +1,748 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="ar" dir="rtl">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>لوحة إشارات التداول</title>
7
+ <!-- Bootstrap RTL CSS -->
8
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.rtl.min.css">
9
+ <!-- Font Awesome -->
10
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
11
+ <!-- Google Font - Cairo -->
12
+ <link href="https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700&display=swap" rel="stylesheet">
13
+ <!-- Custom CSS -->
14
+ <style>
15
+ :root {
16
+ --primary-color: #3498db;
17
+ --secondary-color: #2c3e50;
18
+ --success-color: #2ecc71;
19
+ --danger-color: #e74c3c;
20
+ --warning-color: #f39c12;
21
+ --info-color: #1abc9c;
22
+ --light-color: #f8f9fa;
23
+ --dark-color: #343a40;
24
+ }
25
+
26
+ body {
27
+ font-family: 'Cairo', sans-serif;
28
+ background-color: #f5f7fa;
29
+ color: #333;
30
+ padding-bottom: 60px;
31
+ }
32
+
33
+ .navbar {
34
+ background-color: var(--secondary-color);
35
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
36
+ }
37
+
38
+ .navbar-brand {
39
+ font-weight: 700;
40
+ color: white !important;
41
+ }
42
+
43
+ .dashboard-header {
44
+ background-color: white;
45
+ border-radius: 15px;
46
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
47
+ padding: 25px;
48
+ margin-bottom: 25px;
49
+ }
50
+
51
+ .status-card {
52
+ border-radius: 15px;
53
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
54
+ transition: all 0.3s ease;
55
+ border: none;
56
+ overflow: hidden;
57
+ }
58
+
59
+ .status-card:hover {
60
+ transform: translateY(-5px);
61
+ box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
62
+ }
63
+
64
+ .status-card .card-body {
65
+ padding: 25px;
66
+ }
67
+
68
+ .signal-card {
69
+ border-radius: 15px;
70
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
71
+ margin-bottom: 25px;
72
+ transition: all 0.3s ease;
73
+ overflow: hidden;
74
+ border: none;
75
+ }
76
+
77
+ .signal-card:hover {
78
+ transform: translateY(-5px);
79
+ box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
80
+ }
81
+
82
+ .signal-card .card-header {
83
+ display: flex;
84
+ justify-content: space-between;
85
+ align-items: center;
86
+ background-color: var(--secondary-color);
87
+ color: white;
88
+ font-weight: 600;
89
+ padding: 18px 25px;
90
+ }
91
+
92
+ .signal-card .card-body {
93
+ padding: 25px;
94
+ }
95
+
96
+ .signal-info {
97
+ display: flex;
98
+ flex-wrap: wrap;
99
+ gap: 15px;
100
+ }
101
+
102
+ .signal-detail {
103
+ flex: 1;
104
+ min-width: 150px;
105
+ background-color: #f8f9fa;
106
+ padding: 15px 20px;
107
+ border-radius: 12px;
108
+ box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05);
109
+ }
110
+
111
+ .signal-detail h6 {
112
+ margin-bottom: 8px;
113
+ color: var(--secondary-color);
114
+ font-size: 15px;
115
+ font-weight: 600;
116
+ }
117
+
118
+ .signal-detail p {
119
+ margin-bottom: 0;
120
+ font-weight: 500;
121
+ font-size: 16px;
122
+ }
123
+
124
+ .reason-section {
125
+ margin-top: 20px;
126
+ background-color: #f8f9fa;
127
+ padding: 20px;
128
+ border-radius: 12px;
129
+ box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05);
130
+ }
131
+
132
+ .reason-section h6 {
133
+ color: var(--secondary-color);
134
+ font-weight: 600;
135
+ margin-bottom: 12px;
136
+ }
137
+
138
+ .signal-actions {
139
+ display: flex;
140
+ justify-content: flex-end;
141
+ gap: 15px;
142
+ margin-top: 20px;
143
+ }
144
+
145
+ .btn-action {
146
+ border-radius: 10px;
147
+ padding: 10px 20px;
148
+ font-weight: 500;
149
+ display: flex;
150
+ align-items: center;
151
+ gap: 8px;
152
+ transition: all 0.3s ease;
153
+ }
154
+
155
+ .btn-action:hover {
156
+ transform: translateY(-3px);
157
+ box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
158
+ }
159
+
160
+ .badge-buy {
161
+ background-color: var(--success-color);
162
+ color: white;
163
+ padding: 6px 12px;
164
+ border-radius: 8px;
165
+ font-weight: 600;
166
+ }
167
+
168
+ .badge-sell {
169
+ background-color: var(--danger-color);
170
+ color: white;
171
+ padding: 6px 12px;
172
+ border-radius: 8px;
173
+ font-weight: 600;
174
+ }
175
+
176
+ .badge-starting {
177
+ background-color: var(--warning-color);
178
+ color: white;
179
+ padding: 6px 12px;
180
+ border-radius: 8px;
181
+ }
182
+
183
+ .badge-active {
184
+ background-color: var(--primary-color);
185
+ color: white;
186
+ padding: 6px 12px;
187
+ border-radius: 8px;
188
+ }
189
+
190
+ .badge-completed {
191
+ background-color: var(--success-color);
192
+ color: white;
193
+ padding: 6px 12px;
194
+ border-radius: 8px;
195
+ }
196
+
197
+ .badge-failed {
198
+ background-color: var(--danger-color);
199
+ color: white;
200
+ padding: 6px 12px;
201
+ border-radius: 8px;
202
+ }
203
+
204
+ .add-signal-btn {
205
+ position: fixed;
206
+ bottom: 30px;
207
+ right: 30px;
208
+ width: 65px;
209
+ height: 65px;
210
+ border-radius: 50%;
211
+ background-color: var(--primary-color);
212
+ color: white;
213
+ display: flex;
214
+ justify-content: center;
215
+ align-items: center;
216
+ font-size: 24px;
217
+ box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
218
+ transition: all 0.3s ease;
219
+ z-index: 1000;
220
+ border: none;
221
+ }
222
+
223
+ .add-signal-btn:hover {
224
+ transform: scale(1.1);
225
+ background-color: #2980b9;
226
+ color: white;
227
+ }
228
+
229
+ .delete-all-btn {
230
+ background-color: var(--danger-color);
231
+ color: white;
232
+ border: none;
233
+ border-radius: 10px;
234
+ padding: 12px 20px;
235
+ font-weight: 500;
236
+ transition: all 0.3s ease;
237
+ display: flex;
238
+ align-items: center;
239
+ gap: 8px;
240
+ }
241
+
242
+ .delete-all-btn:hover {
243
+ background-color: #c0392b;
244
+ transform: translateY(-3px);
245
+ box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
246
+ }
247
+
248
+ /* Custom Switch */
249
+ .switch {
250
+ position: relative;
251
+ display: inline-block;
252
+ width: 80px;
253
+ height: 80px;
254
+ border: 2px solid #dcdcdc;
255
+ background: #e0e0e0;
256
+ box-shadow: 7px 7px 23px #bebebe, -7px -7px 23px #ffffff;
257
+ overflow: hidden;
258
+ border-radius: 60px;
259
+ }
260
+
261
+ .switch input {
262
+ opacity: 0;
263
+ width: 0;
264
+ height: 0;
265
+ }
266
+
267
+ .slider {
268
+ position: absolute;
269
+ cursor: pointer;
270
+ top: 0;
271
+ left: 0;
272
+ right: 0;
273
+ bottom: 0;
274
+ -webkit-transition: 0.5s;
275
+ transition: 0.5s;
276
+ }
277
+
278
+ .chbox:checked + .slider:before {
279
+ background: white;
280
+ box-shadow: none;
281
+ }
282
+
283
+ .chbox:focus + .slider {
284
+ box-shadow: 0 0 1px #2196f3;
285
+ }
286
+
287
+ .slider {
288
+ color: #9a9a9a;
289
+ display: flex;
290
+ align-items: center;
291
+ justify-content: center;
292
+ font-size: 11px;
293
+ font-family: 'Cairo', sans-serif;
294
+ }
295
+
296
+ .slider--0 {
297
+ color: white;
298
+ font-weight: 600;
299
+ background-color: var(--success-color);
300
+ }
301
+
302
+ .slider--1 div {
303
+ transition: 0.5s;
304
+ }
305
+
306
+ .slider--1 div {
307
+ position: absolute;
308
+ width: 100%;
309
+ height: 50%;
310
+ left: 0;
311
+ }
312
+
313
+ .chbox:checked ~ .slider--1 div:first-child {
314
+ transform: translateY(-100%);
315
+ transition-delay: 1s;
316
+ }
317
+
318
+ .chbox:checked ~ .slider--1 div:last-child {
319
+ transform: translateY(100%);
320
+ transition-delay: 1s;
321
+ }
322
+
323
+ .chbox:checked ~ .slider--2 {
324
+ transform: translateX(100%);
325
+ transition-delay: 0.5s;
326
+ }
327
+
328
+ .chbox:checked ~ .slider--3 {
329
+ transform: translateX(-100%);
330
+ transition-delay: 0s;
331
+ }
332
+
333
+ .slider--1 div:first-child {
334
+ transform: translateY(0);
335
+ top: 0;
336
+ background-color: #f3f3f3;
337
+ transition-delay: 0s;
338
+ }
339
+
340
+ .slider--1 div:last-child {
341
+ transform: translateY(0);
342
+ bottom: 0;
343
+ background-color: #f3f3f3;
344
+ border-top: 1px solid #e0e0e0;
345
+ transition-delay: 0s;
346
+ }
347
+
348
+ .slider--2 {
349
+ background-color: #e6e6e6;
350
+ transition-delay: 0.5s;
351
+ transform: translateX(0);
352
+ border-left: 1px solid #d2d2d2;
353
+ }
354
+
355
+ .slider--3 {
356
+ background-color: #d2d2d2;
357
+ transition-delay: 1s;
358
+ transform: translatex(0);
359
+ border-right: 1px solid #d2d2d2;
360
+ font-weight: 600;
361
+ }
362
+
363
+ /* Responsive adjustments */
364
+ @media (max-width: 768px) {
365
+ .signal-info {
366
+ flex-direction: column;
367
+ gap: 10px;
368
+ }
369
+
370
+ .signal-detail {
371
+ min-width: 100%;
372
+ }
373
+
374
+ .signal-actions {
375
+ flex-wrap: wrap;
376
+ }
377
+
378
+ .dashboard-header h2 {
379
+ font-size: 1.5rem;
380
+ }
381
+
382
+ .add-signal-btn {
383
+ width: 55px;
384
+ height: 55px;
385
+ font-size: 20px;
386
+ bottom: 20px;
387
+ right: 20px;
388
+ }
389
+
390
+ .switch {
391
+ width: 60px;
392
+ height: 60px;
393
+ }
394
+ }
395
+
396
+ /* Loading spinner */
397
+ .loading-overlay {
398
+ position: fixed;
399
+ top: 0;
400
+ left: 0;
401
+ width: 100%;
402
+ height: 100%;
403
+ background-color: rgba(255, 255, 255, 0.8);
404
+ display: flex;
405
+ justify-content: center;
406
+ align-items: center;
407
+ z-index: 9999;
408
+ visibility: hidden;
409
+ opacity: 0;
410
+ transition: all 0.3s;
411
+ }
412
+
413
+ .loading-overlay.active {
414
+ visibility: visible;
415
+ opacity: 1;
416
+ }
417
+
418
+ .spinner {
419
+ width: 60px;
420
+ height: 60px;
421
+ border: 6px solid var(--light-color);
422
+ border-top: 6px solid var(--primary-color);
423
+ border-radius: 50%;
424
+ animation: spin 1s linear infinite;
425
+ }
426
+
427
+ @keyframes spin {
428
+ 0% { transform: rotate(0deg); }
429
+ 100% { transform: rotate(360deg); }
430
+ }
431
+
432
+ /* Empty state */
433
+ .empty-state {
434
+ text-align: center;
435
+ padding: 60px 20px;
436
+ background-color: white;
437
+ border-radius: 15px;
438
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
439
+ }
440
+
441
+ .empty-state i {
442
+ font-size: 70px;
443
+ color: #ddd;
444
+ margin-bottom: 25px;
445
+ }
446
+
447
+ .empty-state h3 {
448
+ color: var(--secondary-color);
449
+ margin-bottom: 15px;
450
+ font-weight: 600;
451
+ }
452
+
453
+ .empty-state p {
454
+ color: #777;
455
+ margin-bottom: 25px;
456
+ font-size: 16px;
457
+ }
458
+
459
+ .empty-state .btn {
460
+ padding: 12px 25px;
461
+ border-radius: 10px;
462
+ font-weight: 500;
463
+ transition: all 0.3s ease;
464
+ }
465
+
466
+ .empty-state .btn:hover {
467
+ transform: translateY(-3px);
468
+ box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
469
+ }
470
+ </style>
471
+ </head>
472
+ <body>
473
+ <!-- Loading Overlay -->
474
+ <div class="loading-overlay" id="loadingOverlay">
475
+ <div class="spinner"></div>
476
+ </div>
477
+
478
+ <!-- Navbar -->
479
+ <nav class="navbar navbar-expand-lg navbar-dark mb-4">
480
+ <div class="container">
481
+ <a class="navbar-brand" href="{{ url_for('index') }}">
482
+ <i class="fas fa-chart-line me-2"></i> لوحة إشارات التداول
483
+ </a>
484
+ <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
485
+ <span class="navbar-toggler-icon"></span>
486
+ </button>
487
+ <div class="collapse navbar-collapse" id="navbarNav">
488
+ <ul class="navbar-nav me-auto">
489
+ <li class="nav-item">
490
+ <a class="nav-link active" href="{{ url_for('index') }}">
491
+ <i class="fas fa-home me-1"></i> الرئيسية
492
+ </a>
493
+ </li>
494
+ </ul>
495
+ </div>
496
+ </div>
497
+ </nav>
498
+
499
+ <div class="container">
500
+ <!-- Flash Messages -->
501
+ {% with messages = get_flashed_messages(with_categories=true) %}
502
+ {% if messages %}
503
+ {% for category, message in messages %}
504
+ <div class="alert alert-{{ category }} alert-dismissible fade show" role="alert">
505
+ {{ message }}
506
+ <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
507
+ </div>
508
+ {% endfor %}
509
+ {% endif %}
510
+ {% endwith %}
511
+
512
+ <!-- Dashboard Header -->
513
+ <div class="dashboard-header">
514
+ <div class="row align-items-center">
515
+ <div class="col-md-6">
516
+ <h2 class="mb-0"><i class="fas fa-signal me-2"></i> إشارات التداول</h2>
517
+ </div>
518
+ <div class="col-md-6 text-md-end mt-3 mt-md-0">
519
+ <form action="{{ url_for('delete_all_signals') }}" method="post" id="deleteAllForm" class="d-inline">
520
+ <button type="button" class="delete-all-btn" onclick="confirmDeleteAll()">
521
+ <i class="fas fa-trash-alt me-1"></i> حذف جميع الإشارات
522
+ </button>
523
+ </form>
524
+ </div>
525
+ </div>
526
+ </div>
527
+
528
+ <!-- System Status Cards -->
529
+ <div class="row mb-4">
530
+ <div class="col-md-6 mb-3 mb-md-0">
531
+ <div class="card status-card h-100">
532
+ <div class="card-body">
533
+ <h5 class="card-title mb-4 fw-bold">النظام العميق</h5>
534
+ <p class="card-text mb-4">الحالة الحالية: <strong>{{ 'نشط' if system_status.deeper else 'غير نشط' }}</strong></p>
535
+ <div class="d-flex align-items-center justify-content-between">
536
+ <span class="fw-medium">تفعيل النظام:</span>
537
+ <label class="switch">
538
+ <input type="checkbox" class="chbox" id="deeperToggle" {{ 'checked' if system_status.deeper else '' }}
539
+ onchange="toggleSystem('deeper', this.checked)">
540
+ <div class="slider slider--0">تشغيل</div>
541
+ <div class="slider slider--1">
542
+ <div></div>
543
+ <div></div>
544
+ </div>
545
+ <div class="slider slider--2"></div>
546
+ <div class="slider slider--3">إيقاف</div>
547
+ </label>
548
+ </div>
549
+ </div>
550
+ </div>
551
+ </div>
552
+ <div class="col-md-6">
553
+ <div class="card status-card h-100">
554
+ <div class="card-body">
555
+ <h5 class="card-title mb-4 fw-bold">النظام الرئيسي</h5>
556
+ <p class="card-text mb-4">الحالة الحالية: <strong>{{ 'نشط' if system_status.paires else 'غير نشط' }}</strong></p>
557
+ <div class="d-flex align-items-center justify-content-between">
558
+ <span class="fw-medium">تفعيل النظام:</span>
559
+ <label class="switch">
560
+ <input type="checkbox" class="chbox" id="pairesToggle" {{ 'checked' if system_status.paires else '' }}
561
+ onchange="toggleSystem('paires', this.checked)">
562
+ <div class="slider slider--0">تشغيل</div>
563
+ <div class="slider slider--1">
564
+ <div></div>
565
+ <div></div>
566
+ </div>
567
+ <div class="slider slider--2"></div>
568
+ <div class="slider slider--3">إيقاف</div>
569
+ </label>
570
+ </div>
571
+ </div>
572
+ </div>
573
+ </div>
574
+ </div>
575
+
576
+ <!-- Signals List -->
577
+ <div class="signals-container">
578
+ {% if signals %}
579
+ {% for signal in signals %}
580
+ <div class="card signal-card">
581
+ <div class="card-header">
582
+ <div>
583
+ <span class="me-2">{{ signal.pair }}</span>
584
+ <span class="badge {{ 'badge-buy' if 'شراء' in signal.type else 'badge-sell' }}">{{ signal.type }}</span>
585
+ </div>
586
+ <div>
587
+ <span class="badge
588
+ {% if signal.status == 'starting' %}badge-starting
589
+ {% elif signal.status == 'active' %}badge-active
590
+ {% elif signal.status == 'completed' %}badge-completed
591
+ {% elif signal.status == 'failed' %}badge-failed
592
+ {% endif %}">
593
+ {% if signal.status == 'starting' %}بداية
594
+ {% elif signal.status == 'active' %}نشط
595
+ {% elif signal.status == 'completed' %}مكتمل
596
+ {% elif signal.status == 'failed' %}فشل
597
+ {% endif %}
598
+ </span>
599
+ </div>
600
+ </div>
601
+ <div class="card-body">
602
+ <div class="signal-info">
603
+ <div class="signal-detail">
604
+ <h6>الإطار الزمني</h6>
605
+ <p>{{ signal.timeframe }}</p>
606
+ </div>
607
+ <div class="signal-detail">
608
+ <h6>نقطة الدخول</h6>
609
+ <p>{{ signal.entry }}</p>
610
+ </div>
611
+ <div class="signal-detail">
612
+ <h6>وقف الخسارة</h6>
613
+ <p>{{ signal.stop_loss }}</p>
614
+ </div>
615
+ <div class="signal-detail">
616
+ <h6>جني الأرباح</h6>
617
+ <p>{{ signal.take_profit }}</p>
618
+ </div>
619
+ <div class="signal-detail">
620
+ <h6>المدة المتوقعة</h6>
621
+ <p>{{ signal.duration }}</p>
622
+ </div>
623
+ </div>
624
+
625
+ <div class="reason-section">
626
+ <h6>سبب التحليل</h6>
627
+ <p>{{ signal.reason }}</p>
628
+ </div>
629
+
630
+ <div class="signal-actions">
631
+ <a href="{{ url_for('edit_signal', signal_id=loop.index0) }}" class="btn btn-primary btn-action">
632
+ <i class="fas fa-edit"></i> تعديل
633
+ </a>
634
+ <button type="button" class="btn btn-danger btn-action"
635
+ onclick="confirmDelete({{ loop.index0 }})">
636
+ <i class="fas fa-trash-alt"></i> حذف
637
+ </button>
638
+ </div>
639
+ </div>
640
+ </div>
641
+ {% endfor %}
642
+ {% else %}
643
+ <div class="empty-state">
644
+ <i class="fas fa-chart-bar"></i>
645
+ <h3>لا توجد إشارات متاحة</h3>
646
+ <p>لا توجد إشارات تداول حالياً للعرض.</p>
647
+ <a href="{{ url_for('add_signal') }}" class="btn btn-primary">
648
+ <i class="fas fa-plus me-1"></i> إضافة أول إشارة
649
+ </a>
650
+ </div>
651
+ {% endif %}
652
+ </div>
653
+ </div>
654
+
655
+ <!-- Add Signal Button -->
656
+ <a href="{{ url_for('add_signal') }}" class="add-signal-btn">
657
+ <i class="fas fa-plus"></i>
658
+ </a>
659
+
660
+ <!-- Delete Signal Form (Hidden) -->
661
+ <form id="deleteSignalForm" action="" method="post" style="display: none;"></form>
662
+
663
+ <!-- Bootstrap JS and dependencies -->
664
+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
665
+
666
+ <!-- Custom JavaScript -->
667
+ <script>
668
+ // Show loading overlay
669
+ function showLoading() {
670
+ document.getElementById('loadingOverlay').classList.add('active');
671
+ }
672
+
673
+ // Hide loading overlay
674
+ function hideLoading() {
675
+ document.getElementById('loadingOverlay').classList.remove('active');
676
+ }
677
+
678
+ // Confirm delete signal
679
+ function confirmDelete(signalId) {
680
+ if (confirm('هل أنت متأكد من حذف هذه الإشارة؟')) {
681
+ showLoading();
682
+ const form = document.getElementById('deleteSignalForm');
683
+ form.action = `/signals/delete/${signalId}`;
684
+ form.submit();
685
+ }
686
+ }
687
+
688
+ // Confirm delete all signals
689
+ function confirmDeleteAll() {
690
+ if (confirm('هل أنت متأكد من حذف جميع الإشارات؟ لا يمكن التراجع عن هذا الإجراء!')) {
691
+ showLoading();
692
+ document.getElementById('deleteAllForm').submit();
693
+ }
694
+ }
695
+
696
+ // Toggle system status
697
+ function toggleSystem(systemType, status) {
698
+ showLoading();
699
+
700
+ fetch('/system/toggle', {
701
+ method: 'POST',
702
+ headers: {
703
+ 'Content-Type': 'application/x-www-form-urlencoded',
704
+ },
705
+ body: `system_type=${systemType}&status=${status}`
706
+ })
707
+ .then(response => response.json())
708
+ .then(data => {
709
+ hideLoading();
710
+ if (data.success) {
711
+ // Flash a success message
712
+ let systemName = systemType === 'deeper' ? 'النظام العميق' : 'النظام الرئيسي';
713
+ let statusText = status ? 'تم تفعيل' : 'تم إيقاف';
714
+ const alertHtml = `
715
+ <div class="alert alert-success alert-dismissible fade show" role="alert">
716
+ ${statusText} ${systemName} بنجاح!
717
+ <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
718
+ </div>
719
+ `;
720
+ document.querySelector('.container').insertAdjacentHTML('afterbegin', alertHtml);
721
+ } else {
722
+ alert(`خطأ: ${data.message}`);
723
+ // Reset the toggle to its previous state
724
+ document.getElementById(`${systemType}Toggle`).checked = !status;
725
+ }
726
+ })
727
+ .catch(error => {
728
+ hideLoading();
729
+ console.error('Error:', error);
730
+ alert('حدث خطأ أثناء تحديث حالة النظام.');
731
+ // Reset the toggle to its previous state
732
+ document.getElementById(`${systemType}Toggle`).checked = !status;
733
+ });
734
+ }
735
+
736
+ // Auto-dismiss alerts after 5 seconds
737
+ document.addEventListener('DOMContentLoaded', function() {
738
+ setTimeout(function() {
739
+ const alerts = document.querySelectorAll('.alert');
740
+ alerts.forEach(alert => {
741
+ const bsAlert = new bootstrap.Alert(alert);
742
+ bsAlert.close();
743
+ });
744
+ }, 5000);
745
+ });
746
+ </script>
747
+ </body>
748
+ </html>