From 6e90196b7769809b754b72219410e0c6eb2c73d2 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Mon, 20 Aug 2012 22:00:57 +0800 Subject: [PATCH] updates for tagging and language fix --- .../app/assets/javascripts/galleryAPI.js.erb | 324 ++++++++++++------ .../app/assets/stylesheets/gallery.css | 6 + .../back_end/orbit_galleries_controller.rb | 53 ++- .../gallery/app/models/gallery_album.rb | 1 + .../gallery/app/models/gallery_image.rb | 2 +- .../orbit_galleries/categorylist.html.erb | 6 +- .../orbit_galleries/edit_album.html.erb | 34 +- .../back_end/orbit_galleries/index.html.erb | 63 ++-- .../gallery/config/locales/en.yml | 1 + .../gallery/config/locales/zh_tw.yml | 1 + .../built_in_modules/gallery/config/routes.rb | 1 + 11 files changed, 346 insertions(+), 146 deletions(-) diff --git a/vendor/built_in_modules/gallery/app/assets/javascripts/galleryAPI.js.erb b/vendor/built_in_modules/gallery/app/assets/javascripts/galleryAPI.js.erb index b6cc6b8d..288de296 100644 --- a/vendor/built_in_modules/gallery/app/assets/javascripts/galleryAPI.js.erb +++ b/vendor/built_in_modules/gallery/app/assets/javascripts/galleryAPI.js.erb @@ -1,31 +1,46 @@ <%# encoding: utf-8 %> +$.extend($.expr[':'], { + 'containsi': function (elem, i, match, array) { + return (elem.textContent || elem.innerText || '').toLowerCase().indexOf((match[3] || "").toLowerCase()) >= 0; + } +}); var galleryAPI = function(){ g = this; this.urlVars = rcom.getUrlVars(); this.albumArea = $("#orbit_gallery"); - this.loadArea = ""; + this.loadArea = null; + this.tagList = $("ul#gallery_tag_list"); // this.authenticated = false; - this.initialize = function(){ + this.initialize = function(callbackFn){ $(document).ready(function(){ bindHandlers(); + var passid = null; if(typeof g.urlVars['cat']!= "undefined"){ + g.loadArea = "albums"; + passid = g.urlVars['cat']; g.loadAlbums(g.urlVars['cat']); - g.loadArea = "albums"; }else if(typeof g.urlVars['album']!= "undefined"){ - g.loadImages(g.urlVars['album']); g.loadArea = "images"; + passid = g.urlVars['album']; + g.loadImages(g.urlVars['album']); }else if(typeof g.urlVars['theater']!= "undefined"){ - g.loadTheater(g.urlVars['theater']); g.loadArea = "theater"; + passid = g.urlVars['theater']; + g.loadTheater(g.urlVars['theater']); }else if(typeof g.urlVars['edit']!= "undefined"){ - g.editAlbum(g.urlVars['edit']); g.loadArea = "edit"; + passid = g.urlVars['edit']; + g.editAlbum(g.urlVars['edit']); }else if(typeof g.urlVars['tag']!= "undefined"){ + g.loadArea = "albums"; + passid = g.urlVars['tag']; g.loadAlbums(g.urlVars['tag']); + }else if(g.urlVars.length == 0){ g.loadArea = "albums"; - }else{ g.loadAlbums("all"); - g.loadArea = "albums"; + } + if(typeof callbackFn == "function"){ + callbackFn.call(this,g.loadArea,passid); } }) var bindHandlers = function(){ @@ -48,6 +63,7 @@ var galleryAPI = function(){ window.location = url; } }) + } $("#filter .filter-clear a").click(function(){ var loc = window.location.href; @@ -105,12 +121,15 @@ var galleryAPI = function(){ } this.loadAlbums = function(id){ - var headbtn = $('" href="albums" onclick="return false;"><%= I18n.t("gallery.add_album") %>'); - headbtn.click(function(){g.makeNewAlbum();}) - g.albumArea.find(".rghead .rgfn").html(headbtn); + g.loadFooterPanel(g.loadArea,id,function(headbtn){ + headbtn = $(headbtn); + headbtn.click(function(){g.makeNewAlbum();}) + g.albumArea.find(".rghead .rgfn").html(headbtn); + }) + g.albumArea.find("#imgholder").empty(); - var $addsign = $('
Add Album
'); - $addsign.find("a").click(function(){g.makeNewAlbum();}) + // var $addsign = $('
Add Album
'); + // $addsign.find("a").click(function(){g.makeNewAlbum();}) if(id!="all"){ var cids = []; @@ -137,43 +156,75 @@ var galleryAPI = function(){ $.each(categories,function(x,category){ $.each(category,function(i,album){ if(album.cover == "default") - var $img = $("
"+album.name+"
"); + var $img = $("
"+album.name+"
"); else - var $img = $("
"+album.name+"
"); + var $img = $("
"+album.name+"
"); + var tag_string = ""; + for(tag in album.tag_names){ + tag_string+=album.tag_names[tag] + " "; + } + $img.find("span.tagnames").text(tag_string); g.albumArea.find("#imgholder").append($img); }) }) - g.albumArea.find("#imgholder").append($addsign); + // g.albumArea.find("#imgholder").append($addsign); }) } this.loadImages = function(id){ + var panelopen = false; + g.loadFooterPanel(g.loadArea,id,function(headerPanel){ + headarea = $(headerPanel); + g.albumArea.find(".rghead .rgfn").html(headarea); + $('.bt-tag').click(function(){ + $(this).toggleClass("active"); + var $tag_panel = $('#tag_panel'), + tag_panel_position = 0; + if( $tag_panel.css('right') == '0px' ){ + tag_panel_position = -200; + } + $tag_panel.animate({'right':tag_panel_position}, 300); - var headarea = '" href="orbit_gallery"><%= I18n.t("gallery.back_to_albums") %> '; - - headarea+='" href="images" onclick="return false;"><%= I18n.t("gallery.add_images") %> '; - headarea+='" href="delete" onclick="return false;"><%= I18n.t("gallery.del_album") %> '; - headarea+='" href="orbit_gallery?edit='+id+'" ><%= I18n.t("gallery.edit") %>'; - - headarea+='" href="" ><%= I18n.t("gallery.album_tag") %>'; - - headarea = $(headarea); + g.albumArea + .delay(200) + .animate({'margin-right':tag_panel_position+200},300); + return false; + }); + g.albumArea.find("#tag_search_box").keyup(function(e){ + sval = $(this).val(); + if(sval == "<%= I18n.t('gallery.search_tags') %>") + sval = ""; + sval = sval.replace(/(^\s*)|(\s*$)/g,''); + if(sval){ + var re1 = new RegExp("^[\u4E00-\uFA29]*$"); //Chinese character range + var re2 = new RegExp("^[\uE7C7-\uE7F3]*$"); + if ((re1.test(sval) && (re2.test(sval)))){ + $("ul#gallery_tag_list li span:not(:contains("+sval+"))").parent().slideUp(); + }else{ + $("ul#gallery_tag_list li span:not(:containsi("+sval+"))").parent().slideUp(); + } + }else{ + $("ul#gallery_tag_list li").slideDown(); + } + }) + g.albumArea.find("#tag_panel button.bt-save").click(function(){ + g.saveTags(id,g.loadArea); + }) + g.albumArea.find(".rghead .rgfn a.bt-add").click(function(){ + showUploadPanel(); + }) + g.albumArea.find(".rghead .rgfn a.bt-del").click(function(){ + g.deleteAlbum(id); + }) + }) var uploadpanel = $('
'); var frame = $(''); - g.albumArea.find(".rghead .rgfn").html(headarea); - g.albumArea.find(".rghead .rgfn a.bt-add").click(function(){ - showUploadPanel(); - }) - g.albumArea.find(".rghead .rgfn a.bt-del").click(function(){ - g.deleteAlbum(id); - }) uploadpanel.find("a.bt-cls").click(function(){ uploadpanel.hide("slide"); frame.remove(); g.loadImages(id); panelopen = false; }) - var panelopen = false; var showUploadPanel = function(){ if(!panelopen){ uploadpanel.prepend(frame); @@ -186,36 +237,24 @@ var galleryAPI = function(){ g.albumArea.find("#imgholder").empty(); $("#filter").remove(); g.albumArea.css("margin-top",""); - var $addsign = $('
Add Album
'); - $addsign.find("a").click(function(){showUploadPanel();}) - $.getJSON("get_images",{aid:id},function(images){ - $.each(images,function(i,image){ + // var $addsign = $('
Add Album
'); + // $addsign.find("a").click(function(){showUploadPanel();}) + $.getJSON("get_images",{aid:id},function(album){ + $.each(album.images,function(i,image){ var thumb = image.file.thumb.url; var $img = $("
"); g.albumArea.find("#imgholder").append($img); }) - g.albumArea.find("#imgholder").append($addsign); + g.tagList.find("input").attr("checked",false); + $.each(album.tags,function(i,tag){ + + g.tagList.find("li[data-content="+tag+"] input").attr("checked",true); + }) + // g.albumArea.find("#imgholder").append($addsign); }) - g.albumArea.find("#imgholder").append($addsign); - - + // g.albumArea.find("#imgholder").append($addsign); // tag - $('.bt-tag').click(function(){ - var $tag_panel = $('#tag_panel'), - tag_panel_position = 0; - - if( $tag_panel.css('right') == '0px' ){ - tag_panel_position = -200; - } - $tag_panel.animate({'right':tag_panel_position}, 300); - - g.albumArea - .delay(200) - .animate({'margin-right':tag_panel_position+200},300); - return false; - }); - - + } this.loadTheater = function(id){ var imageArray; @@ -230,7 +269,52 @@ var galleryAPI = function(){ $("#main_pic").height(picHeight); $img.height("100%"); + + $('.bt-tag').click(function(){ + if(!$(this).hasClass("active")) + updatePhotoTag(); + $(this).toggleClass("active"); + var $tag_panel = $('#tag_panel'), + tag_panel_position = 0; + if( $tag_panel.css('right') == '0px' ){ + tag_panel_position = -200; + } + $tag_panel.animate({'right':tag_panel_position}, 300); + + g.albumArea + .delay(200) + .animate({'margin-right':tag_panel_position+200},300); + return false; + }); + var updatePhotoTag = function(){ + var tags = imageArray[imagecount].tag_ids; + g.tagList.find("input").attr("checked",false); + for(tag in tags){ + g.tagList.find("li[data-content="+tags[tag]+"] input").attr("checked",true); + } + } + g.albumArea.find("#tag_search_box").keyup(function(e){ + sval = $(this).val(); + if(sval == "<%= I18n.t('gallery.search_tags') %>") + sval = ""; + sval = sval.replace(/(^\s*)|(\s*$)/g,''); + if(sval){ + var re1 = new RegExp("^[\u4E00-\uFA29]*$"); //Chinese character range + var re2 = new RegExp("^[\uE7C7-\uE7F3]*$"); + if ((re1.test(sval) && (re2.test(sval)))){ + $("ul#gallery_tag_list li span:not(:contains("+sval+"))").parent().slideUp(); + }else{ + $("ul#gallery_tag_list li span:not(:containsi("+sval+"))").parent().slideUp(); + } + + }else{ + $("ul#gallery_tag_list li").slideDown(); + } + }) + g.albumArea.find("#tag_panel button.bt-save").click(function(){ + g.saveTags(imageArray[imagecount]._id,g.loadArea); + }) $(".slidectrl a.togglelist").click(function(){ var rslide_h = $rslide.outerHeight(); if ( $slidelist.height() < 1 ){ @@ -328,10 +412,13 @@ var galleryAPI = function(){ window.history.pushState({path:pageurl},'',pageurl); } // $(".slideinfo b.info").text(imageArray[imagecount].title); + if($('.bt-tag').hasClass("active")) + updatePhotoTag(); $(".slideinfo span.info").text(imageArray[imagecount].description); if(imageArray.length > 1) updateNavigation(); }) + } var updateNavigation = function(){ var next, prev; @@ -353,19 +440,15 @@ var galleryAPI = function(){ } var preparestage = function(albumid){ - $.getJSON("get_images",{aid:albumid},function(images){ - imageArray = eval(images); - $.each(images,function(i,image){ + $.getJSON("get_images",{aid:albumid},function(album){ + imageArray = eval(album.images); + $.each(album.images,function(i,image){ if(image._id == id) imagecount = i; }) bindHandlers(); }) } - - var head = $('"><%= I18n.t("gallery.back_to_photos") %>'); - var head1 = $('" href="" ><%= I18n.t("gallery.edit") %>'); - var head2 = $('" href="" ><%= I18n.t("gallery.photo_tag") %>'); g.albumArea.find("#imgholder").load("theater?pic="+id,function(theater,response,xhr){ if(xhr.status == 404){ $(this).text("<%= I18n.t('gallery.pic_not_found') %>."); @@ -374,16 +457,55 @@ var galleryAPI = function(){ $("#filter").remove(); g.albumArea.css("margin-top",""); var albumid = $(theater).find("#main_pic").attr("data-content"); - head.attr("href","orbit_gallery?album="+albumid); - head1.attr("href","orbit_gallery?edit="+albumid); - g.albumArea.find(".rghead .rgfn").html(head); - g.albumArea.find(".rghead .rgfn").append(head1,head2); - picHeight = $(window).height() - ($("#orbit-bar").outerHeight() + $("#orbit_gallery .rghead").outerHeight()); + g.loadFooterPanel(g.loadArea,id,function(head){ + head = $(head); + g.albumArea.find(".rghead .rgfn").html(head); + g.albumArea.find("a.bt-back").attr("href","orbit_gallery?album="+albumid); + g.albumArea.find("a.bt-edit").attr("href","orbit_gallery?edit="+albumid); + }) + g.albumArea.css("margin-bottom","0"); + picHeight = $(window).height() - ($("#orbit-bar").outerHeight() + $("#orbit_gallery .form-actions").outerHeight()); preparestage(albumid); + + }); + } + this.editAlbum = function(id){ + var bindHandlers = function(){ + $(".nav .nav-tabs a").click(function(){ + $(".tab_content .tab-pane").hide(); - // tag + }) + $(".description_loader .edit_fn .bt-cover").click(function(){ + $(".bt-cover").removeClass("setcover"); + $(this).addClass("setcover"); + $.post("set_cover",{"imageid":$(this).attr("href"),"aid":id},function(){}) + }) + $(".description_loader .edit_fn .bt-dels").click(function(){ + $(this).toggleClass("setdelete"); + if($(".description_loader .edit_fn .setdelete").length > 0){ + g.albumArea.find(".rghead .rgfn .bt-delete").show(); + }else{ + g.albumArea.find(".rghead .rgfn .bt-delete").hide(); + } + }) + g.albumArea.find(".rghead .rgfn .bt-save").click(function(){ + // var dataArray = Array(); + // $(".description_loader .txtchange").each(function(){ + // dataArray.push({"id":$(this).attr("for"),"text": $(this).val()}); + // }) + // var albumnm = Array(); + // $(".albumname_edit .txtchange").each(function(){ + // albumnm.push($(this).val()) + // }) + var dataArray = $("form#edit_album").serialize(); + $.post("update_album",{"aid":id,"data":dataArray},function(){ + + }) + }) $('.bt-tag').click(function(){ + + $(this).toggleClass("active"); var $tag_panel = $('#tag_panel'), tag_panel_position = 0; @@ -397,33 +519,26 @@ var galleryAPI = function(){ .animate({'margin-right':tag_panel_position+200},300); return false; }); - }); - } - - this.editAlbum = function(id){ - var bindHandlers = function(){ - $("#description_loader .edit_fn .bt-cover").click(function(){ - $(".bt-cover").removeClass("setcover"); - $(this).addClass("setcover"); - $.post("set_cover",{"imageid":$(this).attr("href"),"aid":id},function(){}) - }) - $("#description_loader .edit_fn .bt-dels").click(function(){ - $(this).toggleClass("setdelete"); - if($("#description_loader .edit_fn .setdelete").length > 0){ - g.albumArea.find(".rghead .rgfn .bt-delete").show(); + g.albumArea.find("#tag_search_box").keyup(function(e){ + sval = $(this).val(); + if(sval == "<%= I18n.t('gallery.search_tags') %>") + sval = ""; + sval = sval.replace(/(^\s*)|(\s*$)/g,''); + if(sval){ + var re1 = new RegExp("^[\u4E00-\uFA29]*$"); //Chinese character range + var re2 = new RegExp("^[\uE7C7-\uE7F3]*$"); + if ((re1.test(sval) && (re2.test(sval)))){ + $("ul#gallery_tag_list li span:not(:contains("+sval+"))").parent().slideUp(); + }else{ + $("ul#gallery_tag_list li span:not(:containsi("+sval+"))").parent().slideUp(); + } + }else{ - g.albumArea.find(".rghead .rgfn .bt-delete").hide(); + $("ul#gallery_tag_list li").slideDown(); } }) - g.albumArea.find(".rghead .rgfn .bt-save").click(function(){ - var dataArray = Array(); - $("#description_loader .txtchange").each(function(){ - dataArray.push({"id":$(this).attr("for"),"text": $(this).val()}); - }) - albumnm = $(".albumname_edit #album_name_text").val(); - $.post("update_album",{data:dataArray,"aid":id,"name":albumnm},function(){ - - }) + g.albumArea.find("#tag_panel button.bt-save").click(function(){ + g.saveTags(imageArray[imagecount]._id,g.loadArea); }) var tempval; $(".txtchange").focus(function(){ @@ -436,8 +551,8 @@ var galleryAPI = function(){ var images_to_delete = new Array(); var delete_cover = false; var doms_to_delete = new Array(); - var thiscover = $("#description_loader .edit_fn .setcover").attr("href"); - $("#description_loader .edit_fn .bt-dels").each(function(){ + var thiscover = $(".description_loader .edit_fn .setcover").attr("href"); + $(".description_loader .edit_fn .bt-dels").each(function(){ if($(this).hasClass("setdelete")){ images_to_delete.push($(this).attr("href")); doms_to_delete.push($(this).parent().parent()); @@ -471,5 +586,20 @@ var galleryAPI = function(){ bindHandlers(); }) } -} + this.saveTags = function(id,tagsfor){ + var tagids = new Array(); + g.tagList.find("li input:checked").each(function(){ + tagids.push($(this).parent().attr("data-content")); + }) + var tag = null; + if(g.loadArea == "images") + tag = "album"; + else if(g.loadArea == "theater") + tag = "pic"; + $.post("save_tags",{"id":id,"tag":tag,"tids":tagids},function(){ + + }) + } +} +galleryAPI.prototype.locale = "en"; diff --git a/vendor/built_in_modules/gallery/app/assets/stylesheets/gallery.css b/vendor/built_in_modules/gallery/app/assets/stylesheets/gallery.css index b3a3fdb5..88916e00 100755 --- a/vendor/built_in_modules/gallery/app/assets/stylesheets/gallery.css +++ b/vendor/built_in_modules/gallery/app/assets/stylesheets/gallery.css @@ -549,6 +549,12 @@ body.fullscreen, .fullscreen #container, .fullscreen #container2, .fullscreen #m margin-left: 8px; margin-right: 8px; } +.tab_content .tab-pane{ + display: none; +} +.tab_content .active{ + display: block; +} #orbit_gallery .btn { margin: 0; } #orbit_gallery .rgfn .btn { margin-left: 8px; diff --git a/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/orbit_galleries_controller.rb b/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/orbit_galleries_controller.rb index 3a2a17f0..cb78c5f6 100644 --- a/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/orbit_galleries_controller.rb +++ b/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/orbit_galleries_controller.rb @@ -2,7 +2,7 @@ class Panel::Gallery::BackEnd::OrbitGalleriesController < OrbitBackendController include AdminHelper def index if is_manager? || is_admin? || is_sub_manager? - @authenticated = true + @authenticated = true #turn this value to false for view only else @authenticated = false end @@ -90,8 +90,20 @@ include AdminHelper end end end - - + i = 0 + @albums.each do |album| + album.each do |values| + # if values.tag_ids.kind_of?(Array) + tags = Array.new + values.tag_ids.each do |tag| + tags << GalleryTag.find(tag)[I18n.locale] + end + # end + values.tag_names = tags + values.save + end + i = i + 1 + end # @albums = GalleryAlbum.find("5017a7babd98eb049900000a") # @albums.update_attributes({:tag_ids =>["501ba786bd98eb0232000126"]}) @@ -118,8 +130,7 @@ include AdminHelper def get_images @album = GalleryAlbum.find(params["aid"]) - @images = @album.gallery_images.all - render :json=>@images.to_json + render :json=>{"images" => @album.gallery_images.all, "tags" => @album.tag_ids}.to_json end def theater @@ -143,7 +154,7 @@ include AdminHelper aid = params['aid'] album = GalleryAlbum.find(aid) @images = album.gallery_images.all - @album_name = album.name + @album_name = album.name_translations @cover = album.cover render :layout => false end @@ -171,16 +182,30 @@ include AdminHelper end def update_album + # data = params['data'] + # album_name = params['name'] + # aid = params['aid'] + # data.each do |d| + # image = GalleryImage.find(d[1][:id]) + # image.update_attributes(:description=>d[1][:text]) + # end + # album = GalleryAlbum.find(aid) + # album.update_attributes(:name => album_name) data = params['data'] - album_name = params['name'] - aid = params['aid'] - data.each do |d| - image = GalleryImage.find(d[1][:id]) - image.update_attributes(:description=>d[1][:text]) + debugger + + render :json =>{"success"=>true}.to_json + end + + def save_tags + case params[:tag] + when "album" + @object = GalleryAlbum.find(params[:id]) + when "pic" + @object = GalleryImage.find(params[:id]) end - album = GalleryAlbum.find(aid) - album.update_attributes(:name => album_name) - render :json =>{"success"=>true}.to_json + @object.update_attributes({:tag_ids => params[:tids]}) + render :json => {"success"=> "true"}.to_json end end diff --git a/vendor/built_in_modules/gallery/app/models/gallery_album.rb b/vendor/built_in_modules/gallery/app/models/gallery_album.rb index f76f98af..b16e3289 100644 --- a/vendor/built_in_modules/gallery/app/models/gallery_album.rb +++ b/vendor/built_in_modules/gallery/app/models/gallery_album.rb @@ -6,6 +6,7 @@ class GalleryAlbum field :description, localize: true field :cover, default: "default" field :cover_path + field :tag_names belongs_to :gallery_category has_and_belongs_to_many :tags, :class_name => "GalleryTag" diff --git a/vendor/built_in_modules/gallery/app/models/gallery_image.rb b/vendor/built_in_modules/gallery/app/models/gallery_image.rb index e3dc5de1..8b958ddd 100644 --- a/vendor/built_in_modules/gallery/app/models/gallery_image.rb +++ b/vendor/built_in_modules/gallery/app/models/gallery_image.rb @@ -5,7 +5,7 @@ class GalleryImage mount_uploader :file, GalleryUploader field :title - field :description + field :description, localize: true has_and_belongs_to_many :tags, :class_name => "GalleryTag" diff --git a/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/orbit_galleries/categorylist.html.erb b/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/orbit_galleries/categorylist.html.erb index 1103206b..33f19760 100644 --- a/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/orbit_galleries/categorylist.html.erb +++ b/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/orbit_galleries/categorylist.html.erb @@ -2,9 +2,9 @@ <% @categorylist.each do |category| %>
- + <% @site_valid_locales.each do |locale| %> - <%= category.name_translations[locale] %> + <%= category.name_translations[locale] %> <% end %>
@@ -37,7 +37,7 @@ var parent = a.parent().parent(); var parenthtml = parent.html(); var tempdom = $("
"); - parent.find("span").each(function(){ + parent.find("span.value").each(function(){ var locale = $(this).attr("for"); var lang = { "en" : "English", diff --git a/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/orbit_galleries/edit_album.html.erb b/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/orbit_galleries/edit_album.html.erb index 6dc2232f..d7c6b365 100644 --- a/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/orbit_galleries/edit_album.html.erb +++ b/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/orbit_galleries/edit_album.html.erb @@ -4,26 +4,42 @@ # from line 129 %> +
-
+ <% i = 0 %> + <% @site_valid_locales.each do |locale| %> + <% if i == 0 %> +
+ <% else %> +
+ <% end %> + <% i = 1 %>
-
+
-
+
<% @images.each do |image| %>
- +
Delete + Tag <% if image.id.to_s == @cover %> Set Cover <% else %> @@ -34,7 +50,9 @@ <% end %>
- +
-->
\ No newline at end of file diff --git a/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/orbit_galleries/index.html.erb b/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/orbit_galleries/index.html.erb index b3e82caa..dd06797d 100644 --- a/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/orbit_galleries/index.html.erb +++ b/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/orbit_galleries/index.html.erb @@ -68,6 +68,7 @@
+ <% if @authenticated %>
@@ -76,35 +77,25 @@
+ <% + @locales = Array.new + @site_valid_locales.each do |locale| + @locales << locale + end + %>
-
    -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • +
- + +
+ <% end %> <% content_for :page_specific_javascript do %> <%= javascript_include_tag "galleryAPI" %> <% end %> diff --git a/vendor/built_in_modules/gallery/config/locales/en.yml b/vendor/built_in_modules/gallery/config/locales/en.yml index 38936646..b26a62ef 100644 --- a/vendor/built_in_modules/gallery/config/locales/en.yml +++ b/vendor/built_in_modules/gallery/config/locales/en.yml @@ -27,4 +27,5 @@ en: save: Save cate_auth: Category Authorization cancel: Cancel + search_tags: Search Tags diff --git a/vendor/built_in_modules/gallery/config/locales/zh_tw.yml b/vendor/built_in_modules/gallery/config/locales/zh_tw.yml index 1d755e26..6957141f 100644 --- a/vendor/built_in_modules/gallery/config/locales/zh_tw.yml +++ b/vendor/built_in_modules/gallery/config/locales/zh_tw.yml @@ -24,4 +24,5 @@ zh_tw: del_album?: "刪除這本相簿嗎?" album_not_found: "相簿不存在" pic_not_found: "照片不存在" + search_tags: 搜索標籤 diff --git a/vendor/built_in_modules/gallery/config/routes.rb b/vendor/built_in_modules/gallery/config/routes.rb index 65de562d..41e53507 100644 --- a/vendor/built_in_modules/gallery/config/routes.rb +++ b/vendor/built_in_modules/gallery/config/routes.rb @@ -18,6 +18,7 @@ Rails.application.routes.draw do match "set_cover" => "orbit_galleries#set_cover" match "delete_images" => "orbit_galleries#delete_images" match "update_album" => "orbit_galleries#update_album" + match "save_tags" => "orbit_galleries#save_tags" resources :tags end end