Skip to content

Commit

Permalink
Merge pull request #197 from openSUSE/raw
Browse files Browse the repository at this point in the history
Update the stylesheet and introduce the raw url
  • Loading branch information
hellcp authored Jun 18, 2024
2 parents f2261e2 + 255c6bb commit acb2cf5
Show file tree
Hide file tree
Showing 31 changed files with 53 additions and 3,870 deletions.
10 changes: 8 additions & 2 deletions app/controllers/pastes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# The endpoints and pages for pastes
# TODO: Implement authentication from the outside
class PastesController < ApplicationController
before_action :set_paste, only: %i[show destroy]
before_action :set_paste, only: %i[show destroy raw]
after_action :verify_authorized, except: :index
after_action :verify_policy_scoped, only: :index
# Set up activestorage for development
Expand Down Expand Up @@ -51,10 +51,16 @@ def destroy
end
end

def raw
authorize @paste, :show?

redirect_to @paste.content.attachment.url
end

private

def set_paste
@paste = Paste.find_by(permalink: params[:permalink])
@paste = Paste.find_by(permalink: params[:paste_permalink] || params[:permalink])

redirect_to pastes_url, alert: t(:paste_not_found) unless @paste
end
Expand Down
20 changes: 0 additions & 20 deletions app/themes/openSUSE/assets/stylesheets/_alert.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,6 @@
border-width: 0 0 0 4px;
color: inherit;

&.alert-success {
border-color: $success;
background-color: transparentize($success, 0.8);
}

&.alert-info {
border-color: $info;
background-color: transparentize($info, 0.8);
}

&.alert-warning {
border-color: $warning;
background-color: transparentize($warning, 0.8);
}

&.alert-danger {
border-color: $danger;
background-color: transparentize($danger, 0.8);
}

> p,
> ol,
> ul,
Expand Down
Loading

0 comments on commit acb2cf5

Please sign in to comment.