Skip to content

Commit

Permalink
Merge pull request tobymao#10157 from benjaminxscott/frontpage
Browse files Browse the repository at this point in the history
copyedits on frontpage
  • Loading branch information
tobymao authored Jan 18, 2024
2 parents 5582527 + c3634d3 commit 1d75c91
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 32 deletions.
9 changes: 1 addition & 8 deletions assets/app/view/home.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ def render
your_games, other_games = @games.partition { |game| user_in_game?(@user, game) || user_owns_game?(@user, game) }

children = [
render_header,
h(Welcome, show_intro: your_games.empty?),
h(Welcome),
h(Chat, user: @user, connection: @connection),
]

Expand Down Expand Up @@ -103,11 +102,5 @@ def render_filter_row(children)
filter_row = h(GameRowFilters)
children << filter_row if filter_row
end

def render_header
h('div#greeting.card_header', [
h(:h2, "Welcome#{@user ? ' ' + @user['name'] : ''}!"),
])
end
end
end
30 changes: 8 additions & 22 deletions assets/app/view/welcome.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
module View
class Welcome < Snabberb::Component
needs :app_route, default: nil, store: true
needs :show_intro, default: true

def render
children = [render_notification]
children << render_introduction if @show_intro
children << render_introduction
children << render_buttons

h('div#welcome.half', children)
Expand All @@ -20,17 +19,8 @@ def render_notification
<p><a href="https://github.com/tobymao/18xx/wiki/1847-AE">1847AE</a> is in beta.
<a href="https://github.com/tobymao/18xx/wiki/1894">1894</a> is in beta.
<a href="https://github.com/tobymao/18xx/wiki/1822CA">1822CA</a> is in alpha.</p>
<p>Learn how to get <a href='https://github.com/tobymao/18xx/wiki/Notifications'>notifications</a> by email, Slack, Discord, and Telegram.</p>
<p>Please submit problem reports and make suggestions for improvements on
<a href='https://github.com/tobymao/18xx/issues'>GitHub</a>. Join the
<a href='https://join.slack.com/t/18xxgames/shared_invite/zt-27imtsj2u-vussFAqtecmACsycjdsIhg'>18xx Slack</a>.
to chat about 18xx and the website.
</p>
<p>The <a href='https://github.com/tobymao/18xx/wiki'>18xx.games Wiki</a> has rules, maps,
and other information about all the games, along with an FAQ.</p>
<p>Support our publishers: #{Lib::Publisher.link_list.join}.</p>
<p>You can support this project on <a href='https://www.patreon.com/18xxgames'>Patreon</a>.</p>
<p>Report bugs and make feature requests <a href='https://github.com/tobymao/18xx/issues'>on GitHub</a>.</p>
MESSAGE

props = {
Expand All @@ -49,16 +39,12 @@ def render_notification

def render_introduction
message = <<~MESSAGE
<p>18xx.games is a website where you can play async or real-time 18xx games (based on the system originally devised by the brilliant Francis Tresham)!
If you are new to 18xx games then Shikoku 1889, 18Chesapeake, or 18MS are good games to begin with.</p>
<p>You can play locally with hot seat mode without an account. If you want to play multiplayer, you'll need to create an account.</p>
<p>If you look at other people's games, you can make moves to play around but it won't affect them and changes won't be saved.
You can clone games in the tools tab and then play around locally.</p>
<p>In multiplayer games, you'll also be able to make moves for other players, this is so people can say 'pass me this SR' and you don't
need to wait. To use this feature in a game, enable "Master Mode" in the Tools tab. Please use it politely!</p>
<p>Check out the <a href='https://github.com/tobymao/18xx/wiki/FAQ'>FAQ</a>, <a href='https://github.com/tobymao/18xx/wiki/Power-User-Features'>keyboard shortcuts</a> and <a href='https://github.com/tobymao/18xx/wiki'>the Wiki</a></p>
<p>Find games in the chat or <a href='https://github.com/tobymao/18xx/wiki/18xx-Online-Communities%2C-Media%2C-and-Resources#community'>on (unofficial) Discord servers</a></p>
<p>Setup <a href='https://github.com/tobymao/18xx/wiki/Notifications'>turn notifications</a> via webhook to Slack, Discord, and Telegram</p>
<p>Ask questions in <code>#18xxgames</code> <a href='https://join.slack.com/t/18xxgames/shared_invite/zt-27imtsj2u-vussFAqtecmACsycjdsIhg'>on the 18XX Slack</a></p>
<p>Buy physical copies of 18XX games from publishers:</br> #{Lib::Publisher.link_list.join}.</p>
<p>Keep the servers running by becoming a member <a href='https://www.patreon.com/18xxgames'>on Patreon</a></p>
MESSAGE

props = {
Expand Down
4 changes: 2 additions & 2 deletions spec/assets_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,11 @@ def render(**needs)

describe '#html' do
it 'renders logged out' do
expect(render).to include('Welcome!')
expect(render).to include('18xx.Games')
end

it 'renders home logged in' do
expect(render(user: { name: 'toby', settings: { consent: true } })).to include('Welcome toby!')
expect(render(user: { name: 'toby', settings: { consent: true } })).to include('Profile (toby)')
end

it 'consent logged in' do
Expand Down

0 comments on commit 1d75c91

Please sign in to comment.