-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CareersBlock for Resource Page template sections streamblock(USAJobs API) #799
Merged
noahmanger
merged 21 commits into
release/public-beta-20170216
from
feature/usa-jobs-templatetag
Feb 15, 2017
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
383ff65
committing usajobs app and base/settings.py to register app
johnnyporkchops 6dcfe03
usajobs/templates/fec_jobs_list.html
johnnyporkchops 2b8f510
deleted unused files
johnnyporkchops 0b0c5f1
removed unused app on INSATALLED APPS in base.py
johnnyporkchops 20ea464
removed unused url definition and import statement
johnnyporkchops 0d034eb
Merge remote-tracking branch 'origin' into feature/usa-jobs-templatetag
johnnyporkchops 1c0eea3
added careers blocks and templatetag
johnnyporkchops 218c1e2
restored fec/urls.py to match original on dev
johnnyporkchops fbcb9db
updated open_jobs.py, needed Positio URI variable
johnnyporkchops 388dca2
make staging use the umbrella
LindsayYoung 2ef91aa
removed API key did other requested edits
johnnyporkchops 5336bc8
Fixes migrations in CMS develop branch
ccostino 32bec7a
Merge pull request #807 from 18F/feature/new-api-url
c6c55b9
Merge pull request #811 from 18F/bug/fix-table-migration
c02b731
set API key as sensitive env var using UUPS in CF
johnnyporkchops 271d313
Merge branch 'develop' into feature/usa-jobs-templatetag
johnnyporkchops 9982536
padding to bottom of job entries
johnnyporkchops 3cb9078
Merge branch 'feature/usa-jobs-templatetag' of github.com:18F/fec-cms…
johnnyporkchops fdd9724
fixed UL nesting...again
johnnyporkchops 8556ce1
requested edits to Python
johnnyporkchops bd3294d
missed on lowercase change
johnnyporkchops File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.10.5 on 2017-02-10 22:30 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('home', '0060_auto_20170209_2030'), | ||
('home', '0058_auto_20170210_2136'), | ||
] | ||
|
||
operations = [ | ||
] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{% load wagtailcore_tags %} | ||
{% load open_jobs %} | ||
|
||
{% get_jobs %} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{% load wagtailcore_tags %} | ||
<section class="slab slab--neutral slab--inline" > | ||
<div class="container"> | ||
<ul> | ||
{% for j in jobData %} | ||
<li> | ||
<h3><a href="{{ j.position_uri }}">{{ j.position_id }} , {{ j.position_title}}</a></h3> | ||
<ul class="u-padding--bottom"> | ||
<li class='t-sans'><strong>Open Period:</strong> {{ j.position_start_date }} - {{ j.position_end_date }}</li> | ||
<li class='t-sans'><strong>Who May Apply:</strong> {{ j.who_may_apply }}</li> | ||
<li class='t-sans'><strong>Grade:</strong> {{ j.job_grade }} - {{ j.low_grade }} - {{ j.high_grade }}</li> | ||
</ul> | ||
</li> | ||
{% empty %} | ||
<li class='t-sans'>There are currently no open positions available. Please check back on this page or Job Announcements on <a href='https://www.usajobs.gov/' title='USAJobs website'>USAJOBs</a> for the latest FEC Vacancy Announcements.")</li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
</section> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
|
||
from django import template | ||
import requests | ||
from django.conf import settings | ||
from django.conf import os | ||
import dateutil.parser | ||
|
||
register = template.Library() | ||
|
||
@register.inclusion_tag('partials/jobs.html') | ||
def get_jobs(): | ||
url = "https://data.usajobs.gov/api/Search" | ||
|
||
querystring = {"Organization":"LF00","WhoMayApply":"All"} | ||
headers = { | ||
'authorization-key': settings.USAJOBS_API_KEY, | ||
'user-agent': "[email protected]", | ||
'host': "data.usajobs.gov", | ||
'cache-control': "no-cache", | ||
} | ||
|
||
response = requests.request("GET", url, headers=headers, params=querystring) | ||
|
||
responses=response.json() | ||
|
||
jobData = [] | ||
for i in responses['SearchResult']['SearchResultItems']: | ||
x= {} | ||
x = { | ||
"position_title": i["MatchedObjectDescriptor"]["PositionTitle"] , | ||
"position_id": i["MatchedObjectDescriptor"]["PositionID"], | ||
"position_uri": i ["MatchedObjectDescriptor"]["PositionURI"], | ||
"position_start_date" : dateutil.parser.parse(i['MatchedObjectDescriptor']['PositionStartDate']), | ||
"position_end_date" : dateutil.parser.parse(i['MatchedObjectDescriptor']['PositionEndDate']), | ||
"who_may_apply" : i['MatchedObjectDescriptor']['UserArea']['Details']['WhoMayApply']['Name'], | ||
"job_grade" : i['MatchedObjectDescriptor']['JobGrade'][0]['Code'], | ||
"low_grade" : i['MatchedObjectDescriptor']['UserArea']['Details']['LowGrade'], | ||
"high_grade" : i['MatchedObjectDescriptor']['UserArea']['Details']['HighGrade'] } | ||
jobData.append(x) | ||
|
||
return ({'jobData':jobData}) | ||
|
||
|
This file contains 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to add a preference to your text editor to strip out extraneous whitespace like this. Not a big deal, but will result in fewer false diffs.