Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
253 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
class SitesController < ApplicationController | ||
before_filter :authenticate_user! | ||
|
||
respond_to :html | ||
|
||
def show | ||
@site = Site.current # TODO: remove after cancan | ||
respond_with(@site) | ||
end | ||
|
||
def edit | ||
@site = Site.current # TODO: remove after cancan | ||
respond_with(@site) | ||
end | ||
|
||
def update | ||
@site = Site.current # TODO: remove after cancan | ||
if @site.update_attributes(params[:site]) | ||
respond_with(@site, :location => site_path) | ||
else | ||
respond_with(@site, :location => edit_site_path(@site)) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class ShowablePasswordInput < SimpleForm::Inputs::PasswordInput | ||
include ActionView::Helpers::FormTagHelper | ||
|
||
def input | ||
field = @builder.password_field(attribute_name, input_html_options) | ||
cb_name = attribute_name.to_s + '_show' | ||
cb = check_box_tag cb_name, 'show', false, :class => 'showable_password_show' | ||
cb_label = label_tag cb_name, I18n.t('show_question'), :class => 'showable_password_show_label' | ||
"#{field}#{cb}#{cb_label}".html_safe | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
-# = render :partial => 'manage/menu' | ||
-# = content_for :sidebar do | ||
-# .affix-top{ :"data-spy" => "affix", :"data-offset-top" => "160" } | ||
-# = link_to t('save'), "#form-edit-site", :class => "btn btn-primary btn-block submit-form" | ||
#manage | ||
= simple_form_for @site, :url => site_path, :html => { :id => "form-edit-site", :method => :put, :multipart => true, :class => 'single-column' } do |f| | ||
.left-column | ||
= f.input :name | ||
= f.input :description, :as => :text, :input_html => { :rows => 5 } | ||
= f.input :domain | ||
= f.input :locale, :collection => I18n.available_locales | ||
= f.input :signature, :as => :text, :input_html => { :rows => 5 } | ||
= f.input :feedback_url | ||
= f.input :analytics_code | ||
= f.input :shib_enabled, :as => :boolean | ||
= f.input :shib_email_field | ||
= f.input :shib_name_field | ||
.right-column | ||
= f.input :smtp_user_name | ||
= f.input :smtp_password, :as => :showable_password | ||
= f.input :smtp_sender | ||
= f.input :smtp_domain | ||
= f.input :smtp_server | ||
= f.input :smtp_port | ||
= f.input :smtp_auto_tls | ||
= f.input :smtp_auth_type | ||
= f.input :exception_notifications, :as => :boolean | ||
= f.input :exception_notifications_email | ||
= f.input :exception_notifications_prefix | ||
= f.input :chat_enabled, :as => :boolean | ||
= f.input :xmpp_domain | ||
= f.input :xmpp_server | ||
= f.button :submit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
-# = render :partial => 'manage/menu' | ||
-# = content_for :sidebar do | ||
-# .affix-top{ :"data-spy" => "affix", :"data-offset-top" => "160" } | ||
-# = link_to t('button.edit'), edit_site_path, :class => "btn btn-primary btn-block" | ||
#manage | ||
= simple_form_for @site, :url => "", :html => { :class => 'single-column' } do |f| | ||
.left-column | ||
= f.input :name, :disabled => true | ||
= f.input :description, :as => :text, :input_html => { :rows => 5 }, :disabled => true | ||
= f.input :domain, :disabled => true | ||
= f.input :locale, :collection => I18n.available_locales, :disabled => true | ||
= f.input :signature, :as => :text, :input_html => { :rows => 5 }, :disabled => true | ||
= f.input :feedback_url, :disabled => true | ||
= f.input :analytics_code, :disabled => true | ||
= f.input :shib_enabled, :as => :boolean, :disabled => true | ||
= f.input :shib_email_field, :disabled => true | ||
= f.input :shib_name_field, :disabled => true | ||
.right-column | ||
= f.input :smtp_user_name, :disabled => true | ||
= f.input :smtp_password, :disabled => true | ||
= f.input :smtp_sender, :disabled => true | ||
= f.input :smtp_domain, :disabled => true | ||
= f.input :smtp_server, :disabled => true | ||
= f.input :smtp_port, :disabled => true | ||
= f.input :smtp_auto_tls, :disabled => true | ||
= f.input :smtp_auth_type, :disabled => true | ||
= f.input :exception_notifications, :as => :boolean, :disabled => true | ||
= f.input :exception_notifications_email, :disabled => true | ||
= f.input :exception_notifications_prefix, :disabled => true | ||
= f.input :chat_enabled, :as => :boolean, :disabled => true | ||
= f.input :xmpp_domain, :disabled => true | ||
= f.input :xmpp_server, :disabled => true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.