module
Ktistec::ViewHelper::ClassMethods
Defined in:
views/view_helper.crConstant Summary
-
ACTOR_COLOR_COUNT =
12 -
NUMBERS_TO_WORDS =
{0 => "zero", 1 => "one", 2 => "two", 3 => "three", 4 => "four", 5 => "five", 6 => "six", 7 => "seven", 8 => "eight", 9 => "nine", 10 => "ten", 11 => "eleven", 12 => "twelve", 13 => "thirteen", 14 => "fourteen", 15 => "fifteen", 16 => "sixteen", 17 => "seventeen", 18 => "eighteen", 19 => "nineteen", 20 => "twenty"} -
PUBLIC =
"https://www.w3.org/ns/activitystreams#Public"
Instance Method Summary
- #activity_type_class(activity)
- #actor_icon(actor, classes = nil)
- #actor_states(object, author, actor, followed_actors)
- #actor_type(actor)
- #actor_type_class(actor)
-
#addressing(params, actor)
Derives visibility and to/cc addressing from the "visibility" param.
- #depth(object)
- #mention_page_mention_banner(env, mention, follow, count)
- #mention_states(object, actor)
-
#normalize_params(params : URI::Params) : Hash(String, String | Array(String))
Normalizes
paramsinto a consistent hash format. -
#normalize_params(params : Hash(String, JSON::Any::Type)) : Hash(String, String | Array(String))
Normalizes
paramsinto a consistent hash format. -
#notification_count_and_color(actor, since : Time | Nil)
Returns a tuple of {count, color, tooltip} for actor notifications.
-
#number_to_word(n : Int) : String
Converts an integer to its word representation.
- #object_data_attributes(object, author, actor, followed_hashtags, followed_mentions)
-
#object_partial(env, object, actor = object.attributed_to(include_deleted: true), author = actor, *, activity = nil, with_detail = false, as_context = false, show_quote = true, for_thread = nil, for_actor = nil, highlight = false)
Renders an ActivityPub object.
- #object_states(object)
- #object_type_class(object)
- #paginate(env, collection)
- #pagination_params(env)
- #quote_states(object, actor)
- #tag_page_tag_controls(env, hashtag, task, follow, count)
- #thread_page_thread_controls(env, thread, task, follow)
-
#visibility(actor, object)
Derives visibility from to/cc addressing.
- #wrap_filter_term(str)
Instance Method Detail
Derives visibility and to/cc addressing from the "visibility" param.
Normalizes params into a consistent hash format.
Normalizes params into a consistent hash format.
Returns a tuple of {count, color, tooltip} for actor notifications.
Converts an integer to its word representation.
Returns the word for numbers 0-20 and the number itself as a string for numbers outside that range.
Renders an ActivityPub object.
Parameters:
env: HTTP request environment.object: The ActivityPub object to render.actor: The actor who performed the activity (defaults to object'sattributed_to). May differ from author.author: The original author of the object (defaults toactor).activity: Optional activity containing this object (e.g., Like, Announce).with_detail: Renders expanded view with additional metadata.as_context: Indicates this object is being shown to provide context for (or is part of) the main content, not as the primary interactive element.show_quote: Whether or not to render quoted content (defaults to true).for_thread: Collection of objects in thread; enables thread view rendering.for_actor: Actor for whom view is being rendered.highlight: Whether or not to highlight this object in the feed.
Derives visibility from to/cc addressing.
If the object has explicit addressing, uses that. Otherwise, if the object is a reply, inherits from the parent: public posts are public, everything else is direct. Otherwise, defaults to public.