infra updates
This commit is contained in:
@@ -96,7 +96,7 @@
|
||||
$("[data-t]").each ->
|
||||
$(this).html t($(this).data("t"), $(this).data("tAttributes"))
|
||||
|
||||
$("*[data-time]").each ->
|
||||
$("[data-time]").each ->
|
||||
$(this).text moment($(this).data("time")).format($(this).data("timeFormat") or "dd D MMM HH:mm")
|
||||
|
||||
# jQuery UI datepicker support
|
||||
|
||||
@@ -3,7 +3,7 @@ class SupplierController < Suppliers::ApplicationController
|
||||
if Rails.env.development?
|
||||
redirect_to "http://localhost:4202/supplier/#{params[:other]}"
|
||||
else
|
||||
render html: File.read(Rails.root.join('public/supplier/index.html'))
|
||||
redirect_to "https://supplier.mozo.bar/supplier/#{params[:other]}"
|
||||
end
|
||||
end
|
||||
=begin
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
|
||||
def passthru
|
||||
return show_404 alert: 'Test'
|
||||
send(params[:provider]) and return if available_action?(params[:provider])
|
||||
show_404
|
||||
# Or alternatively,
|
||||
# raise ActionController::RoutingError.new('Not Found')
|
||||
end
|
||||
|
||||
@@ -1,21 +1,4 @@
|
||||
module ApplicationHelper
|
||||
def title(*args)
|
||||
res = content_tag :h1, class: 'page-title' do
|
||||
if args.first.is_a?(Symbol) && (args[1].respond_to?(:model_name) || args[1].class.respond_to?(:model_name))
|
||||
model = args[1].respond_to?(:model_name) ? args[1] : args[1].class
|
||||
if args.first == :index
|
||||
t('action.index.label', models: model.model_name.human_plural)
|
||||
else
|
||||
t("action.#{args.first}.label", model: model.model_name.human)
|
||||
end
|
||||
else
|
||||
args.first
|
||||
end
|
||||
end
|
||||
content_for :page_title, res
|
||||
res
|
||||
end
|
||||
|
||||
# overwrite i18n l, to handle nil values
|
||||
def l(*args)
|
||||
return '' unless args.first
|
||||
|
||||
@@ -51,6 +51,14 @@ class User
|
||||
)
|
||||
end
|
||||
|
||||
# needed for cmtool
|
||||
def is_admin?
|
||||
admin?
|
||||
end
|
||||
def active?
|
||||
true
|
||||
end
|
||||
|
||||
def facebook_id
|
||||
uid
|
||||
end
|
||||
|
||||
@@ -1,21 +1,20 @@
|
||||
- model_class = Supplier
|
||||
.page-header= title :index, model_class
|
||||
- title :index, model_class
|
||||
- if @suppliers.any?
|
||||
table.table
|
||||
thead
|
||||
tr
|
||||
th= model_class.human_attribute_name(:name)
|
||||
th= model_class.human_attribute_name(:created_at)
|
||||
th=t 'helpers.actions.title'
|
||||
th.action-header
|
||||
th.action-header
|
||||
tbody
|
||||
- @suppliers.each do |supplier|
|
||||
tr
|
||||
td= link_to supplier.name, [:admin, supplier]
|
||||
td=l supplier.created_at, format: :short
|
||||
td
|
||||
= link_to t('helpers.links.edit'), [:edit, :admin, supplier], class: 'btn btn-mini'
|
||||
'
|
||||
= link_to t("helpers.links.destroy"), [:admin, supplier], method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-mini btn-danger'
|
||||
td data-time=supplier.created_at.iso8601 data-time-format="dd D MMM HH:mm YYYY"
|
||||
= edit_td [:admin, supplier]
|
||||
= destroy_td [:admin, supplier]
|
||||
- else
|
||||
= no_content_given model_class
|
||||
= link_to t("helpers.links.new"), new_admin_supplier_path, class: 'btn btn-primary'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
- model_class = UserFeedback
|
||||
.page-header= title :index, model_class
|
||||
- title :index, model_class
|
||||
- if @user_feedbacks.any?
|
||||
= paginate @user_feedbacks
|
||||
table.table.table-striped
|
||||
@@ -8,17 +8,16 @@
|
||||
th= User.model_name.human
|
||||
th= model_class.human_attribute_name(:content)
|
||||
th= model_class.human_attribute_name(:created_at)
|
||||
th=t 'helpers.actions.title'
|
||||
th.action-header
|
||||
th.action-header
|
||||
tbody
|
||||
- @user_feedbacks.each do |user_feedback|
|
||||
tr
|
||||
td= link_to user_feedback.user.email, [:admin, user_feedback.user]
|
||||
td= user_feedback.content
|
||||
td=l user_feedback.created_at, format: :short
|
||||
td
|
||||
= link_to t('helpers.links.edit'), [:edit, :admin, user_feedback], class: 'btn btn-mini'
|
||||
'
|
||||
= link_to t("helpers.links.destroy"), [:admin, user_feedback], method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-mini btn-danger'
|
||||
td data-time=user_feedback.created_at.iso8601 data-time-format="dd D MMM HH:mm YYYY"
|
||||
= edit_td [:admin, user_feedback]
|
||||
= destroy_td [:admin, user_feedback]
|
||||
- else
|
||||
= no_content_given model_class
|
||||
/= link_to t("helpers.links.new"), new_admin_user_path, class: 'btn btn-primary'
|
||||
|
||||
Reference in New Issue
Block a user