Skip to content

Commit

Permalink
Update ux routes
Browse files Browse the repository at this point in the history
The first round had a `ux` prefix for ux routes (I thought I needed to
have a prefix for flask to be happy; thank goodness that isn't the
case!)

This also renames the `review` pages to `search` (which is more
accurate to the use case, and makes the route for viewing a proposal
a bit more descriptive (`proposal/ID`)

Issue #27
  • Loading branch information
slifty committed Sep 30, 2021
1 parent a956fac commit bba8cc1
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions cgap/blueprints/ux.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@

from cgap.db import get_db

bp = Blueprint('ux', __name__, url_prefix='/ux')
bp = Blueprint('ux', __name__, url_prefix='/')

@bp.route('/apply', methods=('GET', 'POST'))
@bp.route('/gms-apply', methods=('GET', 'POST'))
def apply():
return render_template('apply.html')

@bp.route('/review', methods=('GET', 'POST'))
@bp.route('/search', methods=('GET', 'POST'))
def review():
return render_template('review.html')
return render_template('search.html')

@bp.route('/review/<int:proposal_id>', methods=('GET', 'POST'))
@bp.route('/proposal/<int:proposal_id>', methods=('GET', 'POST'))
def view(proposal_id):
return render_template('view.html', proposal_id=proposal_id)
return render_template('proposal.html', proposal_id=proposal_id)
2 changes: 1 addition & 1 deletion cgap/static/apply.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ app.component('AutofillForm', {
},

redirectToProposalView() {
window.location.href = `/ux/review/${this.proposal.id}`
window.location.href = `/proposal/${this.proposal.id}`
},

submitForm() {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion cgap/static/review.js → cgap/static/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ app.component('ProposalSearch', {
this.fetchProposals(event.target.value);
},
generateViewUrl(id) {
return `/ux/review/${id}`;
return `/proposal/${id}`;
}
},

Expand Down
2 changes: 1 addition & 1 deletion cgap/templates/view.html → cgap/templates/proposal.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends 'base.html' %}

{% block head %}
<script type="text/javascript" src="{{ url_for('static', filename='view.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='proposal.js') }}"></script>
{% endblock %}

{% block title %}View Proposal{% endblock %}
Expand Down
6 changes: 3 additions & 3 deletions cgap/templates/review.html → cgap/templates/search.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{% extends 'base.html' %}

{% block head %}
<script type="text/javascript" src="{{ url_for('static', filename='review.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='search.js') }}"></script>
{% endblock %}

{% block title %}Review Proposals{% endblock %}
{% block title %}Search{% endblock %}

{% block content %}
<div id="app">
<h1>Review Proposals</h1>
<h1>Search Organizations</h1>
<proposal-search></proposal-search>
</div>
<script type="text/javascript">
Expand Down

0 comments on commit bba8cc1

Please sign in to comment.