From 2967ee8c9fa2a7266562af7bf460a2f2c6ba6b75 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Tue, 2 Dec 2014 21:15:21 +0800 Subject: [PATCH] title fixed --- .../admin/register_api_controller.rb | 19 +++---------------- .../admin/registered_sites/_index.html.erb | 2 +- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/app/controllers/admin/register_api_controller.rb b/app/controllers/admin/register_api_controller.rb index e665621..c7f8139 100644 --- a/app/controllers/admin/register_api_controller.rb +++ b/app/controllers/admin/register_api_controller.rb @@ -6,11 +6,13 @@ class Admin::RegisterApiController < ApplicationController response["success"] = false domain = params[:site_domain] email = params[:admin_email] + title = params[:site_title] site = RegisteredSite.where(:site_domain => domain).first rescue nil if site.nil? site = RegisteredSite.new site.site_domain = domain site.admin_email = email + site.title_translations = title site.generate_confirmation_token site.save response["success"] = true @@ -70,12 +72,6 @@ class Admin::RegisterApiController < ApplicationController request = Net::HTTP::Post.new("/store/confirmation") request.body = params_to_send.to_query response = http.request(request) - # data = JSON.parse(response.body) - # if data["success"] == true - # return true - # else - # return false - # end end def confirm_email @@ -92,13 +88,4 @@ class Admin::RegisterApiController < ApplicationController end end -end - - -# if -# response["success"] = true -# # send_confirmation_email(site.admin_email, site.confirmation_token, site.site_token) -# else -# response["message"] = "Invalid site token." -# response["error"] = "INVALID_SITE_TOKEN" -# end \ No newline at end of file +end \ No newline at end of file diff --git a/app/views/admin/registered_sites/_index.html.erb b/app/views/admin/registered_sites/_index.html.erb index cd11b1b..4dcb87e 100644 --- a/app/views/admin/registered_sites/_index.html.erb +++ b/app/views/admin/registered_sites/_index.html.erb @@ -32,7 +32,7 @@ <%= t("registered_sites.site_active") %>
<% end %> - <%= site.category.nil? ? "Category not assigned" : "#{site.category.title}".html_safe %> + <%= site.category.nil? ? "Category not assigned." : "#{site.category.title}".html_safe %> <% site.tags.each do |tag| %>