Skip to content

Commit

Permalink
begin working on source cards
Browse files Browse the repository at this point in the history
  • Loading branch information
pessi-v committed Jul 4, 2024
1 parent ec39d2b commit 3f6f7ad
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 32 deletions.
2 changes: 1 addition & 1 deletion app/assets/stylesheets/components/_source.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.source_info {
border-top: var(--border);
border-bottom: var(--border);
}
}
75 changes: 47 additions & 28 deletions app/views/sources/_source.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,52 @@ css:
color: var(--color-primary);
}

.source_card {
width: 100%;
height: auto;
border: var(--border);
display: flex;
}

.half {
width: 50%;
}

= turbo_frame_tag source
p
strong
'Name:
= source.name

p
strong
'Url:
= source.url

p
strong
'Active:
= source.active

p
strong
'Show images:
= source.show_images

p
strong
'Last error status:
p.error
= source.last_error_status

= button_to "Edit", edit_source_path(source), method: :get
= button_to "Delete", source, method: :delete, form: {data: {turbo_confirm: "Deleting this source will destroy all of it's articles too. If you want to keep the articles, you should just deactivate the source."}}
.source_card
.half
h1
= source.name

p
= source.url

p
strong
'Active:
= source.active

p
strong
'Show images:
= source.show_images

p
strong
'Allow video:
= source.allow_video

p
strong
'Allow audio:
= source.allow_audio

p
strong
'Last error status:
p.error
= source.last_error_status

.half
= button_to "Change", edit_source_path(source), method: :get
= button_to "Unsubscribe", source, method: :delete, form: {data: {turbo_confirm: "Unsubscribing from this source will remove all of it's articles from the database. If you want to keep the articles, you should just deactivate the source."}}
6 changes: 3 additions & 3 deletions app/views/sources/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
= @article_counts_by_day[index]


.list_view_desktop
= turbo_frame_tag 'new_source'
= turbo_frame_tag 'sources'
= turbo_frame_tag 'sources'
.list_view_desktop
= turbo_frame_tag 'new_source'
= render @sources
/ - @sources.each do |source|
/ = link_to(source) do
Expand Down

0 comments on commit 3f6f7ad

Please sign in to comment.