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

Frontend update #5

Merged
merged 76 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
9198cb8
Fix login button
Xpirix Aug 27, 2024
80e0ff5
Install webpack and Bulma CSS
Xpirix Aug 27, 2024
9ce48f0
Configure webpack with Django
Xpirix Aug 27, 2024
7c1dbf9
Add new header component
Xpirix Aug 28, 2024
719716f
Add footer, add menu items in second navbar
Xpirix Aug 28, 2024
8839ae8
Update fontawesome, fix footer
Xpirix Aug 28, 2024
cd02305
Add sustaining members section
Xpirix Aug 28, 2024
d920c4e
Init homepage improvement
Xpirix Aug 28, 2024
502b6d5
Fix bulma components style
Xpirix Aug 29, 2024
939ad08
Sidebar homepage update
Xpirix Aug 29, 2024
25a87c2
Finishing homepage UI update, implement all bulma sass from QGIS.org
Xpirix Aug 29, 2024
4f3506f
Plugins sample on the homepage limited to 5
Xpirix Aug 29, 2024
b71e69f
Init update plugins list UI
Xpirix Aug 29, 2024
86464a6
Finishing homepage UI update
Xpirix Aug 30, 2024
b38730b
Update plugin upload UI
Xpirix Sep 2, 2024
6ba019e
Plugin detail landing page UI
Xpirix Sep 2, 2024
0879740
Fix repo name typo
Xpirix Sep 3, 2024
8a922e3
Update plugin version tab UI
Xpirix Sep 3, 2024
55bb2fd
Finishing update on plugin detail landing page
Xpirix Sep 3, 2024
e5e274e
Init Update for plugin form UI
Xpirix Sep 3, 2024
10e3246
Plugin delete and token detail UI
Xpirix Sep 3, 2024
f046414
Revert danger color variable
Xpirix Sep 3, 2024
fb451d2
Fix requirements
Xpirix Sep 24, 2024
7dceb43
Save menu fixture
Xpirix Sep 24, 2024
d46eff4
Improving plugins list sidebar
Xpirix Sep 25, 2024
9cf3f27
Fix plugin tags modal
Xpirix Sep 25, 2024
8e916b1
Improve plugin details page
Xpirix Sep 25, 2024
fdcffe0
Fix main website url
Xpirix Sep 25, 2024
2e013f2
Use bulma for notification
Xpirix Sep 25, 2024
02b4153
Add is-light with is-danger classes
Xpirix Sep 25, 2024
8eba80e
Fix version manage icon color
Xpirix Sep 25, 2024
801bf48
Fix header responsiveness
Xpirix Sep 26, 2024
6fff449
Plugin list improvement
Xpirix Sep 26, 2024
6756cd1
Plugin detail version list table improvement
Xpirix Sep 26, 2024
c197bb9
Update design of feedback page
Xpirix Sep 26, 2024
a2a55aa
Update token management UI
Xpirix Sep 26, 2024
b80f01a
Update plugin version details UI
Xpirix Sep 27, 2024
58fa505
Update login page UI
Xpirix Sep 27, 2024
4c35241
Responsive plugin details and version detail improvement
Xpirix Sep 27, 2024
d1f617d
Clean bootstrap, add credits and license in footer
Xpirix Sep 27, 2024
81cef86
Increase waiting for starting container time in GH actions
Xpirix Sep 27, 2024
c312c26
Build containers before running in GH actions
Xpirix Sep 27, 2024
abc9cf6
Downgrade to django 4.2.15
Xpirix Sep 27, 2024
fa184e5
Downgrade to django 4.2.14
Xpirix Sep 27, 2024
428ab05
Revert django version in requirements
Xpirix Sep 27, 2024
0ff0dc2
Fix simplemenu fixture to fix unit tests
Xpirix Sep 28, 2024
ab1a7dc
Revert container waiting for start time in GH action
Xpirix Sep 28, 2024
f3477b6
Fix logo on the homepage
Xpirix Sep 28, 2024
30921e2
Add plugins grid list
Xpirix Oct 2, 2024
be6c7f7
Add loadmenu to production commands
Xpirix Oct 2, 2024
543d89e
Truncate long url in plugin detail
Xpirix Oct 2, 2024
6e6ceed
Show upload plugin button in mobile
Xpirix Oct 2, 2024
7a0ef15
Fix plugin card in mobile
Xpirix Oct 2, 2024
d29b2e3
Add admin button
Xpirix Oct 2, 2024
8e0b57a
Add a ribbon for new, featured and deprecated
Xpirix Oct 2, 2024
b7db36d
Fix login icon
Xpirix Oct 2, 2024
630be8d
Improve UI of search page
Xpirix Oct 3, 2024
0416d07
Sort the search result by download number
Xpirix Oct 3, 2024
f351e4e
Plugin list sorting options
Xpirix Oct 3, 2024
615ad8b
Fix plugins list sorting
Xpirix Oct 3, 2024
3731666
Check if author exists in plugin grid list
Xpirix Oct 3, 2024
3ee659e
Fix the plugins list table
Xpirix Oct 7, 2024
e5963ac
Move stable link to category menu
Xpirix Oct 7, 2024
e3729da
Add a description for the plugins list
Xpirix Oct 7, 2024
6bb0f60
Add a menu entry for documentation
Xpirix Oct 8, 2024
9bc61e8
Remove unused codes
Xpirix Oct 10, 2024
b566fb4
Fix login page style
Xpirix Oct 17, 2024
95e9d06
Improve the description of each list
Xpirix Oct 25, 2024
23aef96
Remove max-width content restriction for smaller screen
Xpirix Oct 25, 2024
a6b2976
Fix the date and stars in responsive mode
Xpirix Oct 25, 2024
5744c81
Add description for all plugins list
Xpirix Oct 25, 2024
b8ae92a
Fix experimental icon colors, remove tag style for qgis versions
Xpirix Oct 25, 2024
9f22dc2
Use Weighted Rating Formula for stars sorting
Xpirix Nov 4, 2024
62e55b1
Show number of pages in pagination
Xpirix Nov 4, 2024
a15c19b
Transform the get sustaining members tag to a scheduled job
Xpirix Nov 5, 2024
e4e8739
Add redirection for the planet and the hub websites
Xpirix Nov 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ jobs:
run: cp .env.template .env


- name: Run docker-compose build
run: docker compose build

- name: Run the containers
run: docker compose up -d db devweb

Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,12 @@ qgis-app/api/tests/*/
qgis-app/whoosh_index/
docker-compose.override.yml
.env

# Webpack
node_modules
qgis-app/static/bundles
qgis-app/package-lock.json
qgis-app/webpack-stats.json

# Sustaining members template
qgis-app/templates/flatpages/sustaining_members.html
10 changes: 5 additions & 5 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

## Development Environment

- Clone git repo `git clone https://github.com/qgis/QGID-Plugins-Website.git`
- Clone git repo `git clone https://github.com/qgis/QGIS-Plugins-Website.git`
- Run `$ pwd` in order to get your current directory
- Path to your repo should be `<your current directory>/QGID-Plugins-Website `
- Go to dockerize directory `cd QGID-Plugins-Website/dockerize`
- Path to your repo should be `<your current directory>/QGIS-Plugins-Website `
- Go to dockerize directory `cd QGIS-Plugins-Website/dockerize`

- Build and spin container
```bash
Expand Down Expand Up @@ -65,7 +65,7 @@ pre-commit install --config .pre-commit-config.yaml

### Setting up a remote interpreter in PyCharm

- PyCharm -> Preferences -> Project: QGID-Plugins-Website
- PyCharm -> Preferences -> Project: QGIS-Plugins-Website
- Click on the gear icon next to project interpreter -> add
- SSH Interpreter -> New server configuration
- Host : `localhost`
Expand Down Expand Up @@ -116,7 +116,7 @@ Now set these options:
filesystem and the filesystem in the remote (docker) host. Click the ellipsis
and add a run that points to your git checkout on your local host and the
/home/web directory in the docker host. e.g.
* **Local path:** <path to your git repo>/QGID-Plugins-Website/qgis-app
* **Local path:** <path to your git repo>/QGIS-Plugins-Website/qgis-app
* **Remote path:** /home/web/django_project
* click OK to save your run configuration

Expand Down
11 changes: 9 additions & 2 deletions dockerize/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,13 @@ exec:
@echo "------------------------------------------------------------------"
@docker compose -p $(PROJECT_ID) $(c)

loadmenu:
@echo
@echo "------------------------------------------------------------------"
@echo "Delete all simplemenu entries and load from fixtures/all_menu.json"
@echo "------------------------------------------------------------------"
@docker compose -p $(PROJECT_ID) exec uwsgi python manage.py clear_simplemenu
@docker compose -p $(PROJECT_ID) exec uwsgi python manage.py loaddata fixtures/all_menu.json
# ----------------------------------------------------------------------------
# D E V E L O P M E N T C O M M A N D S
# ----------------------------------------------------------------------------
Expand All @@ -222,7 +229,7 @@ devweb: db
@echo "------------------------------------------------------------------"
@echo "Running in DEVELOPMENT mode"
@echo "------------------------------------------------------------------"
@docker compose -p $(PROJECT_ID) up --no-deps -d devweb rabbitmq worker beat
@docker compose -p $(PROJECT_ID) up --no-deps -d devweb rabbitmq worker beat webpack

devweb-runserver: devweb
@echo
Expand All @@ -236,4 +243,4 @@ dbseed:
@echo "------------------------------------------------------------------"
@echo "Seed db with JSON data from /fixtures/*.json"
@echo "------------------------------------------------------------------"
@docker compose -p $(PROJECT_ID) exec devweb bash -c 'python manage.py loaddata fixtures/*.json'
@docker compose -p $(PROJECT_ID) exec devweb bash -c 'python manage.py loaddata fixtures/*.json'
4 changes: 4 additions & 0 deletions dockerize/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,7 @@ make devweb-runserver
make dbseed
```

- **loadmenu:** Clear all menu entries and load menu from JSON file at `fixtures/simplemenu.json`.
```sh
make loadmenu
```
15 changes: 14 additions & 1 deletion dockerize/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ services:
- ${QGISPLUGINS_STATIC_VOLUME}:/home/web/static:rw
- ${QGISPLUGINS_MEDIA_VOLUME}:/home/web/media:rw
- celerybeat-schedule:/home/web/celerybeat-schedule:rw
command: uwsgi --ini /uwsgi.conf
command: bash -c "npm install && npm run build && uwsgi --ini /uwsgi.conf"
depends_on:
- db
- rabbitmq
Expand Down Expand Up @@ -90,6 +90,19 @@ services:
networks:
internal:

webpack:
container_name: qgis-plugins-webpack
build:
context: ${PWD}/../
dockerfile: dockerize/docker/Dockerfile
target: dev
working_dir: /home/web/django_project
command: npm start
volumes:
- ../qgis-app:/home/web/django_project
- ${QGISPLUGINS_STATIC_VOLUME}:/home/web/static:rw
- ${QGISPLUGINS_MEDIA_VOLUME}:/home/web/media:rw

rabbitmq:
image: rabbitmq:3.7-alpine
hostname: rabbitmq
Expand Down
9 changes: 9 additions & 0 deletions dockerize/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ ADD dockerize/docker/REQUIREMENTS.txt /REQUIREMENTS.txt

RUN pip install --upgrade pip && pip install -r /REQUIREMENTS.txt

# Install NodeJS and bulma css webpack
RUN apt-get -qq update && apt-get -qq install -y --no-install-recommends wget && \
wget --no-check-certificate https://deb.nodesource.com/setup_20.x -O /tmp/node.sh && bash /tmp/node.sh && \
apt-get -qq update && apt-get -qq install -y nodejs build-essential

WORKDIR /home/web/django_project
COPY qgis-app/package.json /home/web/django_project/package.json
RUN npm install -g [email protected] && npm install -g [email protected] && npm install -g [email protected] && npm install

RUN mkdir -p /var/log/uwsgi

WORKDIR /home/web/django_project
Expand Down
4 changes: 4 additions & 0 deletions dockerize/docker/REQUIREMENTS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,7 @@ uwsgi~=2.0
freezegun~=1.4

sentry-sdk~=2.2
django-webpack-loader~=3.1

beautifulsoup4~=4.12
setuptools~=75.1
2 changes: 1 addition & 1 deletion dockerize/production/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN apt-get update && apt-get install -y libsasl2-dev python-dev libldap2-dev li

ARG BRANCH_TAG=develop
RUN mkdir -p /usr/src; mkdir -p /home/web && \
git clone --depth=1 git://github.com/qgis/QGID-Plugins-Website.git --branch ${BRANCH_TAG} /usr/src/plugins/ && \
git clone --depth=1 git://github.com/qgis/QGIS-Plugins-Website.git --branch ${BRANCH_TAG} /usr/src/plugins/ && \
rm -rf /home/web/django_project && \
ln -s /usr/src/plugins/qgis-app /home/web/django_project

Expand Down
4 changes: 2 additions & 2 deletions dockerize/scripts/renew-ssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# 2021-11-12 11:10:00 UTC
# ...etc

#25 11 * * * /bin/bash /home/web/QGID-Plugins-Website/dockerize/scripts/renew_ssl.sh > /tmp/ssl-renewal-logs.txt
#25 11 * * * /bin/bash /home/web/QGIS-Plugins-Website/dockerize/scripts/renew_ssl.sh > /tmp/ssl-renewal-logs.txt


docker compose -f /home/web/QGID-Plugins-Website/dockerize/docker-compose.yml -p qgis-plugins run certbot renew
docker compose -f /home/web/QGIS-Plugins-Website/dockerize/docker-compose.yml -p qgis-plugins run certbot renew
2 changes: 2 additions & 0 deletions dockerize/sites-enabled/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ if [ $# -eq 1 ]; then
echo "Run in prod mode"
CONF_FILE=prod.conf
ln -s /etc/nginx/sites-available/$CONF_FILE /etc/nginx/conf.d/$CONF_FILE
ln -s /etc/nginx/sites-available/redirections.conf /etc/nginx/redirections.conf
exec nginx -g "daemon off;"
;;
# Production SSL mode, run using uwsgi
[Pp][Rr][Oo][Dd][-][Ss][Ss][Ll])
echo "Run in prod SSL mode"
CONF_FILE=prod-ssl.conf
ln -s /etc/nginx/sites-available/$CONF_FILE /etc/nginx/conf.d/$CONF_FILE
ln -s /etc/nginx/sites-available/redirections.conf /etc/nginx/redirections.conf
exec nginx -g "daemon off;"
;;
esac
Expand Down
6 changes: 6 additions & 0 deletions dockerize/sites-enabled/prod-ssl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ server {
if ($http_user_agent ~* (360Spider|80legs.com|Abonti|AcoonBot|Acunetix|adbeat_bot|AddThis.com|adidxbot|ADmantX|AhrefsBot|AngloINFO|Antelope|Applebot|BaiduSpider|BeetleBot|billigerbot|binlar|bitlybot|BlackWidow|BLP_bbot|BoardReader|Bolt\ 0|BOT\ for\ JCE|Bot\ mailto\:craftbot@yahoo\.com|casper|CazoodleBot|CCBot|checkprivacy|ChinaClaw|chromeframe|Clerkbot|Cliqzbot|clshttp|CommonCrawler|comodo|crawler4j|Crawlera|CRAZYWEBCRAWLER|Curious|Custo|CWS_proxy|Default\ Browser\ 0|diavol|DigExt|Digincore|DIIbot|discobot|DISCo|DoCoMo|DotBot|Download\ Demon|DTS.Agent|EasouSpider|eCatch|ecxi|EirGrabber|Elmer|EmailCollector|EmailSiphon|EmailWolf|Exabot|ExaleadCloudView|ExpertSearchSpider|ExpertSearch|Express\ WebPictures|ExtractorPro|extract|EyeNetIE|Ezooms|F2S|FastSeek|feedfinder|FeedlyBot|FHscan|finbot|Flamingo_SearchEngine|FlappyBot|FlashGet|flicky|Flipboard|g00g1e|Genieo|genieo|GetRight|GetWeb\!|GigablastOpenSource|GozaikBot|Go\!Zilla|Go\-Ahead\-Got\-It|GrabNet|grab|Grafula|GrapeshotCrawler|GTB5|GT\:\:WWW|Guzzle|harvest|HMView|HomePageBot|HTTP\:\:Lite|HubSpot|icarus6|IDBot|id\-search|IlseBot|Image\ Stripper|Image\ Sucker|Indigonet|Indy\ Library|integromedb|InterGET|InternetSeer\.com|Internet\ Ninja|IRLbot|ISC\ Systems\ iRc\ Search\ 2\.1|jakarta|JetCar|JobdiggerSpider|JOC\ Web\ Spider|Jooblebot|kanagawa|KINGSpider|kmccrew|larbin|LeechFTP|libwww|Lingewoud|LinkChecker|linkdexbot|LinksCrawler|LinksManager\.com_bot|linkwalker|LinqiaRSSBot|LivelapBot|ltx71|LubbersBot|lwp\-trivial|Mail.RU_Bot|masscan|Mass\ Downloader|maverick|Maxthon$|Mediatoolkitbot|MegaIndex|MegaIndex|megaindex|MFC_Tear_Sample|Microsoft\ URL\ Control|microsoft\.url|MIDown\ tool|miner|Missigua\ Locator|Mister\ PiX|mj12bot|Mozilla.*Indy|Mozilla.*NEWT|MSFrontPage|msnbot|Navroad|NearSite|NetAnts|netEstate|NetSpider|NetZIP|Net\ Vampire|NextGenSearchBot|nutch|Octopus|Offline\ Explorer|Offline\ Navigator|OpenindexSpider|OpenWebSpider|OrangeBot|Owlin|PageGrabber|PagesInventory|panopta|panscient\.com|Papa\ Foto|pavuk|pcBrowser|PECL\:\:HTTP|PeoplePal|Photon|PHPCrawl|planetwork|PleaseCrawl|PNAMAIN.EXE|PodcastPartyBot|prijsbest|proximic|psbot|purebot|pycurl|QuerySeekerSpider|R6_CommentReader|R6_FeedFetcher|RealDownload|ReGet|Riddler|Rippers\ 0|rogerbot|RSSingBot|rv\:1.9.1|RyzeCrawler|SafeSearch|SBIder|Screaming|search.goo.ne.jp|SearchmetricsBot|search_robot|SemrushBot|Semrush|SentiBot|SEOkicks|SeznamBot|ShowyouBot|SightupBot|SISTRIX|sitecheck\.internetseer\.com|siteexplorer.info|SiteSnagger|skygrid|Slurp|SmartDownload|Snoopy|Sogou|Sosospider|spaumbot|Steeler|sucker|SuperBot|Superfeedr|SuperHTTP|SurdotlyBot|Surfbot|tAkeOut|Teleport\ Pro|TinEye-bot|TinEye|Toata\ dragostea\ mea\ pentru\ diavola|Toplistbot|trendictionbot|TurnitinBot|turnit|URI\:\:Fetch|Vagabondo|Vagabondo|vikspider|VoidEYE|VoilaBot|WBSearchBot|webalta|WebAuto|WebBandit|WebCollage|WebCopier|WebFetch|WebGo\ IS|WebLeacher|WebReaper|WebSauger|Website\ eXtractor|Website\ Quester|WebStripper|WebWhacker|WebZIP|Web\ Image\ Collector|Web\ Sucker|Wells\ Search\ II|WEP\ Search|WeSEE|Widow|WinInet|woobot|woopingbot|worldwebheritage.org|Wotbox|WPScan|WWWOFFLE|WWW\-Mechanize|Xaldon\ WebSpider|XoviBot|yacybot|Yahoo|YandexBot|Yandex|YisouSpider|zermelo|Zeus|zh-CN|ZmEu|ZumBot|ZyBorg) ) {
return 403;
}

# Redirect planet and hub resources to the new location
include redirections.conf;
}

location /metabase/ {
Expand Down Expand Up @@ -220,6 +223,9 @@ server {
return 403;
}

# Redirect planet and hub resources to the new location
include redirections.conf;

}


Expand Down
3 changes: 3 additions & 0 deletions dockerize/sites-enabled/prod.conf
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ server {
return 403;
}

# Redirect planet and hub resources to the new location
include redirections.conf;

}


Expand Down
6 changes: 6 additions & 0 deletions dockerize/sites-enabled/redirections.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
rewrite ^/planet$ https://planet.qgis.org permanent;
rewrite ^/styles(.*)$ https://hub.qgis.org/styles$1 permanent;
rewrite ^/geopackages(.*)$ https://hub.qgis.org/geopackages$1 permanent;
rewrite ^/models(.*)$ https://hub.qgis.org/models$1 permanent;
rewrite ^/wavefronts(.*)$ https://hub.qgis.org/wavefronts$1 permanent;
rewrite ^/layerdefinitions(.*)$ https://hub.qgis.org/layerdefinitions$1 permanent;
14 changes: 12 additions & 2 deletions qgis-app/custom_haystack_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,19 @@ def build_form(self, form_kwargs=None):

def get_results(self):
"""
Fetches the results
Fetches the search results and sorts them in descending order based on the 'downloads' attribute.
If the 'downloads' attribute is not present or the object is None, it defaults to 0.
"""
return self.form.searchqueryset
results = self.form.searchqueryset
sort_by = 'downloads'
results = sorted(
results,
key=lambda x: int(
getattr(x.object, sort_by)
) if x.object is not None else 0,
reverse=True # Reverse the sort order
)
return results


urlpatterns = [
Expand Down
14 changes: 14 additions & 0 deletions qgis-app/docs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from django.shortcuts import render
from django.utils.translation import gettext_lazy as _



def docs_publish(request):
"""
Renders the docs_publish page
"""
return render(
request,
"flatpages/docs_publish.html",
{},
)
Loading