Created
July 8, 2014 07:03
-
-
Save proffalken/b8dd8138042026d630bf to your computer and use it in GitHub Desktop.
pydash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, render_template | |
import pygerrit | |
app = Flask(__name__) | |
app.config.from_object('config') | |
@app.errorhandler(404) | |
def not_found(error): | |
return render_template('404.html'), 404 | |
from app.gerrit.views import mod as gerritModule | |
from app.jira.views import mod as jiraModule | |
app.register_blueprint(gerritModule) | |
app.register_blueprint(jiraModule) | |
@app.route("/", methods = ['GET'] ) | |
def index(): | |
gerrit_servers = app.config['GERRIT_SERVERS'] | |
return render_template('index.html', gerrit_servers=gerrit_servers) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
{% block body %} | |
Sorry, there is nothing here | |
{% endblock %} | |
</div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### CONFIG SETTINGS FOR THE DASHBOARD ### | |
GERRIT_SERVERS = [ | |
{ | |
'name': 'Gerrit One', | |
'uri': 'https://first.gerrit.server', | |
'rest_support': False, | |
'username': 'myuser', | |
'password': 'password123' | |
}, | |
{ | |
'name': 'OpenStack', | |
'uri': 'https://review.openstack.org', | |
'rest_support': True, | |
'username': 'myuser', | |
'password': 'password123' | |
} | |
] | |
JIRA_SERVERS = [ | |
{ | |
'name': 'My JIRA Server', | |
'uri': 'https://jira.mydomain.com', | |
'username': 'myuser', | |
'password': 'password123' | |
} | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "base.html" %} | |
{% block title %}Dashboard{% endblock %} | |
<div class="row"> | |
{% for svr in gerrit_servers %} | |
<div class="col-md-4"> | |
<ul> | |
<li>{{ svr['name'] }}</li> | |
</ul> | |
</div> | |
{% endfor %} | |
</div> | |
{% block body %} | |
{% endblock %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've also tried svr.name on line 7 of index.html (the usual style) and that doesn't work either