-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
06e5bd2
commit 1c95cbc
Showing
24 changed files
with
220 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@keyframes appear-then-fade { | ||
0%,100% { | ||
opacity: 0 | ||
} | ||
|
||
6%,66% { | ||
opacity: 1 | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
@import "*"; | ||
@import "components/*"; | ||
|
||
.field_with_errors { | ||
border: darkred 1px solid; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.flash-notice { | ||
position: fixed; | ||
top: 5rem; | ||
width: 100%; | ||
display: flex; | ||
justify-content: center; | ||
} | ||
|
||
.flash-notice__content { | ||
background-color: rgba(35, 28, 51, 0.75); | ||
animation: appear-then-fade 6s 250ms both; | ||
border-radius: 5rem; | ||
padding: .5rem 1.5rem; | ||
display: flex; | ||
align-items: center; | ||
color: gainsboro; | ||
backdrop-filter: blur(3px) contrast(0.5) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.heading--medium { | ||
font-size: 2rem; | ||
} | ||
|
||
.text--small { | ||
font-size: 1rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module HackathonScoped | ||
extend ActiveSupport::Concern | ||
|
||
included do | ||
before_action :set_hackathon, except: [:index, :new, :create] | ||
end | ||
|
||
private | ||
|
||
def set_hackathon | ||
@hackathon = Hackathon.find(params[:hackathon_id]) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
class Hackathons::SubmissionsController < ApplicationController | ||
def index | ||
@hackathons = Hackathon.not_approved.where applicant: Current.user | ||
|
||
redirect_to new_hackathons_request_path if @hackathons.none? | ||
end | ||
|
||
def new | ||
@hackathon = Hackathon.new | ||
end | ||
|
||
def create | ||
@hackathon = Hackathon.new(hackathon_params) | ||
if @hackathon.save context: :submit | ||
redirect_to hackathons_requests_path, notice: "Your hackathon has been submitted for approval!" | ||
else | ||
render :new, status: :unprocessable_entity | ||
end | ||
end | ||
|
||
def show | ||
@hackathon = Hackathon.not_approved.where(applicant: Current.user).find(params[:id]) | ||
end | ||
|
||
private | ||
|
||
def hackathon_params | ||
params.require(:hackathon).permit( | ||
:name, | ||
:website, | ||
:logo, | ||
:banner, | ||
:starts_at, | ||
:ends_at, | ||
:address, | ||
:expected_attendees | ||
) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails | ||
import "@hotwired/turbo-rails" | ||
import "controllers" | ||
|
||
import LocalTime from "local-time" | ||
LocalTime.start() |
4 changes: 2 additions & 2 deletions
4
...avascript/controllers/hello_controller.js → ...controllers/element_removal_controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { Controller } from "@hotwired/stimulus" | ||
|
||
export default class extends Controller { | ||
connect() { | ||
this.element.textContent = "Hello World!" | ||
remove() { | ||
this.element.remove() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<h3>Your Hackathon Submissions</h3> | ||
<% @hackathons.each do |hackathon| %> | ||
<article> | ||
<%= link_to hackathon.name, hackathons_request_path(hackathon) %> | ||
|
||
<small><i><%= hackathon.events.timelined.last %></i></small> | ||
</article> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<%= form_with model: @hackathon, url: hackathons_requests_path do |form| %> | ||
<div> | ||
<%= form.label :name, "Hackathon Name" %> | ||
<%= form.text_field :name, required: true, placeholder: "Epoch" %> | ||
</div> | ||
|
||
<div> | ||
<%= form.label :website %> | ||
<%= form.text_field :website, required: true, placeholder: "epoch.hackclub.com" %> | ||
</div> | ||
|
||
<div> | ||
<%= form.label :logo %> | ||
<%= form.file_field :logo %> | ||
</div> | ||
|
||
<div> | ||
<%= form.label :banner %> | ||
<%= form.file_field :banner %> | ||
</div> | ||
|
||
<div> | ||
<%= form.label :start_date %> | ||
<%= form.date_field :starts_at, required: true %> | ||
</div> | ||
|
||
<div> | ||
<%= form.label :end_date %> | ||
<%= form.date_field :ends_at, required: true %> | ||
</div> | ||
|
||
<div> | ||
<%= form.label :location %> | ||
<%= form.text_field :address, required: true, placeholder: "15 Falls Rd, Shelburne VT" %> | ||
</div> | ||
|
||
<div> | ||
<%= form.label :expected_attendees %> | ||
<%= form.number_field :expected_attendees, required: true %> | ||
</div> | ||
|
||
<%= form.button "Submit for Review" %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<h1 class="heading--medium"> | ||
<%= @hackathon.name %> | ||
</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
</head> | ||
|
||
<body> | ||
<%= render "shared/flash" %> | ||
<%= yield %> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<% if flash.notice %> | ||
<div class="flash-notice" data-controller="element-removal" data-action="animationend->element-removal#remove"> | ||
<div class="flash-notice__content"> | ||
<%= flash.notice %> | ||
</div> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ | |
pin "@hotwired/stimulus", to: "stimulus.min.js", preload: true | ||
pin "@hotwired/stimulus-loading", to: "stimulus-loading.js", preload: true | ||
pin_all_from "app/javascript/controllers", under: "controllers" | ||
pin "local-time", to: "https://ga.jspm.io/npm:[email protected]/app/assets/javascripts/local-time.js" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Rails.application.configure do | ||
config.action_view.field_error_proc = proc do |html_tag, instance| | ||
if html_tag !~ /^input/ | ||
html_tag | ||
elsif (class_attribute_index = html_tag.index('class="')) | ||
html_tag.insert(class_attribute_index + 7, "field_with_errors ") | ||
elsif html_tag.index("/>") | ||
html_tag.insert(html_tag.index("/>"), " class=field_with_errors ") | ||
else | ||
html_tag.insert(html_tag.index(">"), " class=field_with_errors ") | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters