File size: 12,866 Bytes
d449189
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
<!DOCTYPE html>
<html lang="ar" dir="rtl">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>تعديل الإشارة - لوحة إشارات التداول</title>
    <!-- Bootstrap RTL CSS -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.rtl.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <!-- Google Font - Cairo -->
    <link href="https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700&display=swap" rel="stylesheet">
    <!-- Custom CSS -->
    <style>

        :root {

            --primary-color: #3498db;

            --secondary-color: #2c3e50;

            --success-color: #2ecc71;

            --danger-color: #e74c3c;

            --warning-color: #f39c12;

            --info-color: #1abc9c;

            --light-color: #f8f9fa;

            --dark-color: #343a40;

        }



        body {

            font-family: 'Cairo', sans-serif;

            background-color: #f5f7fa;

            color: #333;

            padding-bottom: 60px;

        }



        .navbar {

            background-color: var(--secondary-color);

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

        }



        .navbar-brand {

            font-weight: 700;

            color: white !important;

        }



        .form-card {

            background-color: white;

            border-radius: 15px;

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

            padding: 35px;

            margin-bottom: 30px;

        }



        .form-title {

            color: var(--secondary-color);

            font-weight: 600;

            margin-bottom: 30px;

            padding-bottom: 15px;

            border-bottom: 1px solid #eee;

        }



        .form-label {

            font-weight: 500;

            color: var(--secondary-color);

            margin-bottom: 8px;

        }



        .form-control, .form-select {

            border-radius: 10px;

            padding: 12px 15px;

            border: 1px solid #ddd;

            transition: all 0.3s;

            font-size: 15px;

        }



        .form-control:focus, .form-select:focus {

            border-color: var(--primary-color);

            box-shadow: 0 0 0 0.25rem rgba(52, 152, 219, 0.25);

        }



        .btn-submit {

            background-color: var(--primary-color);

            border: none;

            border-radius: 10px;

            padding: 12px 25px;

            font-weight: 500;

            transition: all 0.3s;

            display: flex;

            align-items: center;

            gap: 8px;

        }



        .btn-submit:hover {

            background-color: #2980b9;

            transform: translateY(-3px);

            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);

        }



        .btn-cancel {

            border-radius: 10px;

            padding: 12px 25px;

            font-weight: 500;

            transition: all 0.3s;

            display: flex;

            align-items: center;

            gap: 8px;

        }



        .btn-cancel:hover {

            transform: translateY(-3px);

            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);

        }



        .form-section {

            margin-bottom: 30px;

        }



        .form-section-title {

            font-size: 18px;

            font-weight: 600;

            color: var(--secondary-color);

            margin-bottom: 20px;

        }



        /* Loading spinner */

        .loading-overlay {

            position: fixed;

            top: 0;

            left: 0;

            width: 100%;

            height: 100%;

            background-color: rgba(255, 255, 255, 0.8);

            display: flex;

            justify-content: center;

            align-items: center;

            z-index: 9999;

            visibility: hidden;

            opacity: 0;

            transition: all 0.3s;

        }



        .loading-overlay.active {

            visibility: visible;

            opacity: 1;

        }



        .spinner {

            width: 60px;

            height: 60px;

            border: 6px solid var(--light-color);

            border-top: 6px solid var(--primary-color);

            border-radius: 50%;

            animation: spin 1s linear infinite;

        }



        @keyframes spin {

            0% { transform: rotate(0deg); }

            100% { transform: rotate(360deg); }

        }



        /* Responsive adjustments */

        @media (max-width: 768px) {

            .form-card {

                padding: 25px;

            }



            .form-title {

                font-size: 1.5rem;

            }

        }

    </style>
</head>
<body>
    <!-- Loading Overlay -->
    <div class="loading-overlay" id="loadingOverlay">
        <div class="spinner"></div>
    </div>

    <!-- Navbar -->
    <nav class="navbar navbar-expand-lg navbar-dark mb-4">
        <div class="container">
            <a class="navbar-brand" href="{{ url_for('index') }}">
                <i class="fas fa-chart-line me-2"></i> لوحة إشارات التداول
            </a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav me-auto">
                    <li class="nav-item">
                        <a class="nav-link" href="{{ url_for('index') }}">
                            <i class="fas fa-home me-1"></i> الرئيسية
                        </a>
                    </li>
                </ul>
            </div>
        </div>
    </nav>

    <div class="container">
        <div class="form-card">
            <h2 class="form-title"><i class="fas fa-edit me-2"></i> تعديل إشارة التداول</h2>

            <form action="{{ url_for('edit_signal', signal_id=signal_id) }}" method="post" id="editSignalForm" onsubmit="showLoading()">
                <div class="form-section">
                    <div class="form-section-title">المعلومات الأساسية</div>
                    <div class="row">
                        <div class="col-md-6 mb-3">
                            <label for="pair" class="form-label">زوج العملة</label>
                            <input type="text" class="form-control" id="pair" name="pair" required

                                   value="{{ signal.pair }}">
                        </div>
                        <div class="col-md-6 mb-3">
                            <label for="timeframe" class="form-label">الإطار الزمني</label>
                            <select class="form-select" id="timeframe" name="timeframe" required>
                                <option value="1min" {{ 'selected' if signal.timeframe == '1min' else '' }}>1 دقيقة</option>
                                <option value="5min" {{ 'selected' if signal.timeframe == '5min' else '' }}>5 دقائق</option>
                                <option value="15min" {{ 'selected' if signal.timeframe == '15min' else '' }}>15 دقيقة</option>
                                <option value="30min" {{ 'selected' if signal.timeframe == '30min' else '' }}>30 دقيقة</option>
                                <option value="1h" {{ 'selected' if signal.timeframe == '1h' else '' }}>1 ساعة</option>
                                <option value="4h" {{ 'selected' if signal.timeframe == '4h' else '' }}>4 ساعات</option>
                                <option value="1d" {{ 'selected' if signal.timeframe == '1d' else '' }}>يومي</option>
                                <option value="1w" {{ 'selected' if signal.timeframe == '1w' else '' }}>أسبوعي</option>
                            </select>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-6 mb-3">
                            <label for="type" class="form-label">نوع الإشارة</label>
                            <select class="form-select" id="type" name="type" required>
                                <option value="شراء (Buy)" {{ 'selected' if 'شراء' in signal.type else '' }}>شراء (Buy)</option>
                                <option value="بيع (Sell)" {{ 'selected' if 'بيع' in signal.type else '' }}>بيع (Sell)</option>
                            </select>
                        </div>
                        <div class="col-md-6 mb-3">
                            <label for="duration" class="form-label">المدة المتوقعة</label>
                            <input type="text" class="form-control" id="duration" name="duration" required

                                   value="{{ signal.duration }}">
                        </div>
                    </div>
                </div>

                <div class="form-section">
                    <div class="form-section-title">نقاط الدخول والخروج</div>
                    <div class="row">
                        <div class="col-md-4 mb-3">
                            <label for="entry" class="form-label">سعر الدخول</label>
                            <input type="text" class="form-control" id="entry" name="entry" required

                                   value="{{ signal.entry }}">
                        </div>
                        <div class="col-md-4 mb-3">
                            <label for="stop_loss" class="form-label">وقف الخسارة</label>
                            <input type="text" class="form-control" id="stop_loss" name="stop_loss" required

                                   value="{{ signal.stop_loss }}">
                        </div>
                        <div class="col-md-4 mb-3">
                            <label for="take_profit" class="form-label">جني الأرباح</label>
                            <input type="text" class="form-control" id="take_profit" name="take_profit" required

                                   value="{{ signal.take_profit }}">
                        </div>
                    </div>
                </div>

                <div class="form-section">
                    <div class="form-section-title">التحليل والحالة</div>
                    <div class="mb-3">
                        <label for="reason" class="form-label">سبب التحليل</label>
                        <textarea class="form-control" id="reason" name="reason" rows="5" required>{{ signal.reason }}</textarea>
                    </div>
                    <div class="mb-3">
                        <label for="status" class="form-label">حالة الإشارة</label>
                        <select class="form-select" id="status" name="status" required>
                            <option value="starting" {{ 'selected' if signal.status == 'starting' else '' }}>بداية</option>
                            <option value="active" {{ 'selected' if signal.status == 'active' else '' }}>نشط</option>
                            <option value="completed" {{ 'selected' if signal.status == 'completed' else '' }}>مكتمل</option>
                            <option value="failed" {{ 'selected' if signal.status == 'failed' else '' }}>فشل</option>
                        </select>
                    </div>
                </div>

                <div class="d-flex justify-content-end mt-4">
                    <a href="{{ url_for('index') }}" class="btn btn-secondary btn-cancel me-2">
                        <i class="fas fa-times me-1"></i> إلغاء
                    </a>
                    <button type="submit" class="btn btn-primary btn-submit">
                        <i class="fas fa-save me-1"></i> تحديث الإشارة
                    </button>
                </div>
            </form>
        </div>
    </div>

    <!-- Bootstrap JS and dependencies -->
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>

    <!-- Custom JavaScript -->
    <script>

        // Show loading overlay

        function showLoading() {

            document.getElementById('loadingOverlay').classList.add('active');

        }



        // Hide loading overlay

        function hideLoading() {

            document.getElementById('loadingOverlay').classList.remove('active');

        }

    </script>
</body>
</html>