diff --git a/app/assets/stylesheets/asciicasts.sass b/app/assets/stylesheets/asciicasts.sass index a81cfc5..0ca7097 100644 --- a/app/assets/stylesheets/asciicasts.sass +++ b/app/assets/stylesheets/asciicasts.sass @@ -91,7 +91,7 @@ h2 font-size: 20px - .share-modal + .modal-dialog max-width: 900px width: initial diff --git a/app/presenters/asciicast_page_presenter.rb b/app/presenters/asciicast_page_presenter.rb index 24cf952..8811734 100644 --- a/app/presenters/asciicast_page_presenter.rb +++ b/app/presenters/asciicast_page_presenter.rb @@ -4,6 +4,8 @@ class AsciicastPagePresenter attr_reader :routes, :asciicast, :current_user, :policy, :playback_options + delegate :download_filename, to: :asciicast, prefix: true + def self.build(routes, asciicast, current_user, playback_options) decorated_asciicast = asciicast.decorate policy = Pundit.policy(current_user, asciicast) @@ -115,6 +117,10 @@ class AsciicastPagePresenter asciicast.featured? end + def can_replay_in_terminal? + asciicast.version > 0 + end + private def author diff --git a/app/views/asciicasts/_download.html.erb b/app/views/asciicasts/_download.html.erb new file mode 100644 index 0000000..d67da11 --- /dev/null +++ b/app/views/asciicasts/_download.html.erb @@ -0,0 +1,57 @@ +