Commit 8fd20f87 authored by Nicholas J Anderson's avatar Nicholas J Anderson
Browse files

Added index page

parent 26039fcf
from flask import Flask, jsonify
from flask import Flask, jsonify, render_template
from peoplefinder import call_standard
app = Flask(__name__)
def base_api():
return 'Peoplefinder Api'
return render_template('index.html')
def search_all(search):
{% raw %}
<!DOCTYPE html>
<!--[if IE 9]<html class="lt-ie10" lang="en"><![endif]-->
<html class="no-js"lang="en" ng-app="peoplefinderApp">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SRCT's PeopleFinder API</title>
<link rel="stylesheet" href="">
<link rel="stylesheet" href="">
.srct-logo {
.contain-to-grid, .top-bar {
.top-bar .name h1 {
/* display:inline-block; */
.top-bar .name h1 a {
font-weight: bold;
dt {
float: left;
clear: left;
margin: 0;
padding: 0 .5em 0 0;
font-weight:normal !important;
dt:after {
dd {
margin: 0;
padding: 0;
<script src=""></script>
<body ng-controller="QueryCtrl">
<div class="contain-to-grid">
<nav class="top-bar" data-topbar role="navigation">
<ul class="title-area">
<li class="name">
<h1><a href="#"><img src="" class="srct-logo">PeopleFinder API</a></h1>
<div class="row">
<div class="large-12 columns">
<h1>Query Builder</h1>
<div class="row">
<div class="large-12 columns">
<div class="alert-box alert" ng-show="error && !dismissed">
<a href="#" ng-click="dismiss()" class="close">&times;</a>
<div class="row">
<form ng-submit="doQuery();">
<div class="large-6 medium-12 columns">
<label>Query Group
<select ng-model="group" ng-change="updateUrl();">
<option value="all">Students and Faculty</option>
<option value="students">Students Only</option>
<option value="faculty">Faculty Only</option>
<div class="large-6 medium-12 columns">
<label>Query String
<input type="text" placeholder="Query String" ng-change="updateUrl();" ng-required ng-model="generalStr">
<input type="submit" style="display:none">
<div class="row">
<div class="large-12 columns">
<div class="row collapse">
<div class="small-10 columns">
<input type="text" ng-model="query" disabled>
<div class="small-2 columns">
<a href="#" class="button postfix" ng-click="doQuery();">Go!</a>
<div class="row">
<div class="large-12 columns" ng-repeat="result in results">
<dt ng-show="{{!!}}">Email</dt>
<dd ng-show="{{!!}}"><a href="mailto:{{}}">{{}}</a></dd>
<dt ng-show="{{!!result.address}}">Address</dt>
<dd ng-show="{{!!result.address}}">{{result.address}}</dd>
<dt ng-show="{{!!}}">Phone</dt>
<dd ng-show="{{!!}}">{{}}</dd>
<dt ng-show="{{!!result.fax}}">Fax</dt>
<dd ng-show="{{!!result.fax}}">{{result.fax}}</dd>
<dt ng-show="{{!!result.major}}">Major</dt>
<dd ng-show="{{!!result.major}}">{{result.major}}</dd>
<script src=""></script>
var peoplefinderApp = angular.module('peoplefinderApp', []);
var baseURL = window.location.protocol+"//";
peoplefinderApp.controller('QueryCtrl', function($scope, $http) {
$scope.results = [];
$ = "all";
$scope.generalStr = "";
$scope.doQuery = function() {
$http.get(baseURL + "/" + $ + "/" + $scope.generalStr).success(function(data) {
$scope.results = data.results;
}).error(function(data, status, headers, config) {
$scope.error = "Oops! Looks like that query didn't work!";
$scope.dismissed = false;
$scope.updateUrl = function() {
$scope.query = baseURL + "/" + $ + "/" + $scope.generalStr;
$scope.dismiss = function() {
$scope.dismissed = true;
{% endraw %}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment