diff --git a/README.md b/README.md index 7654902..c8c447d 100644 --- a/README.md +++ b/README.md @@ -1,65 +1,3 @@ # Monumental Reasonator for monuments - -## Server - -A small python server providing authorization for edit actions on Wikidata. - -### Local setup - -1. Install python requirements - -```bash -pip install -r requirements.txt -``` - -2. Setup config.yaml - -Copy config.default.yaml to config.local.yaml. You may need to add oauth consumer info, which you can apply for [here](https://meta.wikimedia.org/wiki/Special:OAuthConsumerRegistration/propose). If you need a set of keys for testing purposes (running on localhost:5000), you can email me at . - -3. Run the dev server - -```bash -python monumental/server.py -``` - -Test it out: - - - Login: http://localhost:5000/login - - A simple Wikidata API query: http://localhost:5000/api?action=query&list=random&rnnamespace=0&rnlimit=10 - - Get an edit token (with authorization): http://localhost:5000/api?action=query&meta=tokens&use_auth=true - -See [here](https://www.wikidata.org/w/api.php) for full Wikidata API docs. - -### License - -Copyright (c) 2017, Stephen LaPorte - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - * The names of the contributors may not be used to endorse or - promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/monumental/README.md b/monumental/README.md new file mode 100644 index 0000000..7cddd82 --- /dev/null +++ b/monumental/README.md @@ -0,0 +1,27 @@ +A small python server providing authorization for edit actions on Wikidata. + +### Local setup + +1. Install python requirements + +```bash +pip install -r requirements.txt +``` + +2. Setup config.yaml + +Copy config.default.yaml to config.local.yaml. You may need to add oauth consumer info, which you can apply for [here](https://meta.wikimedia.org/wiki/Special:OAuthConsumerRegistration/propose). If you need a set of keys for testing purposes (running on localhost:5000), you can email me at . + +3. Run the dev server + +```bash +python monumental/server.py +``` + +Test it out: + + - Login: http://localhost:5000/login + - A simple Wikidata API query: http://localhost:5000/api?action=query&list=random&rnnamespace=0&rnlimit=10 + - Get an edit token (with authorization): http://localhost:5000/api?action=query&meta=tokens&use_auth=true + +See [here](https://www.wikidata.org/w/api.php) for full Wikidata API docs. diff --git a/package.json b/package.json index 259c893..ecbf1a3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "monumental", - "version": "0.10.0", + "version": "17.03.01", "private": true, "description": "Monumental app", "main": "src/index.js", @@ -8,6 +8,7 @@ "start-live": "webpack-dev-server --content-base src --progress --colors", "start": "webpack --watch --content-base src --progress --colors", "build": "webpack --content-base src --progress", + "build-dev": "set NODE_ENV=dev&&webpack --content-base src --progress", "test": "echo OK" }, "devDependencies": { diff --git a/src/components/index.js b/src/components/index.js old mode 100644 new mode 100755 index 1dfd838..d8b0a50 --- a/src/components/index.js +++ b/src/components/index.js @@ -2,12 +2,28 @@ import main from './main/main'; import dashboard from './main/dashboard/dashboard'; import list from './main/list/list'; import map from './main/map/map'; + import monument from './main/monument/monument'; +import location from './main/monument/components/location'; +import nativeName from './main/monument/components/native-name'; +import url from './main/monument/components/url'; + +import toolbar from './toolbar/toolbar'; + +import category from './main/games/category/games-category'; export default () => { main(); dashboard(); list(); map(); + monument(); + location(); + nativeName(); + url(); + + toolbar(); + + category(); }; diff --git a/src/components/main/dashboard/dashboard.html b/src/components/main/dashboard/dashboard.html old mode 100644 new mode 100755 index 5334e7e..e5e9855 --- a/src/components/main/dashboard/dashboard.html +++ b/src/components/main/dashboard/dashboard.html @@ -1,649 +1,172 @@ - -
-
-

Europe

- Adana (Turkey) • - Almaty (Kazakhstan) • - Amsterdam (Netherlands) • - Ankara (Turkey) • - Antalya (Turkey) • - Astana (Kazakhstan) • - Astrakhan (Russia) • - Athens (Greece) • - Baku (Azerbaijan) • - Balıkesir (Turkey) • - Barcelona (Spain) • - Barnaul (Russia) • - Belgrade (Serbia) • - Berlin (Germany) • - Birmingham (United Kingdom) • - Bratislava (Slovakia) • - Bremen (Germany) • - Brussels (Belgium) • - Bucharest (Romania) • - Budapest (Hungary) • - Bursa (Turkey) • - Chelyabinsk (Russia) • - Chișinău (Moldova) • - Cologne (Germany) • - Copenhagen (Denmark) • - Denizli (Turkey) • - Dnipro (Ukraine) • - Donetsk (Ukraine) • - Dortmund (Germany) • - Dresden (Germany) • - Dublin (Ireland) • - Düsseldorf (Germany) • - Essen (Germany) • - Frankfurt (Germany) • - Free Hanseatic City of Bremen (Germany) • - Ganja (Azerbaijan) • - Gaziantep (Turkey) • - Genoa (Italy) • - Glasgow (United Kingdom) • - Gomel (Belarus) • - Gothenburg (Sweden) • - Hamburg (Germany) • - Hanover (Germany) • - Helsinki (Finland) • - Istanbul (Turkey) • - Kayseri (Turkey) • - Kazan (Russia) • - Kemerovo (Russia) • - Khabarovsk (Russia) • - Kharkiv (Ukraine) • - Kraków (Poland) • - Krasnoyarsk (Russia) • - Kryvyi Rih (Ukraine) • - Kyiv (Ukraine) • - Leeds (United Kingdom) • - Leipzig (Germany) • - Lisbon (Portugal) • - London (United Kingdom) • - Lviv (Ukraine) • - Madrid (Spain) • - Makhachkala (Russia) • - Marseille (France) • - Milan (Italy) • - Minsk (Belarus) • - Moscow (Russia) • - Munich (Germany) • - Málaga (Spain) • - Naberezhnye Chelny (Russia) • - Naples (Italy) • - Nizhny Novgorod (Russia) • - Novosibirsk (Russia) • - Nuremberg (Germany) • - Omsk (Russia) • - Oslo (Norway) • - Palermo (Italy) • - Paris (France) • - Penza (Russia) • - Perm (Russia) • - Poznań (Poland) • - Prague (Czech Republic) • - Riga (Latvia) • - Rome (Italy) • - Rostov-on-Don (Russia) • - Rotterdam (Netherlands) • - Saint Petersburg (Russia) • - Samara (Russia) • - Seville (Spain) • - Sheffield (United Kingdom) • - Shymkent (Kazakhstan) • - Skopje (Republic of Macedonia) • - Sofia (Bulgaria) • - Stockholm (Sweden) • - Stuttgart (Germany) • - Tbilisi (Georgia) • - The Hague (Netherlands) • - Tolyatti (Russia) • - Turin (Italy) • - Tyumen (Russia) • - Ufa (Russia) • - Ulyanovsk (Russia) • - Valencia (Spain) • - Vienna (Austria) • - Vilnius (Lithuania) • - Vladivostok (Russia) • - Volgograd (Russia) • - Voronezh (Russia) • - Warsaw (Poland) • - Wrocław (Poland) • - Yaroslavl (Russia) • - Yekaterinburg (Russia) • - Yerevan (Armenia) • - Zagreb (Croatia) • - Zaporizhzhya (Ukraine) • - Zaragoza (Spain) • - İzmir (Turkey) • - Łódź (Poland) -
-
-

Africa

- Abeokuta (Nigeria) • - Abidjan (Côte d'Ivoire) • - Abuja (Nigeria) • - Accra (Ghana) • - Addis Ababa (Ethiopia) • - Agadir (Morocco) • - Alexandria (Egypt) • - Algiers (Algeria) • - Antananarivo (Madagascar) • - Asmara (Eritrea) • - Bangui (Central African Republic) • - Benghazi (Libya) • - Blantyre (Malawi) • - Bouaké (Côte d'Ivoire) • - Brazzaville (Republic of the Congo) • - Bujumbura (Burundi) • - Bulawayo (Zimbabwe) • - Cairo (Egypt) • - Conakry (Guinea) • - Dar es Salaam (Tanzania) • - Djibouti (Djibouti) • - Douala (Cameroon) • - Fes (Morocco) • - Freetown (Sierra Leone) • - Giza (Egypt) • - Harare (Zimbabwe) • - Helwan (Egypt) • - Ife (Nigeria) • - Ilorin (Nigeria) • - Johannesburg (South Africa) • - Jos (Nigeria) • - Kaduna (Nigeria) • - Kampala (Uganda) • - Khartoum (Sudan) • - Khartoum North (Sudan) • - Kigali (Rwanda) • - Kinshasa (Democratic Republic of the Congo) • - Kitwe (Zambia) • - Kumasi (Ghana) • - Lagos (Nigeria) • - Libreville (Gabon) • - Lilongwe (Malawi) • - Lomé (Togo) • - Luanda (Angola) • - Lubumbashi (Democratic Republic of the Congo) • - Lusaka (Zambia) • - Maiduguri (Nigeria) • - Maputo (Mozambique) • - Marrakesh (Morocco) • - Matola (Mozambique) • - Mombasa (Kenya) • - Monrovia (Liberia) • - N'Djamena (Chad) • - Nairobi (Kenya) • - Niamey (Niger) • - Nouakchott (Mauritania) • - Ogbomosho (Nigeria) • - Omdurman (Sudan) • - Ouagadougou (Burkina Faso) • - Port Said (Egypt) • - Pretoria (South Africa) • - Rabat (Morocco) • - Sekondi-Takoradi (Ghana) • - Shubra El-Kheima (Egypt) • - Tripoli (Libya) • - Yaoundé (Cameroon) -
-
-

Asia

- Abu Dhabi (United Arab Emirates) • - Adana (Turkey) • - Aden (Yemen) • - Agartala (India) • - Agra (India) • - Ahvaz (Iran) • - Al Ain (United Arab Emirates) • - Al Hudaydah (Yemen) • - Aleppo (Syria) • - Alexandria (Egypt) • - Almaty (Kazakhstan) • - Amman (Jordan) • - An Najaf (Iraq) • - Ankara (Turkey) • - Antalya (Turkey) • - Antipolo (Philippines) • - Astana (Kazakhstan) • - Astrakhan (Russia) • - Aurangabad (India) • - Bacolod (Philippines) • - Bacoor (Philippines) • - Baghdad (Iraq) • - Baku (Azerbaijan) • - Balikpapan (Indonesia) • - Balıkesir (Turkey) • - Bandarlampung (Indonesia) • - Bandung (Indonesia) • - Bangalore (India) • - Bangkok (Thailand) • - Banjarmasin (Indonesia) • - Bareilly (India) • - Barnaul (Russia) • - Batam (Indonesia) • - Beijing (People's Republic of China) • - Bekasi (Indonesia) • - Bhiwandi (India) • - Bishkek (Kyrgyzstan) • - Bogor (Indonesia) • - Bursa (Turkey) • - Busan (South Korea) • - Cagayan de Oro (Philippines) • - Cairo (Egypt) • - Caloocan (Philippines) • - Cebu City (Philippines) • - Chandigarh (India) • - Changde (People's Republic of China) • - Chelyabinsk (Russia) • - Chennai (India) • - Cheongju (South Korea) • - Chiba (Japan) • - Chongqing (People's Republic of China) • - Cimahi (Indonesia) • - Coimbatore (India) • - Colombo (Sri Lanka) • - Cần Thơ (Vietnam) • - Damascus (Syria) • - Daqing (People's Republic of China) • - Dasmariñas (Philippines) • - Davao City (Philippines) • - Delhi (India) • - Denizli (Turkey) • - Denpasar (Indonesia) • - Depok (Indonesia) • - Dhaka (Bangladesh) • - Doha (Qatar) • - Dubai (United Arab Emirates) • - Dushanbe (Tajikistan) • - Erbil (Iraq) • - Faisalabad (Pakistan) • - Fukuoka (Japan) • - Funabashi (Japan) • - Fuzhou (People's Republic of China) • - Ganja (Azerbaijan) • - Gaza City (Palestine) • - Gaziantep (Turkey) • - General Santos (Philippines) • - George Town (Malaysia) • - Giza (Egypt) • - Goyang (South Korea) • - Gujranwala (Pakistan) • - Guntur (India) • - Hachiōji City (Japan) • - Haiphong (Vietnam) • - Hamamatsu (Japan) • - Hamhung (North Korea) • - Hanoi (Vietnam) • - Hefei (People's Republic of China) • - Helwan (Egypt) • - Higashiōsaka (Japan) • - Himeji (Japan) • - Hiroshima (Japan) • - Ho Chi Minh City (Vietnam) • - Homs (Syria) • - Hyderabad (India) • - Hyderabad (Pakistan) • - Irbid (Jordan) • - Isfahan (Iran) • - Islamabad (Pakistan) • - Istanbul (Turkey) • - Jaipur (India) • - Jakarta (Indonesia) • - Jambi (Indonesia) • - Jeddah (Saudi Arabia) • - Jeonju (South Korea) • - Jerusalem (Israel) • - Jerusalem (Jordan) • - Jerusalem (Palestine) • - Jodhpur (India) • - Kabul (Afghanistan) • - Kagoshima (Japan) • - Kaifeng (People's Republic of China) • - Kaohsiung City (Taiwan) • - Karachi (Pakistan) • - Karaj (Iran) • - Kathmandu (Nepal) • - Kawaguchi (Japan) • - Kawasaki (Japan) • - Kayseri (Turkey) • - Kazan (Russia) • - Kemerovo (Russia) • - Kermanshah (Iran) • - Khabarovsk (Russia) • - Khulna (Bangladesh) • - Kirkuk (Iraq) • - Kitakyūshū (Japan) • - Klang (Malaysia) • - Kolkata (India) • - Krasnoyarsk (Russia) • - Kuala Lumpur (Malaysia) • - Kuantan (Malaysia) • - Kumamoto (Japan) • - Kuwait City (Kuwait) • - Kyoto (Japan) • - Kōbe (Japan) • - Lanzhou (People's Republic of China) • - Las Piñas (Philippines) • - Latakia (Syria) • - Macau (People's Republic of China) • - Makassar (Indonesia) • - Makati (Philippines) • - Makhachkala (Russia) • - Malang (Indonesia) • - Mandalay (Myanmar) • - Manila (Philippines) • - Matsuyama (Japan) • - Mawlamyine (Myanmar) • - Mecca (Saudi Arabia) • - Medan (Indonesia) • - Moscow (Russia) • - Mosul (Iraq) • - Mumbai (India) • - Muntinlupa (Philippines) • - Mysore (India) • - Naberezhnye Chelny (Russia) • - Nagoya (Japan) • - Nantong (People's Republic of China) • - Naypyidaw (Myanmar) • - Niigata (Japan) • - Nizhny Novgorod (Russia) • - Novosibirsk (Russia) • - Okayama (Japan) • - Omsk (Russia) • - Palembang (Indonesia) • - Parañaque (Philippines) • - Pasig (Philippines) • - Pekanbaru (Indonesia) • - Penza (Russia) • - Perm (Russia) • - Peshawar (Pakistan) • - Petaling Jaya (Malaysia) • - Phnom Penh (Cambodia) • - Pohang (South Korea) • - Pontianak (Indonesia) • - Port Said (Egypt) • - Pune (India) • - Pyongyang (North Korea) • - Qiqihar (People's Republic of China) • - Quetta (Pakistan) • - Quezon City (Philippines) • - Ranchi (India) • - Rawalpindi (Pakistan) • - Riyadh (Saudi Arabia) • - Rostov-on-Don (Russia) • - Sagamihara (Japan) • - Saint Petersburg (Russia) • - Saitama (Japan) • - Sakai City (Japan) • - Samara (Russia) • - Samarinda (Indonesia) • - Samarkand (Uzbekistan) • - San Jose del Monte (Philippines) • - Sana'a (Yemen) • - Sapporo (Japan) • - Sargodha (Pakistan) • - Semarang (Indonesia) • - Sendai (Japan) • - Seoul (South Korea) • - Serang (Indonesia) • - Shanghai (People's Republic of China) • - Shantou (People's Republic of China) • - Shaoxing (People's Republic of China) • - Shiraz (Iran) • - Shizuoka (Japan) • - Shubra El-Kheima (Egypt) • - Shymkent (Kazakhstan) • - Sialkot (Pakistan) • - Singapore (Singapore) • - Surabaya (Indonesia) • - Surakarta (Indonesia) • - Ta'izz (Yemen) • - Taguig (Philippines) • - Taipei (Taiwan) • - Tangerang (Indonesia) • - Tangerang Selatan (Indonesia) • - Taoyuan District (Taiwan) • - Tashkent (Uzbekistan) • - Tasikmalaya (Indonesia) • - Tehran (Iran) • - Tianjin (People's Republic of China) • - Tokyo (Japan) • - Tokyo (Japan) • - Tolyatti (Russia) • - Trichy (India) • - Trichy (Tamil Nadu) • - Tyumen (Russia) • - Ufa (Russia) • - Ulaanbaatar (Mongolia) • - Ulsan (South Korea) • - Ulyanovsk (Russia) • - Utsunomiya (Japan) • - Valenzuela (Philippines) • - Varanasi (India) • - Vientiane (Laos) • - Vijayawada (India) • - Visakhapatnam (India) • - Vladivostok (Russia) • - Volgograd (Russia) • - Voronezh (Russia) • - Wenzhou (People's Republic of China) • - Wuhu (People's Republic of China) • - Yancheng (People's Republic of China) • - Yangon (Myanmar) • - Yaroslavl (Russia) • - Yazd (Iran) • - Yekaterinburg (Russia) • - Yokohama (Japan) • - Yongin (South Korea) • - Zamboanga City (Philippines) • - Zhengzhou (People's Republic of China) • - Zibo (People's Republic of China) • - İzmir (Turkey) • - Ōsaka (Japan) -
-
-

Central America

- Emilce nombre unico (Guatemala) • - Guatemala City (Guatemala) • - Havana (Cuba) • - Santiago de Cuba (Cuba) -
-
-

North America

- Acapulco (Mexico) • - Albuquerque (United States of America) • - Austin (United States of America) • - Baltimore (United States of America) • - Boston (United States of America) • - Calgary (Canada) • - Carrefour (Haiti) • - Chicago (United States of America) • - Chihuahua (Mexico) • - Ciudad Nezahualcóyotl (Mexico) • - Columbus (United States of America) • - Culiacán (Mexico) • - Dallas (United States of America) • - Denver (United States of America) • - Detroit (United States of America) • - Ecatepec de Morelos (Mexico) • - Edmonton (Canada) • - El Paso (United States of America) • - Ensenada (Mexico) • - Fort Worth (United States of America) • - Hamilton (Canada) • - Hermosillo (Mexico) • - Houston (United States of America) • - Indianapolis (United States of America) • - Jacksonville (United States of America) • - Kingston (Jamaica) • - Las Vegas (United States of America) • - León (Mexico) • - Los Angeles (United States of America) • - Louisville (United States of America) • - Managua (Nicaragua) • - Memphis (United States of America) • - Mexico City (Mexico) • - Milwaukee (United States of America) • - Mississauga (Canada) • - Monterrey (Mexico) • - Montreal (Canada) • - Nashville (United States of America) • - New York City (United States of America) • - Oklahoma City (United States of America) • - Ottawa (Canada) • - Panama City (Panama) • - Philadelphia (United States of America) • - Phoenix (United States of America) • - Port-au-Prince (Haiti) • - Portland (United States of America) • - Quebec City (Canada) • - San Antonio (United States of America) • - San Diego (United States of America) • - San Francisco (United States of America) • - San Jose (United States of America) • - San Pedro Sula (Honduras) • - San Salvador (El Salvador) • - Santiago de los Caballeros (Dominican Republic) • - Santo Domingo (Dominican Republic) • - Seattle (United States of America) • - Tegucigalpa (Honduras) • - Tlaquepaque (Mexico) • - Toronto (Canada) • - Tucson (United States of America) • - Tultitlán de Mariano Escobedo (Mexico) • - Tuxtla Gutiérrez (Mexico) • - Vancouver (Canada) • - Washington, D.C. (United States of America) • - Winnipeg (Canada) • - Xalapa (Mexico) • - Zapopan (Mexico) -
-
-

Oceania

- Adelaide (Australia) • - Albuquerque (United States of America) • - Auckland (New Zealand) • - Austin (United States of America) • - Baltimore (United States of America) • - Boston (United States of America) • - Brisbane (Australia) • - Chicago (United States of America) • - Columbus (United States of America) • - Dallas (United States of America) • - Denver (United States of America) • - Detroit (United States of America) • - El Paso (United States of America) • - Fort Worth (United States of America) • - Houston (United States of America) • - Indianapolis (United States of America) • - Jacksonville (United States of America) • - Las Vegas (United States of America) • - Los Angeles (United States of America) • - Louisville (United States of America) • - Melbourne (Australia) • - Memphis (United States of America) • - Milwaukee (United States of America) • - Nashville (United States of America) • - New York City (United States of America) • - Oklahoma City (United States of America) • - Perth (Australia) • - Philadelphia (United States of America) • - Phoenix (United States of America) • - Portland (United States of America) • - San Antonio (United States of America) • - San Diego (United States of America) • - San Francisco (United States of America) • - San Jose (United States of America) • - Seattle (United States of America) • - Sydney (Australia) • - Tucson (United States of America) • - Washington, D.C. (United States of America) -
-
-

South America

- Arequipa (Peru) • - Asunción (Paraguay) • - Barquisimeto (Venezuela) • - Belo Horizonte (Brazil) • - Belém (Brazil) • - Bogota (Colombia) • - Brasília (Brazil) • - Buenos Aires (Argentina) • - Cali (Colombia) • - Callao (Peru) • - Campinas (Brazil) • - Chiclayo (Peru) • - Curitiba (Brazil) • - Cúcuta (Venezuela) • - Fortaleza (Brazil) • - Goiânia (Brazil) • - Guarulhos (Brazil) • - Guayaquil (Ecuador) • - La Paz (Bolivia) • - La Plata (Argentina) • - Lima (Peru) • - Maceió (Brazil) • - Manaus (Brazil) • - Mar del Plata (Argentina) • - Maracay (Venezuela) • - Montevideo (Uruguay) • - Osasco (Brazil) • - Panama City (Panama) • - Porto Alegre (Brazil) • - Quito (Ecuador) • - Recife (Brazil) • - Ribeirão Preto (Brazil) • - Rio de Janeiro (Brazil) • - Rosario (Argentina) • - San Miguel de Tucumán (Argentina) • - Santa Cruz (Bolivia) • - Santiago (Chile) • - Santo André (Brazil) • - Sorocaba (Brazil) • - São Bernardo do Campo (Brazil) • - São José dos Campos (Brazil) • - São Luís (Brazil) • - São Paulo (Brazil) • - Trujillo (Peru) • - Uberlândia (Brazil) • - Yurimaguas (Peru) -
-
-
-
-

Language

-
- - - - - - - - - - - - +
+
+

Examples

+

+ Adana (Turkey) · + Almaty (Kazakhstan) · + Amsterdam (Netherlands) · + Ankara (Turkey) · + Antalya (Turkey) · + Astana (Kazakhstan) · + Astrakhan (Russia) · + Athens (Greece) · + Baku (Azerbaijan) · + Balıkesir (Turkey) · + Barcelona (Spain) · + Barnaul (Russia) · + Belgrade (Serbia) · + Berlin (Germany) · + Birmingham (United Kingdom) · + Bratislava (Slovakia) · + Bremen (Germany) · + Brussels (Belgium) · + Bucharest (Romania) · + Budapest (Hungary) · + Bursa (Turkey) · + Chelyabinsk (Russia) · + Chișinău (Moldova) · + Cologne (Germany) · + Copenhagen (Denmark) · + Denizli (Turkey) · + Dnipro (Ukraine) · + Donetsk (Ukraine) · + Dortmund (Germany) · + Dresden (Germany) · + Dublin (Ireland) · + Düsseldorf (Germany) · + Essen (Germany) · + Frankfurt (Germany) · + Bremen (Germany) · + Ganja (Azerbaijan) · + Gaziantep (Turkey) · + Genoa (Italy) · + Glasgow (United Kingdom) · + Gomel (Belarus) · + Gothenburg (Sweden) · + Hamburg (Germany) · + Hanover (Germany) · + Helsinki (Finland) · + Istanbul (Turkey) · + Kayseri (Turkey) · + Kazan (Russia) · + Kemerovo (Russia) · + Khabarovsk (Russia) · + Kharkiv (Ukraine) · + Kraków (Poland) · + Krasnoyarsk (Russia) · + Kryvyi Rih (Ukraine) · + Kyiv (Ukraine) · + Leeds (United Kingdom) · + Leipzig (Germany) · + Lisbon (Portugal) · + London (United Kingdom) · + Lviv (Ukraine) · + Madrid (Spain) · + Makhachkala (Russia) · + Marseille (France) · + Milan (Italy) · + Minsk (Belarus) · + Moscow (Russia) · + Munich (Germany) · + Málaga (Spain) · + Naberezhnye Chelny (Russia) · + Naples (Italy) · + Nizhny Novgorod (Russia) · + Novosibirsk (Russia) · + Nuremberg (Germany) · + Omsk (Russia) · + Oslo (Norway) · + Palermo (Italy) · + Paris (France) · + Penza (Russia) · + Perm (Russia) · + Poznań (Poland) · + Prague (Czech Republic) · + Riga (Latvia) · + Rome (Italy) · + Rostov-on-Don (Russia) · + Rotterdam (Netherlands) · + Saint Petersburg (Russia) · + Samara (Russia) · + Seville (Spain) · + Sheffield (United Kingdom) · + Shymkent (Kazakhstan) · + Skopje (Republic of Macedonia) · + Sofia (Bulgaria) · + Stockholm (Sweden) · + Stuttgart (Germany) · + Tbilisi (Georgia) · + The Hague (Netherlands) · + Tolyatti (Russia) · + Turin (Italy) · + Tyumen (Russia) · + Ufa (Russia) · + Ulyanovsk (Russia) · + Valencia (Spain) · + Vienna (Austria) · + Vilnius (Lithuania) · + Vladivostok (Russia) · + Volgograd (Russia) · + Voronezh (Russia) · + Warsaw (Poland) · + Wrocław (Poland) · + Yaroslavl (Russia) · + Yekaterinburg (Russia) · + Yerevan (Armenia) · + Zagreb (Croatia) · + Zaporizhzhya (Ukraine) · + Zaragoza (Spain) · + İzmir (Turkey) · + Łódź (Poland) +

+
+
+ +
+

Set language

+

+ + + + + + + + + + + + +

+ Save +
- Save -
-
diff --git a/src/components/main/dashboard/dashboard.js b/src/components/main/dashboard/dashboard.js old mode 100644 new mode 100755 index ee1c857..d47f19f --- a/src/components/main/dashboard/dashboard.js +++ b/src/components/main/dashboard/dashboard.js @@ -3,15 +3,24 @@ import template from './dashboard.html'; const DashboardComponent = { controller, template }; -function controller($state, localStorageService) { +function controller($mdToast, $state, $window, WikiService, langService) { const vm = this; - vm.languages = localStorageService.get('languages') || ['en', 'de']; + vm.languages = langService.getUserLanguages(); + vm.loading = false; vm.saveLanguages = saveLanguages; + init(); + + function init() { + $window.document.title = 'Dashboard – Monumental'; + } + function saveLanguages() { - vm.languages.indexOf('en') === -1 ? vm.languages.push('en') : false; - localStorageService.set('languages', vm.languages.filter(lang => lang)); - $state.reload(); + langService.setUserLanguages(vm.languages.filter(lang => lang)) + .then(() => { + $mdToast.show($mdToast.simple().textContent('Languages saved!').hideDelay(3000)); + $state.reload(); + }); } } diff --git a/src/components/main/dashboard/dashboard.scss b/src/components/main/dashboard/dashboard.scss old mode 100644 new mode 100755 index efb2e5d..d8947a2 --- a/src/components/main/dashboard/dashboard.scss +++ b/src/components/main/dashboard/dashboard.scss @@ -2,8 +2,28 @@ @import '../../../styles/responsive'; mo-dashboard { - .dashboard { - width: 980px; - max-width: 100%; - } + .dashboard { + width: 980px; + max-width: 100%; + } + + .dashboard__box { + margin: 5px; + background: white; + border: 1px solid $softGrey; + border-radius: 2px; + padding: 20px; + + .md-title { + margin: 0; + } + + md-input-container { + margin-bottom: 0; + + .md-errors-spacer { + display: none; + } + } + } } \ No newline at end of file diff --git a/src/components/main/games/category/games-category.html b/src/components/main/games/category/games-category.html new file mode 100644 index 0000000..e68cc33 --- /dev/null +++ b/src/components/main/games/category/games-category.html @@ -0,0 +1,94 @@ +
+
+
+
+
+ + List of monuments in + + + {{ ::country.name }} + + + with image but without Wikimedia Commons category. + + Click plus next to category sugestion to add it. +
+
+ + This is cached value. It means it is not updated real-time. + {{$ctrl.total}} results + + + forward next entries + +
+
+
+ +
+
+ + +
+
+ + {{ ::item.name.value }} + +
+

+ {{ ::item.name.value }} + {{ ::item.place }} · {{ ::item.admin }} +

+
+

+ + add_circle_outline + + check_circle + + + Click to see diff or revert edit + check_circle + + + {{ ::category }} + +

+
+
+
+
+
+
+
+ + forward next entries + +
+
+

{{ $ctrl.error }}

+
+
+

Loading data...

+
+
+
\ No newline at end of file diff --git a/src/components/main/games/category/games-category.js b/src/components/main/games/category/games-category.js new file mode 100644 index 0000000..e9afcb6 --- /dev/null +++ b/src/components/main/games/category/games-category.js @@ -0,0 +1,126 @@ +import _ from 'lodash'; + +import './../games.scss'; +import template from './games-category.html'; + +const GamesCategoryComponent = { controller, template }; + +function controller($mdToast, $q, $state, $stateParams, $window, WikiService, langService, wikidata) { + const vm = this; + const id = $stateParams.country.includes('Q') ? $stateParams.country : `Q${$stateParams.country}`; + + vm.countries = [ + { name: 'France', code: 'Q142' }, + { name: 'Germany', code: 'Q183' }, + { name: 'Great Britain', code: 'Q145' }, + { name: 'Poland', code: 'Q36' }, + { name: 'the USA', code: 'Q30' }, + ]; + vm.country = id || 'Q36'; + vm.loading = true; + + vm.reload = () => $state.go($state.current, { country: vm.country }, { reload: true }); + vm.saveCategory = saveCategory; + + init(); + + function getCategories(filenames) { + return WikiService.getFilesCategories(filenames.map(filename => `File:${filename}`)) + .then((response) => { + const images = {}; + _.values(response).forEach((element) => { + images[element.title.substring(5)] = element.categories ? + element.categories.map(category => category.title.substring(9)) : + false; + }); + return images; + }); + } + + function getCountry() { + wikidata.get({ ids: id }) + .then((response) => { + const entry = response.entities[id]; + vm.name = entry.labels.en.value; + }); + } + + function getList() { + const langs = langService.getNativeLanguages(id); + if (!langs) { return $q.reject('Provided ID is not a country'); } + + return wikidata.getSPARQL(`SELECT ?item ?itemLabel (SAMPLE(?placeLabel) AS ?placeLabel) (SAMPLE(?adminLabel) AS ?adminLabel) (SAMPLE(?image) AS ?image) + WHERE { + ?item wdt:P17 wd:${id} . + ?item wdt:P1435 ?monument . + ?item wdt:P18 ?image . + OPTIONAL { ?item wdt:P276 ?place . ?place rdfs:label ?placeLabel . FILTER(LANG(?placeLabel) = "${langs[0]}") } . + OPTIONAL { ?item wdt:P131 ?admin . ?admin rdfs:label ?adminLabel . FILTER(LANG(?adminLabel) = "${langs[0]}") } . + MINUS { ?item wdt:P373 ?commons } . + SERVICE wikibase:label { bd:serviceParam wikibase:language "${langs.join(',')}" } + } + GROUP BY ?item ?itemLabel`); + } + + function init() { + vm.loading = true; + vm.list = []; + + $window.document.title = 'Monumental'; + + getCountry(); + getList() + .then((response) => { + const rand = Math.floor(Math.random() * (response.length - 24)); + const data = response.slice(rand, rand + 25); + vm.total = response.length; + vm.list = data.map(element => ({ + name: { + value_id: element.item.value.substring(element.item.value.indexOf('/Q') + 1), + value: element.itemLabel.value, + }, + admin: element.adminLabel ? element.adminLabel.value : undefined, + place: element.placeLabel ? element.placeLabel.value : undefined, + image: { + name: decodeURIComponent(element.image.value.replace('http://commons.wikimedia.org/wiki/Special:FilePath/', '')), + thumburl: `${element.image.value.replace('wiki/Special:FilePath', 'w/index.php?title=Special:Redirect/file')}&width=100`, + }, + })); + if (!vm.list.length) { return $q.reject('No entries to display'); } + return vm.list; + }) + .then(list => getCategories(list.map(entry => entry.image.name))) + .then((response) => { + vm.list.forEach((element) => { + element.categories = response[element.image.name]; + }); + vm.loading = false; + }) + .catch((err) => { + vm.error = err; + vm.loading = false; + }); + } + + function saveCategory(item, category) { + const id = item.name.value_id; + if (id && category) { + item.success = item.error = undefined; + item.loading = category; + WikiService.addCategory(id, category).then((response) => { + item.success = category; + item.loading = false; + }).catch((err) => { + item.error = err; + item.loading = false; + $mdToast.show($mdToast.simple().textContent(`Error: ${err}`).hideDelay(3000)); + }); + } + } +} + +export default () => { + angular + .module('monumental') + .component('moGameCategory', GamesCategoryComponent); +}; diff --git a/src/components/main/games/games.scss b/src/components/main/games/games.scss new file mode 100644 index 0000000..9b26ee3 --- /dev/null +++ b/src/components/main/games/games.scss @@ -0,0 +1,121 @@ +@import '../../../styles/variables'; +@import '../../../styles/responsive'; + +mo-game-category { + .game__subheader { + padding: 15px 25px; + background: #fafafa; + border-bottom: 1px solid $softGrey; + + md-input-container { + margin-bottom: 0; + margin-top: 0; + padding: 0 5px 2px; + + .md-errors-spacer { + display: none; + } + } + + .material-icons { + cursor: pointer; + font-size: 20px; + } + } + + .list { + width: 980px; + } + + .list__item { + border-left: 10px solid white; + + &.list__item--loading { + border-left: 10px solid #bdc3c7; + } + + &.list__item--done { + border-left: 10px solid #27ae60; + } + + &.list__item--error { + border-left: 10px solid #c0392b; + } + } + + .list__done { + background: #fafafa; + } + + .list__container { + background: white; + border: 1px solid $softGrey; + border-radius: 2px; + + & > md-list { + padding: 0; + } + + md-list-item.md-2-line { + border-bottom: 1px solid $softGrey; + + .md-list-item-text { + border-right: 5px solid transparent; + + p { + color: $darkGrey; + padding: 5px 20px 5px 0; + + } + + .md-button { + min-width: 36px; + min-height: 36px; + margin: 0 10px 0 0; + } + } + } + } + + .list__category { + margin-bottom: 5px !important; + margin-right: 15px !important; + + &.list__category--underlined { + border-bottom: 1px solid $softGrey; + } + } + + .list__status { + height: 75px; + width: 24px; + margin: 15px; + } + + .list__image { + width: 75px; + min-width: 75px; + height: 75px; + background: $softGrey; + margin: 15px; + } + + .list__image-link { + background: $softGrey; + width: 100%; + height: 100%; + + img { + max-width: 100%; + max-height: 100%; + } + } + + .list__loading { + position: absolute; + width: 100%; + height: 100%; + background: rgba(255, 255, 255, .9); + z-index: 10; + } +} diff --git a/src/components/main/list/list.html b/src/components/main/list/list.html old mode 100644 new mode 100755 index fb47139..4a3aa04 --- a/src/components/main/list/list.html +++ b/src/components/main/list/list.html @@ -1,69 +1,86 @@ - -
- - Dashboard - - - - - {{item.label}} - {{item.description}} - - -
-
- -
- - - {{$ctrl.list.length}} results - Loading... - - -
- {{item.name.value}} +
+
+
+
+ + + +
+
+ -
-

{{item.name.value}}

-

{{item.admin.value}}

+
+
+
+
+
+

{{ ::$ctrl.place.labels[$ctrl.lang] || "no name" }}

+

- - -
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- +
+ Wikidata +
+
+
+ +
+
+
+
+
+ + {{$ctrl.list.length}} results + Loading... +
+
+
+ +
+
+ + +
+ {{ item.name.value }} +
+
+

{{ item.name.value }}

+

{{ item.admin.value }}

+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+
+
- +
\ No newline at end of file diff --git a/src/components/main/list/list.js b/src/components/main/list/list.js old mode 100644 new mode 100755 index 2fc6669..f3b9ad5 --- a/src/components/main/list/list.js +++ b/src/components/main/list/list.js @@ -1,106 +1,89 @@ -import _ from 'lodash'; - import './list.scss'; import template from './list.html'; -import '../../../images/marker.png'; -const ListComponent = { - controller: controller, - template: template -}; +const ListComponent = { controller, template }; -function controller($state, $stateParams, $timeout, leafletData, localStorageService, wikidata) { - let vm = this; - const id = $stateParams.id[0] === 'Q' ? $stateParams.id : 'Q' + $stateParams.id; +function controller($state, $stateParams, $timeout, $window, langService, leafletData, localStorageService, mapService, WikiService, wikidata) { + const vm = this; + const icon = mapService.getMapIcon(); + const id = $stateParams.id.includes('Q') ? $stateParams.id : `Q${$stateParams.id}`; + let langs = langService.getUserLanguages(); - vm.map = {}; + vm.filters = {}; + vm.image = []; + vm.lang = langs[0]; + vm.map = mapService.getMapInstance({ center: { lat: 49.4967, lng: 12.4805, zoom: 4 } }); vm.listParams = {}; - vm.goToItem = (item) => item ? $state.go('main.list', { id: item.id.substring(1) }) : false; - vm.querySearch = (text) => wikidata.getSearch(text); - vm.search = {}; - - const icon = { - iconUrl: 'assets/images/marker.png', - shadowUrl: undefined, - iconSize: [40, 40], - shadowSize: [0, 0], - iconAnchor: [20, 20], - shadowAnchor: [0, 0] - }; - - vm.map = { - center: { - lat: 51.686, - lng: 19.545, - zoom: 7 - }, - markers: {}, - layers: { - baselayers: { - osm: { - name: 'OpenStreetMap', - type: 'xyz', - url: '//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', - layerOptions: { - subdomains: ['a', 'b', 'c'], - attribution: '© OpenStreetMap contributors', - continuousWorld: true - } - } - }, - overlays: { - monuments: { - name: 'Monuments', - type: 'markercluster', - visible: true - } - } - } - }; - if (!id || id === 'Q') { vm.showMap = true; return; } - let langs = $stateParams.lang ? [$stateParams.lang] : []; - langs = langs.concat(localStorageService.get('languages') || ['en', 'de']); - wikidata.setLanguages(langs); + init(); - wikidata.getSearch(id).then(results => { - vm.search.selectedItem = results.length ? results[0] : undefined; - }); + function getImage(image) { + WikiService.getImage(image).then((response) => { + vm.image.push(response.imageinfo); + }); + } - wikidata.getSPARQL(`SELECT DISTINCT ?item ?itemLabel (SAMPLE(?admin) AS ?admin) (SAMPLE(?adminLabel) AS ?adminLabel) (SAMPLE(?coord) AS ?coord) (SAMPLE(?image) AS ?image) + function getList() { + return wikidata.getSPARQL(`SELECT DISTINCT ?item ?itemLabel + (SAMPLE(?admin) AS ?admin) (SAMPLE(?adminLabel) AS ?adminLabel) (SAMPLE(?coord) AS ?coord) (SAMPLE(?image) AS ?image) WHERE { - ?item p:P1435 ?monument . - ?item wdt:P131* wd:` + id + ` . - ?item wdt:P131 ?admin . - ?item wdt:P625 ?coord . - OPTIONAL { ?item wdt:P18 ?image } - OPTIONAL { ?admin rdfs:label ?adminLabel. FILTER(LANG(?adminLabel) = "` + langs[0] + `"). } - SERVICE wikibase:label { bd:serviceParam wikibase:language "` + langs.join(',') + `" } + ?item p:P1435 ?monument; wdt:P131* wd:${id}; wdt:P131 ?admin; wdt:P625 ?coord . + OPTIONAL { ?item wdt:P18 ?image } + OPTIONAL { ?admin rdfs:label ?adminLabel . FILTER(LANG(?adminLabel) IN ("${langs[0]}")) } + SERVICE wikibase:label { bd:serviceParam wikibase:language "${langs.join(',')}" } } GROUP BY ?item ?itemLabel - ORDER BY ?itemLabel`).then(data => { + ORDER BY ?itemLabel`); + } + + function getPlace() { + return wikidata.getById(id).then((data) => { + const first = Object.keys(data)[0]; + vm.place = data[first]; + + const claims = vm.place.claims; + if (vm.place.claims.P18) { + claims.P18.values.forEach(image => getImage(image.value)); + } + if (vm.place.claims.P17) { + const country = claims.P17.values[0]; + langs = langs.concat(langService.getNativeLanguages(country.value_id)); + } + return true; + }); + } + + function init() { + getPlace() + .then(() => { + const title = vm.place.labels[vm.lang] || vm.place.labels.en || vm.place.id; + $window.document.title = `${title} – Monumental`; + + return getList(); + }) + .then((data) => { // console.log(data) vm.list = data.map(element => ({ name: { value_id: element.item.value.substring(element.item.value.indexOf('/Q') + 1), - value: element.itemLabel.value + value: element.itemLabel.value, }, admin: { value_id: element.admin.value.substring(element.admin.value.indexOf('/Q') + 1), - value: element.adminLabel ? element.adminLabel.value : element.admin.value.substring(element.admin.value.indexOf('/Q') + 1) + value: element.adminLabel ? element.adminLabel.value : element.admin.value.substring(element.admin.value.indexOf('/Q') + 1), }, coord: element.coord.value ? element.coord.value.replace('Point(', '').replace(')', '').split(' ') : false, image: element.image ? element.image.value.replace('wiki/Special:FilePath', 'w/index.php?title=Special:Redirect/file') + '&width=120' : false })); return vm.list; - }).then(list => { - let bounds = []; - list.forEach(element => { + }).then((list) => { + const bounds = []; + list.forEach((element) => { if (element.coord) { vm.map.markers[element.name.value_id] = { lat: +element.coord[1], @@ -117,7 +100,7 @@ function controller($state, $stateParams, $timeout, leafletData, localStorageSer
`, layer: 'monuments', - icon: icon + icon, }; bounds.push([+element.coord[1], +element.coord[0]]); } @@ -131,6 +114,7 @@ function controller($state, $stateParams, $timeout, leafletData, localStorageSer }); }); }); + } } export default () => { diff --git a/src/components/main/list/list.scss b/src/components/main/list/list.scss old mode 100644 new mode 100755 index c6c58c9..6733f43 --- a/src/components/main/list/list.scss +++ b/src/components/main/list/list.scss @@ -2,57 +2,133 @@ @import '../../../styles/responsive'; mo-list { - .list { - width: 450px; - height: calc(100vh - 105px); + .list { + width: 450px; + } + + .list__header { + padding: 20px 25px; + background: white; + border-bottom: 1px solid $softGrey; + + .header__primary { + margin-bottom: 10px; + border-bottom: 1px solid $softGrey; } - - .list__container { - margin-right: 20px; - md-list-item.md-2-line { - border-bottom: 1px solid $softGrey; - } + .header__secondary { + .material-icons { + margin-right: 5px; + color: $lightGrey; + } + & > div { + margin-bottom: 15px; + } + } + + .header__image { + width: 100px; + height: 100px; + padding: 5px; + margin-right: 25px; + border: 1px solid $softGrey; + } + + .header__image-link { + background: $softGrey; + width: 100%; + height: 100%; + + img { + max-width: 100%; + max-height: 100%; + } } - .list__image { - width: 75px; - min-width: 75px; - height: 75px; - background: $softGrey; - margin: 15px 15px 15px 0; - - img { - max-width: 100%; - max-height: 100%; - } + .header__title { + margin-top: 0; + margin-bottom: 0; + font-size: 32px; + line-height: 32px; } - .list__map { - background: $softGrey; + .header__subtitle { + margin-top: 0; + margin-bottom: 10px; + } - .angular-leaflet-map { - width: 100%; - height: 100%; - } + .header__place { + display: block; + } + } - .leaflet-popup-close-button { - z-index: 1; - padding: 5px; - } + .list__subheader { + padding: 15px 25px; + background: #fafafa; + border-bottom: 1px solid $softGrey; - .leaflet-popup-content-wrapper { - border-radius: 2px; - } + md-input-container { + margin-bottom: 0; + margin-top: 0; + padding: 0; - .leaflet-popup-content { - min-width: 300px; - margin: 0; - font: 16px Roboto, Arial, sans-serif; - } + .md-errors-spacer { + display: none; + } } + } + + .list__container { + margin-right: 20px; + background: white; + border: 1px solid $softGrey; + border-radius: 2px; - md-autocomplete { - margin: 20px; + md-list-item.md-2-line { + border-bottom: 1px solid $softGrey; } + } + + .list__image { + width: 75px; + min-width: 75px; + height: 75px; + background: $softGrey; + margin: 15px 15px 15px 0; + + img { + max-width: 100%; + max-height: 100%; + } + } + + .list__map { + background: white; + border: 1px solid $softGrey; + border-radius: 2px; + + .angular-leaflet-map { + width: 100%; + height: 100%; + } + + .leaflet-popup-close-button { + z-index: 1; + padding: 5px; + } + + .leaflet-popup-content-wrapper { + border-radius: 2px; + } + + .leaflet-popup-content { + min-width: 300px; + margin: 0; + font: 16px Roboto, Arial, sans-serif; + } + } + + md-autocomplete { + margin: 20px; + } } \ No newline at end of file diff --git a/src/components/main/main.html b/src/components/main/main.html old mode 100644 new mode 100755 index be33d1c..a0cdefa --- a/src/components/main/main.html +++ b/src/components/main/main.html @@ -1 +1,2 @@ + \ No newline at end of file diff --git a/src/components/main/main.js b/src/components/main/main.js old mode 100644 new mode 100755 index 1fba5f0..6895270 --- a/src/components/main/main.js +++ b/src/components/main/main.js @@ -2,23 +2,10 @@ import './main.scss'; import template from './main.html'; import pack from '../../../package.json'; -const MainComponent = { - controller: controller, - template: template -}; - -function controller(wikidata, $state, $stateParams, localStorageService) { - let vm = this; - - let langs = $stateParams.lang ? [$stateParams.lang] : []; - langs = langs.concat(localStorageService.get('languages') || ['en', 'de']); - - vm.lang = langs[0]; - wikidata.setLanguages(langs); +const MainComponent = { controller, template }; - vm.goToItem = (item) => $state.go('main.object', {id: item.title.substring(1)}); - vm.querySearch = (text) => wikidata.getSearch(text); - vm.search = {}; +function controller() { + const vm = this; } export default () => { diff --git a/src/components/main/main.scss b/src/components/main/main.scss old mode 100644 new mode 100755 index 6e0365a..f30b3f8 --- a/src/components/main/main.scss +++ b/src/components/main/main.scss @@ -2,17 +2,17 @@ @import '../../styles/responsive'; .toolbar { - .md-toolbar-tools { - max-width: 980px; - padding: 0; + .md-toolbar-tools { + max-width: 980px; + padding: 0; - md-autocomplete { - width: 300px; - } + md-autocomplete { + width: 300px; } + } - &.toolbar--wide .md-toolbar-tools { - max-width: 100%; - padding-left: 15px; - } + &.toolbar--wide .md-toolbar-tools { + max-width: 100%; + padding-left: 15px; + } } \ No newline at end of file diff --git a/src/components/main/map/map.html b/src/components/main/map/map.html old mode 100644 new mode 100755 index 63572d7..352b8a3 --- a/src/components/main/map/map.html +++ b/src/components/main/map/map.html @@ -1,45 +1,22 @@ - -
- - Dashboard - - - - - {{item.label}} - {{item.description}} - - -
-
+ ng-if="$ctrl.map.center.zoom <= 12">

Zoom in

+ ng-if="$ctrl.loading">
+ ng-if="$ctrl.map.center.zoom > 12 && !$ctrl.loading && !$ctrl.list.length">

No results

+ md-virtual-repeat="item in $ctrl.list | orderBy: 'name.value'" + ui-sref="main.object({id: item.name.value_id.substring(1)})">
{{item.name.value}}
diff --git a/src/components/main/map/map.js b/src/components/main/map/map.js old mode 100644 new mode 100755 index 2fd8cab..0a9ee28 --- a/src/components/main/map/map.js +++ b/src/components/main/map/map.js @@ -3,27 +3,21 @@ import template from './map.html'; const MapComponent = { controller, template }; -function controller($location, $scope, $state, $stateParams, $timeout, leafletData, localStorageService, mapService, wikidata) { +function controller($location, $scope, $state, $stateParams, $timeout, $window, langService, leafletData, localStorageService, mapService, wikidata) { const vm = this; const icon = mapService.getMapIcon(); + const langs = langService.getUserLanguages(); // bindings - vm.goToItem = item => setMap(item); vm.map = mapService.getMapInstance({ center: { lat: 49.4967, lng: 12.4805, zoom: 4 } }); - vm.querySearch = text => wikidata.getSearch(text); vm.list = []; vm.listParams = {}; vm.loading = false; vm.loadingMap = true; - vm.search = {}; // activate - let langs = $stateParams.lang ? [$stateParams.lang] : []; - langs = langs.concat(localStorageService.get('languages') || ['en', 'de']); - wikidata.setLanguages(langs); - $scope.$on('centerUrlHash', (event, centerHash) => { $location.search({ c: centerHash }); }); @@ -42,6 +36,8 @@ function controller($location, $scope, $state, $stateParams, $timeout, leafletDa }); }, 100); + $window.document.title = 'Monumental'; + // functions function getDataBB(bounds) { @@ -58,7 +54,10 @@ function controller($location, $scope, $state, $stateParams, $timeout, leafletDa SERVICE wikibase:label { bd:serviceParam wikibase:language "${langs.join(',')}" } }`).then((data) => { vm.map.markers = {}; - vm.list = data.map(element => setListElement(element)); + // http://stackoverflow.com/a/36744732/1418878 + vm.list = data + .map(element => setListElement(element)) + .filter((element, index, array) => array.findIndex(t => t.name.value_id === element.name.value_id) === index); vm.list.forEach((element) => { vm.map.markers[element.name.value_id] = setMarker(element); }); @@ -66,6 +65,10 @@ function controller($location, $scope, $state, $stateParams, $timeout, leafletDa }); } + /** + * Gets link to image + * @param {String} image + */ function getImage(image) { if (image) { const newImage = image.value.replace('wiki/Special:FilePath', 'w/index.php?title=Special:Redirect/file'); diff --git a/src/components/main/map/map.scss b/src/components/main/map/map.scss old mode 100644 new mode 100755 index f907d7a..7e7d38e --- a/src/components/main/map/map.scss +++ b/src/components/main/map/map.scss @@ -2,86 +2,91 @@ @import '../../../styles/responsive'; mo-map { - .list { - position: relative; - width: 450px; - height: calc(100vh - 105px); - } - - .list__container { - margin-right: 20px; + .list { + position: relative; + width: 450px; + height: calc(100vh - 105px); + } + + .list__container { + margin-right: 20px; + background: white; + border: 1px solid $softGrey; + border-radius: 2px; - md-list-item.md-2-line { - border-bottom: 1px solid $softGrey; - } + md-list-item.md-2-line { + border-bottom: 1px solid $softGrey; } + } - .list__loading { - position: absolute; - z-index: 10; - width: 100%; - height: 100%; - background: rgba(250,250,250,.8); - padding: 20px; + .list__loading { + position: absolute; + z-index: 10; + width: 100%; + height: 100%; + background: rgba(250,250,250,.8); + padding: 20px; - md-progress-linear { - max-width: 200px; - } - - &.ng-enter { - transition: 0.3s linear all; - opacity: 0; - } - &.ng-enter.ng-enter-active { - opacity: 1; - } - &.ng-leave { - transition: 0.3s linear all; - opacity: 1; - } - &.ng-leave.ng-leave-active { - opacity: 0; - } + md-progress-linear { + max-width: 200px; } - - .list__image { - width: 75px; - min-width: 75px; - height: 75px; - background: $softGrey; - margin: 15px 15px 15px 0; - - img { - max-width: 100%; - max-height: 100%; - } + + &.ng-enter { + transition: 0.3s linear all; + opacity: 0; + } + &.ng-enter.ng-enter-active { + opacity: 1; + } + &.ng-leave { + transition: 0.3s linear all; + opacity: 1; } + &.ng-leave.ng-leave-active { + opacity: 0; + } + } - .list__map { - background: $softGrey; + .list__image { + width: 75px; + min-width: 75px; + height: 75px; + background: $softGrey; + margin: 15px 15px 15px 0; + + img { + max-width: 100%; + max-height: 100%; + } + } - .angular-leaflet-map { - width: 100%; - height: 100%; - } + .list__map { + background: white; + border: 1px solid $softGrey; + border-radius: 2px; - .leaflet-popup-close-button { - z-index: 1; - padding: 5px; - } + .angular-leaflet-map { + width: 100%; + height: 100%; + } - .leaflet-popup-content-wrapper { - border-radius: 2px; - } + .leaflet-popup-close-button { + z-index: 1; + padding: 5px; + } - .leaflet-popup-content { - min-width: 300px; - margin: 0; - font: 16px Roboto, Arial, sans-serif; - } + .leaflet-popup-content-wrapper { + border-radius: 2px; } - md-autocomplete { - margin: 20px; + .leaflet-popup-content { + min-width: 300px; + margin: 0; + font: 16px Roboto, Arial, sans-serif; } + } + + md-autocomplete { + margin: 20px; + } } \ No newline at end of file diff --git a/src/components/main/monument/components/location.js b/src/components/main/monument/components/location.js new file mode 100644 index 0000000..59802e7 --- /dev/null +++ b/src/components/main/monument/components/location.js @@ -0,0 +1,45 @@ +const LocationComponent = { + bindings: { monument: '=' }, + controller, + template: `
+ location_city + + + {{place.value}} · + + No location provided + +
`, +}; + +function controller(wikidata) { + const vm = this; + init(); + + function init() { + let prop; + let id; + const claims = vm.monument.claims; + + if (claims.P276) { + prop = 'wdt:P276/wdt:P131'; + id = vm.monument.id; + } else if (claims.P131) { + prop = 'wdt:P131'; + const preferred = claims.P131.values.filter(value => value.rank === 'preferred'); + id = preferred.length ? preferred[0].value_id : claims.P131.values[0].value_id; + } else { + return; + } + + wikidata.getRecursive(id, prop).then((response) => { + vm.location = response; + }); + } +} + +export default () => { + angular + .module('monumental') + .component('moLocation', LocationComponent); +}; diff --git a/src/components/main/monument/components/native-name.js b/src/components/main/monument/components/native-name.js new file mode 100644 index 0000000..39ebea9 --- /dev/null +++ b/src/components/main/monument/components/native-name.js @@ -0,0 +1,29 @@ +const NativeNameComponent = { + bindings: { monument: '=' }, + controller, + template: '{{ ::name }} · ', +}; + +function controller(langService) { + const vm = this; + vm.getNativeLabel = getNativeLabel; + + function getNativeLabel() { + const country = getPropertyValue('P17'); + const languages = langService.getNativeLanguages(country.value_id); + return languages.map(lang => vm.monument.labels[lang]).filter(name => name); + } + + function getPropertyValue(prop) { + if (vm.monument.claims[prop] && vm.monument.claims[prop].values.length) { + return vm.monument.claims[prop].values[0]; + } + return false; + } +} + +export default () => { + angular + .module('monumental') + .component('moNativeName', NativeNameComponent); +}; diff --git a/src/components/main/monument/components/url.js b/src/components/main/monument/components/url.js new file mode 100644 index 0000000..e5ff926 --- /dev/null +++ b/src/components/main/monument/components/url.js @@ -0,0 +1,28 @@ +const UrlComponent = { + bindings: { monument: '<' }, + controller, + template: `
+ link + {{ ::$ctrl.label }} + no official website +
`, +}; + +function controller() { + const vm = this; + init(); + + function init() { + if (vm.monument && vm.monument.claims && vm.monument.claims.P856) { + const values = vm.monument.claims.P856.values; + vm.value = values[0].value; + vm.label = values[0].value.replace(/^https?:\/\/(www\.)?/, '').replace(/^\/|\/$/g, ''); + } + } +} + +export default () => { + angular + .module('monumental') + .component('moUrl', UrlComponent); +}; diff --git a/src/components/main/monument/monument.html b/src/components/main/monument/monument.html old mode 100644 new mode 100755 index a7225d7..3935cc6 --- a/src/components/main/monument/monument.html +++ b/src/components/main/monument/monument.html @@ -1,70 +1,98 @@ - -
- - Dashboard - - - - - {{item.label}} - {{item.description}} - - -
-
- -
- - -
-

Loading...

+
+
+
+
+
+ + + +
+
+
+
+
+

{{ ::$ctrl.monument.labels[$ctrl.lang] || "no name" }}

+

+ +

+
+
+ Wikidata +
+
+ +
+
+
+
+ + + +
+
-
-

{{$ctrl.monument.labels[$ctrl.lang] || 'no name'}}

-

{{$ctrl.monument.labels.en || 'no english name'}}

- -
- place - - {{place.value}} · - no location - +
+
+
+

Wikipedia

+ + + {{wiki}} +
- -
-
-

Wikipedia

- - - {{wiki}} - -
- -
+
+ ng-click="$ctrl.showArticleLong = true"> Show more
+
+

Properties

Properties
- - Show raw data - - - Show Wikidata page - -
{{$ctrl.monument | json}}
- -
-
- crop_original -
- - - -
- - - -
- - collections {{$ctrl.monument.claims.P373.property[$ctrl.lang]}} - - - -
- - map Google Maps - - - map OSM - +
+
+

Map

+ +
+ + + map Show all monuments nearby + +
- +
diff --git a/src/components/main/monument/monument.js b/src/components/main/monument/monument.js old mode 100644 new mode 100755 index 2778632..fd4b172 --- a/src/components/main/monument/monument.js +++ b/src/components/main/monument/monument.js @@ -2,37 +2,41 @@ import _ from 'lodash'; import './monument.scss'; import template from './monument.html'; -import '../../../images/marker.png'; const MonumentComponent = { controller, template }; -function controller($http, $q, $sce, $stateParams, $timeout, $window, localStorageService, WikiService, wikidata) { +function controller($http, $q, $sce, $stateParams, $timeout, $window, localStorageService, WikiService, langService, leafletData, mapService, wikidata) { const vm = this; - const id = $stateParams.id[0] === 'Q' ? $stateParams.id : `Q${$stateParams.id}`; + const icon = mapService.getMapIcon(); + const id = $stateParams.id.includes('Q') ? $stateParams.id : `Q${$stateParams.id}`; + const langs = langService.getUserLanguages(); vm.getCommonsLink = getCommonsLink; + vm.getWikipedia = getWikipedia; vm.image = []; + vm.lang = langs[0]; vm.map = {}; - let langs = $stateParams.lang ? [$stateParams.lang] : []; - langs = langs.concat(localStorageService.get('languages') || ['en', 'de']); - - vm.lang = langs[0]; - wikidata.setLanguages(langs); getWikidata(); // functions + function getCategoryInfo(category) { + WikiService.getCategoryInfo(category).then((response) => { + vm.category = response; + }); + } + function getCategoryMembers(category) { WikiService.getCategoryMembers(category).then((data) => { const promises = data.map(image => WikiService.getImage(image, { iiurlheight: 75 })); - $q.all(promises).then((data) => { - vm.images = data.map(image => image.imageinfo); + $q.all(promises).then((response) => { + vm.images = response.map(image => image.imageinfo); }); }); } - function getArticleHeader(lang, name) { + function getWikipedia(lang, name) { const language = lang.replace('wiki', ''); WikiService.getArticleHeader(language, name).then((data) => { vm.article = $sce.trustAsHtml(data); @@ -45,18 +49,15 @@ function controller($http, $q, $sce, $stateParams, $timeout, $window, localStora function getCommonsLink() { const name = vm.monument.claims.P373.values[0].value; - return 'https://commons.wikimedia.org/wiki/Category:' + encodeURIComponent(name); + return `https://commons.wikimedia.org/wiki/Category:${encodeURIComponent(name)}`; } - function getFullLocation(id) { - wikidata.getRecursive(id, 'P131').then(data => { - vm.location = data; - }); - } + function getImage() { + const image = getPropertyValue('P18'); + if (!image) { return; } - function getImage(image) { - WikiService.getImage(image).then(data => { - vm.image.push(data.imageinfo); + WikiService.getImage(image.value).then((response) => { + vm.image.push(response.imageinfo); }); } @@ -65,61 +66,58 @@ function controller($http, $q, $sce, $stateParams, $timeout, $window, localStora vm.monument.interwiki = _.mapValues(vm.monument.interwiki, wiki => ({ code: wiki.site.replace('wiki', ''), title: wiki.title, - link: 'https://' + wiki.site.replace('wiki', '') + '.wikipedia.org/wiki/' + wiki.title + link: `https://${wiki.site.replace('wiki', '')}.wikipedia.org/wiki/${wiki.title}`, })); } + function getPropertyValue(prop) { + if (vm.monument.claims[prop] && vm.monument.claims[prop].values.length) { + return vm.monument.claims[prop].values[0]; + } + return false; + } + function getWikidata() { vm.loading = true; wikidata.getById(id).then((data) => { - const first = Object.keys(data)[0]; - vm.monument = data[first]; + vm.monument = _.sample(data); const claims = vm.monument.claims; - if (vm.monument.claims.P18) { - claims.P18.values.forEach(image => getImage(image.value)); - } + getImage(); if (vm.monument.claims.P373) { + getCategoryInfo(claims.P373.values[0].value); getCategoryMembers(claims.P373.values[0].value); } - if (vm.monument.claims.P131) { - getFullLocation(claims.P131.values[0].value_id); - } + + vm.monument.interwikis = Object.keys(vm.monument.interwiki).length; const articleInterwiki = vm.monument.interwiki[`${langs[0]}wiki`] || vm.monument.interwiki[`${langs[1]}wiki`] || vm.monument.interwiki[`${langs[2]}wiki`]; if (articleInterwiki) { - getArticleHeader(articleInterwiki.site, articleInterwiki.title); + getWikipedia(articleInterwiki.site, articleInterwiki.title); } if (vm.monument.claims.P625) { const value = vm.monument.claims.P625.values[0].value; - const icon = { - iconUrl: 'assets/images/marker.png', - shadowUrl: undefined, - iconSize: [40, 40], - shadowSize: [0, 0], - iconAnchor: [20, 20], - shadowAnchor: [0, 0] - }; - - vm.map = { - center: { + vm.map = mapService.getMapInstance({ center: { + lat: value.latitude, + lng: value.longitude, + zoom: 16, + } }); + vm.map.markers = { + marker: { lat: value.latitude, lng: value.longitude, - zoom: 15 + icon, }, - markers: { - marker: { - lat: value.latitude, - lng: value.longitude, - icon: icon - } - } }; + leafletData.getMap().then((map) => { + map.scrollWheelZoom.disable(); + map.once('focus', () => { map.scrollWheelZoom.enable(); }); + }); } getInterwiki(); vm.loading = false; - let title = vm.monument.labels[vm.lang] || vm.monument.labels.en || vm.monument.id; - $window.document.title = title + ' – Monumental'; + const title = vm.monument.labels[vm.lang] || vm.monument.labels.en || vm.monument.id; + $window.document.title = `${title} – Monumental`; }); } } diff --git a/src/components/main/monument/monument.scss b/src/components/main/monument/monument.scss old mode 100644 new mode 100755 index bb7e007..58335cf --- a/src/components/main/monument/monument.scss +++ b/src/components/main/monument/monument.scss @@ -2,126 +2,146 @@ @import '../../../styles/responsive'; mo-monument { - .monument { - width: 980px; - max-width: 100%; + .monument { + width: 980px; + max-width: 100%; + } + + .monument__header { + padding: 25px; + background: white; + border-bottom: 1px solid $softGrey; + + .monument__primary { + margin-bottom: 20px; + border-bottom: 1px solid $softGrey; } - - .monument__left { - width: 100%; - margin-right: 50px; + .monument__secondary { + .material-icons { + margin-right: 5px; + color: $lightGrey; + } + & > div { + margin-bottom: 15px; + } } - - .monument__right { - width: 300px; - min-width: 300px; - overflow: hidden; - - .md-button { - margin-left: 0; - margin-right: 0; - } + } + + .monument__subheader { + padding: 15px 0; + background: #fafafa; + border-bottom: 1px solid $softGrey; + } + + .monument__images { + width: 980px; + height: 90px; + overflow: hidden; + text-align: center; + + img { + display: inline-block; + margin-right: 5px; + padding: 5px; + background: white; + border: 1px solid $softGrey; } - - .monument__image { - background: #bdbdbd; - width: 300px; - height: 300px; - margin-top: 10px; - - md-icon.material-icons { - width: 60px; - height: 60px; - font-size: 60px; - opacity: .75; - } + } + + .monument__image { + width: 300px; + height: 300px; + padding: 5px; + margin-right: 25px; + border: 1px solid $softGrey; + } + + .monument__image-link { + background: $softGrey; + width: 100%; + height: 100%; + + img { + max-width: 100%; + max-height: 100%; } - - .monument__images { - margin-top: 10px; - width: 400px; - - img { - margin-right: 1px; - display: inline-block; - } + } + + .monument__panel { + margin: 15px 0; + padding: 30px; + background: white; + border: 1px solid $softGrey; + border-radius: 2px; + } + + .monument__title { + margin-top: 0; + margin-bottom: 0; + } + + .monument__subtitle { + margin-top: 0; + margin-bottom: 15px; + } + + .monument__place { + display: block; + margin-bottom: 30px !important; + } + + .monument__article { + .article__header { + .md-button.md-primary { + margin-left: 0; + margin-right: 0; + } } - .monument__title { + .article__text { + position:relative; + max-height: 320px; + overflow: hidden; + font-family: 'Merriweather', serif; + font-size: 15px; + text-align: justify; + line-height: 1.8; + + p:first-child { margin-top: 0; - margin-bottom: 0; - } + } - .monument__subtitle { - margin-top: 0; - margin-bottom: 15px; + &.article__text--long { + max-height: none; + } } - .monument__place { - margin-bottom: 15px; - - .material-icons { - margin-right: 5px; - color: $lightGrey; - } + .article__more { + margin-top: -14px; + z-index: 5; + box-shadow: inset rgb(255,255,255) 0 -45px 15px; } - .monument__article { - margin-top: 30px; - - .article__header { - .md-button.md-primary { - margin-left: 0; - margin-right: 0; - } - } - - .article__text { - position:relative; - max-height: 320px; - overflow: hidden; - font-family: 'Merriweather', serif; - font-size: 15px; - text-align: justify; - line-height: 1.8; - - p:first-child { - margin-top: 0; - } - - &.article__text--long { - max-height: none; - } - - &:after { - content: ""; - position: absolute; top: 0; bottom: 0; left: -15px; right: -15px; - box-shadow: inset rgb(250,250,250) 0 -20px 10px; - } - } - - .md-button { - margin-top: -18px; - } + .md-icon-button { + margin-top: -18px; } + } - .monument__details { - .monument__details-item { - margin-bottom: 15px; - - strong { - margin-right: 20px; - } - } + .monument__details { + .monument__details-item { + margin-bottom: 15px; - .monument__details-value { - line-height: 1.5; - } + strong { + margin-right: 20px; + } } - - .angular-leaflet-map { - width: 100%; - height: 300px; - margin-top: 20px; + + .monument__details-value { + line-height: 1.5; } + } + + .angular-leaflet-map { + height: 600px; + } } \ No newline at end of file diff --git a/src/components/toolbar/toolbar.html b/src/components/toolbar/toolbar.html new file mode 100644 index 0000000..785a0eb --- /dev/null +++ b/src/components/toolbar/toolbar.html @@ -0,0 +1,37 @@ + +
+
+ + Monumental + +
+ + + {{item.label}} + {{item.description}} + + +
+ Logged In + Login +
+
+
+
+
+ + Logout +
+
\ No newline at end of file diff --git a/src/components/toolbar/toolbar.js b/src/components/toolbar/toolbar.js new file mode 100644 index 0000000..67dbb5a --- /dev/null +++ b/src/components/toolbar/toolbar.js @@ -0,0 +1,59 @@ +import './toolbar.scss'; +import template from './toolbar.html'; + +const ToolbarComponent = { bindings: { wide: '=' }, controller, template }; + +function controller($mdToast, $state, $window, WikiService, wikidata) { + const vm = this; + vm.isLoggedIn = false; + vm.loading = true; + vm.search = {}; + + // functions + + vm.goToItem = goToItem; + vm.login = login; + vm.logout = logout; + vm.querySearch = text => wikidata.getSearch(text); + + init(); + + function goToItem(item) { + if (!item) { return; } + wikidata.getRecursive(item.id, 'wdt:P31/wdt:P279').then((response) => { + const ids = response.map(prop => prop.value_id); + if (ids.includes('Q811979')) { + $state.go('main.object', { id: item.id.substring(1) }); + } else if (ids.includes('Q1496967')) { + $state.go('main.list', { id: item.id.substring(1) }); + } else { + $mdToast.show($mdToast.simple() + .position('top right') + .textContent(`${item.label} is not an architectural structure or territorial entity`) + .hideDelay(2000)); + } + }); + } + + function init() { + WikiService.getToken().then((response) => { + vm.isLoggedIn = response; + vm.loading = false; + }); + } + + function login() { + vm.loading = true; + $window.location.pathname = `${$window.__env.baseUrl}/login`; + } + + function logout() { + $window.location.pathname = `${$window.__env.baseUrl}/logout`; + } +} + +export default () => { + angular + .module('monumental') + .component('moToolbar', ToolbarComponent); +}; diff --git a/src/components/toolbar/toolbar.scss b/src/components/toolbar/toolbar.scss new file mode 100644 index 0000000..68c15e1 --- /dev/null +++ b/src/components/toolbar/toolbar.scss @@ -0,0 +1,48 @@ +.toolbar { + padding: 0 5px; + min-height: 54px; + max-height: 54px; + + .md-toolbar-tools-wide { + max-width: none; + } + + md-autocomplete { + background: rgba(255, 255, 255, 0.15); + + md-autocomplete-wrap { + box-shadow: none; + + input { + padding: 0 10px; + color: white; + } + + ::-webkit-input-placeholder { color: rgba(255, 255, 255, 0.75); } + ::-moz-placeholder { color: rgba(255, 255, 255, 0.75); } + :-ms-input-placeholder { color: rgba(255, 255, 255, 0.75); } + :-moz-placeholder { color: rgba(255, 255, 255, 0.75); } + } + } + + .md-toolbar-tools { + max-height: 54px; + height: 54px; + } +} + +.md-virtual-repeat-container.md-autocomplete-suggestions-container { + z-index: 1000 !important; +} + +.toolbar__settings { + position: absolute; + width: 100%; + z-index: 10; + padding: 10px 25px; + background: white; + + .toolbar__column { + max-width: 980px; + } +} \ No newline at end of file diff --git a/src/images/marker-red.png b/src/images/marker-red.png new file mode 100644 index 0000000..eaeb016 Binary files /dev/null and b/src/images/marker-red.png differ diff --git a/src/images/marker-shadow.png b/src/images/marker-shadow.png new file mode 100644 index 0000000..d1e773c Binary files /dev/null and b/src/images/marker-shadow.png differ diff --git a/src/images/marker.png b/src/images/marker.png old mode 100644 new mode 100755 diff --git a/src/index.js b/src/index.js old mode 100644 new mode 100755 index 88e164c..b9c1695 --- a/src/index.js +++ b/src/index.js @@ -35,7 +35,7 @@ angular 'restangular', 'infinite-scroll', 'leaflet-directive', - 'LocalStorageModule' + 'LocalStorageModule', ]) .config(localStorageConfig) .config(stateConfig) @@ -53,7 +53,7 @@ function localStorageConfig(localStorageServiceProvider) { /** * Config of routing - * + * * @param {any} $stateProvider * @param {any} $urlRouterProvider */ @@ -61,17 +61,17 @@ function stateConfig($stateProvider, $urlRouterProvider) { $stateProvider .state('main', { template: '', - resolve: {} + resolve: {}, }) .state('main.dashboard', { url: '/', - template: ``, - resolve: {} + template: '', + resolve: {}, }) .state('main.list', { url: '/list/:id', - template: ``, - resolve: {} + template: '', + resolve: {}, }) .state('main.map', { url: '/map', @@ -79,33 +79,43 @@ function stateConfig($stateProvider, $urlRouterProvider) { resolve: {}, }) .state('main.object', { - url: '/object/:id?lang', - template: ``, - resolve: {} + url: '/object/:id', + template: '', + resolve: {}, + }) + .state('main.game', { + abstract: true, + url: '/games', + template: '

Loading

', + }) + .state('main.game.category', { + url: '/add-category?country', + template: '', + resolve: {}, }); $urlRouterProvider.otherwise('/'); } /** * Config of material design theme - * + * * @param {any} $mdThemingProvider * @param {any} $provide */ function themeConfig($mdThemingProvider, $provide) { - let tp = $mdThemingProvider; - tp.definePalette('moRed', tp.extendPalette('red', { - '500': '#8f0000', - '600': '#8f0000' + const tp = $mdThemingProvider; + tp.definePalette('belize', tp.extendPalette('blue', { + 500: '#2980b9', + 600: '#2980b9', })); tp.alwaysWatchTheme(true); tp.theme('default') - .primaryPalette('moRed') - .accentPalette('blue'); + .primaryPalette('belize') + .accentPalette('orange'); $provide.value('themeProvider', tp); } components(); -services(); \ No newline at end of file +services(); diff --git a/src/index_dev.ejs b/src/index_dev.ejs old mode 100644 new mode 100755 index 491963a..65e79c3 --- a/src/index_dev.ejs +++ b/src/index_dev.ejs @@ -11,6 +11,7 @@ (function (window) { window.__env = window.__env || {}; window.__env.name = 'dev'; + window.__env.baseUrl = '/monumental'; }(this)); diff --git a/src/index_local.ejs b/src/index_local.ejs old mode 100644 new mode 100755 index fe95050..92ea526 --- a/src/index_local.ejs +++ b/src/index_local.ejs @@ -11,6 +11,7 @@ (function (window) { window.__env = window.__env || {}; window.__env.name = 'local'; + window.__env.baseUrl = ''; }(this)); diff --git a/src/services/index.js b/src/services/index.js old mode 100644 new mode 100755 index 3d53019..a1987f2 --- a/src/services/index.js +++ b/src/services/index.js @@ -1,9 +1,11 @@ +import lang from './lang.service'; import map from './map.service'; import theme from './theme.service'; import wiki from './wiki.service'; import wikidata from './wikidata.service'; export default () => { + lang(); map(); theme(); wiki(); diff --git a/src/services/lang.service.js b/src/services/lang.service.js new file mode 100644 index 0000000..6f2d5d3 --- /dev/null +++ b/src/services/lang.service.js @@ -0,0 +1,231 @@ +const LangService = function ($q, localStorageService) { + const service = { + getNativeLanguages, + getUserLanguages, + setUserLanguages, + }; + + const languagesList = { + Q889: ['ps'], + Q222: ['sq'], + Q262: ['ar'], + Q228: ['ca'], + Q916: ['pt'], + Q781: ['en'], + Q414: ['es'], + Q399: ['hy'], + Q408: ['en'], + Q40: ['de'], + Q227: ['az'], + Q398: ['ar'], + Q902: ['bn'], + Q244: ['en'], + Q184: ['ru', 'be'], + Q31: ['nl', 'fr', 'de'], + Q242: ['en'], + Q962: ['fr'], + Q917: ['dz'], + Q750: ['es'], + Q225: ['hr', 'sr', 'bs'], + Q963: ['en'], + Q155: ['pt'], + Q921: ['en'], + Q219: ['bg'], + Q965: ['fr'], + Q967: ['fr', 'en'], + Q424: ['km'], + Q1009: ['fr', 'en'], + Q1011: ['pt'], + Q929: ['fr'], + Q657: ['fr', 'ar'], + Q298: ['es'], + Q739: ['es'], + Q970: ['fr', 'ar'], + Q800: ['es'], + Q224: ['hr'], + Q241: ['es'], + Q229: ['tr', 'el'], + Q213: ['cs'], + Q1008: ['fr'], + Q974: ['fr'], + Q977: ['fr', 'ar'], + Q784: ['en'], + Q786: ['es'], + Q574: ['pt'], + Q736: ['es'], + Q79: ['ar'], + Q792: ['es'], + Q983: ['fr', 'es', 'pt'], + Q986: ['en', 'ar', 'ti'], + Q191: ['et'], + Q115: ['am'], + Q702: ['en'], + Q712: ['en'], + Q33: ['fi', 'sv'], + Q142: ['fr'], + Q1000: ['fr'], + Q1005: ['en'], + Q230: ['ka'], + Q183: ['de'], + Q117: ['en'], + Q41: ['el'], + Q769: ['en'], + Q774: ['es'], + Q1006: ['fr'], + Q1007: ['pt'], + Q734: ['en'], + Q790: ['fr', 'ht'], + Q783: ['es'], + Q28: ['hu'], + Q189: ['is'], + Q668: ['hi', 'en'], + Q252: ['id'], + Q794: ['fa'], + Q796: ['ar', 'ku'], + Q27: ['en'], + Q801: ['he'], + Q38: ['it'], + Q766: ['en'], + Q17: ['ja'], + Q810: ['ar'], + Q232: ['kk'], + Q114: ['en', 'sw'], + Q29999: ['nl'], + Q710: ['en'], + Q817: ['ar'], + Q813: ['ru', 'ky'], + Q819: ['lo'], + Q211: ['lv'], + Q822: ['ar'], + Q1013: ['en', 'st'], + Q1014: ['en'], + Q1016: ['ar'], + Q347: ['de'], + Q37: ['lt'], + Q32: ['fr', 'de', 'lb'], + Q1019: ['fr', 'mg'], + Q1020: ['en', 'ny'], + Q833: ['en'], + Q826: ['dv'], + Q912: ['fr'], + Q233: ['en', 'mt'], + Q709: ['en', 'mh'], + Q1025: ['ar'], + Q1027: ['fr', 'en'], + Q96: ['es'], + Q217: ['mo'], + Q235: ['fr'], + Q711: ['mn'], + Q236: ['hr', 'sq', 'sr', 'bs'], + Q1028: ['ar'], + Q1029: ['pt'], + Q836: ['my'], + Q1030: ['en'], + Q697: ['en', 'na'], + Q837: ['ne'], + Q664: ['en', 'mi'], + Q811: ['es'], + Q1032: ['fr'], + Q1033: ['en'], + Q423: ['ko'], + Q20: ['nn', 'nb'], + Q842: ['ar'], + Q843: ['ur', 'en'], + Q695: ['en'], + Q804: ['es'], + Q691: ['en', 'ho', 'tpi'], + Q733: ['es', 'gn'], + Q419: ['es', 'ay'], + Q928: ['en'], + Q36: ['pl'], + Q45: ['pt'], + Q846: ['ar'], + Q221: ['mk'], + Q971: ['fr'], + Q218: ['ro'], + Q159: ['ru'], + Q1037: ['fr', 'en', 'rw'], + Q763: ['en'], + Q760: ['en'], + Q757: ['es', 'en'], + Q683: ['en', 'sm'], + Q238: ['it'], + Q1039: ['pt'], + Q1041: ['fr'], + Q403: ['sr'], + Q1042: ['fr', 'en', 'crs'], + Q1044: ['en'], + Q334: ['en', 'ta', 'ms'], + Q214: ['sk'], + Q215: ['sl'], + Q685: ['en'], + Q1045: ['so', 'ar'], + Q258: ['en', 'zu'], + Q884: ['ko'], + Q958: ['en'], + Q29: ['es'], + Q854: ['ta', 'si'], + Q1049: ['en', 'ar'], + Q730: ['nl'], + Q1050: ['en', 'ss'], + Q34: ['fi', 'yi', 'sv'], + Q39: ['fr', 'de', 'it'], + Q858: ['ar'], + Q863: ['tg'], + Q924: ['en', 'sw'], + Q869: ['th'], + Q778: ['en'], + Q945: ['fr'], + Q678: ['en', 'to'], + Q754: ['en'], + Q948: ['ar'], + Q43: ['tr'], + Q874: ['ru', 'tk'], + Q672: ['en', 'tvl'], + Q1036: ['en', 'sw'], + Q212: ['uk'], + Q878: ['ar'], + Q145: ['en'], + Q30: ['en'], + Q77: ['es'], + Q265: ['uz'], + Q686: ['fr', 'en', 'bi'], + Q717: ['es'], + Q881: ['vi'], + Q805: ['ar'], + Q953: ['en'], + Q954: ['en'], + }; + let userLanguages = []; + + return service; + + // + + function getNativeLanguages(code) { + return languagesList[code]; + } + + function getUserLanguages() { + if (userLanguages.length) { return angular.copy(userLanguages); } + + const ls = localStorageService.get('languages'); + const def = navigator.language || navigator.userLanguage; + + userLanguages = ls || [def]; + if (!userLanguages.includes('en')) { userLanguages.push('en'); } + return angular.copy(userLanguages); + } + + function setUserLanguages(langs) { + localStorageService.set('languages', langs); + userLanguages = langs; + return $q.when(true); + } +}; + +export default () => { + angular + .module('monumental') + .factory('langService', LangService); +}; diff --git a/src/services/map.service.js b/src/services/map.service.js old mode 100644 new mode 100755 index f3a2055..d8b6f14 --- a/src/services/map.service.js +++ b/src/services/map.service.js @@ -1,4 +1,5 @@ -import '../images/marker.png'; +import '../images/marker-red.png'; +import '../images/marker-shadow.png'; const MapService = () => { const service = { @@ -12,12 +13,13 @@ const MapService = () => { function getMapIcon(options) { return angular.extend({ - iconUrl: 'assets/images/marker.png', - shadowUrl: undefined, - iconSize: [40, 40], - shadowSize: [0, 0], - iconAnchor: [20, 20], - shadowAnchor: [0, 0], + iconUrl: 'assets/images/marker-red.png', + shadowUrl: 'assets/images/marker-shadow.png', + iconSize: [29, 41], + shadowSize: [41, 41], + iconAnchor: [15, 41], + shadowAnchor: [12, 41], + popupAnchor: [0, -43], }, options); } @@ -31,6 +33,16 @@ const MapService = () => { markers: {}, layers: { baselayers: { + wiki: { + name: 'Wikimedia Maps', + type: 'xyz', + url: '//maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png', + layerOptions: { + subdomains: ['a', 'b', 'c'], + attribution: '© OpenStreetMap contributors', + continuousWorld: true, + }, + }, osm: { name: 'OpenStreetMap', type: 'xyz', diff --git a/src/services/theme.service.js b/src/services/theme.service.js old mode 100644 new mode 100755 index 160e8c3..2d9ed98 --- a/src/services/theme.service.js +++ b/src/services/theme.service.js @@ -1,21 +1,21 @@ -const VersionService = function($timeout, $mdTheming, themeProvider) { +const VersionService = function ($timeout, $mdTheming, themeProvider) { const service = { version: 'default', - getVersion: getVersion, - setVersion: setVersion + getVersion, + setVersion, }; return service; - //// + // function getVersion() { return service.version; } function setVersion(version) { - themeProvider.setDefaultTheme(version); - service.version = version; + themeProvider.setDefaultTheme(version); + service.version = version; } }; diff --git a/src/services/wiki.service.js b/src/services/wiki.service.js old mode 100644 new mode 100755 index e6ef441..9001dc1 --- a/src/services/wiki.service.js +++ b/src/services/wiki.service.js @@ -1,17 +1,22 @@ import _ from 'lodash'; -const WikiService = function ($http, $q) { - +const WikiService = function ($http, $httpParamSerializerJQLike, $q, $window, wikidata) { const service = { - getArticleHeader: getArticleHeader, - getCategoryMembers: getCategoryMembers, - getImage: getImage + addCategory, + getArticleHeader, + getFilesCategories, + getCategoryInfo, + getCategoryMembers, + getImage, + getUserInfo, + getToken, + setClaim, }; const defaultParams = { action: 'query', format: 'json', - callback: 'JSON_CALLBACK' + callback: 'JSON_CALLBACK', }; const categoryFilesParams = angular.extend({}, defaultParams, { @@ -31,46 +36,130 @@ const WikiService = function ($http, $q) { // functions + function addCategory(id, value) { + return wikidata.get({ ids: id }) + .then((response) => { + const entry = response.entities[id]; + return entry.claims.P373; + }) + .then((response) => { + if (response) { + return $q.reject('Category is already added'); + } + return setClaim({ + action: 'wbcreateclaim', + format: 'json', + entity: `${id}`, + property: 'P373', + snaktype: 'value', + summary: '#monumental', + value: `"${value}"`, + }); + }); + } + function getArticleHeader(lang, title) { - let params = angular.extend({}, defaultParams, { + const params = angular.extend({}, defaultParams, { prop: 'extracts', titles: title, redirects: true, - exintro: 1 + exintro: 1, }); - return $http.jsonp('https://' + lang + '.wikipedia.org/w/api.php', { - params: params, - cache: true - }).then(data => { - return _.values(data.data.query.pages)[0].extract; + return $http.jsonp(`https://${lang}.wikipedia.org/w/api.php`, { + params, + cache: true, + }).then((response) => { + return _.values(response.data.query.pages)[0].extract; + }); + } + + function getCategoryInfo(category) { + const params = angular.extend({}, defaultParams, { + prop: 'categoryinfo', + titles: `Category:${category}`, + }); + return $http.jsonp('https://commons.wikimedia.org/w/api.php', { + params, + cache: true, + }).then((response) => { + const page = _.sample(response.data.query.pages); + return angular.extend({}, page.categoryinfo, { title: page.title }); }); } function getCategoryMembers(category) { - let params = angular.extend({}, categoryFilesParams, { cmtitle: 'Category:' + category }); + const params = angular.extend({}, categoryFilesParams, { cmtitle: `Category:${category}` }); return $http.jsonp('https://commons.wikimedia.org/w/api.php', { - params: params, - cache: true - }).then(data => { - let images = data.data.query.categorymembers.map(image => image.title.substring(5)); + params, + cache: true, + }).then((response) => { + const images = response.data.query.categorymembers.map(image => image.title.substring(5)); return images; }); } + function getFilesCategories(files) { + const params = angular.extend({}, defaultParams, { + prop: 'categories', + clshow: '!hidden', + cllimit: '250', + titles: files.join('|'), + }); + return $http.jsonp('https://commons.wikimedia.org/w/api.php', { + params, + }).then(response => response.data.query.pages); + } + function getImage(image, extraParams) { - let params = angular.extend({}, imageParams, { titles: 'File:' + image }, extraParams); + const params = angular.extend({}, imageParams, { titles: `File:${image}` }, extraParams); return $http.jsonp('https://commons.wikimedia.org/w/api.php', { - params: params, - cache: true - }).then(data => { - const image = _.head(_.values(data.data.query.pages)); + params, + cache: true, + }).then((response) => { + const image = _.head(_.values(response.data.query.pages)); return angular.extend({}, image, { imageinfo: image.imageinfo[0] }); }); } + + function getUserInfo(extraParams) { + const params = angular.extend({}, defaultParams, { + meta: 'userinfo|globaluserinfo', + }, extraParams); + return $http.jsonp('https://wikidata.org/w/api.php', { + params, + }).then(response => response.data.query.globaluserinfo); + } + + function getToken() { + return $http.get(`${$window.__env.baseUrl}/api`, { + params: { + action: 'query', + meta: 'tokens', + use_auth: 'true', + }, + }).then((response) => { + if (response.data && response.data.query) { + return response.data.query.tokens.csrftoken; + } + return false; + }); + } + + function setClaim(params) { + return $http({ + method: 'POST', + url: `${$window.__env.baseUrl}/api`, + data: $httpParamSerializerJQLike(angular.extend({ use_auth: true }, params)), + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + }).then((response) => { + if (response.data.status === 'exception') { return $q.reject(response.data.exception); } + return response; + }); + } }; export default () => { angular .module('monumental') .factory('WikiService', WikiService); -}; \ No newline at end of file +}; diff --git a/src/services/wikidata.service.js b/src/services/wikidata.service.js old mode 100644 new mode 100755 index 7142010..6bde0bd --- a/src/services/wikidata.service.js +++ b/src/services/wikidata.service.js @@ -1,26 +1,25 @@ -const wdService = function ($http, $q) { - +const wdService = function ($http, $q, langService) { const service = { - getById: getById, - getLabels: getLabels, - getRecursive: getRecursive, - getSearch: getSearch, - getSPARQL: getSPARQL, - setLanguages: setLanguages + get, + getById, + getLabels, + getRecursive, + getSearch, + getSPARQL, }; const defaultParams = { action: 'wbgetentities', format: 'json', props: ['info', 'labels', 'aliases', 'descriptions', 'claims', 'datatype', 'sitelinks'], - languages: ['en'], - callback: 'JSON_CALLBACK' + languages: langService.getUserLanguages(), + callback: 'JSON_CALLBACK', }; /** * Iterates over own enumerable string keyed properties of an object and * invokes `func` for each property.. - * + * * @param {Object} object The object to iterate over * @param {Function} func The function invoked per iteration * @returns {Object} Returns `object` @@ -41,32 +40,41 @@ const wdService = function ($http, $q) { * @returns {Promise} */ function get(data) { - let params = angular.extend({}, defaultParams, data); + const params = angular.extend({}, defaultParams, data); return $http.jsonp('https://www.wikidata.org/w/api.php', { params: mapValues(params, p => angular.isArray(p) ? p.join('|') : p), - cache: false - }); + cache: false, + }).then(response => response.data); } function getLabels(ids) { - return get({ - ids: ids, - props: ['labels'] - }).then(response => mapValues(response.data.entities, entity => simplifyLabels(entity.labels))); + const promises = []; + for (let i = 0; i < Math.ceil(ids.length / 50); i += 1) { + promises.push(get({ + ids: ids.slice(i * 50, ((i + 1) * 50) - 1), + props: ['labels'], + })); + } + return $q.all(promises).then((responses) => { + const result = {}; + responses.forEach((response) => { + const values = mapValues(response.entities, entity => simplifyLabels(entity.labels)); + angular.extend(result, values); + }); + return result; + }); } function getRecursive(element, recursiveProperty) { - let query = `SELECT ?parent ?parentLabel WHERE { - wd:`+ element + ` wdt:` + recursiveProperty + `* ?parent . - SERVICE wikibase:label { bd:serviceParam wikibase:language "` + defaultParams.languages.join(', ') + `" } + const query = `SELECT ?parent ?parentLabel WHERE { + wd:${element} ${recursiveProperty}* ?parent . + SERVICE wikibase:label { bd:serviceParam wikibase:language "${defaultParams.languages.join(', ')}" } }`; - return getSPARQL(query).then(data => { - return data.map(element => ({ - link: element.parent.value.replace('entity', 'wiki'), - value_id: element.parent.value.substring(element.parent.value.indexOf('/Q') + 1), - value: element.parentLabel.value - })); - }); + return getSPARQL(query).then(data => data.map((element) => ({ + link: element.parent.value.replace('entity', 'wiki'), + value_id: element.parent.value.substring(element.parent.value.indexOf('/Q') + 1), + value: element.parentLabel.value, + }))); } function getSearch(text) { @@ -74,14 +82,14 @@ const wdService = function ($http, $q) { action: 'wbsearchentities', search: text, type: 'item', - language: defaultParams.languages[0] - }).then(data => data.data.search); + language: defaultParams.languages[0], + }).then(response => response.search); } function getSPARQL(query) { return $http.get('https://query.wikidata.org/sparql', { - params: { query: query }, - cache: false + params: { query: query.replace(/ {2,}/g, ' ') }, + cache: false, }).then(data => data.data.results.bindings); } @@ -103,10 +111,6 @@ const wdService = function ($http, $q) { return result; } - function setLanguages(languages) { - defaultParams.languages = languages; - } - function simplifyAliases(aliases) { return mapValues(aliases, lang => lang.map(alias => alias.value)); } @@ -119,7 +123,7 @@ const wdService = function ($http, $q) { aliases: simplifyAliases(entity.aliases), descriptions: simplifyLabels(entity.descriptions), claims: simplifyClaims(entity.claims), - interwiki: entity.sitelinks + interwiki: entity.sitelinks, }; } @@ -131,9 +135,10 @@ const wdService = function ($http, $q) { const snak = claim.mainsnak; return { value_type: snak.datatype, - value_id: snak.datavalue.value.id, - value: snak.datavalue.value, - qualifiers: claim.qualifiers + value_id: snak.snaktype === 'novalue' ? false : snak.datavalue.value.id, + value: snak.snaktype === 'novalue' ? false : snak.datavalue.value, + qualifiers: claim.qualifiers, + rank: claim.rank, }; } @@ -141,23 +146,23 @@ const wdService = function ($http, $q) { return mapValues(claims, claim => claim.map(simplifyClaim)); } - //function getIDs + // function getIDs function getById(id) { let entities = {}; return get({ ids: id, - languages: defaultParams.languages + languages: undefined, }) - .then(data => mapValues(data.data.entities, entity => simplifyEntity(entity))) - .then(data => { + .then(response => mapValues(response.entities, entity => simplifyEntity(entity))) + .then((data) => { entities = data; const simplified = mapValues(data, entity => mapValues(entity.claims, claim => claim.map(value => value.value_id))); let ids = []; - forOwn(simplified, item => { + forOwn(simplified, (item) => { ids.push.apply(ids, Object.keys(item)); forOwn(item, prop => ids.push.apply(ids, prop)); }); @@ -165,15 +170,15 @@ const wdService = function ($http, $q) { return ids; }) .then(labelsIDs => getLabels(labelsIDs)) - .then(labels => { - forOwn(entities, entity => { + .then((labels) => { + forOwn(entities, (entity) => { entity.claims = mapValues(entity.claims, (values, key) => ({ property_id: key, property: labels[key], values: values.map(value => labels[value.value_id] ? angular.extend(value, { value: labels[value.value_id] }) : value), - qualifiers: entity.qualifiers + qualifiers: entity.qualifiers, })); }); return entities; @@ -187,4 +192,4 @@ export default () => { angular .module('monumental') .factory('wikidata', wdService); -}; \ No newline at end of file +}; diff --git a/src/styles/_general.scss b/src/styles/_general.scss old mode 100644 new mode 100755 index deb0ae9..099d413 --- a/src/styles/_general.scss +++ b/src/styles/_general.scss @@ -1,13 +1,22 @@ @import 'variables'; html, body { - width: 100%; - height: 100%; + height: auto !important; + min-width: 100%; + min-height: 100%; } body { color: $darkGrey; font: 16px Roboto, Arial, sans-serif; + + md-toast.md-bottom { + position: fixed; + } + + &.md-toast-animating { + overflow: auto !important; + } } ::-webkit-scrollbar { @@ -18,16 +27,18 @@ body { background: rgba(0,0,0,0.2); } -md-content { - margin: 20px; -} - .container { + background: #f5f5f5; min-height: calc(100vh - 64px); ui-view, ui-view > * { width: 100%; } + + & > md-content { + margin: 20px; + background: transparent; + } } //// @@ -38,7 +49,7 @@ md-content { a, a.link { cursor: pointer; - color: #8f0000; + color: $primary; text-decoration: none; } @@ -46,6 +57,10 @@ a, a.link { color: $lightGrey; } +small { + font-size: 95%; +} + .full-width { width: 100%; } @@ -66,14 +81,4 @@ a, a.link { strong { font-weight: 500; -} - -//// - -.toolbar { - padding: 0 5px; -} - -.md-virtual-repeat-container.md-autocomplete-suggestions-container { - z-index: 1000 !important; } \ No newline at end of file diff --git a/src/styles/_responsive.scss b/src/styles/_responsive.scss old mode 100644 new mode 100755 diff --git a/src/styles/_variables.scss b/src/styles/_variables.scss old mode 100644 new mode 100755 index ce98f24..512285b --- a/src/styles/_variables.scss +++ b/src/styles/_variables.scss @@ -1,3 +1,5 @@ $softGrey: #e5e5e5; -$lightGrey: rgba(0,0,0,0.54); -$darkGrey: rgba(0,0,0,.87); \ No newline at end of file +$lightGrey: rgba(0,0,0,0.38); +$darkGrey: rgba(0,0,0,.87); + +$primary: #2980b9 diff --git a/src/styles/style.scss b/src/styles/style.scss old mode 100644 new mode 100755 diff --git a/webpack.config.js b/webpack.config.js index b40ade8..aea0ae1 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -59,8 +59,8 @@ var config = { var ENV = process.env.NODE_ENV; if (ENV === 'prod' || ENV === 'dev') { config.output = { - path: path.join(__dirname, 'app', 'dist'), - publicPath: 'dist/', + path: path.join(__dirname, 'monumental', 'static', 'assets'), + publicPath: 'assets/', filename: 'bundle.min.js?v=' + package.version }; config.plugins = [