From b80bd744ad873f6fc43018bc4bfb90677de167bd Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Mon, 17 Dec 2012 12:01:45 +0100 Subject: Start of GS5. --- .../templates/views/erb/_form.html.erb | 20 +++++++++++++++ .../templates/views/erb/edit.html.erb | 3 +++ .../templates/views/erb/login.html.erb | 30 ++++++++++++++++++++++ .../templates/views/erb/signup.html.erb | 5 ++++ .../templates/views/haml/_form.html.haml | 16 ++++++++++++ .../templates/views/haml/edit.html.haml | 3 +++ .../templates/views/haml/login.html.haml | 26 +++++++++++++++++++ .../templates/views/haml/signup.html.haml | 5 ++++ 8 files changed, 108 insertions(+) create mode 100644 lib/generators/nifty/authentication/templates/views/erb/_form.html.erb create mode 100644 lib/generators/nifty/authentication/templates/views/erb/edit.html.erb create mode 100644 lib/generators/nifty/authentication/templates/views/erb/login.html.erb create mode 100644 lib/generators/nifty/authentication/templates/views/erb/signup.html.erb create mode 100644 lib/generators/nifty/authentication/templates/views/haml/_form.html.haml create mode 100644 lib/generators/nifty/authentication/templates/views/haml/edit.html.haml create mode 100644 lib/generators/nifty/authentication/templates/views/haml/login.html.haml create mode 100644 lib/generators/nifty/authentication/templates/views/haml/signup.html.haml (limited to 'lib/generators/nifty/authentication/templates/views') diff --git a/lib/generators/nifty/authentication/templates/views/erb/_form.html.erb b/lib/generators/nifty/authentication/templates/views/erb/_form.html.erb new file mode 100644 index 0000000..4e1c47d --- /dev/null +++ b/lib/generators/nifty/authentication/templates/views/erb/_form.html.erb @@ -0,0 +1,20 @@ +<%%= form_for @<%= user_singular_name %> do |f| %> + <%%= f.error_messages %> +
+ <%%= f.label :username %> + <%%= f.text_field :username %> +
+
+ <%%= f.label :email, "Email Address" %> + <%%= f.text_field :email %> +
+
+ <%%= f.label :password %> + <%%= f.password_field :password %> +
+
+ <%%= f.label :password_confirmation, "Confirm Password" %> + <%%= f.password_field :password_confirmation %> +
+
<%%= f.submit (@<%= user_singular_name %>.new_record? ? "Sign up" : "Update") %>
+<%% end %> diff --git a/lib/generators/nifty/authentication/templates/views/erb/edit.html.erb b/lib/generators/nifty/authentication/templates/views/erb/edit.html.erb new file mode 100644 index 0000000..75de67e --- /dev/null +++ b/lib/generators/nifty/authentication/templates/views/erb/edit.html.erb @@ -0,0 +1,3 @@ +<%% title "Update Profile" %> + +<%%= render "form" %> diff --git a/lib/generators/nifty/authentication/templates/views/erb/login.html.erb b/lib/generators/nifty/authentication/templates/views/erb/login.html.erb new file mode 100644 index 0000000..1cbc428 --- /dev/null +++ b/lib/generators/nifty/authentication/templates/views/erb/login.html.erb @@ -0,0 +1,30 @@ +<%% title "Log in" %> + +

Don't have an account? <%%= link_to "Sign up!", signup_path %>

+ +<%- if options[:authlogic] -%> +<%%= form_for @<%= session_singular_name %> do |f| %> + <%%= f.error_messages %> +
+ <%%= f.label :username %> + <%%= f.text_field :username %> +
+
+ <%%= f.label :password %> + <%%= f.password_field :password %> +
+
<%%= f.submit "Log in" %>
+<%% end %> +<%- else -%> +<%%= form_tag <%= session_plural_name %>_path do %> +
+ <%%= label_tag :login, "Username or Email Address" %> + <%%= text_field_tag :login, params[:login] %> +
+
+ <%%= label_tag :password %> + <%%= password_field_tag :password %> +
+
<%%= submit_tag "Log in" %>
+<%% end %> +<%- end -%> diff --git a/lib/generators/nifty/authentication/templates/views/erb/signup.html.erb b/lib/generators/nifty/authentication/templates/views/erb/signup.html.erb new file mode 100644 index 0000000..6f282b5 --- /dev/null +++ b/lib/generators/nifty/authentication/templates/views/erb/signup.html.erb @@ -0,0 +1,5 @@ +<%% title "Sign up" %> + +

Already have an account? <%%= link_to "Log in", login_path %>.

+ +<%%= render "form" %> diff --git a/lib/generators/nifty/authentication/templates/views/haml/_form.html.haml b/lib/generators/nifty/authentication/templates/views/haml/_form.html.haml new file mode 100644 index 0000000..992ee9c --- /dev/null +++ b/lib/generators/nifty/authentication/templates/views/haml/_form.html.haml @@ -0,0 +1,16 @@ += form_for @<%= user_singular_name %> do |f| + = f.error_messages + .field + = f.label :username + = f.text_field :username + .field + = f.label :email, "Email Address" + = f.text_field :email + .field + = f.label :password + = f.password_field :password + .field + = f.label :password_confirmation, "Confirm Password" + = f.password_field :password_confirmation + .actions + = f.submit (@<%= user_singular_name %>.new_record? ? "Sign up" : "Update") diff --git a/lib/generators/nifty/authentication/templates/views/haml/edit.html.haml b/lib/generators/nifty/authentication/templates/views/haml/edit.html.haml new file mode 100644 index 0000000..4b43a3b --- /dev/null +++ b/lib/generators/nifty/authentication/templates/views/haml/edit.html.haml @@ -0,0 +1,3 @@ +- title "Sign up" + += render "form" diff --git a/lib/generators/nifty/authentication/templates/views/haml/login.html.haml b/lib/generators/nifty/authentication/templates/views/haml/login.html.haml new file mode 100644 index 0000000..22fc95b --- /dev/null +++ b/lib/generators/nifty/authentication/templates/views/haml/login.html.haml @@ -0,0 +1,26 @@ +- title "Log in" + +%p== Don't have an account? #{link_to "Sign up!", signup_path} + +<%- if options[:authlogic] -%> += form_for @<%= session_singular_name %> do |f| + = f.error_messages + .field + = f.label :username + = f.text_field :username + .field + = f.label :password + = f.password_field :password + .actions + = f.submit "Log in" +<%- else -%> +- form_tag <%= session_plural_name %>_path do + .field + = label_tag :login, "Username or Email Address" + = text_field_tag :login, params[:login] + .field + = label_tag :password + = password_field_tag :password + .actions + = submit_tag "Log in" +<%- end -%> diff --git a/lib/generators/nifty/authentication/templates/views/haml/signup.html.haml b/lib/generators/nifty/authentication/templates/views/haml/signup.html.haml new file mode 100644 index 0000000..dc75c13 --- /dev/null +++ b/lib/generators/nifty/authentication/templates/views/haml/signup.html.haml @@ -0,0 +1,5 @@ +- title "Sign up" + +%p== Already have an account? #{link_to "Log in", login_path}. + += render "form" -- cgit v1.2.3