summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--app/assets/stylesheets/application.scss6
-rw-r--r--core/lib/leap_web_core/dependencies.rb3
-rw-r--r--core/lib/leap_web_core/ui_dependencies.rb1
-rw-r--r--ui_dependencies.rb4
m---------users/app/assets/javascripts/srp0
-rw-r--r--users/app/controllers/users_controller.rb14
-rw-r--r--users/app/views/sessions/new.html.haml1
-rw-r--r--users/app/views/users/_warnings.html.haml12
-rw-r--r--users/app/views/users/edit.html.haml7
-rw-r--r--users/app/views/users/new.html.haml1
-rw-r--r--users/leap_web_users.gemspec4
12 files changed, 32 insertions, 23 deletions
diff --git a/.gitignore b/.gitignore
index 73cd22e..a79d841 100644
--- a/.gitignore
+++ b/.gitignore
@@ -29,3 +29,5 @@ public/provider.json
config/config.yml
bin
.*.swp
+public/1/*
+vendor/bundle/*
diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss
index 298a758..28206b1 100644
--- a/app/assets/stylesheets/application.scss
+++ b/app/assets/stylesheets/application.scss
@@ -3,6 +3,9 @@
//
@import "head";
+// First import journal variables
+// @import "bootswatch/cerulean/variables";
+
//
// import bootstrap.
//
@@ -14,6 +17,9 @@
//
@import "leap";
+// And finally bootswatch style itself
+// @import "bootswatch/cerulean/bootswatch";
+
//
// import custom scss, content to be set in deployment.
//
diff --git a/core/lib/leap_web_core/dependencies.rb b/core/lib/leap_web_core/dependencies.rb
index 7f6ca87..e4a8807 100644
--- a/core/lib/leap_web_core/dependencies.rb
+++ b/core/lib/leap_web_core/dependencies.rb
@@ -11,7 +11,8 @@ module LeapWebCore
"haml" => "~> 3.1.7",
"bootstrap-sass" => "~> 2.0.4",
"jquery-rails" => nil,
- "simple_form" => nil
+ "simple_form" => nil,
+ "bootswatch-rails", "~> 0.5.0"
}
def self.require_ui_gems
diff --git a/core/lib/leap_web_core/ui_dependencies.rb b/core/lib/leap_web_core/ui_dependencies.rb
index e0a0b86..c2fc8cf 100644
--- a/core/lib/leap_web_core/ui_dependencies.rb
+++ b/core/lib/leap_web_core/ui_dependencies.rb
@@ -2,6 +2,7 @@ require "haml"
require "bootstrap-sass"
require "jquery-rails"
require "simple_form"
+require "bootswatch-rails"
if Rails.env == "development"
require "haml-rails"
diff --git a/ui_dependencies.rb b/ui_dependencies.rb
index c01de44..2cfd851 100644
--- a/ui_dependencies.rb
+++ b/ui_dependencies.rb
@@ -4,16 +4,16 @@ gem "jquery-rails"
gem "simple_form"
gem 'client_side_validations'
gem 'client_side_validations-simple_form'
+gem "bootswatch-rails", "~> 0.5.0"
gem 'kaminari', "0.13.0" # for pagination. trying 0.13.0 as there seem to be
# issues with 0.14.0 when using couchrest
-# gem 'bootstrap-editable-rails', "~>0.0.4"
-
gem 'rails-i18n' # locale files for built-in validation messages and times
# https://github.com/svenfuchs/rails-i18n
# for a list of keys:
# https://github.com/svenfuchs/rails-i18n/blob/master/rails/locale/en.yml
+
group :assets do
gem "haml-rails", "~> 0.3.4"
gem "sass-rails", "~> 3.2.5"
diff --git a/users/app/assets/javascripts/srp b/users/app/assets/javascripts/srp
-Subproject fff770a866b44abce6fe0fc5d5ffde034225436
+Subproject e7a0b830b8f994316a560001a9e7397422b184b
diff --git a/users/app/controllers/users_controller.rb b/users/app/controllers/users_controller.rb
index 6664bd7..4ce970b 100644
--- a/users/app/controllers/users_controller.rb
+++ b/users/app/controllers/users_controller.rb
@@ -3,6 +3,7 @@
#
class UsersController < UsersBaseController
+
before_filter :authorize, :only => [:show, :edit, :update, :destroy]
before_filter :fetch_user, :only => [:show, :edit, :update, :destroy]
before_filter :authorize_admin, :only => [:index]
@@ -33,20 +34,9 @@ class UsersController < UsersBaseController
def edit
end
- #
- # The API user update is used instead. Maybe someday we will have something for which this makes sense.
- #
- #def update
- # @user.update_attributes(params[:user])
- # respond_with @user
- #end
-
def destroy
@user.destroy
- respond_to do |format|
- format.html { redirect_to(admin? ? users_path : root_path) }
- format.json { head :no_content }
- end
+ redirect_to admin? ? users_url : root_url
end
end
diff --git a/users/app/views/sessions/new.html.haml b/users/app/views/sessions/new.html.haml
index 81a55b8..c915968 100644
--- a/users/app/views/sessions/new.html.haml
+++ b/users/app/views/sessions/new.html.haml
@@ -1,5 +1,6 @@
.span1
.span9
+ = render :partial => 'users/warnings'
%h2=t :login
= simple_form_for @session, :validate => true, :html => { :id => :new_session, :class => 'form-horizontal' } do |f|
= f.input :login, :required => false, :label => t(:username), :input_html => { :id => :srp_username }
diff --git a/users/app/views/users/_warnings.html.haml b/users/app/views/users/_warnings.html.haml
new file mode 100644
index 0000000..7e0b2ce
--- /dev/null
+++ b/users/app/views/users/_warnings.html.haml
@@ -0,0 +1,12 @@
+%noscript
+ %div.alert.alert-error=t :js_required
+#cookie_warning.alert.alert-error{:style => "display:none"}
+ =t :cookie_disabled_warning
+:javascript
+ document.cookie = "testing=cookies_enabled; path=/";
+ if(document.cookie.indexOf("testing=cookies_enabled") < 0)
+ {
+ document.getElementById('cookie_warning').style.display = 'block';
+ } else {
+ document.getElementById('cookie_warning').style.display = 'none';
+ } \ No newline at end of file
diff --git a/users/app/views/users/edit.html.haml b/users/app/views/users/edit.html.haml
index f06df44..08e9dc3 100644
--- a/users/app/views/users/edit.html.haml
+++ b/users/app/views/users/edit.html.haml
@@ -1,6 +1 @@
-= render 'edit'
-
-
-=# user_form_with 'login_and_password_fields', :legend => :update_login_and_password if @user == current_user
-=# render 'cancel_account'
-
+= render 'edit' \ No newline at end of file
diff --git a/users/app/views/users/new.html.haml b/users/app/views/users/new.html.haml
index b1953e1..f8d14b5 100644
--- a/users/app/views/users/new.html.haml
+++ b/users/app/views/users/new.html.haml
@@ -6,6 +6,7 @@
.span1
.span9
+ = render :partial => 'warnings'
%h2=t :signup
= simple_form_for(@user, form_options) do |f|
%legend= t(:signup_message)
diff --git a/users/leap_web_users.gemspec b/users/leap_web_users.gemspec
index c57937f..013b44a 100644
--- a/users/leap_web_users.gemspec
+++ b/users/leap_web_users.gemspec
@@ -11,8 +11,8 @@ Gem::Specification.new do |s|
s.homepage = "http://www.leap.se"
s.summary = "User registration and authorization for the leap platform"
s.description = "This this plugin for the leap platform provides user signup and login. It uses Secure Remote Password for the authentication."
-
- s.files = Dir["{app,config,db,lib}/**/*"] + ["Rakefile", "Readme.md"]
+
+ s.files = Dir["{app,config,db,lib}/**/*"] + ["Rakefile"]
s.test_files = Dir["test/**/*"]
s.add_dependency "leap_web_core", LeapWeb::VERSION