mirror of
https://github.com/djohnlewis/stackdump
synced 2025-04-07 18:23:27 +00:00
Built licenses pages into the app.
This commit is contained in:
parent
1da980424c
commit
9807f0c076
python/src/stackdump
@ -246,6 +246,28 @@ def search():
|
|||||||
|
|
||||||
return render_template('results.html', context)
|
return render_template('results.html', context)
|
||||||
|
|
||||||
|
# this method MUST sit above the site_index and other methods below so it
|
||||||
|
# cannot be subverted by a site with a site key of 'licenses'.
|
||||||
|
@get('/licenses/mit')
|
||||||
|
@get('/licenses/mit/')
|
||||||
|
@uses_templates
|
||||||
|
def mit_license():
|
||||||
|
'''\
|
||||||
|
Renders the 'mit license' page.
|
||||||
|
'''
|
||||||
|
return render_template('mit_license.html')
|
||||||
|
|
||||||
|
# this method MUST sit above the site_index and other methods below so it
|
||||||
|
# cannot be subverted by a site with a site key of 'licenses'.
|
||||||
|
@get('/licenses/cc-wiki')
|
||||||
|
@get('/licenses/cc-wiki/')
|
||||||
|
@uses_templates
|
||||||
|
def cc_wiki_license():
|
||||||
|
'''\
|
||||||
|
Renders the 'cc-wiki license' page.
|
||||||
|
'''
|
||||||
|
return render_template('cc-wiki_license.html')
|
||||||
|
|
||||||
@get('/:site_key#[\w\.]+#')
|
@get('/:site_key#[\w\.]+#')
|
||||||
@get('/:site_key#[\w\.]+#/')
|
@get('/:site_key#[\w\.]+#/')
|
||||||
@uses_templates
|
@uses_templates
|
||||||
|
@ -631,7 +631,7 @@ if not (site_name and site_key and site_desc and dump_date):
|
|||||||
|
|
||||||
# prevent importing sites with keys that clash with method names in the app,
|
# prevent importing sites with keys that clash with method names in the app,
|
||||||
# e.g. a site key of 'search' would clash with the Stackdump-wide search page.
|
# e.g. a site key of 'search' would clash with the Stackdump-wide search page.
|
||||||
if site_key in ('search', 'import', 'media'):
|
if site_key in ('search', 'import', 'media', 'licenses'):
|
||||||
print 'The site key given, %s, is a reserved word in Stackdump.' % site_key
|
print 'The site key given, %s, is a reserved word in Stackdump.' % site_key
|
||||||
print 'Use the --site-key parameter to specify an alternate site key.'
|
print 'Use the --site-key parameter to specify an alternate site key.'
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
|
@ -46,10 +46,10 @@
|
|||||||
</p>
|
</p>
|
||||||
<a href="https://bitbucket.org/samuel.lai/stackdump/">Stackdump</a> is
|
<a href="https://bitbucket.org/samuel.lai/stackdump/">Stackdump</a> is
|
||||||
licensed under
|
licensed under
|
||||||
<a href="http://en.wikipedia.org/wiki/MIT_License">MIT License</a>. The
|
<a href="{{ SETTINGS.APP_URL_ROOT }}licenses/mit">MIT License</a>. The
|
||||||
<a href="http://www.stackexchange.com">StackExchange</a> content is
|
<a href="http://www.stackexchange.com">StackExchange</a> content is
|
||||||
licensed under
|
licensed under
|
||||||
<a href="http://creativecommons.org/licenses/by-sa/3.0/">Creative
|
<a href="{{ SETTINGS.APP_URL_ROOT }}licenses/cc-wiki">Creative
|
||||||
Commons [cc-wiki]</a>.
|
Commons [cc-wiki]</a>.
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
59
python/src/stackdump/templates/cc-wiki_license.html
Normal file
59
python/src/stackdump/templates/cc-wiki_license.html
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}
|
||||||
|
Stackdump - cc-wiki License
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<div class="row nodata">
|
||||||
|
<div class="span16">
|
||||||
|
<h1>Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)</h1>
|
||||||
|
<p><em>This is the human-readable summary of the license. The full legal text
|
||||||
|
is available at the <a href="http://creativecommons.org/licenses/by-sa/3.0/">
|
||||||
|
Creative Commons</a> site.</em></p>
|
||||||
|
<h2>You are free:</h2>
|
||||||
|
<p><strong>to Share</strong> - to copy, distribute and transmit the work</p>
|
||||||
|
<p><strong>to Remix</strong> - to adapt the work</p>
|
||||||
|
<p>to make commercial use of the work</p>
|
||||||
|
|
||||||
|
<h2>Under the following conditions:</h2>
|
||||||
|
<p>
|
||||||
|
<strong>Attribution</strong> - You must attribute the work in the manner
|
||||||
|
specified by the author or licensor (but not in any way that
|
||||||
|
suggests that they endorse you or your use of the work).
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<strong>Share Alike</strong> - If you alter, transform, or build upon this work,
|
||||||
|
you may distribute the resulting work only under the same or
|
||||||
|
similar license to this one.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h2>With the understanding that:</h2>
|
||||||
|
<p>
|
||||||
|
<strong>Waiver</strong> - Any of the above conditions can be waived if you get
|
||||||
|
permission from the copyright holder.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<strong>Public Domain</strong> - Where the work or any of its elements is in the
|
||||||
|
public domain under applicable law, that status is in no way
|
||||||
|
affected by the license.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<strong>Other Rights</strong> - In no way are any of the following rights
|
||||||
|
affected by the license:
|
||||||
|
</p>
|
||||||
|
<ul>
|
||||||
|
<li>Your fair dealing or fair use rights, or other applicable
|
||||||
|
copyright exceptions and limitations;</li>
|
||||||
|
<li>The author's moral rights;</li>
|
||||||
|
<li>Rights other persons may have either in the work itself or
|
||||||
|
in how the work is used, such as publicity or privacy rights.</li>
|
||||||
|
</ul>
|
||||||
|
<p>
|
||||||
|
<strong>Notice</strong> - For any reuse or distribution, you must make clear to
|
||||||
|
others the license terms of this work. The best way to do this
|
||||||
|
is with a link to this web page.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
39
python/src/stackdump/templates/mit_license.html
Normal file
39
python/src/stackdump/templates/mit_license.html
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}
|
||||||
|
Stackdump - MIT License
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<div class="row nodata">
|
||||||
|
<div class="span16">
|
||||||
|
<h1>MIT License</h1>
|
||||||
|
<p>
|
||||||
|
Permission is hereby granted, free of charge, to any person
|
||||||
|
obtaining a copy of this software and associated documentation
|
||||||
|
files (the "Software"), to deal in the Software without
|
||||||
|
restriction, including without limitation the rights to use,
|
||||||
|
copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
|
sell copies of the Software, and to permit persons to whom the
|
||||||
|
Software is furnished to do so, subject to the following
|
||||||
|
conditions:
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
The above copyright notice and this permission notice shall be
|
||||||
|
included in all copies or substantial portions of the Software.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||||
|
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
|
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||||
|
OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
Loading…
x
Reference in New Issue
Block a user