Skip to content

Commit

Permalink
Several updates. Getting ready for Rails 3 integration.
Browse files Browse the repository at this point in the history
  • Loading branch information
hcayless committed Feb 10, 2015
1 parent df91e7a commit c0f2c3f
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 26 deletions.
7 changes: 5 additions & 2 deletions app/controllers/identifiers_controller.rb
Expand Up @@ -38,8 +38,11 @@ def history
def create
@publication = Publication.find(params[:publication_id].to_s)
identifier_type = params[:identifier_type].constantize

@identifier = identifier_type.new_from_template(@publication)
if params[:apis_collection]
@identifier = APISIdentifier.new_from_template(@publication, params[:apis_collection].to_s)
else
@identifier = identifier_type.new_from_template(@publication)
end
if @identifier.nil?
flash[:error] = "Publication already has identifiers of this type, cannot create new file from templates."
redirect_to polymorphic_path([@publication],
Expand Down
8 changes: 4 additions & 4 deletions app/views/ddb_identifiers/commentary.haml
Expand Up @@ -325,7 +325,7 @@
}
else {
request_url = "#{defined?(XSUGAR_STANDALONE_URL) ? XSUGAR_STANDALONE_URL : ''}";
request_url = "/" + request_url.split("/").slice(3).join("/");
//request_url = "/" + request_url.split("/").slice(3).join("/");
}

//force first entry to be inside a paragraph tag markup - will remove first one for display on transform back
Expand Down Expand Up @@ -415,7 +415,7 @@
}
else {
request_url = "#{defined?(XSUGAR_STANDALONE_URL) ? XSUGAR_STANDALONE_URL : ''}";
request_url = "/" + request_url.split("/").slice(3).join("/");
//request_url = "/" + request_url.split("/").slice(3).join("/");
}

//force first entry to be inside a paragraph tag markup - will remove first one for display on transform back
Expand Down Expand Up @@ -503,7 +503,7 @@
}
else {
request_url = "#{defined?(XSUGAR_STANDALONE_URL) ? XSUGAR_STANDALONE_URL : ''}";
request_url = "/" + request_url.split("/").slice(3).join("/");
//request_url = "/" + request_url.split("/").slice(3).join("/");
}

// even though saved as & in XML, comes here as & only
Expand Down Expand Up @@ -891,7 +891,7 @@
}
else {
request_url = "#{defined?(XSUGAR_STANDALONE_URL) ? XSUGAR_STANDALONE_URL : ''}";
request_url = "/" + request_url.split("/").slice(3).join("/");
//request_url = "/" + request_url.split("/").slice(3).join("/");
}

// this is called from helper pop up page
Expand Down
2 changes: 1 addition & 1 deletion app/views/ddb_identifiers/edit.haml
Expand Up @@ -12,7 +12,7 @@
}
else {
request_url = "#{defined?(XSUGAR_STANDALONE_URL) ? XSUGAR_STANDALONE_URL : ''}";
request_url = "/" + request_url.split("/").slice(3).join("/");
//request_url = "/" + request_url.split("/").slice(3).join("/");
}

new Ajax.Request(request_url, {
Expand Down
7 changes: 6 additions & 1 deletion app/views/publications/_publication_listing.haml
Expand Up @@ -38,7 +38,12 @@
- class_type = i
- link_id = i + publication.id.to_s
- create_type = 'Create New'
= link_to(create_type, options = {:controller => 'identifiers', :action => 'create', :publication_id => publication.id, :identifier_type => class_type, :method => :post}, html_options = {:id => "#{link_id}", :onclick => "$('#{link_id}').replace('<b #{newstyle}>Creating New...</b>');"})
- if class_type == 'APISIdentifier'
- options = ['Create New'] << APISIdentifier.collection_names_hash.sort
- form_for :apis, :url => {:controller => 'identifiers', :action => 'create', :publication_id => publication.id, :identifier_type => class_type} do |f|
= select_tag "apis_collection", options_for_select(options.flatten.uniq), :prompt => 'Create New', :onchange => "this.form.submit()"
- else
= link_to(create_type, options = {:controller => 'identifiers', :action => 'create', :publication_id => publication.id, :identifier_type => class_type, :method => :post}, html_options = {:id => "#{link_id}", :onclick => "$('#{link_id}').replace('<b #{newstyle}>Creating New...</b>');"})
- else
= "-"
- elsif meta_ids.length > 0
Expand Down
7 changes: 6 additions & 1 deletion app/views/publications/show.haml
Expand Up @@ -193,7 +193,12 @@
- link_type = class_type.constantize::FRIENDLY_NAME
- create_type = 'Create new ' + link_type
- newstyle = 'style="color:white; background-color:#005DAA"'
= link_to(create_type, options = {:controller => 'identifiers', :action => 'create', :publication_id => @publication.id, :identifier_type => class_type, :method => :post}, html_options = {:id => "#{link_type}", :onclick => "$('#{link_type}').replace('<b #{newstyle}>Creating New #{link_type}...</b>');"})
- if class_type == 'APISIdentifier'
- options = ['Create new APIS'] << APISIdentifier.collection_names_hash.sort
- form_for :apis, :url => {:controller => 'identifiers', :action => 'create', :publication_id => @publication.id, :identifier_type => class_type} do |f|
= select_tag 'apis_collection', options_for_select(options.flatten.uniq), :onchange => "this.form.submit()"
- else
= link_to(create_type, options = {:controller => 'identifiers', :action => 'create', :publication_id => @publication.id, :identifier_type => class_type, :method => :post}, html_options = {:id => "#{link_type}", :onclick => "$('#{link_type}').replace('<b #{newstyle}>Creating New #{link_type}...</b>');"})

%br

Expand Down
5 changes: 3 additions & 2 deletions config/environments/production.rb
Expand Up @@ -5,14 +5,15 @@
config.cache_classes = true

# Use a different logger for distributed setups
# config.logger = SysLogger.new
config.logger = Logger.new(STDOUT)

# Full error reports are disabled and caching is turned on
config.action_controller.consider_all_requests_local = false
config.action_controller.perform_caching = false
config.action_controller.page_cache_directory = "#{RAILS_ROOT}/public/cache/"
config.cache_store = :file_store, "/tmp/sosol/"
#config.log_level = :warn

config.log_level = :warn
#config.action_controller.page_cache_directory = "public/cache"
#config.action_controller.page_cache_extension = ".html.erb"
# config.action_view.cache_template_loading = true
Expand Down
18 changes: 3 additions & 15 deletions public/stylesheets/sass/editor.sass
Expand Up @@ -272,18 +272,6 @@ styled_button_show
&:active
background: #ff7777

#rpx_box
float: left
width: 30em

#signup_box
float: right
width: 20em

#signup_explanation
clear: both


#edit_bar
//inherit default instead font-family: Georgia,serif
font-size: 75%
Expand Down Expand Up @@ -363,13 +351,13 @@ styled_button_show
color: black
text-decoration: none

#rpx_box
#janrainEngageEmbed
float: left
width: 30em
margin-bottom: 2em;

#signup_box
float: right
width: 20em
width: 35em

#signup_explanation
clear: both
Expand Down

0 comments on commit c0f2c3f

Please sign in to comment.