control пре 3 година
родитељ
комит
3a068350e0

+ 2 - 12
app/accounts.py

@@ -19,7 +19,7 @@ def login():
             if check_password_hash(user.password, challenge_passwd):
                 flash('Successful Login!', category='success')
                 login_user(user, remember=True)
-                return redirect(url_for('dashboards.home'))
+                return redirect(url_for('dashboards.market'))
             else:
                 flash('Unsucessful Login!', category='error')
         else:
@@ -70,20 +70,10 @@ def register():
                     db.session.add(new_user)
                     db.session.commit()
                     flash('Account Registration Successful!', category='success')
-                    return redirect(url_for('dashboards.home'))
+                    return redirect(url_for('dashboards.market'))
                 else:
                     flash('Registration Failed', category='error')
     return render_template("register.html", user=current_user)
 
-@accounts.route('/modal_home')
-def modal_home():
-    return render_template("detail_art_for_home.html", user=current_user)
 
-@accounts.route('/modal_profile')
-def modal_profile():
-    return render_template("detail_art_for_profile.html", user=current_user)
 
-@accounts.route('/profile')
-@login_required
-def profile():
-    return render_template("profile.html", user=current_user)

+ 14 - 2
app/dashboards.py

@@ -6,6 +6,18 @@ from . import db
 dashboards = Blueprint('dashboards', __name__)
 
 @dashboards.route('/', methods=['GET', 'POST'])
+def market():
+    return render_template('market.html', user=current_user)
+	
+@dashboards.route('/profile', methods=['GET', 'POST'])
 @login_required
-def home():
-	return render_template('home.html', user=current_user)
+def profile():
+	return render_template('profile.html', user=current_user)
+	
+@dashboards.route('/modal_home')
+def modal_home():
+    return render_template('detail_art_for_home.html', user=current_user)
+
+@dashboards.route('/modal_profile')
+def modal_profile():
+    return render_template('detail_art_for_profile.html', user=current_user)

+ 2 - 2
app/templates/base.html

@@ -52,7 +52,7 @@ body {
         <ul class="navbar-nav">
             {% if user.is_authenticated %} <!-- shows only if user is logged in -->
             <li class="nav-item">
-                <a class="nav-link" href="/">Home</a>
+                <a class="nav-link" href="/">Market</a>
                 <a class="nav-link" href="/create_art">Create Art</a>
             </li>
         </ul>
@@ -64,7 +64,7 @@ body {
         </ul>
         {% else %}
             <li class="nav-item">
-                <a class="nav-link" href="/">Home</a>
+                <a class="nav-link" href="/">Market</a>
             </li>
         </ul>
         <ul class="navbar-nav-right">

+ 2 - 2
app/templates/detail_art_for_profile.html

@@ -49,7 +49,7 @@
             />
             <label for="Bidding Price"></label>
             <p>At the backend needs to record the bidder nickname and time. And the record will be showing at the bid history table</p>
-            <a href="{{url_for('accounts.profile')}}">Close</a>
+            <a href="{{url_for('dashboards.profile')}}">Close</a>
         </div>
       </div>
       <div class="modal-footer">
@@ -63,4 +63,4 @@
         $("#exampleModal").modal("show")
     })
 </script>
-{% endblock %}
+{% endblock %}

+ 1 - 1
app/templates/home.html → app/templates/market.html

@@ -9,7 +9,7 @@
 <p>2. Art Image (Click the photo will go to pop up detail art page)</p>
 <p>3. Art current bid price</p>
 
-<a href="{{url_for('accounts.modal_home')}}">Popup</a>
+<a href="{{url_for('dashboards.modal_home')}}">Popup</a>
 
 {% block modal %}{% endblock %}
 {% block script %}{% endblock %}

+ 2 - 2
app/templates/profile.html

@@ -53,7 +53,7 @@ table, th, td {
 <p>Art by Me</p>
 <p>1. Art Name</p>
 <p>2. Art Image(Click the photo will go to pop up detail art page)</p>
-<a href="{{url_for('accounts.modal_profile')}}">Popup</a>
+<a href="{{url_for('dashboards.modal_profile')}}">Popup</a>
 
 {% block modal %}{% endblock %}
 {% block script %}{% endblock %}
@@ -76,4 +76,4 @@ table, th, td {
         <td>100</td>
      </tr>
   </table>
-{% endblock %}
+{% endblock %}