|
| 1 | +<div class="container mx-auto px-0 sm:px-4 py-4 md:py-8"> |
| 2 | + <%= render "shared/page_title", title: "Showcase", subtitle: "Rate this project using Majority Judgment" %> |
| 3 | + |
| 4 | + <div class="bg-[#F6DBBA] sm:rounded-xl p-4 mx-2 sm:mx-auto max-w-240"> |
| 5 | + <div class="flex items-start gap-4"> |
| 6 | + <div class="h-20 w-20 flex-shrink-0"> |
| 7 | + <%= image_tag @project.banner, alt: @project.title, class: "w-full h-full object-cover rounded-lg", loading: "lazy" %> |
| 8 | + </div> |
| 9 | + <div class="flex-grow min-w-0"> |
| 10 | + <h3 class="text-xl sm:text-3xl mb-1 truncate"><%= @project.title %></h3> |
| 11 | + <div class="text-base sm:text-lg text-gray-600"> |
| 12 | + <div><%= @project.description %></div> |
| 13 | + </div> |
| 14 | + <div class="grid grid-cols-1 sm:flex sm:flex-wrap justify-center gap-3 sm:gap-4 mt-3"> |
| 15 | + <% if @project.demo_link.present? %> |
| 16 | + <%= render C::StyledButton.new( |
| 17 | + text: "Demo", |
| 18 | + link: @project.demo_link, |
| 19 | + link_target: "_blank", |
| 20 | + icon: "world.svg", |
| 21 | + onclick: "event.stopPropagation()") %> |
| 22 | + <% end %> |
| 23 | + <% if @project.repo_link.present? %> |
| 24 | + <%= render C::StyledButton.new( |
| 25 | + text: "Repository", |
| 26 | + link: @project.repo_link, |
| 27 | + link_target: "_blank", |
| 28 | + icon: "git.svg", |
| 29 | + onclick: "event.stopPropagation()") %> |
| 30 | + <% end %> |
| 31 | + <%= render "shared/report", suspect: @project, already_reported: FraudReport.already_reported_by?(current_user, @project) %> |
| 32 | + </div> |
| 33 | + </div> |
| 34 | + </div> |
| 35 | + |
| 36 | + <div class="space-y-4 sm:space-y-6 mt-8"> |
| 37 | + <% @devlogs.each do |devlog| %> |
| 38 | + <%= render "devlogs/devlog_card", |
| 39 | + devlog: devlog, |
| 40 | + context: 'voting', |
| 41 | + show_comments_inline: false, |
| 42 | + show_comment_modal: false, |
| 43 | + show_likes: false, |
| 44 | + content_margin: 'p-2', |
| 45 | + no_parchment: true %> |
| 46 | + <% end %> |
| 47 | + </div> |
| 48 | + </div> |
| 49 | + |
| 50 | + <div class="mx-2 sm:mx-auto mt-8 sm:mt-12 max-w-220"> |
| 51 | + <%= render C::Container.new do %> |
| 52 | + <div class="p-0 sm:p-2"> |
| 53 | + <%= form_with url: showcase_path, method: :post, data: { turbo: true }, class: "space-y-4" do |f| %> |
| 54 | + <%= hidden_field_tag :project_id, @project.id %> |
| 55 | + <%= hidden_field_tag :time_spent_voting_ms, 0, id: "time_spent_voting_ms" %> |
| 56 | + |
| 57 | + <div class="space-y-3"> |
| 58 | + <% @criteria.each do |criterion| %> |
| 59 | + <div class="bg-soft-bone/50 border border-saddle-taupe/30 rounded-lg p-3"> |
| 60 | + <div class="mb-2 font-medium text-som-dark capitalize"><%= criterion %></div> |
| 61 | + <%= select_tag "vote_mf[ballot][#{criterion}]", |
| 62 | + options_for_select(@grade_labels), |
| 63 | + include_blank: "Select grade", |
| 64 | + required: true, |
| 65 | + class: "som-horizontal-input w-full" %> |
| 66 | + </div> |
| 67 | + <% end %> |
| 68 | + </div> |
| 69 | + |
| 70 | + <div class="flex justify-center items-center w-full mt-4"> |
| 71 | + <%= render C::StyledButton.new(text: "Submit", type: :submit) %> |
| 72 | + </div> |
| 73 | + <% end %> |
| 74 | + </div> |
| 75 | + <% end %> |
| 76 | + </div> |
| 77 | +</div> |
0 commit comments