markmercedes / krudmin Goto Github PK
View Code? Open in Web Editor NEWA Framework on top of Rails engine that provides easy ways to manage your backend data
License: MIT License
A Framework on top of Rails engine that provides easy ways to manage your backend data
License: MIT License
class AddButton < Button::Base
def initialize(policy, action_path)
@policy, @action_path = policy, action_path
end
def to_s
= link_to(new_resource_path, class: 'btn btn-success') do
%i.fa.fa-plus
= t('krudmin.actions.add_new')
end
def render
to_s if policy.new?
end
end
AddButton.for(policy, new_resource_path)
create corresponding view helpers for buttons, this will prevent the need of invoking full names for button classes inside the views
= Krudmin::ActionButtons::AddButton.new(self, new_resource_path)
= add_button(self, new_resource_path)
After adding a new controller inheriting Krudmin:CustomController
and no views created yet,
the following error is shown, instead of a more guiding error about the resource missing:
And it is actually misleading because Krudmin:CustomController
is not supposed to be controlled by a ResourceManager, yet the error says is looking for one.
Constant that contains the presentation logic:
PRESENTATION_METADATA
Concept:
PRESENTATION_METADATA = {
general: { label: "General", class: 'col-lg-4 col-md-6 col-sm-12', partial_form: "/admin/custom_partial"},
}
This kind of controllers will consume data from a given resource manager and will provide read only access for the data wrapped inside of the resource.
Date fields not returning default value. Fixed on #11
Add a DISPLAY_ATTRIBUTES
to the resource manager in order to control which fields appear in the show page.
Currently , you have to specify the attributes in the EDITABLE_ATTRIBUTES
and LISTABLE_ATTRIBUTES
Given that i want to search for an entity's id property, the framework currently removes the id
from the field name, i want to be able to explicitly say entity id
on the search panel.
as an example see the lister
field on the bottom right of the following image
a possible DSL could be
SEARCHABLE_ATTRIBUTES = [:title, :id, :source, :expires_on, :category_id, :area_id, :lister_first_name, :lister_last_name, lister_id: "Lister ID"]
or maybe even pass down options
SEARCHABLE_ATTRIBUTES = [:title, :id, :source, :expires_on, :category_id, :area_id, :lister_first_name, :lister_last_name, lister_id: {label: 'Lister ID'}]
Add a flag for Krudmin:Fields:HasMany
that does not allow the _destroy
attribute and no delete button is render on the _has_many_fields
partial.
e.g:
{format: this.data('date-format')}
$('.datetimepicker').daterangepicker(
$.extend({
timePicker: true,
locale: {
format: "MM/DD/YYYY hh:mm A"
}
}, inputDefaults)
, function(inputValue) {
this.element.val(inputValue.format("MM/DD/YYYY hh:mm A"));
});
$('.datepicker').daterangepicker(
$.extend({
locale: {
format: "MM/DD/YYYY"
}
}, inputDefaults),
function(inputValue) {
this.element.val(inputValue.format("MM/DD/YYYY"));
}
);
view_context.render(partial: "#{theme_path}/partial_name", locals: {foo: :bar})
Current implementation render default rails controls for date and datetime fields.
Allows to configure the theme used, by default the theme under the application will be used, a configuration option should be provided in order to change the default theme.
Organize theme files under logical theme structure
Add renderers for each field type and allow to specify a custom renderer for a specific field from the resource manager.
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.