Skip to content
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

new navbar #6508

Merged
merged 67 commits into from
Nov 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
bb19474
new navbar but should mostly be in a feature
jywarren Oct 21, 2019
50164b1
Changed the hyperlink text in Login/Signup Model (#6364)
amilaneni99 Oct 25, 2019
6d4c448
Update _nodes.html.erb
jywarren Oct 28, 2019
0c55eae
Functional Tests for Ordering aphabetically (#6371)
StlMaris123 Oct 28, 2019
cc9d89a
Change 'Read More' blog link to button (#6537)
daningenthron Oct 28, 2019
3dad8ad
OpenGraph for Twitter
jywarren Oct 28, 2019
bfe7090
Update _new_question.html.erb
jywarren Oct 29, 2019
b8f1ada
Add questions and comments to profile cards (#6472)
nstjean Oct 29, 2019
dfc153d
Removed style-breaking classes from table (#6374)
dylmye Oct 29, 2019
93cbf54
Update 503.html - replace http with https (#6562)
IvetaHron Oct 31, 2019
053bd05
Update 502.html - replace http with https (#6561)
IvetaHron Oct 31, 2019
85e120f
Update 500.html - replace http with https (#6560)
IvetaHron Oct 31, 2019
6f78fa2
Update 422.html - replace http with https (#6559)
IvetaHron Oct 31, 2019
04a8ffd
Update 404.html - replace http with https (#6558)
IvetaHron Oct 31, 2019
4d6bcd4
Update index.html - replace http with https (#6557)
IvetaHron Oct 31, 2019
220278b
change the function named t(...) to translation(...) (#6580)
jamiemccarville Oct 31, 2019
3066fea
Flow: Button to post marker + Popup working for multiple maps (#6591)
sagarpreet-chadha Nov 1, 2019
35d077c
Updated the user.rb file to bootstrap italic (#6535)
kay-ogunbo Nov 2, 2019
64bd591
Update README.md file (#6510)
IvetaHron Nov 2, 2019
0eda8f7
Fix comment spelling error (#6521)
Sensational-Code Nov 2, 2019
9027525
Fix icon color on btn-outline-secondary buttons #6518 (#6520)
Lafexlos Nov 2, 2019
b0601f7
Bump chart.js from 2.8.0 to 2.9.1 (#6567)
dependabot-preview[bot] Nov 2, 2019
cd49bd4
Changed from function t to translation (#6609)
ajitsinghkaler Nov 3, 2019
c650984
Update _edit.html.erb (#6583)
jaywar Nov 3, 2019
59e4929
Update _comments.html.erb (#6585)
loranazarenko Nov 3, 2019
4751a7f
Update user.rb (#6587)
cmwalshWVU Nov 3, 2019
d420a77
Change function t to translation in dashboard/_node_wiki (#6607)
nicoleiocana Nov 3, 2019
3c6face
Update_function t to translation in comments/_form (#6608)
govindgoel Nov 3, 2019
3d2f76c
wiki/methods: Change t to translation in (#6564)
mahoyen Nov 3, 2019
a4ac9f4
t(....) named as translations(...) on lines 25, 30, 35 and 38 (#6552)
Nov 3, 2019
841865a
changed t function name (#6546)
KornelCygan Nov 3, 2019
21e282c
change funcion t to translations in users/spamaway (#6545)
WojciechPreficz Nov 3, 2019
033ae27
Change function t to translations in comments/comments #6538 (#6543)
mehnazyunus Nov 3, 2019
f42c4b0
Update _node_meta.html.erb (#6606)
MarieSell Nov 3, 2019
8128a30
Fix follow button bug on tags (#6576)
crisner Nov 3, 2019
5afa590
Add co-authored posts to profile.html.erb (#6418)
WulfPlasma Nov 5, 2019
a60fc81
Adjustments to tag graph labeling
jywarren Nov 5, 2019
e3f1150
Update stats.html.erb
jywarren Nov 5, 2019
617f38a
Change function to to translation #6603 (#6659)
klaffert Nov 6, 2019
edb4bc0
Refresh button (#6507)
vaibhavmathur13 Nov 6, 2019
a720e67
#6539 Updated t to translations. (#6544)
marcin-wicha Nov 7, 2019
749f81b
Changed t to translation in _node_moderate (#6695)
nishantwrp Nov 8, 2019
8b91eee
some translations adjustments
jywarren Nov 8, 2019
d8d0a54
Add more tests for Node (for note and wiki page titles) (#6366)
seabl Nov 8, 2019
517e624
Add Redis installation to readme (#6398)
mathyoudawson Nov 8, 2019
803f93a
Fix recent questions on shadow page (#6342)
CleverFool77 Nov 8, 2019
161f007
Add package.json, package-lock and test.sqlite-journal to gitingore #…
mathyoudawson Nov 8, 2019
defce80
Make "choose one" link in comment forms appear underlined (#6401)
crtlf Nov 8, 2019
431b557
Fix rubocop errors in app/api & app/channels (#6425)
yamiacat Nov 8, 2019
26465cf
Add tag link to show question (#6430)
dare892 Nov 8, 2019
adea102
removed redundant comment count being showed in blog section (#6746)
Tanish0019 Nov 9, 2019
c7d8fe5
Update t() function to translation() (#6729)
gptshubham595 Nov 9, 2019
77ae5f4
Add redis installations for linux (#6751)
nicoleiocana Nov 10, 2019
36840be
Bump rake from 12.3.3 to 13.0.1 (#6764)
dependabot-preview[bot] Nov 12, 2019
50b355a
Update _comments.html.erb (#6766)
Thunder80 Nov 12, 2019
268352c
Full screen button added in inline maps, Multiple maps in Wiki page w…
sagarpreet-chadha Nov 13, 2019
6aad743
PL.editor shows map if lat,lon passed in URL. (#6788)
sagarpreet-chadha Nov 17, 2019
35e9767
map API using common global variable. (#6802)
sagarpreet-chadha Nov 18, 2019
a5d3392
[Security] Bump https-proxy-agent from 2.2.1 to 2.2.4 (#6803)
dependabot-preview[bot] Nov 18, 2019
1e0eba7
Update _thumbnail.html.erb to make it consistent with new card displa…
jywarren Nov 18, 2019
a775cb5
new navbar but should mostly be in a feature
jywarren Oct 21, 2019
0071096
some translations adjustments
jywarren Nov 8, 2019
fb2d358
final navbar
jywarren Nov 20, 2019
4d676d4
merge
jywarren Nov 20, 2019
8dbdc85
fixes for collapse menu
jywarren Nov 20, 2019
5087421
fixes for collapse menu 2
jywarren Nov 20, 2019
225ac6c
rest of menus
jywarren Nov 21, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,11 @@ test.db
solr/*
test/reports/
!config/application.yml
test.sqlite-journal
# Ignore NPM
node_modules
.byebug_history
vendor/bundle
spec/TEST-Teaspoon-Result.xml
yarn.lock
yarn-error.log
yarn-error.log
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ group :test, :development do
gem 'phantomjs'
gem 'puma', '~> 4.2'
gem 'rails-perftest'
gem 'rake', '~> 12.3.3'
gem 'rake', '~> 13.0.1'
gem 'rest-client'
gem 'rspec'
gem 'selenium-webdriver', '~> 3.142.4'
Expand Down
28 changes: 13 additions & 15 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ GEM
rack-test (>= 0.6.3)
regexp_parser (~> 1.5)
xpath (~> 3.2)
childprocess (2.0.0)
rake (< 13.0)
childprocess (1.0.0)
chronic (0.10.2)
ci_reporter (2.0.0)
builder (>= 2.1.2)
Expand Down Expand Up @@ -108,7 +107,7 @@ GEM
term-ansicolor (~> 1.3)
thor (>= 0.19.4, < 2.0)
tins (~> 1.6)
crass (1.0.4)
crass (1.0.5)
declarative (0.0.10)
declarative-option (0.1.0)
descendants_tracker (0.0.4)
Expand All @@ -119,11 +118,11 @@ GEM
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
equalizer (0.0.11)
erubi (1.8.0)
erubi (1.9.0)
execjs (2.7.0)
faraday (0.15.4)
multipart-post (>= 1.2, < 3)
ffi (1.11.1)
ffi (1.11.2)
ffi-compiler (1.0.1)
ffi (>= 1.0.0)
rake
Expand Down Expand Up @@ -202,7 +201,7 @@ GEM
http_accept_language (2.1.1)
http_parser.rb (0.6.0)
httpclient (2.8.3)
i18n (1.6.0)
i18n (1.7.0)
concurrent-ruby (~> 1.0)
i18n-js (3.3.0)
i18n (>= 0.6.6)
Expand Down Expand Up @@ -243,7 +242,7 @@ GEM
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
loofah (2.2.3)
loofah (2.3.1)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
Expand All @@ -268,7 +267,7 @@ GEM
mimemagic (0.3.3)
mini_mime (1.0.2)
mini_portile2 (2.4.0)
minitest (5.12.0)
minitest (5.13.0)
minitest-reporters (1.3.8)
ansi
builder
Expand All @@ -287,7 +286,7 @@ GEM
netrc (0.11.0)
nifty-generators (0.4.6)
nio4r (2.5.1)
nokogiri (1.10.4)
nokogiri (1.10.5)
mini_portile2 (~> 2.4.0)
nokogumbo (2.0.1)
nokogiri (~> 1.8, >= 1.8.4)
Expand Down Expand Up @@ -379,8 +378,8 @@ GEM
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.2.0)
loofah (~> 2.2, >= 2.2.2)
rails-html-sanitizer (1.3.0)
loofah (~> 2.3)
rails-i18n (5.1.3)
i18n (>= 0.7, < 2)
railties (>= 5.0, < 6)
Expand All @@ -394,7 +393,7 @@ GEM
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
rainbow (3.0.0)
rake (12.3.3)
rake (13.0.1)
rb-fsevent (0.10.3)
rb-inotify (0.10.0)
ffi (~> 1.0)
Expand Down Expand Up @@ -450,9 +449,8 @@ GEM
crass (~> 1.0.2)
nokogiri (>= 1.8.0)
nokogumbo (~> 2.0)
sassc (2.0.1)
sassc (2.2.1)
ffi (~> 1.9)
rake
sassc-rails (2.1.2)
railties (>= 4.0.0)
sassc (>= 2.0)
Expand Down Expand Up @@ -627,7 +625,7 @@ DEPENDENCIES
rails-i18n (~> 5.1.3)
rails-perftest
rails_autolink
rake (~> 12.3.3)
rake (~> 13.0.1)
rb-readline
rdiscount (~> 2.2, >= 2.2.0.1)
recaptcha
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,18 @@ We recommend you either work in a virtual environment, or on a dual booted syste
1. [Dual Booting](https://www.tecmint.com/install-ubuntu-alongside-with-windows-dual-boot/amp/), [option2](https://askubuntu.com/questions/1031993/how-to-install-ubuntu-18-04-alongside-windows-10), [video guide](https://www.youtube.com/watch?v=qNeJvujdB-0&fbclid=IwAR0APhs89jlNR_ENKbSwrp6TI6P-wxlx-a0My9XBvPNAfwtADZaAXqcKtP4)
2. [Setting up a linux virtual env](https://itsfoss.com/install-linux-in-virtualbox/)

## Redis Installation

Public Lab uses Redis and may be required for some functionality when running the application locally.
1. Install Redis if you haven't already:
* Using **MacOS**: `brew install redis`
* Using **Linux**: `sudo yum -y install redis`
2. Run Redis server:
* Using **MacOS**: `brew services start redis`
* Using **Linux**: `redis-server`
3. Run SideKiq: `bundle exec sidekiq`
4. If SideKiq started correctly Redis is now configured and working!

## SSL in Development

We, at Public Lab use [openssl](https://github.com/ruby/openssl) gem to provide SSL (Secure Sockets Layer) for the secure connection in the development mode. You can run the https connection on the localhost by following the following steps:
Expand Down Expand Up @@ -198,6 +210,7 @@ Help improve Public Lab software!
* Try out some supportive tasks https://github.com/publiclab/plots2/wiki/Supportive-Tasks
* Get involved with our weekly community check-ins. For guidelines: [https://github.com/publiclab/plots2/tree/master/doc/CHECKINS.md
](https://github.com/publiclab/plots2/tree/master/doc/CHECKINS.md)
* You can help us by opening first timers issues or fto. The template for opening an issue can be found https://docs.google.com/document/d/1dO-CAgModEGM5cOaMmcnBh2pEON0hv_rH3P2ou2r1eE/edit

## First Time?

Expand Down
8 changes: 4 additions & 4 deletions app/api/srch/search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class Search < Grape::API
if results.present?
docs = results.map do |model|
DocResult.new(
doc_type: 'USERS',
doc_type: 'USERS',
doc_url: '/profile/' + model.name,
doc_title: model.username,
latitude: model.lat,
Expand Down Expand Up @@ -181,7 +181,7 @@ class Search < Grape::API
DocList.new('', search_request)
end
end

# Request URL should be /api/srch/nodes?query=QRY
desc 'Perform a search of nodes', hidden: false,
is_array: false,
Expand Down Expand Up @@ -298,7 +298,6 @@ class Search < Grape::API
end

# Request URL should be /api/srch/taglocations?nwlat=200.0&selat=0.0&nwlng=0.0&selng=200.0[&tag=awesome]
# Note: Query(QRY as above) must have latitude and longitude as query=lat,lon
desc 'Perform a search of documents having nearby latitude and longitude tag values', hidden: false,
is_array: false,
nickname: 'search_tag_locations'
Expand All @@ -317,6 +316,8 @@ class Search < Grape::API
doc_type: 'PLACES',
doc_url: model.path(:items),
doc_title: model.title,
doc_author: model.user.username,
doc_image_url: !model.images.empty? ? model.images.first.path : 0,
score: model.answers.length,
latitude: model.lat,
longitude: model.lon,
Expand All @@ -330,7 +331,6 @@ class Search < Grape::API
end

# Request URL should be /api/srch/nearbyPeople?nwlat=200.0&selat=0.0&nwlng=0.0&selng=200.0[&tag=awesome&sort_by=recent]
# Note: Query(QRY as above) must have latitude and longitude as query=lat,lon
desc 'Perform a search to show people nearby a given location', hidden: false,
is_array: false,
nickname: 'search_nearby_people'
Expand Down
3 changes: 0 additions & 3 deletions app/assets/javascripts/application/i18n/translations.js

This file was deleted.

13 changes: 7 additions & 6 deletions app/assets/javascripts/async_tag_subscriptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ $(document).ready(function()
window.location = "/tag/" + ($('#taginput').val()).replace(/\s/g, '-');
});
$('.index-follow-buttons').on('ajax:success', function(data, status, xhr){
console.log("Hello");
var data_recv = JSON.parse(JSON.stringify(status));
notyNotification('relax', 3000, 'success', 'top', data_recv.message + 'Click <a href="../subscriptions"> here </a> to manage your subscriptions. ');
var html_new = '<a rel="tooltip" title=Following class="btn btn-default btn-sm active" href="/unsubscribe/tag/'+ data_recv.tagname + '"> <i class="fa fa-user-plus" aria-hidden="true"></i>Following</a>';
$('#follow-unfollow-column-'+data_recv.id).html(html_new);
});
console.log("Hello");
var data_recv = JSON.parse(JSON.stringify(status));
notyNotification('relax', 3000, 'success', 'top', data_recv.message + 'Click <a href="../subscriptions"> here </a> to manage your subscriptions. ');
var html_new = '<a rel="tooltip" title=Following class="btn btn-default btn-sm active" href="/unsubscribe/tag/'+ data_recv.tagname + '"> <i class="fa fa-user-plus" aria-hidden="true"></i>Following</a>';
$('#follow-unfollow-column-'+data_recv.id).html(html_new);
window.history.pushState("", "", data_recv.url); // Preserve state
});
$('.index-follow-buttons').on('ajax:error', function(data, status, xhr){
var data_recv = JSON.parse(JSON.stringify(status));
notyNotification('relax', 3000, 'error', 'top', data_recv.message + 'Click <a href="../subscriptions"> here </a> to manage your subscriptions. ');
Expand Down
71 changes: 38 additions & 33 deletions app/assets/javascripts/leaflet_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,6 @@
return map ;
}


function setupFullScreen(map , lat , lon) {
map.addControl(new L.Control.Fullscreen()); // to go full-screen
map.on('fullscreenchange', function () {
if (map.isFullscreen()) {
map.options.minZoom = 3 ;
}
else {
map.options.minZoom = 1 ;
map.panTo(new L.LatLng(lat,lon));
}
});
}


function PLmarker_default(){
L.Icon.PLmarker = L.Icon.extend({
options: {
Expand Down Expand Up @@ -65,13 +50,14 @@
});
}

function contentLayerParser(map,markers_hash, map_tagname) {
function contentLayerParser(map, markers_hash, map_tagname) {
var NWlat = map.getBounds().getNorthWest().lat ;
var NWlng = map.getBounds().getNorthWest().lng ;
var SElat = map.getBounds().getSouthEast().lat ;
var SElng = map.getBounds().getSouthEast().lng ;
map.spin(true) ;
if(map_tagname === null && (typeof map_tagname === "undefined")) {

if(map_tagname === null || (typeof map_tagname === "undefined")) {
taglocation_url = "/api/srch/taglocations?nwlat=" + NWlat + "&selat=" + SElat + "&nwlng=" + NWlng + "&selng=" + SElng ;

} else {
Expand All @@ -82,12 +68,19 @@
for (i = 0; i < data.items.length; i++) {
var url = data.items[i].doc_url;
var title = data.items[i].doc_title;
var author = data.items[i].doc_author;
var image_url = data.items[i].doc_image_url;
var default_url = PLmarker_default();
var mid = data.items[i].doc_id ;
var m = L.marker([data.items[i].latitude, data.items[i].longitude], {icon: default_url}).addTo(map).bindPopup("<a href=" + url + ">" + title + "</a>") ;

var m = L.marker([data.items[i].latitude, data.items[i].longitude], {icon: default_url}).bindPopup("<a href=" + url + ">" + title + "</a>") ;
if(markers_hash.has(mid) === false){
m.addTo(map).bindPopup("<a href=" + url + ">" + title + "</a>") ;

if(image_url) {
m.addTo(map).bindPopup("<div><img src=" + image_url+ " height='140px' /><br>" + "<b>Title:</b> " + title + "<br><b>Author:</b> <a href=" + 'https://publiclab.org/profile/' + author + ">" + author + "</a><br>" + "<a href=" + url + ">" + "Read more..." + "</a></div>" ) ;
} else {
m.addTo(map).bindPopup("<span><b>Title:</b> " + title + "</span><br><span><b>Author:</b> <a href=" + 'https://publiclab.org/profile/' + author + ">" + author + "</a></span><br>" + "<a href=" + url + ">" + "<br>Read more..." + "</a>" ) ;
}
markers_hash.set(mid , m) ;
}
}
Expand All @@ -96,46 +89,53 @@
});
}

function setupInlineLEL(map , layers, mainLayer) {


function setupInlineLEL(map , layers, mainLayer, markers_hash) {

layers = layers.split(',');

L.tileLayer('https://a.tiles.mapbox.com/v3/jywarren.map-lmrwb2em/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map) ;
L.tileLayer('https://a.tiles.mapbox.com/v3/jywarren.map-lmrwb2em/{z}/{x}/{y}.png').addTo(map) ;

var oms = omsUtil(map, {
keepSpiderfied: true,
circleSpiralSwitchover: 0
});

L.LayerGroup.EnvironmentalLayers({
include: layers,
embed: true,
}).addTo(map);

if(typeof mainLayer !== "undefined" && mainLayer !== ""){
if(mainLayer === "people"){
let markers_hash1 = new Map() ;

map.on('zoomend' , function () {
peopleLayerParser(map, markers_hash1);
peopleLayerParser(map, markers_hash);
}) ;

map.on('moveend' , function () {
peopleLayerParser(map,markers_hash1);
peopleLayerParser(map, markers_hash);
}) ;
}
else if(mainLayer === "content"){
let markers_hash2 = new Map() ;

map.on('zoomend' , function () {
contentLayerParser(map,markers_hash2);
contentLayerParser(map, markers_hash);
}) ;

map.on('moveend' , function () {
contentLayerParser(map,markers_hash2);
contentLayerParser(map, markers_hash);
}) ;
}
else { // it is a tagname
let markers_hash3 = new Map() ;

map.on('zoomend' , function () {
contentLayerParser(map,markers_hash3, mainLayer);
contentLayerParser(map, markers_hash, mainLayer);
}) ;

map.on('moveend' , function () {
contentLayerParser(map,markers_hash3, mainLayer);
contentLayerParser(map, markers_hash, mainLayer);
}) ;
}
}
Expand All @@ -146,6 +146,11 @@
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map) ;

var oms = omsUtil(map, {
keepSpiderfied: true,
circleSpiralSwitchover: 0
});

L.LayerGroup.EnvironmentalLayers({
hash: !!sethash,
}).addTo(map);
Expand Down
6 changes: 3 additions & 3 deletions app/assets/javascripts/wikis.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ function setupWiki(node_id, title, raw, logged_in) {
});
$('#content').hide();
} else {
$('#content').html(shortCodePrompt($('#content')[0], {
submitUrl: '/wiki/replace/' + node_id
}));
// $('#content').html(shortCodePrompt($('#content')[0], {
// submitUrl: '/wiki/replace/' + node_id
// }));
postProcessContent();
addDeepLinks($('#content'));
}
Expand Down
1 change: 1 addition & 0 deletions app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@
*= require noty/lib/noty.css
*= require jquery-confirm/css/jquery-confirm.css
*= require jquery.atwho
*= require profile
*/
Loading