Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 2 commits
  • 5 files changed
  • 0 commit comments
  • 1 contributor
View
6 app/controllers/user_sessions_controller.rb
@@ -15,7 +15,7 @@
# limitations under the License.
class UserSessionsController < ApplicationController
-
+
skip_before_filter :require_user, :only => [:new, :create]
def new
@@ -29,7 +29,7 @@ def create
@user_session = UserSession.new(params[:user_session])
if @user_session.save
- flash[:notice] = I18n.t("txt.controllers.user_sessions.login_success")
+ flash[:success] = I18n.t("txt.controllers.user_sessions.login_success")
redirect_to params[:back_to] || (can?(:use, :dashboard) ? dashboard_url : root_path)
else
flash[:error] = I18n.t("txt.views.user_sessions.error")
@@ -41,7 +41,7 @@ def destroy
# TODO Check abilities
current_user_session.destroy
- flash[:notice] = I18n.t("txt.controllers.user_sessions.logout_success")
+ flash[:success] = I18n.t("txt.controllers.user_sessions.logout_success")
redirect_to root_path
end
View
11 app/helpers/navigation_helper.rb
@@ -14,14 +14,19 @@ def sidebar_header(text)
content_tag :li, text, :class => 'nav-header'
end
- def sidebar_item(text = nil, path = nil, active = nil, &block)
+ def sidebar_item(opts = {}, &block)
css_class = ''
- css_class << 'active' if active
+ css_class << 'active' if opts.delete(:active)
content = if block_given?
capture(&block)
else
- link_to(text, path)
+ desc = ActiveSupport::SafeBuffer.new
+ if icon = opts.delete(:icon)
+ desc << icon(icon) << " "
+ end
+ desc << opts.delete(:text).to_s
+ link_to(desc.html_safe, opts.delete(:path))
end
content_tag :li, content, :class => css_class
View
6 app/views/dashboard/_sidebar.html.erb
@@ -5,11 +5,11 @@
<% end %>
<%= sidebar_header t('txt.views.dashboard.full_rdf_export') %>
<% if can?(:full_export, Concept::Base) %>
- <%= sidebar_item(icon(:download) + " Turtle", concepts_url(:format => :ttl)) %>
- <%= sidebar_item(icon(:download) + " RDF/XML", concepts_url(:format => :rdf)) %>
+ <%= sidebar_item(:icon => :download, :text => "RDF/Turtle", :path => concepts_url(:format => :ttl)) %>
+ <%= sidebar_item(:icon => :download, :text => "RDF/XML", :path => concepts_url(:format => :rdf)) %>
<% end %>
<%= sidebar_header 'Extras' %>
<% if can?(:import, Concept::Base) %>
- <%= sidebar_item(icon(:upload) + " " + t('txt.views.dashboard.import'), import_url, params[:controller] == 'import') %>
+ <%= sidebar_item(:icon => :upload, :text => t('txt.views.dashboard.import'), :path => import_url, :active => params[:controller] == 'import') %>
<% end %>
<% end %>
View
14 app/views/user_sessions/new.html.erb
@@ -1,11 +1,9 @@
<%= page_header :title => t("txt.views.user_sessions.header") %>
-<%= form_for @user_session, :url => user_session_path(:back_to => params[:back_to]), :class => "well" do |f| %>
- <%= f.label :email, t("txt.views.user_sessions.email") %>
- <%= f.text_field :email %>
-
- <%= f.label :password, t("txt.views.user_sessions.password") %>
- <%= f.password_field :password %>
-
- <button type="submit" class="btn"><%= t("txt.views.user_sessions.login") %></button>
+<%= simple_form_for @user_session, :url => user_session_path(:back_to => params[:back_to]) do |f| %>
+ <%= f.input :email %>
+ <%= f.input :password %>
+ <div class="form-actions">
+ <%= submit_tag t("txt.views.user_sessions.login"), :class => 'btn btn-primary' %>
+ </div>
<% end %>
View
4 app/views/users/_sidebar.html.erb
@@ -1,5 +1,5 @@
<%= sidebar do %>
<%= sidebar_header 'Links' %>
-<%= sidebar_item icon(:'th-list') + ' ' + User.model_name.human(:count => 5), users_path, params[:action] == 'index' %>
-<%= sidebar_item icon(:user) + ' ' + t('txt.views.users.new_link'), new_user_path, params[:action] == 'new' %>
+<%= sidebar_item :icon => :'th-list', :text => User.model_name.human(:count => 5), :path => users_path, :active => params[:action] == 'index' %>
+<%= sidebar_item :icon => :user, :text => t('txt.views.users.new_link'), :path => new_user_path, :active => params[:action] == 'new' %>
<% end %>

No commit comments for this range

Something went wrong with that request. Please try again.