releaseplatform / content-manager Goto Github PK
View Code? Open in Web Editor NEWSuper simple content mangement for developers.
License: MIT License
Super simple content mangement for developers.
License: MIT License
Something like providing a configurable function, that will accessible on the main_app's application controller. We can then use this to authenticate a user who is allowed to edit the content.
When I for example moved friends_show_content -> friends_index_content there old show data was left lying around.
We should delete it and perhaps offer some way for the information to be cloned into the new view content.
Make no assumptions about it, just provide a config variable that is the name of the layout and default to none.
layout ContentManager.layout unless ContentManager.layout.nil?
Currently we take the parts of the defining class without Content
, lowercase it and use that. e.g.
class ViewIndexContent < ContentBase; end
Would turn into the name viewindex
, which for users is pretty unintelligible unless they regularly get to play with the code base.
Instead we should provide a class method that allow the view name to be set, either through:
name 'ViewIndex'
or alias 'ViewIndex'
or perhaps both?
The layout should be a action specific css file that manages the pixel positioning of the elements of the template.
To use a custom view of content atm a user needs to instantiate an instance of that content presenter, attach it to the controller and then call it in the view.
We could allow a cache like DSL where user wrap calls to 'cm' inside a custom chink / view.
E.g.
content_view :social do
cm :twitter_message
end
Which would allow people to break out of the default content view and easily use another.
Currently the cm
method is made available through the Application Helper. Instead this should be provided as a helper through include ContentManager::Controller
.
So we throw an error when there are not values in the db or defaults for content_keys. Dev's could just provide default values for everything (potentially good practice) but it feels a bit to boiler plate?
The other option is to just turn off that when in the test environment?
Or obviously to hide it behind a config value.
Methods are proxied through fine but instance variables are broken.
A suggested fix would be copying all of the instance variables onto the proxy object when executing the template block.
Make /
point to /views/
controller_action
associated with the view (If any)Currently, when you load up the project you will be greeted by a list of all of the views used in the admin ui of content_manager. These should be turned off by default and a config option made available to turn them on.
Currently, when first loading a project with content_manager newly installed, views are created as and when rails loads them. Ideally these should be created as soon as the new project loads.
This could be achieved by forcing rails to eager load classes deriving ContentBase (which is hard if those classes have not been loaded yet). This could be achieved by:
Having a strict file naming and looking for files that match that name:
Dir["#{Rails.root}/**/*content.rb
Another option is to move away from sub classing and have all content keys allocated in .yml files, somewhere like config/content.yml
containing lines like:
views:
index:
view_title: "default"
show:
back_button: "default"
This could just be an extension of the sub classing, e.g: we read the content.yml (or multiple for larger projects), create classes that subclass ContentBase
and call content_key for each key: string pair in the yml file.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.