Camaleon-CMS: How to disable media files edition - ruby-on-rails

Is there a way to disable the media items edit button? Either in the Camaleon configuration or by using a hook... In my case, the user can only upload images and use them, but cannot edit them!
Thanks!

in the current version you can do it by adding a css style using the hook "admin_before_load".
app/apps/themes/my_theme/config/config.json
"hooks": {
"admin_before_load": ["my_function_admin_before_load"],
....
}
app/apps/themes/my_theme/main_helper.rb
def my_function_admin_before_load
append_asset_content('<style>#cama_media_gallery .media_item .edit_item{display: none;}</style>')
end
In current development version I added two hooks "file_manager_edit_file" and "file_manager_del_file"
Regards!

Related

Disable Quasar's default CSS

Is there any way to disable the default quasar.css which comes with a Quasar app?
It's almost 12000 lines long and I don't plan on using any of it. I can't find anything which mentions how you could do this, so I'm assuming it can't be done.
The solution I've got is for quasar v2, but I am pretty sure it should work with v1 too.
The end result is straighforward:
// quasar.config.js
build: {
chainWebpack (chain) {
chain.resolve.alias.set('quasar/dist/quasar.css', false)
chain.resolve.alias.set('quasar/dist/quasar.prod.css', false)
chain.module.rule('sass').exclude.add(path.resolve(__dirname, '../../node_modules/quasar/dist/quasar.sass'))
chain.module.rule('scss').exclude.add(path.resolve(__dirname, '../../node_modules/quasar/dist/quasar.scss'))
}
}
The chain.resolve.alias.set is taking care of import 'quasar/dist/quasar.css' in the .quasar/client-entry.js file. For a further explanation see https://webpack.js.org/configuration/resolve/#resolvealias
Setting resolve.alias to false will tell webpack to ignore a module.
The chain.module.rule part disables processing of sass/scss. Note that ../../node_modules path will need amending if you don't use workspaces (https://docs.npmjs.com/cli/v7/using-npm/workspaces or https://classic.yarnpkg.com/lang/en/docs/workspaces/).
Note: don't use IgnorePlugin as the imported module will be removed during the build (see https://github.com/webpack/webpack/issues/2858)
Another note: I only tested this in SPA mode, but will update the answer if I come across any problems while testing other modes.
//quasar.conf.js Quasar plugins
plugins: [],
removeDefaultCss: true

How disable LoadingBar of Quasar completely?

Is it possible to disable the LoadingBar of Quasasr completely? It's loading with every AJAX request, but I have own solution for it.
Source:
https://quasar.dev/quasar-plugins/loading-bar
WARNING
When using the UMD version of Quasar, all components, directives and
plugins are installed by default. This includes LoadingBar. Should you
wish to disable it, specify loadingBar: { skipHijack: true } (which
turns off listening to Ajax traffic).
Link - https://quasar.dev/quasar-plugins/loading-bar#Installation
Set skipHijack to true for disabling QAjaxBar.

How to edit my openedx home page?

The Home page presents a default text :
Welcome to the Open edX® platform! It works! This is the default
homepage for this Open edX instance.
Where to go to edit this content ?
Disclaimer : found these solutions online but I did not implemented them. I'am summarizing them here for convenience and later testing. (Source discussion)
There are 2 ways to change you page contents.
1. Manually
If you want to manually update the code, edit the main pages are:
LMS:
edx-playform/lms/templates/main.html
CMS:
edx-playform/cms/templates/base.html
edx-playform/cms/templates/widgets/header.html
2. Via a theme and its edition
Get code in : git clone https://github.com/Stanford-Online/edx-theme /edx/app/edxapp/themes/
Rename scss : mv _default.scss edx-theme.scss
In lms.env.json, set "USE_CUSTOM_THEME": true " , "THEME_NAME": "edx-theme" in lms.env.json
Edit /edx/app/edxapp/edx-platform/lms/templates/index.html

translations using mediaelementjs

How does the auto translations:['es','ar','yi','zh-cn'] work with mediaelement player
I tried the suggestion -
$('audio,video').mediaelementplayer({
// automatically create these translations on load
translations:['es','ar','yi','zh-cn'],
// allow the user to add additional translations
translationSelector: true,
// start with English automatically turned on
startLanguage: 'en'
});
Sorry, Google has removed their translation API so this was pulled from MediaElement.js

TYPO3 RTE (htmlarea) - How can I disable options on Link Wizard (mail,file, etc.)

in Backend TYPO3: How can I disable one of these options on RTE (htmlarea), when the editor click on the LINK-Button (anchor). The Link Wizard starts in new window and the editor can choose the link to a page, folder, mail or ext. website.
I want to remove some of these options. Only "Page" and "Mail" will be allowed.
I thought it was on the pageconfig.ts
RTE.default.blindlinkoptions = spec,url
But it doesn't work. Anyone an idea? Thanks.
There it is:
RTE.default.buttons.link.options.removeItems = page,file,url,mail,spec, folder
You could try this:
RTE.default.FE.classesAnchor.default.url >
RTE.default.FE.classesAnchor.default.file >
or this, or both:
RTE.default.FE.classesAnchor := removeFromList(internal-link,
internal-link-new-window, mail)
I'm not so sure about this solutions. I just looked the pathes up in the Backend in the Info module under PageTSConfig.

Resources