mirror of
https://github.com/fspc/workstand.git
synced 2025-02-23 09:13:23 -05:00
Basic bikes page.
This commit is contained in:
parent
a42654a954
commit
2665d5e4da
22
bikeshop_project/assets/js/bikes/index.jsx
Normal file
22
bikeshop_project/assets/js/bikes/index.jsx
Normal file
@ -0,0 +1,22 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import injectTapEventPlugin from 'react-tap-event-plugin';
|
||||
|
||||
// Needed for onTouchTap
|
||||
// http://stackoverflow.com/a/34015469/988941
|
||||
injectTapEventPlugin();
|
||||
|
||||
|
||||
class App extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<div className="mdl-grid">
|
||||
<div className="mdl-cell mdl-cell--12-col">
|
||||
<h1>Bikes</h1>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
ReactDOM.render(<App />, document.getElementById('root'));
|
7
bikeshop_project/bike/templates/bikes.html
Normal file
7
bikeshop_project/bike/templates/bikes.html
Normal file
@ -0,0 +1,7 @@
|
||||
{% extends 'dashboard.html' %}
|
||||
{% load render_bundle from webpack_loader %}
|
||||
{% block content %}
|
||||
<div id="root"></div>
|
||||
{% render_bundle 'webpack' %}
|
||||
{% render_bundle 'bikes' %}
|
||||
{% endblock %}
|
7
bikeshop_project/bike/urls.py
Normal file
7
bikeshop_project/bike/urls.py
Normal file
@ -0,0 +1,7 @@
|
||||
from django.conf.urls import url
|
||||
|
||||
from .views import BikesView
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^$', BikesView.as_view(), name='bikes')
|
||||
]
|
@ -1,3 +1,11 @@
|
||||
from django.shortcuts import render
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.utils.decorators import method_decorator
|
||||
from django.views.generic import TemplateView
|
||||
|
||||
# Create your views here.
|
||||
|
||||
@method_decorator(login_required, name='dispatch')
|
||||
class BikesView(TemplateView):
|
||||
template_name = 'bikes.html'
|
||||
|
||||
def get(self, request):
|
||||
return self.render_to_response({})
|
||||
|
@ -24,6 +24,7 @@ from rest_framework_jwt.views import obtain_jwt_token
|
||||
import registration
|
||||
from core import urls as core_urls
|
||||
from registration import urls as member_urls
|
||||
from bike import urls as bike_urls
|
||||
|
||||
routeLists = [
|
||||
registration.urls.apiRoutes,
|
||||
@ -39,6 +40,7 @@ urlpatterns = [
|
||||
url(r'^login/', login, {'template_name': 'login.html'}, name='login'),
|
||||
url(r'^logout/', logout_then_login, name='logout'),
|
||||
url(r'^members/', include(member_urls)),
|
||||
url(r'^bikes/', include(bike_urls)),
|
||||
url(r'^admin/', admin.site.urls),
|
||||
url(r'^api/v1/', include(router.urls)),
|
||||
url(r'^api/v1/token-auth/', obtain_jwt_token),
|
||||
|
@ -47,6 +47,7 @@
|
||||
<a class="mdl-navigation__link" href="{% url 'home' %}"><i class="mdl-color-text--blue-grey-400 material-icons" role="presentation">home</i>Home</a>
|
||||
<a class="mdl-navigation__link" href="{% url 'member_new' %}"><i class="mdl-color-text--blue-grey-400 material-icons" role="presentation">person</i>New Member</a>
|
||||
<a class="mdl-navigation__link" href="{% url 'members' %}"><i class="mdl-color-text--blue-grey-400 material-icons" role="presentation">people</i>Members</a>
|
||||
<a class="mdl-navigation__link" href="{% url 'bikes' %}"><i class="mdl-color-text--blue-grey-400 material-icons" role="presentation">directions_bike</i>Bikes</a>
|
||||
<div class="mdl-layout-spacer"></div>
|
||||
{# <a class="mdl-navigation__link" href=""><i class="mdl-color-text--blue-grey-400 material-icons" role="presentation">help_outline</i><span class="visuallyhidden">Help</span></a>#}
|
||||
</nav>
|
||||
|
Loading…
x
Reference in New Issue
Block a user