From be850ce0be1566bcd086a52f6a9753c567b592c6 Mon Sep 17 00:00:00 2001 From: devin Date: Tue, 20 Nov 2012 18:04:23 +0800 Subject: [PATCH 01/18] minor update for gallery and calendar backend --- .../app/assets/javascripts/calendarAPI.js.erb | 8 +++++--- .../calendar/app/assets/stylesheets/calendar.css | 2 +- .../calendar/back_end/cals/agenda_view.html.erb | 4 ++-- .../gallery/app/assets/stylesheets/gallery.css | 15 +++++++++------ 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/vendor/built_in_modules/calendar/app/assets/javascripts/calendarAPI.js.erb b/vendor/built_in_modules/calendar/app/assets/javascripts/calendarAPI.js.erb index 181a757b..a1ab3b6c 100644 --- a/vendor/built_in_modules/calendar/app/assets/javascripts/calendarAPI.js.erb +++ b/vendor/built_in_modules/calendar/app/assets/javascripts/calendarAPI.js.erb @@ -242,7 +242,8 @@ var calendarAPI = function(){ this.loadMonthView = function(month,year){ $("#range_selection").hide(); $("#navigation").show(); - $("#sec1").removeClass("span8").addClass("span3"); + $("#sec1").removeClass("span7").addClass("span3"); + $("#sec3").removeClass("span5").addClass("span4"); $("#sec2").show(); c.view = "month"; if(!month){ @@ -512,7 +513,7 @@ var calendarAPI = function(){ this.loadDayView = function(day,month,year){ $("#range_selection").hide(); $("#navigation").show(); - $("#sec1").removeClass("span8").addClass("span3"); + $("#sec1").removeClass("span7").addClass("span3"); $("#sec2").show(); c.view = "day"; if(!day){ @@ -594,7 +595,8 @@ var calendarAPI = function(){ $('#view_holder').load(url, function() { $("#navigation").hide(); $("#range_selection").html($("#agenda_date_range").html()).show(); - $("#sec1").removeClass("span3").addClass("span8"); + $("#sec1").removeClass("span3").addClass("span7"); + $("#sec3").removeClass("span4").addClass("span5"); $("#sec2").hide(); bindHandlers(); }) diff --git a/vendor/built_in_modules/calendar/app/assets/stylesheets/calendar.css b/vendor/built_in_modules/calendar/app/assets/stylesheets/calendar.css index fd25b10e..0adf7e93 100644 --- a/vendor/built_in_modules/calendar/app/assets/stylesheets/calendar.css +++ b/vendor/built_in_modules/calendar/app/assets/stylesheets/calendar.css @@ -1,7 +1,7 @@ /* orbit calendar */ #orbit_calendar { padding: 10px 8px; - + min-width: 960px; transition: all 0.3s ease; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; diff --git a/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/agenda_view.html.erb b/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/agenda_view.html.erb index 0a57ae8c..5a0dc703 100644 --- a/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/agenda_view.html.erb +++ b/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/agenda_view.html.erb @@ -42,7 +42,7 @@
<% @datesets.each_with_index do |dateset,i| %>
-
+

<%= Date::MONTHNAMES[@calendartitle[i][0]] + " - " + @calendartitle[i][1].to_s %>

@@ -71,7 +71,7 @@
-
+
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 0b5bdc34..86a189fd 100755 --- a/vendor/built_in_modules/gallery/app/assets/stylesheets/gallery.css +++ b/vendor/built_in_modules/gallery/app/assets/stylesheets/gallery.css @@ -90,7 +90,7 @@ -moz-transition: all, 0.3s ease; } .rgalbum .albumname { - font-size: 15px; + font-size: 18px; padding: 6px 0; display: block; transition: background 0.3s ease; @@ -105,14 +105,14 @@ .rgp .rgtitle { margin: 0 0 10px 0; } /* Photo Edit */ -.albumname_edit label, .albumname_edit .rginput, .rgphoto_edit img, .rgphoto_edit .rginput { float: left; } +.albumname_edit label, .albumname_edit .rginput, .rgphoto_edit > a, .rgphoto_edit .rginput { float: left; } .rgphoto_edit, .albumname_edit { clear: both; overflow: hidden; margin-bottom: 10px; } .albumname_edit label { - width: 120px; + width: 150px; margin: 0 10px 0 0; text-align: right; padding: 0; @@ -398,7 +398,7 @@ .rgih26 { width: 208px; } .rgih26 span { } -.rgih26 input { width: 376px; } +.rgih26 input { width: 356px; } .rgih26.focus { } .rgih26.focus span { } .rgih68 { width: 396px; } @@ -408,7 +408,7 @@ .rgih68.focus span { } .rgih98 { width: 396px; } .rgih98 span { } -.rgih98 textarea { width: 376px; height: 80px; } +.rgih98 textarea { width: 356px; height: 110px; } .rgih98.focus { } .rgih98.focus span { } @@ -476,7 +476,7 @@ .tag_search { position: absolute; left: -1px; - bottom: -32px; + bottom: -30px; width: 200px; height: 32px; background-color: #f5f5f5; @@ -552,3 +552,6 @@ padding-left: 12px; padding-right: 12px; } +.o_album_edit form { + margin-left: 8px; +} From 2cc1ed1db7c63d735ad2a28ea3aa0d6252e27072 Mon Sep 17 00:00:00 2001 From: devin Date: Wed, 21 Nov 2012 11:16:23 +0800 Subject: [PATCH 02/18] calendar js minor update --- .../calendar/app/assets/javascripts/calendarAPI.js.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vendor/built_in_modules/calendar/app/assets/javascripts/calendarAPI.js.erb b/vendor/built_in_modules/calendar/app/assets/javascripts/calendarAPI.js.erb index a1ab3b6c..0f9923ca 100644 --- a/vendor/built_in_modules/calendar/app/assets/javascripts/calendarAPI.js.erb +++ b/vendor/built_in_modules/calendar/app/assets/javascripts/calendarAPI.js.erb @@ -389,7 +389,8 @@ var calendarAPI = function(){ this.loadWeekView = function(week,year){ $("#range_selection").hide(); $("#navigation").show(); - $("#sec1").removeClass("span8").addClass("span3"); + $("#sec1").removeClass("span7").addClass("span3"); + $("#sec3").removeClass("span5").addClass("span4"); $("#sec2").show(); c.view = "week"; if(!week){ @@ -514,6 +515,7 @@ var calendarAPI = function(){ $("#range_selection").hide(); $("#navigation").show(); $("#sec1").removeClass("span7").addClass("span3"); + $("#sec3").removeClass("span5").addClass("span4"); $("#sec2").show(); c.view = "day"; if(!day){ From ee053cd8ac5401256f1b51444ae3c55aa5bee7d3 Mon Sep 17 00:00:00 2001 From: "Matthew K. Fu JuYuan" Date: Wed, 21 Nov 2012 11:46:06 +0800 Subject: [PATCH 03/18] fix and hide for visitors,except for album --- .../admin/users_new_interface_controller.rb | 10 +++++++--- .../admin/users_new_interface/_filter.html.erb | 6 ++++-- .../_index_paginator.html.erb | 2 ++ .../_user_for_listing.html.erb | 2 +- .../admin/users_new_interface/show.html.erb | 2 +- app/views/layouts/_guest_orbit_menu.erb | 5 +++++ app/views/layouts/_member_orbit_menu.erb | 15 +++++++++++++++ app/views/layouts/_orbit_bar.html.erb | 18 ++---------------- app/views/layouts/_side_bar_content.html.erb | 10 +++++----- config/mongoid.yml | 2 +- .../back_end/archive_files_controller.rb | 6 +++--- .../archive_files/_archive_files.html.erb | 2 ++ .../panel/calendar/back_end/cals_controller.rb | 6 +++++- .../calendar/back_end/cals/index.html.erb | 2 ++ .../gprs/back_end/locations_controller.rb | 2 +- .../gprs/back_end/locations/index.html.erb | 16 +++++++++++----- 16 files changed, 67 insertions(+), 39 deletions(-) create mode 100644 app/views/layouts/_guest_orbit_menu.erb create mode 100644 app/views/layouts/_member_orbit_menu.erb diff --git a/app/controllers/admin/users_new_interface_controller.rb b/app/controllers/admin/users_new_interface_controller.rb index 8c5ec93a..69c22ed6 100644 --- a/app/controllers/admin/users_new_interface_controller.rb +++ b/app/controllers/admin/users_new_interface_controller.rb @@ -1,9 +1,13 @@ -class Admin::UsersNewInterfaceController < ApplicationController +class Admin::UsersNewInterfaceController < OrbitBackendController layout "new_admin" - before_filter :authenticate_user! - before_filter :set_attribute, :only => [:index, :show, :new, :edit] + # before_filter :authenticate_user! + # before_filter :set_attribute, :only => [:index, :show, :new, :edit] + before_filter :force_order_for_visitor,:only=>[:index,:show] + before_filter :force_order_for_user,:except => [:index,:show] + before_filter :for_app_sub_manager,:except => [:index,:show] + def index get_tags get_sub_roles diff --git a/app/views/admin/users_new_interface/_filter.html.erb b/app/views/admin/users_new_interface/_filter.html.erb index 3262ea5d..4033ff5e 100644 --- a/app/views/admin/users_new_interface/_filter.html.erb +++ b/app/views/admin/users_new_interface/_filter.html.erb @@ -61,8 +61,10 @@ diff --git a/app/views/admin/users_new_interface/_index_paginator.html.erb b/app/views/admin/users_new_interface/_index_paginator.html.erb index 04fff093..3d8864d0 100644 --- a/app/views/admin/users_new_interface/_index_paginator.html.erb +++ b/app/views/admin/users_new_interface/_index_paginator.html.erb @@ -1,7 +1,9 @@
+ <% if is_admin? %> <%= link_to(new_admin_users_new_interface_path,:class=> "btn btn-primary pull-right") do%> <%= t("admin.new_admin.action.add")%> <% end -%> + <%end -%>
<%= paginate @users, :params => {:inner => false}%>
diff --git a/app/views/admin/users_new_interface/_user_for_listing.html.erb b/app/views/admin/users_new_interface/_user_for_listing.html.erb index 9df1eb10..e7fe44ee 100644 --- a/app/views/admin/users_new_interface/_user_for_listing.html.erb +++ b/app/views/admin/users_new_interface/_user_for_listing.html.erb @@ -1,5 +1,5 @@
- + diff --git a/app/views/admin/users_new_interface/_index_paginator.html.erb b/app/views/admin/users_new_interface/_index_paginator.html.erb index 04fff093..3d8864d0 100644 --- a/app/views/admin/users_new_interface/_index_paginator.html.erb +++ b/app/views/admin/users_new_interface/_index_paginator.html.erb @@ -1,7 +1,9 @@
+ <% if is_admin? %> <%= link_to(new_admin_users_new_interface_path,:class=> "btn btn-primary pull-right") do%> <%= t("admin.new_admin.action.add")%> <% end -%> + <%end -%>
<%= paginate @users, :params => {:inner => false}%>
diff --git a/app/views/admin/users_new_interface/_user_for_listing.html.erb b/app/views/admin/users_new_interface/_user_for_listing.html.erb index 9df1eb10..e7fe44ee 100644 --- a/app/views/admin/users_new_interface/_user_for_listing.html.erb +++ b/app/views/admin/users_new_interface/_user_for_listing.html.erb @@ -1,5 +1,5 @@
- +
- - + <% if is_admin? %> + + + <%end%> <%= t("admin.new_admin.attributes.roles")%> <%= t("admin.new_admin.attributes.name")%>
<% if is_admin? %><% end%>
diff --git a/vendor/built_in_modules/gallery/app/views/panel/gallery/front_end/albums/theater.html.erb b/vendor/built_in_modules/gallery/app/views/panel/gallery/front_end/albums/theater.html.erb index 58137ea5..dc1a38f6 100644 --- a/vendor/built_in_modules/gallery/app/views/panel/gallery/front_end/albums/theater.html.erb +++ b/vendor/built_in_modules/gallery/app/views/panel/gallery/front_end/albums/theater.html.erb @@ -42,7 +42,7 @@
From ef3fddd863dcfe90f2a352206bdef0ff85af53f0 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Wed, 21 Nov 2012 16:55:18 +0800 Subject: [PATCH 05/18] fixed sutpid bug for calendar --- .../calendar/app/assets/javascripts/calendarAPI.js.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vendor/built_in_modules/calendar/app/assets/javascripts/calendarAPI.js.erb b/vendor/built_in_modules/calendar/app/assets/javascripts/calendarAPI.js.erb index a1ab3b6c..87e287ae 100644 --- a/vendor/built_in_modules/calendar/app/assets/javascripts/calendarAPI.js.erb +++ b/vendor/built_in_modules/calendar/app/assets/javascripts/calendarAPI.js.erb @@ -290,6 +290,7 @@ var calendarAPI = function(){ }) var doneEventArray = new Array(); var makerow = function(events){ + var $eventrow =null; var currow = 0; var curdate = 0; @@ -320,7 +321,7 @@ var calendarAPI = function(){ var recordcurdate = true; if(allow){ - if(evnt.title=="Navratri") + //console.log(pos); if(pos == 1){ var colspan = 0; @@ -372,6 +373,7 @@ var calendarAPI = function(){ curparent = thisparent; if(recordcurdate) doneEventArray.push(evnt.index); + } } From 1f8f58e93016a54f380457770f8251a3185ace0d Mon Sep 17 00:00:00 2001 From: "Matthew K. Fu JuYuan" Date: Wed, 21 Nov 2012 17:52:25 +0800 Subject: [PATCH 06/18] album and gallery is now opened --- .../app/assets/javascripts/calendarAPI.js.erb | 2 -- .../panel/gallery/back_end/albums_controller.rb | 7 ++++++- .../panel/gallery/widget/albums_controller.rb | 2 +- .../gallery/app/models/gallery_album.rb | 2 +- .../gallery/back_end/album_images/show.html.erb | 12 ++++++------ .../panel/gallery/back_end/albums/index.html.erb | 8 +++++--- .../panel/gallery/back_end/albums/show.html.erb | 12 ++++++------ .../gallery/front_end/orbit_galleries/index.html.erb | 4 ++-- 8 files changed, 27 insertions(+), 22 deletions(-) diff --git a/vendor/built_in_modules/calendar/app/assets/javascripts/calendarAPI.js.erb b/vendor/built_in_modules/calendar/app/assets/javascripts/calendarAPI.js.erb index a1ab3b6c..5f36c760 100644 --- a/vendor/built_in_modules/calendar/app/assets/javascripts/calendarAPI.js.erb +++ b/vendor/built_in_modules/calendar/app/assets/javascripts/calendarAPI.js.erb @@ -320,8 +320,6 @@ var calendarAPI = function(){ var recordcurdate = true; if(allow){ - if(evnt.title=="Navratri") - //console.log(pos); if(pos == 1){ var colspan = 0; if(evnt.total_days>7){ diff --git a/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/albums_controller.rb b/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/albums_controller.rb index 2499d08f..a81b536b 100644 --- a/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/albums_controller.rb +++ b/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/albums_controller.rb @@ -1,8 +1,13 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController include AdminHelper - before_filter :force_order_for_user, :except => [:index,:get_album_json,:get_imgs_json] + # before_filter :force_order_for_user, :except => [:index,:get_album_json,:get_imgs_json] + before_filter :force_order_for_visitor,:only=>[:index,:get_album_json,:get_imgs_json,:get_albums] + before_filter :force_order_for_user,:except => [:index,:get_album_json,:get_imgs_json,:get_albums] + before_filter :for_app_sub_manager,:except => [:index,:get_album_json,:get_imgs_json,:get_albums] + # before_filter lambda + def index if is_manager? || is_admin? || is_sub_manager? @authenticated = true #turn this value to false for view only diff --git a/vendor/built_in_modules/gallery/app/controllers/panel/gallery/widget/albums_controller.rb b/vendor/built_in_modules/gallery/app/controllers/panel/gallery/widget/albums_controller.rb index 5126a16d..99956d41 100644 --- a/vendor/built_in_modules/gallery/app/controllers/panel/gallery/widget/albums_controller.rb +++ b/vendor/built_in_modules/gallery/app/controllers/panel/gallery/widget/albums_controller.rb @@ -1,7 +1,7 @@ class Panel::Gallery::Widget::AlbumsController < OrbitWidgetController def widget1 - @settings = {"vertical"=>2,"horizontal"=>6} + @settings = {"vertical"=>2,"horizontal"=>6} #[note] horizontal has it's limitation from 2 to 6 @class = "c" + @settings["horizontal"].to_s @total = @settings["vertical"] * @settings["horizontal"] @rnd = Random.new 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 03daa383..0a7f6b9c 100644 --- a/vendor/built_in_modules/gallery/app/models/gallery_album.rb +++ b/vendor/built_in_modules/gallery/app/models/gallery_album.rb @@ -5,7 +5,7 @@ class GalleryAlbum field :name, localize: true field :description, localize: true field :cover, default: "default" - field :cover_path + field :cover_path #can refact field :tag_names belongs_to :gallery_category diff --git a/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/album_images/show.html.erb b/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/album_images/show.html.erb index 398aee35..4e939cad 100644 --- a/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/album_images/show.html.erb +++ b/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/album_images/show.html.erb @@ -48,17 +48,17 @@
- <% if @authenticated %> + <%# if @authenticated %> - <% end %> + <%# end %> @@ -83,9 +83,9 @@ diff --git a/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/index.html.erb b/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/index.html.erb index afedbbc4..32273335 100644 --- a/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/index.html.erb +++ b/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/index.html.erb @@ -1,4 +1,3 @@ - <%= stylesheet_link_tag "gallery" %> + + <% if is_sub_manager? %> +<%end %> <% content_for :page_specific_javascript do %> <%= javascript_include_tag "galleryAPI" %> diff --git a/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/show.html.erb b/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/show.html.erb index 434bf704..c5775bac 100644 --- a/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/show.html.erb +++ b/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/show.html.erb @@ -25,17 +25,17 @@
- <% if @authenticated %> + <% #if @authenticated %> - <% end %> + <%# end %> @@ -61,11 +61,11 @@ diff --git a/vendor/built_in_modules/gallery/app/views/panel/gallery/front_end/orbit_galleries/index.html.erb b/vendor/built_in_modules/gallery/app/views/panel/gallery/front_end/orbit_galleries/index.html.erb index 5d8f5a49..9a7aa973 100644 --- a/vendor/built_in_modules/gallery/app/views/panel/gallery/front_end/orbit_galleries/index.html.erb +++ b/vendor/built_in_modules/gallery/app/views/panel/gallery/front_end/orbit_galleries/index.html.erb @@ -14,7 +14,7 @@ - <% if @authenticated %> + <%# if @authenticated %>
@@ -41,7 +41,7 @@
- <% end %> + <%# end %> <% content_for :page_specific_javascript do %> <%= javascript_include_tag "jquery.tinyscrollbar" %> <% end %> From 1279af0c113920bbb669503597cf9e4f5e3c87b8 Mon Sep 17 00:00:00 2001 From: "Matthew K. Fu JuYuan" Date: Wed, 21 Nov 2012 11:46:06 +0800 Subject: [PATCH 07/18] fix and hide for visitors,except for album --- .../admin/users_new_interface_controller.rb | 10 +++++++--- .../admin/users_new_interface/_filter.html.erb | 6 ++++-- .../_index_paginator.html.erb | 2 ++ .../_user_for_listing.html.erb | 2 +- .../admin/users_new_interface/show.html.erb | 2 +- app/views/layouts/_guest_orbit_menu.erb | 5 +++++ app/views/layouts/_member_orbit_menu.erb | 15 +++++++++++++++ app/views/layouts/_orbit_bar.html.erb | 18 ++---------------- app/views/layouts/_side_bar_content.html.erb | 10 +++++----- config/mongoid.yml | 2 +- .../back_end/archive_files_controller.rb | 6 +++--- .../archive_files/_archive_files.html.erb | 2 ++ .../panel/calendar/back_end/cals_controller.rb | 6 +++++- .../calendar/back_end/cals/index.html.erb | 2 ++ .../gprs/back_end/locations_controller.rb | 2 +- .../gprs/back_end/locations/index.html.erb | 16 +++++++++++----- 16 files changed, 67 insertions(+), 39 deletions(-) create mode 100644 app/views/layouts/_guest_orbit_menu.erb create mode 100644 app/views/layouts/_member_orbit_menu.erb diff --git a/app/controllers/admin/users_new_interface_controller.rb b/app/controllers/admin/users_new_interface_controller.rb index 8c5ec93a..69c22ed6 100644 --- a/app/controllers/admin/users_new_interface_controller.rb +++ b/app/controllers/admin/users_new_interface_controller.rb @@ -1,9 +1,13 @@ -class Admin::UsersNewInterfaceController < ApplicationController +class Admin::UsersNewInterfaceController < OrbitBackendController layout "new_admin" - before_filter :authenticate_user! - before_filter :set_attribute, :only => [:index, :show, :new, :edit] + # before_filter :authenticate_user! + # before_filter :set_attribute, :only => [:index, :show, :new, :edit] + before_filter :force_order_for_visitor,:only=>[:index,:show] + before_filter :force_order_for_user,:except => [:index,:show] + before_filter :for_app_sub_manager,:except => [:index,:show] + def index get_tags get_sub_roles diff --git a/app/views/admin/users_new_interface/_filter.html.erb b/app/views/admin/users_new_interface/_filter.html.erb index 3262ea5d..4033ff5e 100644 --- a/app/views/admin/users_new_interface/_filter.html.erb +++ b/app/views/admin/users_new_interface/_filter.html.erb @@ -61,8 +61,10 @@
- - + <% if is_admin? %> + + + <%end%> <%= t("admin.new_admin.attributes.roles")%> <%= t("admin.new_admin.attributes.name")%>
<% if is_admin? %><% end%>
Language
@@ -137,23 +138,50 @@ -
  • - <%= label_tag("", "Date of Publication", class: "s_grid_2 s_grid") %><%= f.text_field :publication_date, size: "20", value: "2012 / 05 / 01", class: "s_grid_4 s_grid"%> - +
      +
    • + <%= label_tag("", "Date of Publication", class: "s_grid_4 s_grid") %> +
    • +
    • + <%= f.date_select :publication_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year, :month, :day] }, {:class => 's_grid_2 s_grid'} %> +
    • +
    +
  • <%= f.text_field :keyword, size: "20", value: "Keywords", class: "s_grid_6 s_grid"%>
  • - <%= f.text_field :tag, size: "20", value: "Tag", class: "s_grid_6 s_grid"%> - +
    <%= f.label :year ,:class => "s_grid_2 s_grid" %>
    +
    <%= select_year((@writing_journal.year ? @writing_journal.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'writing_journal[year]', :class => "s_grid_4 s_grid"} ) %>
  • - <%= label_tag("", "Full Text", class: "s_grid_2 s_grid") %> - <%= f.file_field :writing_journal_files, size: "20", class: "s_grid_4 s_grid"%> +
    <%= f.label :language ,:class => "s_grid_2 s_grid" %>
    + +
  • + +
  • + <%= f.text_field :tag, size: "20", value: "Tag", class: "s_grid_6 s_grid"%> + +
  • + + +
    + +
      +
    • +
      <%= label_tag("", "Full Text", class: "s_grid_2 s_grid") %>
      + <%= f.fields_for :writing_journal_files,@writing_journal do |wjf| %> + <%= wjf.file_field :file %> + <% end %>
    • <%= f.text_area :note, size: "20x2", value: "Note", class: "s_grid_6 s_grid"%> From f9b5f719303c9204be21594d98666f2856fd110e Mon Sep 17 00:00:00 2001 From: "Matthew K. Fu JuYuan" Date: Wed, 21 Nov 2012 18:34:15 +0800 Subject: [PATCH 09/18] visitor now can browse gallery --- .../back_end/album_images_controller.rb | 6 ++-- .../gallery/back_end/albums_controller.rb | 6 ++-- .../back_end/album_images/show.html.erb | 18 +++++++--- .../gallery/back_end/albums/show.html.erb | 34 ++++++++++++------- 4 files changed, 42 insertions(+), 22 deletions(-) diff --git a/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/album_images_controller.rb b/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/album_images_controller.rb index d29ecd40..06eee5de 100644 --- a/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/album_images_controller.rb +++ b/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/album_images_controller.rb @@ -2,8 +2,10 @@ class Panel::Gallery::BackEnd::AlbumImagesController < OrbitBackendController include AdminHelper # before_filter :force_order_for_visitor,:only=>[:index] - before_filter :force_order_for_user#,:except => [:index] - + # before_filter :force_order_for_user#,:except => [:index] + before_filter :force_order_for_visitor,:only=>[:index,:show] + before_filter :force_order_for_user,:except => [:index,:show] + before_filter :for_app_sub_manager,:except => [:index,:show] def show if is_manager? || is_admin? || is_sub_manager? @authenticated = true #turn this value to false for view only diff --git a/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/albums_controller.rb b/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/albums_controller.rb index a81b536b..fa7b5e3b 100644 --- a/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/albums_controller.rb +++ b/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/albums_controller.rb @@ -3,9 +3,9 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController # before_filter :force_order_for_user, :except => [:index,:get_album_json,:get_imgs_json] - before_filter :force_order_for_visitor,:only=>[:index,:get_album_json,:get_imgs_json,:get_albums] - before_filter :force_order_for_user,:except => [:index,:get_album_json,:get_imgs_json,:get_albums] - before_filter :for_app_sub_manager,:except => [:index,:get_album_json,:get_imgs_json,:get_albums] + before_filter :force_order_for_visitor,:only=>[:index,:show,:get_album_json,:get_imgs_json,:get_albums,:imgs] + before_filter :force_order_for_user,:except => [:index,:show,:get_album_json,:get_imgs_json,:get_albums,:imgs] + before_filter :for_app_sub_manager,:except => [:index,:show,:get_album_json,:get_imgs_json,:get_albums,:imgs] # before_filter lambda def index diff --git a/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/album_images/show.html.erb b/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/album_images/show.html.erb index 4e939cad..4d5adafd 100644 --- a/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/album_images/show.html.erb +++ b/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/album_images/show.html.erb @@ -30,6 +30,9 @@
    + + <% if is_admin? %> +
    @@ -61,6 +64,8 @@ <%# end %>
    + + <%end%> " - res << "" + res << "
    " + res << "" res << "
    " printable_ad_images = [] ad_banner.ad_images.each do |ad_image| @@ -84,6 +85,7 @@ module ParserCommon res << "style='#{'display:none;' if hide} #{'cursor:pointer;' if !ad_image.out_link.blank?}'" res << "/>" end + res << "
    " res << "
    " end fragment = Nokogiri::HTML::DocumentFragment.new(body, res) @@ -234,4 +236,25 @@ module ParserCommon public_r_tags.uniq end + # page_counter + def parse_counter(body = nil, page = nil, edit=nil) + body.css('.page_counter').each do |counter| + res = '' + case counter['option'] + when 'all' + res << display_visitors.to_s + when 'today' + res << display_visitors_today.to_s + when 'this_week' + res << display_visitors_this_week.to_s + when 'this_month' + res << display_visitors_this_month.to_s + when 'this_year' + res << display_visitors_this_year.to_s + end + fragment = Nokogiri::HTML::DocumentFragment.new(body, res) + counter.swap(fragment) + end + end + end diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/widget/bulletins_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/widget/bulletins_controller.rb index 0c5c3d91..622944a0 100644 --- a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/widget/bulletins_controller.rb +++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/widget/bulletins_controller.rb @@ -31,14 +31,14 @@ class Panel::Announcement::Widget::BulletinsController < OrbitWidgetController date_now = Time.now if !@category_id.blank? - @bulletins = Bulletin.can_display.where(:bulletin_category_id => @category_id).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page] ).per(@page_num) + @bulletins = Bulletin.available_for_lang(I18n.locale).can_display.where(:bulletin_category_id => @category_id).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page] ).per(@page_num) @current_category = BulletinCategory.from_id(@category_id) rescue nil elsif !params[:tag_id].blank? @tag = AnnouncementTag.find(params[:tag_id]) rescue nil @tag = AnnouncementTag.where(key: params[:tag_id])[0] unless @tag - @bulletins = @tag.bulletins.can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page] ).per(@page_num) + @bulletins = @tag.bulletins.available_for_lang(I18n.locale).can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page] ).per(@page_num) else - @bulletins = Bulletin.can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page] ).per(@page_num) + @bulletins = Bulletin.available_for_lang(I18n.locale).can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page] ).per(@page_num) end get_categorys diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/_index.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/_index.html.erb index a96cad81..95ab7f4f 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/_index.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/_index.html.erb @@ -22,7 +22,7 @@
    <% if wf[1] == 'title' %> - <%= link_to post.send("#{wf[0]}")[I18n.locale], panel_announcement_front_end_bulletin_path(post, :category_id => post.send("#{post.class.to_s.underscore}_category_id")) %> + <%= link_to post.send("#{wf[0]}"), panel_announcement_front_end_bulletin_path(post, :category_id => post.send("#{post.class.to_s.underscore}_category_id")) %> <% elsif wf[1] == 'date' %> <%= display_date(post.send(wf[0])) %> <% elsif wf[1] == 'category' %> diff --git a/vendor/built_in_modules/announcement/config/routes.rb b/vendor/built_in_modules/announcement/config/routes.rb index 675d71f0..35500ac3 100644 --- a/vendor/built_in_modules/announcement/config/routes.rb +++ b/vendor/built_in_modules/announcement/config/routes.rb @@ -49,7 +49,7 @@ Rails.application.routes.draw do # end end namespace :widget do - match "bulletins" => "bulletins#index" + match "index" => "bulletins#index" match "bulletins_and_web_links" => "bulletins#bulletins_and_web_links" match "reload_bulletins" => "bulletins#reload_bulletins" match "reload_web_links" => "bulletins#reload_web_links" From 25a9987f13078135508d1d3ba72f54ea6008e010 Mon Sep 17 00:00:00 2001 From: devin Date: Wed, 21 Nov 2012 11:16:23 +0800 Subject: [PATCH 18/18] calendar js minor update --- .../calendar/app/assets/javascripts/calendarAPI.js.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vendor/built_in_modules/calendar/app/assets/javascripts/calendarAPI.js.erb b/vendor/built_in_modules/calendar/app/assets/javascripts/calendarAPI.js.erb index bb4b512f..6a8564a7 100644 --- a/vendor/built_in_modules/calendar/app/assets/javascripts/calendarAPI.js.erb +++ b/vendor/built_in_modules/calendar/app/assets/javascripts/calendarAPI.js.erb @@ -389,7 +389,8 @@ var calendarAPI = function(){ this.loadWeekView = function(week,year){ $("#range_selection").hide(); $("#navigation").show(); - $("#sec1").removeClass("span8").addClass("span3"); + $("#sec1").removeClass("span7").addClass("span3"); + $("#sec3").removeClass("span5").addClass("span4"); $("#sec2").show(); c.view = "week"; if(!week){ @@ -514,6 +515,7 @@ var calendarAPI = function(){ $("#range_selection").hide(); $("#navigation").show(); $("#sec1").removeClass("span7").addClass("span3"); + $("#sec3").removeClass("span5").addClass("span4"); $("#sec2").show(); c.view = "day"; if(!day){