Browse Source

added public (static) pages

master
Holger Frey 7 years ago
parent
commit
54dd4a0492
  1. 11
      ordr2/static/style.css
  2. 4
      ordr2/templates/layout.jinja2
  3. 10
      ordr2/templates/mytemplate.jinja2
  4. 73
      ordr2/templates/pages/faq.jinja2
  5. 33
      ordr2/templates/pages/welcome.jinja2
  6. 24
      ordr2/views/pages.py
  7. 13
      ordr2/views/public.py
  8. 20
      tests/views/pages.py
  9. 10
      tests/views/public.py

11
ordr2/static/style.css

@ -10,10 +10,15 @@ header .btn-toolbar .btn-group {
margin-right:1em; margin-right:1em;
} }
.container-fluid { main {
padding-top: 1em; padding-top: 2em;
} }
.list-group-header {
.o2-faqs h1, .o2-faqs h2 {
margin-bottom:1rem;
}
.o2-faqs h3 {
margin-top:2rem;
} }

4
ordr2/templates/layout.jinja2

@ -54,13 +54,9 @@
</header> </header>
<main class="container-fluid"> <main class="container-fluid">
<div class="row">
{% block content %} {% block content %}
<p>No content</p> <p>No content</p>
{% endblock content %} {% endblock content %}
</div>
</main> </main>

10
ordr2/templates/mytemplate.jinja2

@ -1,10 +0,0 @@
{% extends "layout.jinja2" %}
{% block title %} ordr | Welcome {% endblock title%}
{% block content %}
<div class="col-12">
<h1><span class="font-semi-bold">Pyramid</span> <span class="smaller">Alchemy project</span></h1>
<p class="lead">Welcome to <span class="font-normal">Ordr2</span>, a&nbsp;Pyramid application generated&nbsp;by<br><span class="font-normal">Cookiecutter</span>.</p>
</div>
{% endblock content %}

73
ordr2/templates/pages/faq.jinja2

@ -0,0 +1,73 @@
{% extends "ordr2:templates/layout.jinja2" %}
{% block title %} Ordr | FAQ {% endblock title %}
{% block content %}
<div class="row justify-content-center o2-faqs">
<div class="col-8">
<h1>Frequently Asked Questions</h1>
<div class="card">
<section class="card-body">
<h2>Account</h2>
<h3 class="h5">
Why can't I log in? It always says: &quot;You entered the wrong unsername and/or password.&quot;
</h3>
<p>
First of all, just because <em>ordr</em> tells you that you have entered a wrong username or password doesn't mean that's necesseraily true. Sound dumb? But actually this is a security measure, which helps against brood force attacks because the adversary doesn't know if the username he guessed was correct or not.
</p>
<p>
Usually there are two common reasons why you can't log in. There are:
</p>
<ol>
<li><em>Your account hasn't been activated by an admin yet.</em> &ndash; In this case ask a admin if he already has activated your account.</li>
<li><em>You mistyped your password or username.</em> &ndash; Just try it another time and make sure caps log isn't activated.</li>
</ol>
<h3 class="h5">
Why can't I choose my own username?
</h3>
<p>
We want to enforce a specific guideline for the username. Namely <em>first name</em> followed immediately by the <em>last name</em>. This way everyone can easily identify the person, who placed an order. So please enter your real name into the registration form. Otherwise your account may not been activated because no one knows who you are.
</p>
<h3 class="h5">
Why can I only edit my email after I registered?
</h3>
<p>
Your username depends on your first and last name. Changing the username is not allowed, therefore you are also not allowed to change your first and last name afterwards. Even admins can not change your first/last name and your username.
</p>
</section>
<section class="card-body">
<h2>Ordering</h2>
<div class="well">
<h3 class="h5">
I have an consumable, which I am ordering regulary but isn't in the databse. Can I add it?
</h3>
<p>
Unfortunately you can not add consumables to the databse yourself. But ask an admin or purchaser. They're certainly to help you out.
</p>
</div>
</section>
<section class="card-body">
<h2>Miscellaneous</h2>
<div class="well">
<h3 class="h5">
I have found a bug where can I report it?
</h3>
<p>
If you have found a bug or an issue with the software please use <a href="https://git.cpi.imtek.uni-freiburg.de/holgi/ordr2/issues">this page here</a>.
You need an <a href="https://wiki.cpi.imtek.uni-freiburg.de/CPIvServerDocumentation/GogsGitServer">gogs</a> account to submit an issue. Please be as specific as you can be.
</p>
</div>
</section>
</div>
</div>
</div>
{% endblock content %}

33
ordr2/templates/pages/welcome.jinja2

@ -0,0 +1,33 @@
{% extends "ordr2:templates/layout.jinja2" %}
{% block title %} Ordr | Welcome {% endblock title %}
{% block content %}
<div class="row justify-content-center">
<div class="col-8">
<div class="jumbotron">
<h1>Welcome to <span class="brand">ordr</span>!</h1>
<p class="lead">An order management system to simplify your shopping for laboratory supplies.</p>
<p>
<strong>What can order do for you?</strong> It will simplify the process of ordering laboratory supplies by using the power of the newest web technologies. Interested? Just follow the three steps below!
</p>
</div>
<div class="row">
<div class="col-4">
<h2>1. Register</h2>
<p>Registration is easy as 1-2-3. Just fill out the form on <?php echo anchor('account/register', 'this page');?> and as soon as an admin has activated your account the shopping can begin!</p>
</div>
<div class="col-4">
<h2>2. Place an Order</h2>
<p>A lot of the chemicals, supllies and so forth are already stored in the database, so you don't have to fill out the order form your self!</p>
</div>
<div class="col-4">
<h2>3. Get notified</h2>
<p>As soons as your purchase has arrived you will automatically get notified. Or you can use the orders overview to check what the working status is.</p>
</div>
</div>
</div>
</div>
{% endblock content %}

24
ordr2/views/pages.py

@ -0,0 +1,24 @@
''' simple pages '''
from pyramid.view import view_config
@view_config(
context='ordr2:resources.RootResource',
permission='view',
renderer='ordr2:templates/pages/welcome.jinja2'
)
def welcome(context, request):
''' the welcome page '''
return {}
@view_config(
context='ordr2:resources.RootResource',
name='faq',
permission='view',
renderer='ordr2:templates/pages/faq.jinja2'
)
def faq(context, request):
''' the faq page '''
return {}

13
ordr2/views/public.py

@ -1,13 +0,0 @@
''' pubic accessible views '''
from pyramid.view import view_config
@view_config(
context='ordr2:resources.RootResource',
permission='view',
renderer='ordr2:templates/mytemplate.jinja2'
)
def index(context, request):
''' the start page '''
return {}

20
tests/views/pages.py

@ -0,0 +1,20 @@
''' Tests for ordr2.views.public '''
def test_welcome_view():
''' test the default view for a root resource '''
from ordr2.views.pages import welcome
result = welcome(None, None)
assert result == {}
def test_faq_view():
''' test the default view for a root resource '''
from ordr2.views.pages import faq
result = faq(None, None)
assert result == {}

10
tests/views/public.py

@ -1,10 +0,0 @@
''' Tests for ordr2.views.public '''
def test_index_view():
''' test the default view for a root resource '''
from ordr2.views.public import index
result = index(None, None)
assert result == {}