diff --git a/config/mongoid.yml b/config/mongoid.yml index d20c4727..ebfecd6e 100644 --- a/config/mongoid.yml +++ b/config/mongoid.yml @@ -8,7 +8,7 @@ defaults: &defaults development: <<: *defaults - database: orbit_site_new + database: test_site diff --git a/vendor/built_in_modules/calendar_new/app/views/panel/calendar_new/back_end/event_categories/list.html.erb b/vendor/built_in_modules/calendar_new/app/views/panel/calendar_new/back_end/event_categories/list.html.erb index a7ba79f4..cc2cce17 100644 --- a/vendor/built_in_modules/calendar_new/app/views/panel/calendar_new/back_end/event_categories/list.html.erb +++ b/vendor/built_in_modules/calendar_new/app/views/panel/calendar_new/back_end/event_categories/list.html.erb @@ -10,4 +10,12 @@ <%= render partial: 'category', collection: @categories %> - \ No newline at end of file + +
+
+ <%= link_to content_tag(:i, nil, class: "icons-plus") + " " + t(:add), '#', class: "btn btn-primary open-slide", data: {title: t(:add_category), id: 'new', module: @module_app_id.to_s } %> +
+ +
\ No newline at end of file diff --git a/vendor/built_in_modules/location/app/controllers/panel/location/back_end/location_categories_controller.rb b/vendor/built_in_modules/location/app/controllers/panel/location/back_end/location_categories_controller.rb new file mode 100644 index 00000000..7dd5e220 --- /dev/null +++ b/vendor/built_in_modules/location/app/controllers/panel/location/back_end/location_categories_controller.rb @@ -0,0 +1,19 @@ +class Panel::Location::BackEnd::LocationCategoriesController < OrbitBackendController + def index + @module_app_id = @module_app.id rescue nil + @categories = get_categories_for_index + @categories = @categories.page(params[:page]).per(10) + respond_to do |format| + format.html # index.html.erb + format.json { render json: @categories } + end + end + + def list + @module_app_id = @module_app.id rescue nil + @categories = get_categories_for_index + @categories = @categories.page(params[:page]).per(10) + render :layout => false + end + +end \ No newline at end of file diff --git a/vendor/built_in_modules/location/app/views/panel/location/back_end/location_categories/_category.html.erb b/vendor/built_in_modules/location/app/views/panel/location/back_end/location_categories/_category.html.erb new file mode 100644 index 00000000..096260c6 --- /dev/null +++ b/vendor/built_in_modules/location/app/views/panel/location/back_end/location_categories/_category.html.erb @@ -0,0 +1,21 @@ + + <% @site_valid_locales.each_with_index do |locale, i| %> + + <%= category.title_translations[locale] %> + <% if i == 0 %> +
+ +
+ <% end %> + + <% end %> + <%= category.custom_value %> + \ No newline at end of file diff --git a/vendor/built_in_modules/location/app/views/panel/location/back_end/location_categories/_form.html.erb b/vendor/built_in_modules/location/app/views/panel/location/back_end/location_categories/_form.html.erb new file mode 100644 index 00000000..59f9d791 --- /dev/null +++ b/vendor/built_in_modules/location/app/views/panel/location/back_end/location_categories/_form.html.erb @@ -0,0 +1,12 @@ +<%= flash_messages %> +<%= f.error_messages %> +<%= label_tag("color", t("location.color")) %> +
+ <%= f.text_field :custom_value, id: "color", :class => "color-picker miniColors input-small", :size => "7", :maxlength => "7", :autocomplete=>"off",:value=>"9100FF" %> +
+<%= f.fields_for :title_translations do |f| %> + <% @site_valid_locales.each do |locale| %> + <%= label_tag "name-#{locale}", "#{t(:name)} (#{I18nVariable.from_locale(locale)})" %> + <%= f.text_field locale, :class => 'input-large', :value => (@category.title_translations[locale] rescue ''), placeholder: t(:name), id: locale %> + <% end %> +<% end %> diff --git a/vendor/built_in_modules/location/app/views/panel/location/back_end/location_categories/index.html.erb b/vendor/built_in_modules/location/app/views/panel/location/back_end/location_categories/index.html.erb new file mode 100644 index 00000000..2c0ae280 --- /dev/null +++ b/vendor/built_in_modules/location/app/views/panel/location/back_end/location_categories/index.html.erb @@ -0,0 +1,66 @@ +<%= stylesheet_link_tag "jquery.miniColors" %> + +<%= javascript_include_tag "jquery.miniColors.min" %> + +<%= javascript_include_tag "admin/categories" %> + +
+ + + + <% @site_valid_locales.each_with_index do |locale, i| %> + + <% end %> + + + + + <%= render partial: 'category', collection: @categories %> + +
<%= t(:_locale, :locale => locale) %><%= t('event_category.color') %>
+ + +
+
+ <%= link_to content_tag(:i, nil, class: "icons-plus") + " " + t(:add), '#', class: "btn btn-primary open-slide", data: {title: t(:add_category), id: 'new', module: @module_app_id.to_s } %> +
+ +
+
+
+
+ + + + +
+
+
+
+ <%= form_for :category, url: nil, html:{:id=>"color"}, remote: true do |f| %> +
+ <%= render :partial => "form", :locals => { :f => f } %> +
+ <%= t(:cancel) %> + <%= f.submit t(:submit), class: 'btn btn-primary btn-small' %> +
+
+ <% end %> +
+
+
+
+ \ No newline at end of file diff --git a/vendor/built_in_modules/location/app/views/panel/location/back_end/location_categories/list.html.erb b/vendor/built_in_modules/location/app/views/panel/location/back_end/location_categories/list.html.erb new file mode 100644 index 00000000..38d45712 --- /dev/null +++ b/vendor/built_in_modules/location/app/views/panel/location/back_end/location_categories/list.html.erb @@ -0,0 +1,21 @@ + + + + <% @site_valid_locales.each_with_index do |locale, i| %> + + <% end %> + + + + + <%= render partial: 'category', collection: @categories %> + +
<%= t(:_locale, :locale => locale) %><%= t('location_category.color') %>
+
+
+ <%= link_to content_tag(:i, nil, class: "icons-plus") + " " + t(:add), '#', class: "btn btn-primary open-slide", data: {title: t(:add_category), id: 'new', module: @module_app_id.to_s } %> +
+ +
\ No newline at end of file diff --git a/vendor/built_in_modules/location/config/routes.rb b/vendor/built_in_modules/location/config/routes.rb index dac4a423..26ce72c9 100644 --- a/vendor/built_in_modules/location/config/routes.rb +++ b/vendor/built_in_modules/location/config/routes.rb @@ -2,7 +2,8 @@ Rails.application.routes.draw do namespace :panel do namespace :location do namespace :back_end do - + match 'location_categories/list' => "location_categories#list" + resources :location_categories match "locations/get_locations" => "locations#get_locations" match "locations/get_categories" => "locations#get_categories" diff --git a/vendor/built_in_modules/location/init.rb b/vendor/built_in_modules/location/init.rb index a0767bc7..5fd2ed6f 100644 --- a/vendor/built_in_modules/location/init.rb +++ b/vendor/built_in_modules/location/init.rb @@ -37,27 +37,27 @@ module Location side_bar do head_label_i18n 'location.location',:icon_class=>"icons-location" available_for [:admin,:guest,:manager,:sub_manager] - active_for_controllers ({:private=>['locations']}) + active_for_controllers ({:private=>['locations','location_categories']}) head_link_path "panel_location_back_end_locations_path" context_link 'location.all_locations', :link_path=>"panel_location_back_end_locations_path" , :priority=>1, - :active_for_action=>{:localtions=>:index}, + :active_for_action=>{:locations=>:index}, :available_for => [:manager] context_link 'location.add_location', :link_path=>"new_panel_location_back_end_location_path" , :priority=>1, - :active_for_action=>{:localtions=>:new}, + :active_for_action=>{:locations=>:new}, :available_for => [:manager] context_link 'location.categories', - :link_path=>"admin_module_app_categories_path(get_module_app)" , + :link_path=>"panel_location_back_end_location_categories_path" , :priority=>1, - :active_for_action=>{:localtion_categories=>:index}, + :active_for_category => 'Location', :available_for => [:manager] end