Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
17640a4
refactor: CMD-97 breadcrumbs for news via 1 template
wesleyboar Jul 16, 2024
55dc431
idea: TUP-706 4.a.i change RSS feed render ⚠️
wesleyboar Jul 19, 2024
de81256
refactor: TUP-706 rename and document blog block
wesleyboar Jul 22, 2024
463871f
feat: TUP-706 render page with only (*_)content
wesleyboar Jul 22, 2024
8038de7
fix: TUP-706 disable failed djangocms_blog_c… url
wesleyboar Jul 22, 2024
89a160c
idea!: TUP-706 render blog base via custom app
wesleyboar Jul 22, 2024
db234df
feat!: TUP-706 render remote url content
wesleyboar Jul 22, 2024
d7f10ae
chore: TUP-706 move an import higher in file
wesleyboar Jul 22, 2024
ec10c85
feat: TUP-706 render remote url via setting
wesleyboar Jul 22, 2024
223b72a
fix: TUP-706 render blog customizations
wesleyboar Jul 22, 2024
aaa971e
Merge branch 'main' into feat/tup-706-news-on-other-sites
wesleyboar Jul 22, 2024
646b26d
fix: TUP-706 render feed ⚠️
wesleyboar Jul 22, 2024
aa709fd
docs: TUP-706 describe each URL's problem
wesleyboar Jul 22, 2024
26a9412
docs: TUP-706 describe each URL goal and status
wesleyboar Jul 22, 2024
4e78038
feat: TUP-706 A.1+3.c remote markup via template
wesleyboar Jul 22, 2024
17380fb
Merge branch 'main' into feat/tup-706-news-on-other-sites
wesleyboar Jul 23, 2024
a461693
feat: TUP-706 A.1.a. support BLOG_MULTISITE
wesleyboar Jul 23, 2024
6bece39
fix: TUP-706 A.1.a. cannot login to site 2
wesleyboar Jul 23, 2024
e6bdbbf
Revert "fix: TUP-706 A.1.a. cannot login to site 2"
wesleyboar Jul 23, 2024
4f9888b
Merge branch 'main' into feat/tup-706-news-on-other-sites
wesleyboar Sep 10, 2024
104fe71
docs: TUP-706 feed status (ineffectual)
wesleyboar Sep 10, 2024
dfc9fa4
docs: tup-706 urls for local and remote
wesleyboar Sep 10, 2024
cd59bf9
feat(poc): TUP-706 get news from remote url
wesleyboar Sep 11, 2024
6995c44
chore: remove test print statements from feeds
wesleyboar Sep 11, 2024
db79397
core: clean up views
wesleyboar Sep 11, 2024
a6d8551
core: clean up views more
wesleyboar Sep 11, 2024
82027fe
refactor: switch order of methods in view class
wesleyboar Sep 11, 2024
0c94401
feat: TUP-706 edit links via get_client_markup()
wesleyboar Sep 11, 2024
49edd04
fix: TUP-706 broken links
wesleyboar Sep 12, 2024
22c6ac3
Merge branch 'main' into feat/tup-706-news-on-other-sites
wesleyboar Sep 13, 2024
c1659f2
chore: remove SITE_ID middleware
wesleyboar Sep 13, 2024
6cd5a77
chore: delete cruft from messy merge
wesleyboar Sep 13, 2024
7d56f8d
refactor: djangocms_blog_custom… → remote_content
wesleyboar Sep 13, 2024
06304c9
Merge branch 'main' into feat/tup-706-news-on-other-sites
wesleyboar Sep 13, 2024
92ed5de
fix: load raw markup from remote site
wesleyboar Sep 18, 2024
2fc6f36
fix: load raw markup from remote site
wesleyboar Sep 18, 2024
98b13e7
style: move parameter
wesleyboar Sep 18, 2024
fef2cb3
feat!: change mage source not article link
wesleyboar Sep 18, 2024
deffe74
fix: links to articles should open on source
wesleyboar Sep 19, 2024
b0b59df
Merge branch 'main' into feat/tup-706-news-on-other-sites
wesleyboar May 8, 2025
e11eb5b
docs: how to test PR #868
wesleyboar May 9, 2025
75d8e97
docs: fix how to test PR #868
wesleyboar May 9, 2025
cf32ee2
feat: (TEMPORARY) dynamic site id
wesleyboar May 9, 2025
8373801
docs: polish how to test PR #868
wesleyboar May 9, 2025
5189c4a
fix: use settings for paths
wesleyboar May 9, 2025
13e3ef0
feat: configurable template
wesleyboar May 9, 2025
a78d398
refactor!: define template in URL not settings
wesleyboar May 9, 2025
b532761
refactor!: fix rel href paths, lose template param
wesleyboar May 9, 2025
2cafa90
fix: tempalte param (and other cms params)
wesleyboar May 9, 2025
dacf89f
docs: known issues
wesleyboar May 9, 2025
ad4039a
refactor: use beautiful soup not regex
wesleyboar May 9, 2025
acfccaa
docs: no major known issues
wesleyboar May 9, 2025
9e8e26b
refactor: rename a function
wesleyboar May 9, 2025
9db425f
chore; remove dumb comments
wesleyboar May 9, 2025
cdf1b77
fix: support cms params in all href values
wesleyboar May 9, 2025
db48919
fix: do not try to load link rel=stylesheets
wesleyboar May 9, 2025
ca631a0
refactor: simplify href/src replacements
wesleyboar May 9, 2025
bdd3ea9
docs: comments
wesleyboar May 9, 2025
17cfe94
Merge branch 'main' into feat/tup-706-news-on-other-sites
wesleyboar May 12, 2025
17cedbd
Merge branch 'main' into feat/tup-706-news-on-other-sites
wesleyboar May 14, 2025
8199707
docs: how to convert (temp file)
wesleyboar May 14, 2025
203af29
feat!: use repo Core-CMS-Plugin-Remote-Content
wesleyboar May 14, 2025
0cbdaf0
refactor: replace internal app with external app
wesleyboar May 15, 2025
2447d25
refactor: remove middleware
wesleyboar May 15, 2025
961e0f4
feat: update plugin
wesleyboar May 15, 2025
9129d24
chore: delete outdated code
wesleyboar May 15, 2025
60235a4
chore: update plugin (get improvements)
wesleyboar May 16, 2025
ec03c50
chore: update plugin (get better admin ui)
wesleyboar May 19, 2025
8d0c41c
chore: update plugin (get better, refactored code)
wesleyboar May 19, 2025
8ba4ac8
test: djangocms_tacc_remote_content
wesleyboar May 20, 2025
4c0749d
chore: djangocms_tacc_remote_content via release
wesleyboar May 20, 2025
2f0fa8a
Merge branch 'main' into feat/tup-706-news-on-other-sites
wesleyboar May 20, 2025
6eaa054
fix: remove extraneous dependency
wesleyboar May 20, 2025
7db0062
fix: absolute urls for links by default
wesleyboar May 22, 2025
bcee891
fix: keep relative urls via new settings
wesleyboar May 22, 2025
37ae28a
feat: do not passthrough cms query params
wesleyboar May 22, 2025
a7148a0
chore: v0.2.0
wesleyboar May 23, 2025
e6edc4a
refactor!: rename raw.html to bare.html
wesleyboar May 27, 2025
209213b
chore: rename raw.html to bare.html in plugin
wesleyboar May 27, 2025
23d7dfd
Merge branch 'main' into feat/tup-706-news-on-other-sites
wesleyboar May 27, 2025
547dd7a
chore: rename bare.html to plain.html in plugin
wesleyboar May 27, 2025
0855fec
chore: v0.3.0
wesleyboar May 27, 2025
72e88cf
chore: TACC/Core-CMS-Plugin-Remote-Content
wesleyboar May 27, 2025
362291e
fix: rename bare.html file to plain.html
wesleyboar May 27, 2025
8d92094
chore: v0.3.1
wesleyboar May 27, 2025
8b0e222
chore: v0.3.2
wesleyboar May 27, 2025
15b85f0
chore: v0.3.3
wesleyboar May 27, 2025
c0bff6a
feat: let admin change how to open external news
wesleyboar May 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 59 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ djangocms-picture = "3.0.0"
djangocms-snippet = "3.0.0"
djangocms-style = "3.0.0"
djangocms-tacc-image-gallery = {git = "https://github.com/TACC/Core-CMS-Plugin-Image-Gallery.git", rev = "v0.1.4"}
djangocms-tacc-remote-content = {git = "https://github.com/TACC/Core-CMS-Plugin-Remote-Content.git", rev = "v0.3.3"}
djangocms-tacc-system-monitor = {git = "https://github.com/TACC/Core-CMS-Plugin-System-Monitor.git", rev = "v0.3.0"}
djangocms-text-ckeditor = "^5.1"
djangocms-transfer = "1.0.1"
Expand Down
4 changes: 2 additions & 2 deletions taccsite_cms/settings_custom.example.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
('standard.html', 'Standard'),
('fullwidth.html', 'Full Width'),

# WARNING: Not intuitive to unset, so only enable as needed e.g. serve Blog such that it can be injected into another CMS
# ('raw.html', 'Raw'),
# WARNING: Unintuitive, so only enable as needed e.g. TACC/Core-CMS#868
# ('plain.html', 'Plain'),
)

########################
Expand Down
46 changes: 46 additions & 0 deletions taccsite_cms/static/site_cms/js/modules/manageExternalArticles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/**
* Get URL of external web article of which internal news article represents
* @param {HTMLElement} article - The article within which to find external URL
* @return {string|null} - The URL of the external article
*/
export function getArticleExternalURL(article) {
if (!article) {
console.warn('No article found', article);
return;
}

// The admin of news promises leads/abstracts will only have 1 external link
const contentLink = article.querySelector('.blog-lead a[href^="http"]');
const isExternalLink = contentLink.hostname !== window.location.hostname;
const URL = isExternalLink ? contentLink.href : null;

return URL;
}

/**
* Modify article links to point to external URLs based on tag name
* @param {string} [extTagName='external'] - A tag that has been set on articles to select
*/
export function changeHowExternalArticleOpens(extTagName = 'external') {
const articles = document.querySelectorAll(
`.blog-list article.has-blog-tag-${extTagName}`
);

console.debug(`Found ${articles.length} article(s) with tag "${extTagName}"`, articles );

[ ...articles ].forEach( article => {
const externalLinkUrl = getArticleExternalURL( article );

if ( externalLinkUrl ) {
const links = article.querySelectorAll(':is(h3, footer) a');

// all links to the post should open external URL in new window
[ ...links ].forEach( link => {
console.debug(`Changed article link to "${externalLinkUrl}"`, link );

link.href = externalLinkUrl;
link.setAttribute('target', '_blank');
});
}
});
}
File renamed without changes.
16 changes: 16 additions & 0 deletions taccsite_cms/templates/snippets/news/open-external-articles.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{# To open external news article, instead of internal news article #}
{% load static %}

<script id="blog-list-link-to-external-site" type="module">
import { changeHowExternalArticleOpens } from '{% static "site_cms/js/modules/manageExternalArticles.js" %}';

// The `{{html}}` is whatever user entered into snippet "HTML:" field
const parameter = '{{html}}';

// Only certain articles should support this feature, cuz
// articles might include external links on internal article
const extTagName = parameter ? parameter : `external`;

// Only care about articles with the given tag
changeHowExternalArticleOpens(extTagName);
</script>