|
|
@@ -59,24 +59,6 @@ def edit(mid):
|
|
59
|
59
|
db.execute("INSERT INTO icons (member_id, icon_location) VALUES (?, ?)", (mid, filename),)
|
|
60
|
60
|
db.commit()
|
|
61
|
61
|
|
|
62
|
|
- if "c9" in request.form:
|
|
63
|
|
- c9 = request.form["c9"]
|
|
64
|
|
- c10 = request.form["c10"]
|
|
65
|
|
- c11 = request.form["c11"]
|
|
66
|
|
- c12 = request.form["c12"]
|
|
67
|
|
- c13 = request.form["c13"]
|
|
68
|
|
- c14 = request.form["c14"]
|
|
69
|
|
- c15 = request.form["c15"]
|
|
70
|
|
- c16 = request.form["c16"]
|
|
71
|
|
- c18 = request.form["c18"]
|
|
72
|
|
- c19 = request.form["c19"]
|
|
73
|
|
- c20 = request.form["c20"]
|
|
74
|
|
- c21 = request.form["c21"]
|
|
75
|
|
- c22 = request.form["c22"]
|
|
76
|
|
-
|
|
77
|
|
- db.execute("UPDATE member SET card_border=(?), card_bg=(?), heading_bg=(?), heading_border=(?), heading_name=(?), heading_subtitle=(?), card_text=(?), icon_border=(?), page_bg=(?), gradient1=(?), gradient2=(?), gradient3=(?), a1=(?), a2=(?) WHERE id=(?)",(c9, c10, c11, c12, c13, c14, c15, c16, c18, c18, c19, c20, c21, c22, mid))
|
|
78
|
|
- db.commit()
|
|
79
|
|
-
|
|
80
|
62
|
if "gid_add" in request.form:
|
|
81
|
63
|
gid = request.form["gid_add"]
|
|
82
|
64
|
db.execute("INSERT INTO group_members (group_id,member_id) VALUES (?,?)",(gid,mid))
|
|
|
@@ -132,62 +114,54 @@ def delete_icon(mid, icon_id):
|
|
132
|
114
|
return redirect(url_for("manage.edit", mid=mid))
|
|
133
|
115
|
|
|
134
|
116
|
|
|
135
|
|
-@bp.route("/add_to_front/<mid>")
|
|
|
117
|
+@bp.route("/add_to_front/<mid>/<location>")
|
|
136
|
118
|
@login_required
|
|
137
|
|
-def add_to_front(mid):
|
|
|
119
|
+def add_to_front(mid,location):
|
|
138
|
120
|
db = get_db()
|
|
139
|
121
|
db.execute("UPDATE member SET front=(?) WHERE id=(?)",(1, mid))
|
|
140
|
122
|
db.commit()
|
|
141
|
123
|
|
|
142
|
|
- return redirect(url_for('home.full_list'))
|
|
|
124
|
+ if location == "home":
|
|
|
125
|
+ return redirect(url_for('index'))
|
|
|
126
|
+ else:
|
|
|
127
|
+ return redirect(url_for('home.full_list'))
|
|
143
|
128
|
|
|
144
|
|
-@bp.route("/remove_front/<mid>")
|
|
|
129
|
+@bp.route("/remove_front/<mid>/<location>")
|
|
145
|
130
|
@login_required
|
|
146
|
|
-def remove_front(mid):
|
|
|
131
|
+def remove_front(mid, location):
|
|
147
|
132
|
db = get_db()
|
|
148
|
133
|
db.execute("UPDATE member SET front=(?) WHERE id=(?)",(0, mid))
|
|
149
|
134
|
db.commit()
|
|
150
|
135
|
|
|
151
|
|
- return redirect(url_for('home.full_list'))
|
|
|
136
|
+ if location == "home":
|
|
|
137
|
+ return redirect(url_for('index'))
|
|
|
138
|
+ else:
|
|
|
139
|
+ return redirect(url_for('home.full_list'))
|
|
152
|
140
|
|
|
153
|
141
|
|
|
154
|
|
-@bp.route("/add_to_home/<mid>")
|
|
|
142
|
+@bp.route("/add_to_home/<mid>/<location>")
|
|
155
|
143
|
@login_required
|
|
156
|
|
-def add_to_home(mid):
|
|
|
144
|
+def add_to_home(mid, location):
|
|
157
|
145
|
db = get_db()
|
|
158
|
146
|
db.execute("UPDATE member SET homepage=(?) WHERE id=(?)",(1, mid))
|
|
159
|
147
|
db.commit()
|
|
160
|
148
|
|
|
161
|
|
- return redirect(url_for('home.full_list'))
|
|
|
149
|
+ if location == "home":
|
|
|
150
|
+ return redirect(url_for('index'))
|
|
|
151
|
+ else:
|
|
|
152
|
+ return redirect(url_for('home.full_list'))
|
|
162
|
153
|
|
|
163
|
|
-@bp.route("/remove_home/<mid>")
|
|
|
154
|
+@bp.route("/remove_home/<mid>/<location>")
|
|
164
|
155
|
@login_required
|
|
165
|
|
-def remove_home(mid):
|
|
|
156
|
+def remove_home(mid,location):
|
|
166
|
157
|
db = get_db()
|
|
167
|
158
|
db.execute("UPDATE member SET homepage=(?) WHERE id=(?)",(0, mid))
|
|
168
|
159
|
db.commit()
|
|
169
|
160
|
|
|
170
|
|
- return redirect(url_for('home.full_list'))
|
|
171
|
|
-
|
|
172
|
|
-@bp.route("/reset_theme/<mid>")
|
|
173
|
|
-@login_required
|
|
174
|
|
-def reset_theme(mid):
|
|
175
|
|
- c9 = "#99dfff"
|
|
176
|
|
- c10 = "#e6f7ff"
|
|
177
|
|
- c11 = "#b3e7ff"
|
|
178
|
|
- c12 = "#008bcc"
|
|
179
|
|
- c13 = "black"
|
|
180
|
|
- c14 = "black"
|
|
181
|
|
- c15 = "black"
|
|
182
|
|
- c16 = "#008bcc"
|
|
183
|
|
- c21 = "#008bcc"
|
|
184
|
|
- c22 = "#026897"
|
|
185
|
|
-
|
|
186
|
|
- db = get_db()
|
|
187
|
|
- db.execute("UPDATE member SET card_border=(?), card_bg=(?), heading_bg=(?), heading_border=(?), heading_name=(?), heading_subtitle=(?), card_text=(?), icon_border=(?), a1=(?), a2=(?) WHERE id=(?)",(c9, c10, c11, c12, c13, c14, c15, c16, c21, c22, mid))
|
|
188
|
|
- db.commit()
|
|
189
|
|
-
|
|
190
|
|
- return redirect(url_for("manage.edit", mid=mid))
|
|
|
161
|
+ if location == "home":
|
|
|
162
|
+ return redirect(url_for('index'))
|
|
|
163
|
+ else:
|
|
|
164
|
+ return redirect(url_for('home.full_list'))
|
|
191
|
165
|
|
|
192
|
166
|
|
|
193
|
167
|
@bp.route("/assets")
|