Git Product home page Git Product logo

content-manager's People

Contributors

ianlawrence avatar jasper-lyons avatar

Watchers

 avatar  avatar  avatar

Forkers

staskoval

content-manager's Issues

Clean up database when views implementations change

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.

Allow wrapping views in a layout.

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?

Allow content views to have developer assigned names.

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?

Allow non controller_action chunks / views

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.

Migrate away from helper based approach.

Currently the cm method is made available through the Application Helper. Instead this should be provided as a helper through include ContentManager::Controller.

Empty values in test databases cause test failures, what to do?

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.

Allow Template Selection from Dashboard

  • Check the controller_action associated with the view (If any)
  • Find all associated templates
  • Allow an active template to be selected from those available and stored in the db
  • Provide the active template to be accessed from the controller via

Make all content records appear on project load

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.