8000 Live refreshing for model, file, creator and collection pages using Turbo by Floppy · Pull Request #4132 · manyfold3d/manyfold · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Live refreshing for model, file, creator and collection pages using Turbo #4132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/models/collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ class Collection < ApplicationRecord
include PublicIDable
include Commentable

broadcasts_refreshes

acts_as_federails_actor(
username_field: :public_id,
name_field: :name,
Expand Down
2 changes: 2 additions & 0 deletions app/models/creator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ class Creator < ApplicationRecord
include PublicIDable
include Commentable

broadcasts_refreshes

acts_as_federails_actor username_field: :slug, name_field: :name, profile_url_method: :url_for

has_many :models, dependent: :nullify
Expand Down
2 changes: 2 additions & 0 deletions app/models/model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ class Model < ApplicationRecord
include Commentable
include Problematic

broadcasts_refreshes

acts_as_federails_actor(
username_field: :public_id,
name_field: :name,
Expand Down
2 changes: 2 additions & 0 deletions app/models/model_file.rb
Original file line number Diff line number Diff line change
10000 Expand Up @@ -6,6 +6,8 @@ class ModelFile < ApplicationRecord

extend Memoist

broadcasts_refreshes

SPECIAL_FILES = [
"datapackage.json"
]
Expand Down
1 change: 1 addition & 0 deletions app/views/collections/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<% end %>

<%= content_for :items do %>
<%= turbo_stream_from @collection %>
<div class="card mb-3 <%= "remote-actor" if @collection.remote? %>">
<div class="card-header"><%= @collection.model_name.human %></div>
<div class="card-body row">
Expand Down
1 change: 1 addition & 0 deletions app/views/creators/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<% end %>

<%= content_for :items do %>
<%= turbo_stream_from @creator %>
<div class="card mb-3 <%= "remote-actor" if @creator.remote? %>">
<div class="card-header"><%= @creator.model_name.human %></div>
<div class="card-body row">
Expand Down
1 change: 1 addition & 0 deletions app/views/model_files/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<% end %>

<%= render partial: "breadcrumb" %>
<%= turbo_stream_from @file %>
<h1><%= @file.name %></h1>

<div class="row row-cols-2">
Expand Down
1 change: 1 addition & 0 deletions app/views/models/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<% end %>

<% content_for :page_header do %>
<%= turbo_stream_from @model %>
<h1>
<a contenteditable="plaintext-only"
data-controller="editable"
Expand Down
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# require "action_mailbox/engine"
# require "action_text/engine"
require "action_view/railtie"
# require "action_cable/engine"
require "action_cable/engine"
# require "rails/test_unit/railtie"

require "rack/contrib"
Expand Down
Loading
0