Initial import

This commit is contained in:
Thierry Carrez 2013-07-01 18:09:56 +02:00
commit 75edee38c3
40 changed files with 10736 additions and 0 deletions

7
.gitignore vendored Normal file
View File

@ -0,0 +1,7 @@
*.pyc
*.swo
*.swp
*.sqlite
*.db
*~
local_settings.py

176
LICENSE Normal file
View File

@ -0,0 +1,176 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

25
README.rst Normal file
View File

@ -0,0 +1,25 @@
Storyboard - A task tracker for OpenStack
=========================================
Storyboard is the Django app used for OpenStack task tracking.
It has the following features:
* tbd
Prerequisites
-------------
You'll need the following Python modules installed:
- django (1.4+)
- python-django-auth-openid
Configuration and Usage
-----------------------
Copy local_settings.py.sample to local_settings.py and change
settings there.
Create empty database:
./manage.py syncdb

14
about/__init__.py Normal file
View File

@ -0,0 +1,14 @@
# Copyright 2013 Thierry Carrez <thierry@openstack.org>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

1109
about/static/css/bootstrap-responsive.css vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

6167
about/static/css/bootstrap.css vendored Normal file

File diff suppressed because it is too large Load Diff

9
about/static/css/bootstrap.min.css vendored Normal file

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

2280
about/static/js/bootstrap.js vendored Normal file

File diff suppressed because it is too large Load Diff

6
about/static/js/bootstrap.min.js vendored Normal file

File diff suppressed because one or more lines are too long

6
about/static/js/jquery.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,12 @@
{% extends "base.html" %}
{% block main %}
<div class="row-fluid">
<div class="span10 offset1">
{% block content %}
{% endblock %}
</div>
</div>
{% endblock %}
{% block script %}
<script type="text/javascript">$("#tab-about").addClass('active')</script>
{% endblock %}

View File

@ -0,0 +1,25 @@
{% extends "about.base.html" %}
{% block content %}
<div class="hero-unit">
<h1>Hello, world!</h1>
<p>This is a template for a simple marketing or informational website. It includes a large callout called the hero unit and three supporting pieces of content. Use it as a starting point to create something more unique.</p>
<p><a href="#" class="btn btn-primary btn-large">Learn more &raquo;</a></p>
</div>
<div class="row-fluid">
<div class="span4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn" href="#">View details &raquo;</a></p>
</div><!--/span-->
<div class="span4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn" href="#">View details &raquo;</a></p>
</div><!--/span-->
<div class="span4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn" href="#">View details &raquo;</a></p>
</div><!--/span-->
</div><!--/row-->
{% endblock %}

85
about/templates/base.html Normal file
View File

@ -0,0 +1,85 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Storyboard</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="/static/css/bootstrap.min.css" rel="stylesheet" media="screen">
<style type="text/css">
body {
padding-top: 60px;
padding-bottom: 40px;
}
.sidebar-nav {
padding: 9px 0;
}
@media (max-width: 980px) {
/* Enable use of floated navbar text */
.navbar-text.pull-right {
float: none;
padding-left: 5px;
padding-right: 5px;
}
}
.btn-micro {
margin-top: -1px;
padding: 1px;
line-height: 14px;
}
.btn-micro [class^="icon-"],
.btn-micro [class*=" icon-"] {
margin-top: 0px;
}
</style>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid">
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="brand" href="#">OpenStack</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li id="tab-projects"><a href="/project">Projects</a></li>
<li id="tab-tasks"><a href="/story">Tasks</a></li>
<li id="tab-about"><a href="/">About</a></li>
</ul>
<ul class="nav pull-right">
{% if user.is_authenticated %}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Logged in as {{ user.username }} <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li class="divider"></li>
<li><a href="/logout">Log out</a></li>
</ul>
</li>
{% else %}
<li><a href="/openid/login?next={{ req.path }}">Log in</a></li>
{% endif %}
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
<div class="container-fluid">
{% block main %}
{% endblock %}
<hr>
<footer>
<p>Powered by StoryBoard.</p>
</footer>
</div><!--/.fluid-container-->
<script src="/static/js/jquery.min.js"></script>
<script src="/static/js/bootstrap.min.js"></script>
{% block script %}
{% endblock %}
</body>
</html>

21
about/urls.py Normal file
View File

@ -0,0 +1,21 @@
# Copyright 2011 Thierry Carrez <thierry@openstack.org>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from django.conf.urls.defaults import *
urlpatterns = patterns('about.views',
(r'^$', 'welcome'),
)

30
about/views.py Normal file
View File

@ -0,0 +1,30 @@
# Copyright 2013 Thierry Carrez <thierry@openstack.org>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.conf import settings
from django.contrib.auth import logout
from django.http import HttpResponseRedirect, HttpResponseForbidden
from django.shortcuts import render
def welcome(request):
return render(request, "about.welcome.html")
def dologout(request):
logout(request)
return HttpResponseRedirect('/')

10
manage.py Executable file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "storyboard.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)

14
projects/__init__.py Normal file
View File

@ -0,0 +1,14 @@
# Copyright 2013 Thierry Carrez <thierry@openstack.org>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

22
projects/admin.py Normal file
View File

@ -0,0 +1,22 @@
# Copyright 2011 Thierry Carrez <thierry@openstack.org>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from projects.models import Project, Series, Milestone
from django.contrib import admin
admin.site.register(Project)
admin.site.register(Series)
admin.site.register(Milestone)

31
projects/models.py Normal file
View File

@ -0,0 +1,31 @@
# Copyright 2011 Thierry Carrez <thierry@openstack.org>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from django.db import models
class Project(models.Model):
name = models.CharField(max_length=50, primary_key=True)
title = models.CharField(max_length=100)
class Series(models.Model):
name = models.CharField(max_length=50, primary_key=True)
class Milestone(models.Model):
name = models.CharField(max_length=50)
series = models.ForeignKey(Series)
active = models.BooleanField(default=True)

View File

@ -0,0 +1,27 @@
{% extends "base.html" %}
{% block main %}
<div class="row-fluid">
<div class="span2">
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li class="nav-header">Projects</li>
<li><a href="#">Search projects</a></li>
{% if user.is_authenticated %}
<li class="nav-header">My projects</li>
<li><a href="/project/nova">Nova</a></li>
<li><a href="#">Subscribe to ...</a></li>
{% endif %}
</ul>
</div><!--/.well -->
{% block extranav %}
{% endblock %}
</div><!--/span-->
<div class="span10">
{% block content %}
{% endblock %}
</div><!--/span-->
</div>
{% endblock %}
{% block script %}
<script type="text/javascript">$("#tab-projects").addClass('active')</script>
{% endblock %}

View File

@ -0,0 +1,4 @@
{% extends "projects.base.html" %}
{% block content %}
Hola.
{% endblock %}

View File

@ -0,0 +1,19 @@
{% extends "projects.base.html" %}
{% block extranav %}
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li class="nav-header">Nova</li>
<li><a href="#">Report a bug</a></li>
<li><a href="#">Triage bugs
<span class="badge badge-important">34</span></a></li>
<li><a href="#">Propose feature</a></li>
</ul>
</div><!--/.well -->
{% endblock %}
{% block content %}
<div class="row-fluid">
<div class="span12">
<h3>Nova</h3>
</div>
</div>
{% endblock %}

22
projects/urls.py Normal file
View File

@ -0,0 +1,22 @@
# Copyright 2011 Thierry Carrez <thierry@openstack.org>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from django.conf.urls.defaults import *
urlpatterns = patterns('projects.views',
(r'^$', 'dashboard'),
(r'^(\S+)$', 'view'),
)

29
projects/views.py Normal file
View File

@ -0,0 +1,29 @@
# Copyright 2013 Thierry Carrez <thierry@openstack.org>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.conf import settings
from django.contrib.auth import logout
from django.http import HttpResponseRedirect, HttpResponseForbidden
from django.shortcuts import render
def dashboard(request):
return render(request, "projects.dashboard.html")
def view(request, project):
return render(request, "projects.view.html")

14
stories/__init__.py Normal file
View File

@ -0,0 +1,14 @@
# Copyright 2011 Thierry Carrez <thierry@openstack.org>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

23
stories/admin.py Normal file
View File

@ -0,0 +1,23 @@
# Copyright 2011 Thierry Carrez <thierry@openstack.org>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from stories.models import Story, Task, Comment, StoryTag
from django.contrib import admin
admin.site.register(Story)
admin.site.register(Task)
admin.site.register(Comment)
admin.site.register(StoryTag)

60
stories/models.py Normal file
View File

@ -0,0 +1,60 @@
# Copyright 2011 Thierry Carrez <thierry@openstack.org>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from django.db import models
from django.contrib.auth.models import User
from projects.models import Project, Series, Milestone
class Story(models.Model):
STORY_TYPES = (
('B', 'Bug'),
('F', 'Feature'),
)
creator = models.ForeignKey(User)
title = models.CharField(max_length=100)
description = models.TextField()
story_type = models.CharField(max_length=1, choices=STORY_TYPES)
importance = models.IntegerField()
class Task(models.Model):
STATUS_TYPES = (
('T', 'Todo'),
('R', 'In review'),
('L', 'Landed'),
)
story = models.ForeignKey(Story)
title = models.CharField(max_length=100, blank=True)
project = models.ForeignKey(Project)
series = models.ForeignKey(Series)
assignee = models.ForeignKey(User)
status = models.CharField(max_length=1, choices=STATUS_TYPES)
milestone = models.ForeignKey(Milestone)
class Comment(models.Model):
story = models.ForeignKey(Story)
posted_date = models.DateTimeField(auto_now=True)
author = models.ForeignKey(User)
content = models.TextField(verbose_name="Add your comment")
class Meta:
ordering = ['posted_date']
class StoryTag(models.Model):
story = models.ForeignKey(Story)
name = models.CharField(max_length=20)

View File

@ -0,0 +1,28 @@
{% extends "base.html" %}
{% block main %}
<div class="row-fluid">
<div class="span2">
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li class="nav-header">Stories</li>
<li><a href="#">Add new bug</a></li>
<li><a href="#">Add new feature</a></li>
<li><a href="#">Search stories</a></li>
<li class="nav-header">Reports</li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
</ul>
</div><!--/.well -->
{% block extranav %}
{% endblock %}
</div><!--/span-->
<div class="span10">
{% block content %}
{% endblock %}
</div><!--/span-->
</div>
{% endblock %}
{% block script %}
<script type="text/javascript">$("#tab-tasks").addClass('active')</script>
{% endblock %}

View File

@ -0,0 +1,8 @@
{% extends "stories.base.html" %}
{% block content %}
<div class="row-fluid">
<div class="span12">
Hola. This should contain the Tasks dashboard one day.
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,117 @@
{% extends "stories.base.html" %}
{% load markup %}
{% block extranav %}
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li class="nav-header">This story</li>
<li><a href="#editstory" data-toggle="modal">Modify story</a></li>
<li><a href="#">Add task</a></li>
<li><a href="#">Order tasks</a></li>
</ul>
</div><!--/.well -->
{% endblock %}
{% block content %}
<div class="row-fluid">
<div class="span2">
<h3>Bug {{ story.id }}</h3>
</div>
<div class="span10">
<span class="badge badge-important">Critical</span><br>
<h4>{{ story.title }}</h4>
</div>
</div>
<hr>
<div class="row-fluid">
<div class="span12">
<table class="table table-condensed">
<thead>
<tr>
<th>Task</th>
<th>Project</th>
<th>Series</th>
<th>Assignee</th>
<th>Status</th>
<th>Milestone</th>
</tr>
</thead>
<tbody>
{% for task in story.task_set.all %}
<tr class="success">
<td>{{ task.title }}</td>
<td>{{ task.project.title }}</td>
<td>{{ task.series.name }}</td>
<td>{{ task.assignee.username }}</td>
<td>{{ task.status }}</td>
<td>{{ task.milestone.name }}</td>
<td>
<button class="btn btn-micro" type="button"><i class="icon-edit"></i></button>
<button class="btn btn-micro" type="button"><i class="icon-remove"></i></button>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<div class="well well-small">
{{ story.description|markdown:"safe" }}
</div>
<p><i class="icon-tags"></i>
{% for tag in story.storytag_set.all %}
<span class="label">{{ tag.name }}</span>
{% endfor %}</p>
</div>
</div>
<div class="row-fluid">
<table class="table table-striped">
<tbody>
{% for comment in story.comment_set.all %}
<tr><td colspan=2>
<i class="icon-comment"></i>
by {{ comment.author.username }} on {{ comment.posted_date }}:
</td></tr>
<tr><td>{{ comment.content|markdown:"safe" }}</td></tr>
{% endfor %}
</tbody>
</table>
<form>
<textarea class="input-block-level" rows="3" placeholder="Add a comment"></textarea>
<button class="btn btn-mini btn-primary" type="button">Add comment</button>
</form>
</div>
<!-- Modal -->
<div id="editstory" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">Modify story</h3>
</div>
<div class="modal-body">
<label>Title</label>
<input class="input-block-level" type="text" value="{{ story.title }}">
<label>Importance</label>
<div class="btn-group" data-toggle="buttons-radio">
<button type="button" class="btn btn-small btn-danger active">Critical</button>
<button type="button" class="btn btn-small btn-warning">High</button>
<button type="button" class="btn btn-small btn-info">Medium</button>
<button type="button" class="btn btn-small">Low</button>
</div>
<label></label>
<label>Description <small>(can use Markdown)</small></label>
<textarea class="input-block-level" rows="8">{{ story.description }}
</textarea>
<label>Tags</label>
<div class="input-prepend">
<span class="add-on"><i class="icon-tags"></i></span>
<input class="input-block-level" id="prependedInput" type="text"
value="{% for tag in story.storytag_set.all %}{{ tag.name }} {% endfor %}">
</span>
</div>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
<button class="btn btn-primary">Save changes</button>
</div>
</div>
{% endblock %}

16
stories/tests.py Normal file
View File

@ -0,0 +1,16 @@
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
"""
self.assertEqual(1 + 1, 2)

22
stories/urls.py Normal file
View File

@ -0,0 +1,22 @@
# Copyright 2013 Thierry Carrez <thierry@openstack.org>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from django.conf.urls.defaults import *
urlpatterns = patterns('stories.views',
(r'^$', 'dashboard'),
(r'^(\d+)$', 'view'),
)

33
stories/views.py Normal file
View File

@ -0,0 +1,33 @@
# Copyright 2013 Thierry Carrez <thierry@openstack.org>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.conf import settings
from django.contrib.auth import logout
from django.http import HttpResponseRedirect, HttpResponseForbidden
from django.shortcuts import render
from stories.models import Story, Task
def dashboard(request):
return render(request, "stories.dashboard.html")
def view(request, storyid):
story = Story.objects.get(id=storyid)
return render(request, "stories.view.html",
{'story': story })

0
storyboard/__init__.py Normal file
View File

198
storyboard/settings.py Normal file
View File

@ -0,0 +1,198 @@
# Django settings for storyboard project.
#
# Copyright 2013 Thierry Carrez <thierry@openstack.org>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'NAME': 'storyboard.db',
'ENGINE': 'django.db.backends.sqlite3',
}
}
# Hosts/domain names that are valid for this site; required if DEBUG is False
# See https://docs.djangoproject.com/en/1.4/ref/settings/#allowed-hosts
ALLOWED_HOSTS = []
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# In a Windows environment this must be set to your system time zone.
TIME_ZONE = 'America/Chicago'
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'
SITE_ID = 1
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True
# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale.
USE_L10N = True
# If you set this to False, Django will not use timezone-aware datetimes.
USE_TZ = True
# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
MEDIA_ROOT = ''
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_URL = ''
# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = ''
# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static/'
# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)
# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
# Make this unique, and don't share it with anybody.
SECRET_KEY = 'h3f)nowb#w2r!%lzy6)-ggd4^nr6x@h)nlk4&amp;5m!$no78egwd_'
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
ROOT_URLCONF = 'storyboard.urls'
# Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION = 'storyboard.wsgi.application'
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.markup',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_openid_auth',
'django.contrib.admin',
'about',
'projects',
'stories',
]
AUTHENTICATION_BACKENDS = (
'django_openid_auth.auth.OpenIDBackend',
'django.contrib.auth.backends.ModelBackend',
)
# Should users be created when new OpenIDs are used to log in?
OPENID_CREATE_USERS = True
OPENID_STRICT_USERNAMES = True
# Can we reuse existing users?
OPENID_REUSE_USERS = True
# When logging in again, should we overwrite user details based on
# data received via Simple Registration?
OPENID_UPDATE_DETAILS_FROM_SREG = True
# If set, always use this as the identity URL rather than asking the
# user. This only makes sense if it is a server URL.
OPENID_SSO_SERVER_URL = 'https://login.launchpad.net/'
# Tell django.contrib.auth to use the OpenID signin URLs.
LOGIN_URL = '/openid/login'
LOGIN_REDIRECT_URL = '/'
# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error when DEBUG=False.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
}
},
'handlers': {
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
}
},
'loggers': {
'django.request': {
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
},
}
}
# Override settings with local ones.
#try:
# from local_settings import *
#except ImportError:
# pass

30
storyboard/urls.py Normal file
View File

@ -0,0 +1,30 @@
# Copyright 2011 Thierry Carrez <thierry@openstack.org>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^openid/', include('django_openid_auth.urls')),
(r'^$', 'about.views.welcome'),
(r'^about/', include('about.urls')),
(r'^project/', include('projects.urls')),
(r'^story/', include('stories.urls')),
url(r'^admin/', include(admin.site.urls)),
(r'^logout$', 'about.views.dologout'),
)

28
storyboard/wsgi.py Normal file
View File

@ -0,0 +1,28 @@
"""
WSGI config for storyboard project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` setting.
Usually you will have the standard Django WSGI application here, but it also
might make sense to replace the whole Django WSGI application with a custom one
that later delegates to the Django one. For example, you could introduce WSGI
middleware here, or combine a Django application with an application of another
framework.
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "storyboard.settings")
# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# application = HelloWorldApplication(application)