Skip to content

Commit

Permalink
some organge tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
michelson committed Jun 17, 2022
1 parent c1eb3e9 commit 274f97f
Show file tree
Hide file tree
Showing 15 changed files with 369 additions and 105 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ rauversion-*.tar

# Ignore assets that are produced by build tools.
/priv/static/assets/
/priv/static/
# Ignore digested assets cache.
/priv/static/cache_manifest.json

Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.
### fake accounts

iex -S mix fake_accounts


### images

https://unsplash.com/photos/eXVd7gDPO9A
https://unsplash.com/photos/mbGxz7pt0jM
2 changes: 1 addition & 1 deletion lib/rauversion/accounts/user.ex
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ defmodule Rauversion.Accounts.User do
"""
def registration_changeset(user, attrs, opts \\ []) do
user
|> cast(attrs, [:email, :password])
|> cast(attrs, [:email, :password, :username])
|> validate_email()
|> validate_password(opts)
end
Expand Down
75 changes: 35 additions & 40 deletions lib/rauversion_web/templates/layout/_user_menu.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<div class="flex justify-between h-16">
<div class="flex items-center px-2 lg:px-0">
<div class="flex-shrink-0 flex items-center">
<a href="/">
<a href="/" class="text-white text-2xl font-extrabold">
RAUVERSION
<% #= image_tag url_for(current_user.avatar), class: "h-8 w-auto" if current_user&.avatar&.persisted? %>
</a>
</div>
Expand All @@ -21,8 +22,8 @@
<li><%= link "LiveDashboard", to: Routes.live_dashboard_path(@conn, :home) %></li>
<% end %>

<li><%= link "Register", to: Routes.user_registration_path(@conn, :new) %></li>
<li><%= link "Log in", to: Routes.user_session_path(@conn, :new) %></li>
<%= link "Register", to: Routes.user_registration_path(@conn, :new), class: "rounded-md py-2 px-3 text-sm font-medium text-white hover:bg-gray-800" %>
<%= link "Log in", to: Routes.user_session_path(@conn, :new), class: "rounded-md py-2 px-3 text-sm font-medium text-white hover:bg-gray-800" %>

</div>
</div>
Expand All @@ -42,7 +43,7 @@
</div>

<div class="flex items-center px-2 lg:px-0">
<a href="#"
<a href="/tracks/new"
class="rounded-md py-2 px-3 text-sm font-medium text-white hover:bg-pink-800 ">
upload
</a>
Expand All @@ -57,55 +58,48 @@
Heroicon name: outline/menu" x-state:on="Menu open" x-state:off="Menu closed" class="h-6 w-6 block" :class="{ 'hidden': open, 'block': !(open) }" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path>
</svg>
<svg x-description="Icon when menu is open.
Heroicon name: outline/x" x-state:on="Menu open" x-state:off="Menu closed" class="h-6 w-6 hidden" :class="{ 'block': open, 'hidden': !(open) }" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
<svg x-description="Icon when menu is open.
Heroicon name: outline/x" x-state:on="Menu open" x-state:off="Menu closed" class="h-6 w-6 hidden" :class="{ 'block': open, 'hidden': !(open) }" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
</svg>
</button>
</div>
<div class="hidden lg:ml-4 lg:flex lg:items-center z-10">



<div data-controller="dropdown" class="relative">

<button type="button"
data-action="dropdown#toggle click@window->dropdown#hide"
class="flex-shrink-0 bg-gray-500 p-1 text-gray-200 rounded-full hover:text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-500 focus:ring-white">
<span class="sr-only">Notificaitons</span>
<svg class="h-6 w-6" x-description="Heroicon name: outline/bell" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"></path>
</svg>
</button>

<div class="hidden lg:ml-4 lg:flex lg:items-center z-10">
<%= if @current_user do %>

<div
data-dropdown-target="menu"
class="origin-top-right absolute right-0 mt-2 w-56 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 focus:outline-none"
data-transition-enter-from="opacity-0 scale-95"
data-transition-enter-to="opacity-100 scale-100"
data-transition-leave-from="opacity-100 scale-100"
data-transition-leave-to="opacity-0 scale-95"
>
<div class="block px-4 py-2 text-sm text-gray-700">
<%= link "Settings", to: Routes.user_settings_path(@conn, :edit), class: "block px-4 py-2 text-sm text-gray-700" %>
<%= link "profile", to: Routes.profile_index_path(@conn, :index, @current_user.username), class: "block px-4 py-2 text-sm text-gray-700" %>
<div data-controller="dropdown" class="relative">
<button type="button"
data-action="dropdown#toggle click@window->dropdown#hide"
class="flex-shrink-0 bg-gray-500 p-1 text-gray-200 rounded-full hover:text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-500 focus:ring-white">
<span class="sr-only">Notificaitons</span>
<svg class="h-6 w-6" x-description="Heroicon name: outline/bell" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"></path>
</svg>
</button>
<div
data-dropdown-target="menu"
class="origin-top-right absolute right-0 mt-2 w-56 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 focus:outline-none"
data-transition-enter-from="opacity-0 scale-95"
data-transition-enter-to="opacity-100 scale-100"
data-transition-leave-from="opacity-100 scale-100"
data-transition-leave-to="opacity-0 scale-95"
>
<div class="block px-4 py-2 text-sm text-gray-700">
<%= link "Settings", to: Routes.user_settings_path(@conn, :edit), class: "block px-4 py-2 text-sm text-gray-700" %>
<%= link "profile", to: Routes.profile_index_path(@conn, :index, @current_user.username), class: "block px-4 py-2 text-sm text-gray-700" %>

<a href="#" class="block px-4 py-2 text-sm text-gray-700">Support</a>
<a href="#" class="block px-4 py-2 text-sm text-gray-700">License</a>
<%= link "Log out", to: Routes.user_session_path(@conn, :delete), method: :delete, class: "block px-4 py-2 text-sm text-gray-700" %>
</div>
<a href="#" class="block px-4 py-2 text-sm text-gray-700">Support</a>
<a href="#" class="block px-4 py-2 text-sm text-gray-700">License</a>
<%= link "Log out", to: Routes.user_session_path(@conn, :delete), method: :delete, class: "block px-4 py-2 text-sm text-gray-700" %>
</div>
</div>
</div>
<% end %>
</div>


</div>
</div>
</div>

<!--
<div x-description="Mobile menu, show/hide based on menu state." class="lg:hidden" id="mobile-menu" x-show="open" style="display: none;">
<div class="pt-2 pb-3 px-2 space-y-1">
Expand Down Expand Up @@ -145,4 +139,5 @@
</div>
</div>
</div>
-->
</nav>
16 changes: 11 additions & 5 deletions lib/rauversion_web/templates/page/index.html.heex
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<main>
<!-- Hero -->
<div class="flex flex-col border-b border-gray-200 lg:border-0">
<nav aria-label="Offers" class="order-last lg:order-first">
<nav aria-label="Offers" class="order-last lg:order-first hidden">
<div class="max-w-7xl mx-auto lg:px-8">
<ul role="list" class="grid grid-cols-1 divide-y divide-gray-200 lg:grid-cols-3 lg:divide-y-0 lg:divide-x">

Expand Down Expand Up @@ -48,14 +48,20 @@
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 lg:grid lg:grid-cols-2">
<div class="max-w-2xl mx-auto py-24 lg:py-64 lg:max-w-none">
<div class="lg:pr-16">

<a href="/" class="text-white text-xl font-extrabold">
RAUVERSION
</a>

<h1 class="tracking-tight text-gray-900 sm:text-5xl xl:text-6xl
font-extrabold text-transparent bg-clip-text bg-gradient-to-r from-purple-400 to-pink-600
">Be your own music industry</h1>
font-extrabold text-transparent bg-clip-text bg-gradient-to-r from-orange-200 to-orange-600">
Be your own music industry
</h1>
<p class="mt-4 text-xl text-gray-100 ">
It's time to empower musicians all around the world and give them tools to own their industry
</p>
<div class="mt-6">
<a href="#" class="inline-block bg-indigo-600 border border-transparent py-3 px-8 rounded-md font-medium text-white hover:bg-indigo-700">
<a href="/users/register" class="inline-block bg-orange-600 border border-transparent py-3 px-8 rounded-md font-medium text-white hover:bg-orange-700">
Start now
</a>
</div>
Expand All @@ -64,7 +70,7 @@
</div>
</div>
<div class="w-full h-48 sm:h-64 lg:absolute lg:top-0 lg:right-0 lg:w-1/2 lg:h-full">
<img src={ Routes.static_path(@conn, "/images/musician-making-music.jpg")} class="w-full h-full object-center object-cover" />
<img src={ Routes.static_path(@conn, "/images/daniel-schludi-mbGxz7pt0jM-unsplash.jpg")} class="w-full h-full object-center object-cover" />
</div>
</div>
</div>
Expand Down
133 changes: 113 additions & 20 deletions lib/rauversion_web/templates/user_registration/new.html.heex
Original file line number Diff line number Diff line change
@@ -1,26 +1,119 @@
<h1>Register</h1>
<div class="min-h-full flex h-screen">
<div class="flex-1 flex flex-col justify-center py-12 px-4 sm:px-6 lg:flex-none lg:px-20 xl:px-24">
<div class="mx-auto w-full max-w-sm lg:w-96">
<div>
<img class="h-12 w-auto" src="https://tailwindui.com/img/logos/workflow-mark-orange-600.svg" alt="Logo">
<h2 class="mt-6 text-3xl font-extrabold text-gray-900">Sign in to your account</h2>
<p class="mt-2 text-sm text-gray-600">
Or
<a href="#" class="font-medium text-orange-600 hover:text-orange-500"> start your 14-day free trial </a>
</p>
</div>

<.form let={f} for={@changeset} action={Routes.user_registration_path(@conn, :create)}>
<%= if @changeset.action do %>
<div class="alert alert-danger">
<p>Oops, something went wrong! Please check the errors below.</p>
</div>
<% end %>
<div class="mt-8">
<div class="hidden">
<div>
<p class="text-sm font-medium text-gray-700">Sign in with</p>

<div class="mt-1 grid grid-cols-3 gap-3">
<div>
<a href="#" class="w-full inline-flex justify-center py-2 px-4 border border-gray-300 rounded-md shadow-sm bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
<span class="sr-only">Sign in with Facebook</span>
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20" aria-hidden="true">
<path fill-rule="evenodd" d="M20 10c0-5.523-4.477-10-10-10S0 4.477 0 10c0 4.991 3.657 9.128 8.438 9.878v-6.987h-2.54V10h2.54V7.797c0-2.506 1.492-3.89 3.777-3.89 1.094 0 2.238.195 2.238.195v2.46h-1.26c-1.243 0-1.63.771-1.63 1.562V10h2.773l-.443 2.89h-2.33v6.988C16.343 19.128 20 14.991 20 10z" clip-rule="evenodd" />
</svg>
</a>
</div>

<div>
<a href="#" class="w-full inline-flex justify-center py-2 px-4 border border-gray-300 rounded-md shadow-sm bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
<span class="sr-only">Sign in with Twitter</span>
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20" aria-hidden="true">
<path d="M6.29 18.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0020 3.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.073 4.073 0 01.8 7.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 010 16.407a11.616 11.616 0 006.29 1.84" />
</svg>
</a>
</div>

<div>
<a href="#" class="w-full inline-flex justify-center py-2 px-4 border border-gray-300 rounded-md shadow-sm bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
<span class="sr-only">Sign in with GitHub</span>
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20" aria-hidden="true">
<path fill-rule="evenodd" d="M10 0C4.477 0 0 4.484 0 10.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0110 4.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.203 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.942.359.31.678.921.678 1.856 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0020 10.017C20 4.484 15.522 0 10 0z" clip-rule="evenodd" />
</svg>
</a>
</div>
</div>
</div>

<div class="mt-6 relative">
<div class="absolute inset-0 flex items-center" aria-hidden="true">
<div class="w-full border-t border-gray-300"></div>
</div>
<div class="relative flex justify-center text-sm">
<span class="px-2 bg-white text-gray-500"> Or continue with </span>
</div>
</div>
</div>

<div class="mt-6">

<%= label f, :email %>
<%= email_input f, :email, required: true %>
<%= error_tag f, :email %>
<.form let={f}
for={@changeset}
action={Routes.user_registration_path(@conn, :create)}
class="space-y-6">
<%= if @changeset.action do %>
<div class="alert alert-danger">
<p>Oops, something went wrong! Please check the errors below.</p>
</div>
<% end %>

<%= label f, :password %>
<%= password_input f, :password, required: true %>
<%= error_tag f, :password %>
<div>
<%= label f, :email, "Email Address", class: "block text-sm font-medium text-gray-700" %>
<div class="mt-1">
<%= email_input f, :email, required: true, class: "appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-orange-500 focus:border-orange-500 sm:text-sm" %>
<%= error_tag f, :email %>
<!--<input id="email" name="email" type="email" autocomplete="email" required class="appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-orange-500 focus:border-orange-500 sm:text-sm">-->
</div>
</div>

<div class="space-y-1">
<label for="password" class="block text-sm font-medium text-gray-700"> Password </label>
<div class="mt-1">
<%= password_input f, :password, required: true, autocomplete: false, class: "appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-orange-500 focus:border-orange-500 sm:text-sm" %>
<%= error_tag f, :password %>
</div>
</div>

<div class="space-y-1">
<label for="username" class="block text-sm font-medium text-gray-700"> Username </label>
<div class="mt-1">
<%= text_input f, :username, required: true, class: "appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-orange-500 focus:border-orange-500 sm:text-sm" %>
<%= error_tag f, :username %>
</div>
</div>

<div class="flex items-center justify-between">
<div class="text-sm">
<%= link "Log in", to: Routes.user_session_path(@conn, :new), class: "font-medium text-orange-600 hover:text-orange-500" %> |
<%= link "Forgot your password?", to: Routes.user_reset_password_path(@conn, :new), class: "font-medium text-orange-600 hover:text-orange-500" %>
</div>
</div>

<div>
<button type="submit" class="w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-orange-600 hover:bg-orange-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-orange-500">
Sign in
</button>
</div>
</.form>
</div>
</div>
</div>
</div>
<div class="hidden lg:block relative w-0 flex-1">

<div>
<%= submit "Register" %>
<img class="absolute inset-0 h-full w-full object-cover"
src={ Routes.static_path(@conn, "/images/actionvance-eXVd7gDPO9A-unsplash.jpg")}
alt="">
</div>
</.form>
</div>

<p>
<%= link "Log in", to: Routes.user_session_path(@conn, :new) %> |
<%= link "Forgot your password?", to: Routes.user_reset_password_path(@conn, :new) %>
</p>
Loading

0 comments on commit 274f97f

Please sign in to comment.