Got gallery update
This commit is contained in:
commit
59ab1e6d17
10 files changed
+91
-7
No files matched your search
@@ -0,0 +1 @@
|
||||
//= require galleryAPI
|
||||
@@ -0,0 +1,27 @@
|
||||
var galleryAPI = function(){
|
||||
g = this;
|
||||
|
||||
this.initialize = function(){
|
||||
$(document).ready(function(){
|
||||
bindHandlers()
|
||||
})
|
||||
var bindHandlers = function(){
|
||||
$("#gallery_panel a.btn").click(function(){
|
||||
rcom.modalWindow({loadDiv:"#"+$(this).attr("href"),width:"400"},function(dom){
|
||||
console.log(dom)
|
||||
dom.find("#category_save_btn").click(function(){
|
||||
var lang = {
|
||||
"en" : dom.find("#category_name_en").val(),
|
||||
"zh_tw" : dom.find("#category_name_zh_tw").val()
|
||||
}
|
||||
$.post("gallery_category_save",{"category":lang},function(){
|
||||
|
||||
})
|
||||
return false;
|
||||
})
|
||||
});
|
||||
return false;
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/orbit_galleries_controller.rb
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
class Panel::Gallery::BackEnd::OrbitGalleriesController < OrbitBackendController
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
def new_category
|
||||
GalleryCategory.create(language_value: params["category"])
|
||||
render :json=>{"success"=>"true"}.to_json
|
||||
end
|
||||
|
||||
end
|
||||
@@ -0,0 +1,6 @@
|
||||
class GalleryCategory
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
|
||||
has_one :i18n_variable, :as => :language_value, :autosave => true, :dependent => :destroy
|
||||
end
|
||||
Vendored
+29
@@ -0,0 +1,29 @@
|
||||
<% content_for :page_specific_javascript do %>
|
||||
<%= javascript_include_tag "galleryAPI" %>
|
||||
<% end %>
|
||||
|
||||
<div id="orbit_gallery">
|
||||
|
||||
</div>
|
||||
<div id="gallery_panel">
|
||||
<a class="btn" href="categories" >Manage Categories</a>
|
||||
<a class="btn" href="albums">Manage Albums</a>
|
||||
</div>
|
||||
<div class="modal hide fade" id="categories">
|
||||
<div class="modal-header">
|
||||
<h3>Categories</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>All Categories</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
New Category[English] : <input type="text" id="category_name_en"></text><br />
|
||||
New Category[Chinese] : <input type="text" id="category_name_zh_tw"></text><br />
|
||||
<a href="#" class="btn" data-dismiss="modal">Close</a>
|
||||
<a href="#" class="btn btn-primary" id="category_save_btn">Save changes</a>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var gallery = new galleryAPI();
|
||||
gallery.initialize();
|
||||
</script>
|
||||
@@ -1,2 +1,14 @@
|
||||
Rails.application.routes.draw do
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
namespace :panel do
|
||||
namespace :gallery do
|
||||
namespace :back_end do
|
||||
match "orbit_gallery" => "orbit_galleries#index"
|
||||
match "gallery_category_save" => "orbit_galleries#new_category"
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
>>>>>>> gallery_orbit
|
||||
end
|
||||
Reference in new issue
Block a user