best-microphone-15927
08/03/2022, 1:42 AMrake app:avo:build-assets
there to get the updated CSS in my app.lemon-wall-20836
08/03/2022, 6:40 AMlemon-wall-20836
08/03/2022, 6:41 AMbest-microphone-15927
08/03/2022, 12:49 PMbest-microphone-15927
08/03/2022, 12:50 PMlemon-wall-20836
08/03/2022, 7:09 PMlemon-wall-20836
08/03/2022, 7:09 PMlemon-wall-20836
08/03/2022, 7:09 PMlemon-wall-20836
08/03/2022, 7:09 PMlemon-wall-20836
08/03/2022, 7:10 PMbest-microphone-15927
08/04/2022, 1:42 PMbest-microphone-15927
08/04/2022, 1:43 PMmodule NavigationLabelWithCount
def navigation_label
<<-HTML
<div class="w-full flex justify-between pr-3">
<div>#{plural_name}</div>
<div>#{resource_count_html}</div>
</div>
HTML
.html_safe
end
private
def resource_count_html
c = resource_count
return if c == 0
<<-HTML
<span class="#{resource_count_tailwind_classes(c)}">
#{resource_count}
</span>
HTML
end
def resource_count
resolve_query_scope.call(model_class: model_class).count
end
def resource_count_tailwind_classes(c)
classes = %w(
text-white
px-2
py-0.5
text-xs
rounded-full
)
if c == 0
classes << "bg-gray-300"
else
classes << "bg-blue-500"
end
classes.join(" ")
end
end
best-microphone-15927
08/04/2022, 1:44 PMinclude NavigationLabelWithCount
lemon-wall-20836
08/04/2022, 2:30 PMlemon-wall-20836
08/04/2022, 2:30 PMlemon-wall-20836
08/04/2022, 2:30 PMlemon-wall-20836
08/04/2022, 2:31 PMbest-microphone-15927
08/05/2022, 1:11 PMlemon-wall-20836
08/05/2022, 1:12 PMlemon-wall-20836
08/05/2022, 1:12 PMnavigation_label
to do what you need it to dolemon-wall-20836
08/05/2022, 1:13 PMlemon-wall-20836
08/05/2022, 1:13 PMlemon-wall-20836
08/05/2022, 1:13 PMbest-microphone-15927
08/05/2022, 1:27 PMnavigation_label
changes/goes away in the future. I don't remember whether it was a documented method or whether I just looked through the Avo source code and said "ah, I can override that method and have the outcome I need".
I appreciate the kind appraisal! I think you're doing a great job of running Avo and you present such a positive and welcoming attitude, and Avo just keeps getting better. I'm at the outset of a significant project build for a client, and I'm trying to leverage Avo for nearly all of the "business user" functionality. I'll be getting into the really custom needs in the next week or two, and expect I'll be getting deep into Custom Tools and Resource Tools. I'll keep an eye out for any types of needs that aren't immediately or easily met by the available customization options, and maybe they'll be good material for feedback. When my work load becomes a bit less intense, I'd love to contribute back to Avo with some code.lemon-wall-20836
08/05/2022, 1:30 PMlemon-wall-20836
08/05/2022, 1:31 PMlemon-wall-20836
08/05/2022, 1:31 PMlemon-wall-20836
08/05/2022, 1:32 PMlemon-wall-20836
08/05/2022, 1:32 PMlemon-wall-20836
08/05/2022, 1:33 PMlemon-wall-20836
08/05/2022, 1:33 PMlemon-wall-20836
08/05/2022, 1:33 PM