Skip to content

Commit 138116f

Browse files
committed
create basic views
1 parent a4f7741 commit 138116f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+818
-0
lines changed

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,5 @@ group :test do
5555
gem "capybara"
5656
gem "selenium-webdriver"
5757
end
58+
59+
gem 'bcrypt', '~> 3.1.7'

Gemfile.lock

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ GEM
7575
public_suffix (>= 2.0.2, < 7.0)
7676
ast (2.4.2)
7777
base64 (0.2.0)
78+
bcrypt (3.1.20)
7879
bigdecimal (3.1.8)
7980
bindex (0.8.1)
8081
bootsnap (1.18.4)
@@ -305,6 +306,7 @@ PLATFORMS
305306
x86_64-linux-musl
306307

307308
DEPENDENCIES
309+
bcrypt (~> 3.1.7)
308310
bootsnap
309311
brakeman
310312
capybara
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class Admin::BaseController < ApplicationController
2+
before_action :authenticate_admin!
3+
4+
def authenticate_admin!
5+
end
6+
end
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class Admin::TeamController < ApplicationController
2+
end
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class Admin::UserController < ApplicationController
2+
end
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class Manage::BaseController < ApplicationController
2+
before_action :authenticate_manager!
3+
4+
def authenticate_manager!
5+
end
6+
end
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class Manage::TeamController < ApplicationController
2+
end
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<%= form_with(model: team) do |form| %>
2+
<% if team.errors.any? %>
3+
<div style="color: red">
4+
<h2><%= pluralize(team.errors.count, "error") %> prohibited this team from being saved:</h2>
5+
6+
<ul>
7+
<% team.errors.each do |error| %>
8+
<li><%= error.full_message %></li>
9+
<% end %>
10+
</ul>
11+
</div>
12+
<% end %>
13+
14+
<div>
15+
<%= form.label :name, style: "display: block" %>
16+
<%= form.text_field :name %>
17+
</div>
18+
19+
<div>
20+
<%= form.submit %>
21+
</div>
22+
<% end %>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<div id="<%= dom_id team %>">
2+
<p>
3+
<strong>Name:</strong>
4+
<%= team.name %>
5+
</p>
6+
7+
</div>

app/views/admin/team/edit.html.erb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<% content_for :title, "Editing team" %>
2+
3+
<h1>Editing team</h1>
4+
5+
<%= render "form", team: @team %>
6+
7+
<br>
8+
9+
<div>
10+
<%= link_to "Show this team", @team %> |
11+
<%= link_to "Back to teams", teams_path %>
12+
</div>

0 commit comments

Comments
 (0)