Skip to content

Commit

Permalink
Merge pull request #11 from keitaroinc/master
Browse files Browse the repository at this point in the history
Merge
  • Loading branch information
klikstermkd authored Oct 26, 2016
2 parents 9e57dc4 + 5de430b commit a828961
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 54 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,5 @@ idea/
.idea/

*.geojson
*.mo
*.mo
!ckanext/orgdashboards/tests/data.geojson
5 changes: 5 additions & 0 deletions bin/travis-install-dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ echo "Creating the PostgreSQL user and database..."
sudo -u postgres psql -c "CREATE USER ckan_default WITH PASSWORD 'pass';"
sudo -u postgres psql -c 'CREATE DATABASE ckan_test WITH OWNER ckan_default;'

echo "NO_START=0\nJETTY_HOST=127.0.0.1\nJETTY_PORT=8983\nJAVA_HOME=$JAVA_HOME" | sudo tee /etc/default/jetty
sudo cp ckan/ckan/config/solr/schema.xml /etc/solr/conf/schema.xml
sudo service jetty restart
sleep 5

echo "Initialising the database..."
cd ckan
paster db init -c test-core.ini
Expand Down
16 changes: 15 additions & 1 deletion bin/travis-run-tests
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,18 @@ echo "NO_START=0\nJETTY_HOST=127.0.0.1\nJETTY_PORT=8983\nJAVA_HOME=$JAVA_HOME" |
sudo cp ckan/ckan/config/solr/schema.xml /etc/solr/conf/schema.xml
sudo service jetty restart

nosetests --nologcapture --with-pylons=test.ini
# We need ckan to be running for some tests
cd ckan
mkdir uploads_storage
paster serve test-core.ini "ckan.storage_path = ckan/uploads_storage" &
cd -

nosetests --ckan --nologcapture --with-pylons=test.ini

# Did an error occur?
NOSE_ERROR=$?

[ "0" -ne "$NOSE_ERROR" ] && echo NOSE tests have failed

# If an error occurred in our tests make sure travis knows
exit `expr $MOCHA_ERROR + $NOSE_ERROR`
33 changes: 17 additions & 16 deletions ckanext/orgdashboards/fanstatic/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ $(function () {
});

if ($('#survey_popup').length) {
var cookie = Cookies.get('survey_popup');
var survey_popup_link = $('.survey_link').attr('href');
var pathname = window.location.pathname;
var paths = pathname.split('/');
var country = paths.reverse()[1];
var survey_popup = $('#survey_popup').popup({
type: 'overlay',
outline: true,
Expand All @@ -69,28 +74,22 @@ $(function () {
closeelement: '#survey_popup_close',
blur: false,
onclose: function () {
Cookies.set('survey_popup_link', $('.survey_link').attr('href'), { expires: 365 });
Cookies.set('survey_popup', country + survey_popup_link, { expires: 365 });
}
});
var survey_popup_link = $('.survey_link').attr('href');

cookie = Cookies.get('survey_popup_link');
if (!cookie || cookie !== country + survey_popup_link) {
$('#survey_popup').removeClass('hidden');
survey_popup.popup('show');

if (undefined == cookie) {
$('#survey_popup').removeClass('hidden');
survey_popup.popup('show');
} else if (cookie != survey_popup_link) {
Cookies.set('survey_popup_link', survey_popup_link, { expires: 365 });
$('#survey_popup').removeClass('hidden');
survey_popup.popup('show');
Cookies.set('survey_popup', country + survey_popup_link, { expires: 365 });

$('#survey_link_button').click(function() {
$('#survey_popup').popup('hide');
});
}
}

$('#survey_link_button').click(function() {
Cookies.set('survey_popup_link', survey_popup_link, { expires: 365 });
$('#survey_popup').popup('hide');
});

_setFocusOnSelectFormControls();
});

Expand Down Expand Up @@ -124,7 +123,9 @@ function _setActiveLanguage() {
languageElement = languageSelector.find('li')[0];
}

languageElement.className = 'active';
if (languageElement) {
languageElement.className = 'active';
}
}

function _setFocusOnSelectFormControls() {
Expand Down
2 changes: 1 addition & 1 deletion ckanext/orgdashboards/templates/dashboards/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ <h1 class="">{{ organization.orgdashboards_header }}</h1>
<a href="#" class="more-link">Read less</a></p>
</div>
</div>
{% if organization.orgdashboards_survey_link == '1' %}
{% if organization.orgdashboards_survey_enabled == '1' %}
<div id="survey_popup" class="hidden">
<h4>Feedback Survey</h4>
<hr>
Expand Down
33 changes: 0 additions & 33 deletions ckanext/orgdashboards/templates/organization/edit_dashboard.html

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ <h2>{{ _('Dashboard settings') }}

{{ form.select('orgdashboards_is_active', 'orgdashboards_is_active', _('Is dashboard active?'), options=[{'value': '1', 'text': 'Yes'}, {'value': '0', 'text': 'No'}], selected=data.orgdashboards_is_active) }}

{{ form.select('orgdashboards_lang_is_active', 'orgdashboards_lang_is_active', _('Show language selector'), options=[{'value': '1', 'text': 'Yes'}, {'value': '0', 'text': 'No'}], selected=data.orgdashboards_lang_is_active) }}
{{ form.select('orgdashboards_lang_is_active', 'orgdashboards_lang_is_active', _('Show language selector'), options=[{'value': '0', 'text': 'No'}, {'value': '1', 'text': 'Yes'}], selected=data.orgdashboards_lang_is_active) }}

{{ form.select('orgdashboards_secondary_dashboard', 'orgdashboards_secondary_dashboard', _('Choose secondary dashboard'), options=h.orgdashboards_get_all_organizations(data.name), selected=data.orgdashboards_secondary_dashboard) }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<legend>{{ _('Dashboard Survey') }}</legend>

<div class="control-group control-full">
{{ form.select('orgdashboards_survey_enabled', 'orgdashboards_survey_enabled', _('Is survey enabled?'), options=[{'value': '1', 'text': 'Yes'}, {'value': '0', 'text': 'No'}], selected=data.orgdashboards_survey_enabled) }}
{{ form.select('orgdashboards_survey_enabled', 'orgdashboards_survey_enabled', _('Is survey enabled?'), options=[{'value': '0', 'text': 'No'}, {'value': '1', 'text': 'Yes'}], selected=data.orgdashboards_survey_enabled) }}

{{ form.markdown('orgdashboards_survey_text', label=_('Survey Text'), id='orgdashboards_survey_text', placeholder=('Set the survey text'), value=data.orgdashboards_survey_text, error=errors.orgdashboards_survey_text) }}

Expand Down
1 change: 1 addition & 0 deletions ckanext/orgdashboards/tests/data.geojson
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"Block Operators ":"Berlanga Holding ","Areas of operation":"Mottama","Myanmar Block":"M-8","Address":"8 Temasek Boulevard, #08-01 Suntec Tower Three, Singapore 038988 "},"geometry":{"type":"Point","coordinates":[103.859398,1.295439]}},{"type":"Feature","properties":{"Block Operators ":"BG E&P","Areas of operation":"Rakhine","Myanmar Block":"A-4; A-7; AD-2; AD-5","Address":"Hintha Business Centres - Floor 3, 608 Merchant Road (corner of Merchant & 31 Street), Pabedan Township, Yangon, Myanmar"},"geometry":{"type":"Point","coordinates":[96.157436,16.771939]}},{"type":"Feature","properties":{"Block Operators ":"Canadian Foresight","Areas of operation":"Taninthayi","Myanmar Block":"M-15","Address":"732 Upper Changi Road East, #01-04, Cascadale, Singapore (486860)"},"geometry":{"type":"Point","coordinates":[103.963039,1.346209]}},{"type":"Feature","properties":{"Block Operators ":"Chevron","Areas of operation":"Rakhine; Ayeyawaddy","Myanmar Block":"A-5; M-5; M-6","Address":"No.5, Airport Avenue Street, 10 Mile Insein Township, Yangon, Myanmar"},"geometry":{"type":"Point","coordinates":[96.131511,16.897269]}},{"type":"Feature","properties":{"Block Operators ":"CNPC","Areas of operation":"Rakhine","Myanmar Block":"AD-1; AD-6","Address":"Golden Valley Road, Bahan Township, Yangon, Myanmar"},"geometry":{"type":"Point","coordinates":[96.145606,16.814672]}},{"type":"Feature","properties":{"Block Operators ":"ConcoPhillips","Areas of operation":"Rakhine","Myanmar Block":"AD-10","Address":"600 North Dairy Ashford (77079-1175), P.O. Box 2197, Houston, TX 77252-2197, USA"},"geometry":{"type":"Point","coordinates":[-95.613463,29.788454]}},{"type":"Feature","properties":{"Block Operators ":"DAEWOO International Corporation","Areas of operation":"Rakhine","Myanmar Block":"A-1; A-3; AD-7","Address":"88, 1st Floor, Pyay Rd, IBC, Ward (10), Hlaing Township, Yangon, Myanmar"},"geometry":{"type":"Point","coordinates":[96.135329,16.842421]}},{"type":"Feature","properties":{"Block Operators ":"ENI","Areas of operation":"Ayeyawaddy","Myanmar Block":"MD-2; MD-4","Address":"Sakura Tower, Sule Pagoda Road, Kyauktada Township, Yangon, Myanmar"},"geometry":{"type":"Point","coordinates":[96.15896,16.777291]}},{"type":"Feature","properties":{"Block Operators ":"JX Nippon Oil and Gas Exploration","Areas of operation":"Taninthayi","Myanmar Block":"M-11; M-12; M-13; M-14","Address":"5847 San Felipe St # 2800, Houston, TX 77057, USA"},"geometry":{"type":"Point","coordinates":[-95.481995,29.749822]}},{"type":"Feature","properties":{"Block Operators ":"Mercator Petroleum","Areas of operation":"Mottama; Taninthayi","Myanmar Block":"M-4; YEB","Address":"3rd Floor, Mittal Tower, B-wing, Nariman Point, Nariman Point, Mumbai, Maharashtra 400021, India"},"geometry":{"type":"Point","coordinates":[72.824772,18.924991]}},{"type":"Feature","properties":{"Block Operators ":"MOECO","Areas of operation":"Rakhine; Ayeyawaddy; Taninthayi","Myanmar Block":"AD-9; AD-11; M-3; MD-5","Address":"No. 18/1, Inya Road, Bahan Township, Yangon, Myanmar"},"geometry":{"type":"Point","coordinates":[96.140376,16.815174]}},{"type":"Feature","properties":{"Block Operators ":"MOGE","Areas of operation":"Ayeyawaddy; Mottama; Taninthayi","Myanmar Block":"M-5; M-6; M-9; M-12; M-13; M-14; Main Field ","Address":"Shukhinthar Myo Patt Rd.,Ward (10-South), Thaketa, Yangon, Myanmar"},"geometry":{"type":"Point","coordinates":[96.214992,16.798336]}},{"type":"Feature","properties":{"Block Operators ":"MPRL","Areas of operation":"Main field","Myanmar Block":"Main Field ","Address":"Vantage Tower, 623 Pyay Road, Kamayut Township 11041, Yangon, Myanmar"},"geometry":{"type":"Point","coordinates":[96.131591,16.82371]}},{"type":"Feature","properties":{"Block Operators ":"MPRL E&P","Areas of operation":"Rakhine ","Myanmar Block":"A-6","Address":"84-85 Hlaing Myint Moh Lane #1,10th Quarter, Hlaing Township, Yangon, Myanmar"},"geometry":{"type":"Point","coordinates":[96.128209,16.837572]}},{"type":"Feature","properties":{"Block Operators ":"Myanmar Petroleum E&P","Areas of operation":"Rakhine","Myanmar Block":"A-4; A-7; AD-2; AD-5","Address":"Vantage Tower, 623 Pyay Road, Kamayut Township, Yangon, Myanmar"},"geometry":{"type":"Point","coordinates":[96.131591,16.82371]}},{"type":"Feature","properties":{"Block Operators ":"Oil India Ltd. ","Areas of operation":"Mottama; Taninthayi","Myanmar Block":"M-4; YEB","Address":"Duliajan - 786 602, Assam, India"},"geometry":{"type":"Point","coordinates":[95.321717,27.355375]}},{"type":"Feature","properties":{"Block Operators ":"Oil Max Energy","Areas of operation":"Mottama; Taninthayi","Myanmar Block":"M-4; YEB","Address":"3-A, Runwal & Omkar Esquare, Chunabhatti Signal, Eastern Express Highway, Sion (East), Mumbai - 400 022, India"},"geometry":{"type":"Point","coordinates":[72.865881,19.046236]}},{"type":"Feature","properties":{"Block Operators ":"Ophir Energy","Areas of operation":"Rakhine ","Myanmar Block":"AD-3","Address":"10th Floor, Sakura Tower, Bogyoke Aung San Road, Kyauktada Township, Yangon, Myanmar"},"geometry":{"type":"Point","coordinates":[96.15936,16.779471]}},{"type":"Feature","properties":{"Block Operators ":"PetrolVietnam","Areas of operation":"Ayeyawaddy; Taninthayi","Myanmar Block":"M-2; MD-2; MD-4","Address":"No. 18, Lang Ha Street, Ba Dinh District, Hanoi, Vietnam"},"geometry":{"type":"Point","coordinates":[105.819265,21.022719]}},{"type":"Feature","properties":{"Block Operators ":"Petronas","Areas of operation":"Taninthayi","Myanmar Block":"M-12; M-13; M-14","Address":"Tower 1, Petronas Twin Towers, Kuala Lumpur City Centre, 50088 Kuala Lumpur, Malaysia"},"geometry":{"type":"Point","coordinates":[107.711515,3.157856]}},{"type":"Feature","properties":{"Block Operators ":"PTTEP","Areas of operation":"Ayeyawaddy; Mottama; Taninthayi","Myanmar Block":"M-3; M-5; M-6; M-9; M-11; M-12; M-13; M-14; MD-7; MD-8","Address":"No.2, Sein Myaung Yeiktha Lane, 8 1/2 Mile, Myangone Township, Yangon, Myanmar"},"geometry":{"type":"Point","coordinates":[96.140668,16.869338]}},{"type":"Feature","properties":{"Block Operators ":"Reliance Industries Ltd.","Areas of operation":"Taninthayi","Myanmar Block":"M-17; M-18","Address":"Maker Chambers - IV, Nariman Point, Mumbai 400 021, India"},"geometry":{"type":"Point","coordinates":[72.822644,18.924748]}},{"type":"Feature","properties":{"Block Operators ":"Royal Marine ","Areas of operation":"Rakhine","Myanmar Block":"A-5","Address":"No.22, 2nd Floor, Shwe Pone Nyet Yeik Mon, Bayint Naung Road, Kamayut Township, Yangon, Myanmar"},"geometry":{"type":"Point","coordinates":[96.12204,16.8296]}},{"type":"Feature","properties":{"Block Operators ":"Shell","Areas of operation":"Rakhine; Taninthayi","Myanmar Block":"AD-9; AD-10; AD-11; MD-5","Address":"Than Lwin Road, U Aung Kane Lane 99 - C/1, Golden Valley, Bahan Township, Yangon, Myanmar"},"geometry":{"type":"Point","coordinates":[96.145748,16.81582]}},{"type":"Feature","properties":{"Block Operators ":"Smart E&P","Areas of operation":"Mottama","Myanmar Block":"M-7","Address":"5th flr., City Bank, Bayint Naung Rd., Mingalar Taung Nyunt Township, Yangon, Myanmar"},"geometry":{"type":"Point","coordinates":[96.172823,16.792756]}},{"type":"Feature","properties":{"Block Operators ":"Statoil","Areas of operation":"Rakhine ","Myanmar Block":"AD-10","Address":"Sakura Tower, Sule Pagoda Road, Kyauktada Township, Yangon, Myanmar"},"geometry":{"type":"Point","coordinates":[96.15896,16.777291]}},{"type":"Feature","properties":{"Block Operators ":"Tap Oil Ltd.","Areas of operation":"Mottama","Myanmar Block":"M-7","Address":"Level 1, 47 Colin St, West Perth, WA 6005, Australia"},"geometry":{"type":"Point","coordinates":[115.841166,-31.948817]}},{"type":"Feature","properties":{"Block Operators ":"Total ","Areas of operation":"Ayeyawaddy; Taninthayi; Main field","Myanmar Block":"M-5; M-6; M-11; YWB","Address":"No.5, Swaetaw Myat Yaekantaw Street, Pan Pin Kone Ward, Mayangone, Yangon, Myanmar"},"geometry":{"type":"Point","coordinates":[96.112544,16.861396]}},{"type":"Feature","properties":{"Block Operators ":"Transcontinental Group","Areas of operation":"Taninthayi","Myanmar Block":"M-15","Address":"Level 14, 191 St George's Terrace, Perth, Western Australia 6000, Australia"},"geometry":{"type":"Point","coordinates":[115.853497,-31.953435]}},{"type":"Feature","properties":{"Block Operators ":"Woodside","Areas of operation":"Rakhine ","Myanmar Block":"A-4; A-6; A-7; AD-2; AD-5","Address":"70/LA-2, Golden Valley Road, Bahan Township, Yangon, Myanmar"},"geometry":{"type":"Point","coordinates":[96.145606,16.814672]}}]}

0 comments on commit a828961

Please sign in to comment.