From 5e25cf584908abe7872129ed25958daf53d8d42f Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Fri, 26 Oct 2012 19:04:51 +0800 Subject: [PATCH 01/30] lot of updates --- .../app/assets/javascripts/calendarAPI.js.erb | 130 +++++++++++++++-- .../calendar/app/assets/javascripts/cals.js | 8 ++ .../app/assets/stylesheets/calendar.css | 2 +- .../calendar/app/assets/stylesheets/cals.css | 8 ++ .../calendar/back_end/cals_controller.rb | 4 +- .../calendar/back_end/events_controller.rb | 121 +++++++++++++++- .../panel/calendar/back_end/cals_helper.rb | 9 ++ .../calendar/back_end/cals/day_view.html.erb | 10 +- .../calendar/back_end/cals/index.html.erb | 10 +- .../calendar/back_end/cals/week_view.html.erb | 16 ++- .../calendar/back_end/events/create.js.erb | 14 +- .../calendar/back_end/events/edit.html.erb | 133 ++++++++++++++++++ .../calendar/back_end/events/new.html.erb | 84 ++++------- .../calendar/back_end/events/show.html.erb | 4 +- .../calendar/back_end/events/update.js.erb | 15 ++ 15 files changed, 471 insertions(+), 97 deletions(-) create mode 100644 vendor/built_in_modules/calendar/app/assets/javascripts/cals.js create mode 100644 vendor/built_in_modules/calendar/app/assets/stylesheets/cals.css create mode 100644 vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/events/edit.html.erb create mode 100644 vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/events/update.js.erb 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 d023a0fa..09ef0195 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 @@ -6,8 +6,7 @@ Date.prototype.getWeek = function (dowOffset) { var newYear = new Date(this.getFullYear(),0,1); var day = newYear.getDay() - dowOffset; //the day of week the year begins on day = (day >= 0 ? day : day + 7); - var daynum = Math.floor((this.getTime() - newYear.getTime() - - (this.getTimezoneOffset()-newYear.getTimezoneOffset())*60000)/86400000) + 1; + var daynum = Math.floor((this.getTime() - newYear.getTime() - (this.getTimezoneOffset()-newYear.getTimezoneOffset())*60000)/86400000) + 1; var weeknum; //if the year starts before the middle of a week if(day < 4) { @@ -49,8 +48,8 @@ var calendarAPI = function(){ this.initialize = function(){ $(window).load(function(){ // c.loadMonthView(c.cur_month,c.cur_year); - // c.loadWeekView(c.cur_week,c.cur_year); - c.loadDayView(c.cur_date,c.cur_month,c.cur_year); + c.loadWeekView(c.cur_week,c.cur_year); + // c.loadDayView(c.cur_date,c.cur_month,c.cur_year); bindHandlers(); }) var bindHandlers = function(){ @@ -61,16 +60,46 @@ var calendarAPI = function(){ $("#create_event_btn").click(function(){ if(!$(this).hasClass("active")){ - c.newEvent($(this).attr("href"),$(this).attr("ref"),c.today.getDate(),c.today.getMonth()+1,c.today.getFullYear()); + c.newEvent($(this).attr("href"),$(this).attr("ref"),c.today.getDate(),c.today.getMonth()+1,c.today.getFullYear(),10.5,"AM"); }else{ c.event_create_div.hide().empty(); } $(this).toggleClass("active"); return false; }) - $("td.click_event").live("click",function(){ - c.newEvent($(this).attr("link"),$(this).attr("ref"),$(this).attr("date"),c.cur_month,c.cur_year); + $(".click_event").live("click",function(e){ + var dt = $(this).attr("date"); + if(!dt){ + var w = $("td.week_day_body").width(); + var parentOffset = $("table.cell_map").offset(); + var relX = e.pageX - parentOffset.left; + var t = 60; + for (var i = 0; i <= 6; i++) { + if(relX > t && relX < (t + w)){ + console.log(i); + dt = $("td.week_day_body").eq(i).attr("date"); + break; + } + t = t + w; + }; + } + var time = $(this).attr("time"); + var ses = $(this).attr("ses"); + if (!time) + time = 10.5; + if(!ses) + ses = "AM"; + + c.newEvent($(this).attr("link"),$(this).attr("ref"),dt,c.cur_month,c.cur_year,time,ses); $("#create_event_btn").toggleClass("active"); + e.stopPropagation(); + }) + $("#edit_event_btn").live("ajax:success",function(evt,form){ + c.event_quick_view_div.empty().hide(); + c.updateEvent(form); + }) + $("#refresh_btn").click(function(){ + c.refresh(); }) $('.mode_switch').click(function(){ @@ -262,7 +291,7 @@ var calendarAPI = function(){ curparent.append($eventrow); } $eventrow = null; - $eventrow = $(""); + $eventrow = $(""); allow = true; }else if(evnt.start_date > curdate){ allow = true; @@ -358,7 +387,7 @@ var calendarAPI = function(){ var height = 15; var full_day_count = 0; var rowcount = 7; - var tr = $(""); + var tr = $(""); var pre = true; $.each(events,function(i,evnt){ // console.log("rowcount: "+rowcount); @@ -371,7 +400,7 @@ var calendarAPI = function(){ $("table.all_day_event_holder").append(tr); } tr = null; - tr = $(''); + tr = $(''); pre = true; } @@ -440,7 +469,7 @@ var calendarAPI = function(){ if(h == 0.5) halfhour = "half"; h = 17 + 20 + (((h-1) * 2) * 20) + 1; - var eventdom = $('
'+displaystarttime+' - '+displayendtime+'
'+evnt.title+'
'); + var eventdom = $('
'+displaystarttime+' - '+displayendtime+'
'+evnt.title+'
'); $(".week_day_body[date="+evnt.start_date+"] .inner").append(eventdom); } if(full_day_count == 0){ @@ -480,7 +509,7 @@ var calendarAPI = function(){ $.getJSON("cals/getDayEvents",{"date":day,"month":month,"year":year},function(events){ $.each(events,function(i,evnt){ if(evnt.all_day){ - $(".all_day_event").append('
'+evnt.title+'
') + $(".all_day_event").append('
'+evnt.title+'
') }else{ var starttime,endtime,displaystarttime,displayendtime; if(evnt.start_am_pm == "AM"){ @@ -521,7 +550,7 @@ var calendarAPI = function(){ if(h == 0.5) halfhour = "half"; h = 17 + 20 + (((h-1) * 2) * 20) + 1; - var eventdom = $('
'+displaystarttime+' - '+displayendtime+'
'+evnt.title+'
'); + var eventdom = $('
'+displaystarttime+' - '+displayendtime+'
'+evnt.title+'
'); $(".event_holder").append(eventdom); } @@ -534,7 +563,7 @@ var calendarAPI = function(){ $('.current_day_title').text('September 2, 2012'); }) } - this.newEvent = function(url,ref,date,month,year){ + this.newEvent = function(url,ref,date,month,year,time,ses){ var bindHandlers = function(){ c.event_create_div.find("button.btn-close").click(function(){ c.event_create_div.hide().empty(); @@ -546,14 +575,67 @@ var calendarAPI = function(){ else c.event_create_div.find("#non_all_day").show() }) + $( "#dpfrom" ).datepicker({ + defaultDate: "+1w", + changeMonth: true, + numberOfMonths: 3, + onSelect: function( selectedDate ) { + $( "#dpto" ).datepicker( "option", "minDate", selectedDate ); + } + }); + $( "#dpto" ).datepicker({ + defaultDate: "+1w", + changeMonth: true, + numberOfMonths: 3, + onSelect: function( selectedDate ) { + $( "#dpfrom" ).datepicker( "option", "maxDate", selectedDate ); + } + }); } - c.event_create_div.load(url+"?ref="+ref+"&date="+date+"&month="+month+"&year="+year,function(){ + c.event_create_div.load(url+"?ref="+ref+"&date="+date+"&month="+month+"&year="+year+"&time="+time+"&ses="+ses,function(){ c.event_create_div.show(); bindHandlers(); }) } + + this.updateEvent = function(form){ + var bindHandlers = function(){ + c.event_create_div.find("button.btn-close").click(function(){ + c.event_create_div.hide().empty(); + $("#create_event_btn").removeClass("active"); + $("#create_event_btn").show(); + }) + c.event_create_div.find("input[for=all_day][type=checkbox]").click(function(){ + if($(this).is(":checked")) + c.event_create_div.find("#non_all_day").hide() + else + c.event_create_div.find("#non_all_day").show() + }) + $( "#dpfrom" ).datepicker({ + defaultDate: "+1w", + changeMonth: true, + numberOfMonths: 3, + onSelect: function( selectedDate ) { + $( "#dpto" ).datepicker( "option", "minDate", selectedDate ); + } + }); + $( "#dpto" ).datepicker({ + defaultDate: "+1w", + changeMonth: true, + numberOfMonths: 3, + onSelect: function( selectedDate ) { + $( "#dpfrom" ).datepicker( "option", "maxDate", selectedDate ); + } + }); + } + c.event_create_div.html(form); + $("#create_event_btn").hide(); + c.event_create_div.show(); + bindHandlers(); + } + this.newCalendars = function(){ if($('.color-picker').length > 0){ $('.color-picker').miniColors(); // just in category view @@ -586,8 +668,26 @@ var calendarAPI = function(){ c.event_quick_view_div.find(".event-close-btn").click(function(){ c.event_quick_view_div.empty().hide(); }) + c.event_quick_view_div.find(".bt-del").bind("ajax:success",function(){ + c.event_quick_view_div.empty().hide(); + dom.remove(); + }) }) } + this.refresh = function(){ + $(".destroy").remove(); + switch (c.view){ + case "week": + c.loadWeekView(c.cur_week,c.cur_year); + break; + case "month": + c.loadMonthView(c.cur_month,c.cur_year); + break; + case "day": + c.loadDayView(c.cur_date,c.cur_month,c.cur_year); + break; + } + } c.initialize(); } diff --git a/vendor/built_in_modules/calendar/app/assets/javascripts/cals.js b/vendor/built_in_modules/calendar/app/assets/javascripts/cals.js new file mode 100644 index 00000000..0443e53a --- /dev/null +++ b/vendor/built_in_modules/calendar/app/assets/javascripts/cals.js @@ -0,0 +1,8 @@ +// This is a manifest file that'll be compiled into including all the files listed below. +// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically +// be included in the compiled file accessible from http://example.com/assets/application.js +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +// the compiled file. +// +//= require jquery-ui +//= require calendarAPI \ No newline at end of file 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 874904a5..3c528bea 100644 --- a/vendor/built_in_modules/calendar/app/assets/stylesheets/calendar.css +++ b/vendor/built_in_modules/calendar/app/assets/stylesheets/calendar.css @@ -71,7 +71,7 @@ } #calendar_day .event_holder { width: 100%; - height: 100%; + /*height: 100%;*/ position: absolute; top: 0; z-index: 1; diff --git a/vendor/built_in_modules/calendar/app/assets/stylesheets/cals.css b/vendor/built_in_modules/calendar/app/assets/stylesheets/cals.css new file mode 100644 index 00000000..f07975b5 --- /dev/null +++ b/vendor/built_in_modules/calendar/app/assets/stylesheets/cals.css @@ -0,0 +1,8 @@ +/* + *This is a manifest file that'll automatically include all the stylesheets available in this directory + *and any sub-directories. You're free to add application-wide styles to this file and they'll appear at + *the top of the compiled file, but it's generally better to create a new file per style scope. + *= font-awesome + *= calendar + *= bootstrap-responsive +*/ \ No newline at end of file diff --git a/vendor/built_in_modules/calendar/app/controllers/panel/calendar/back_end/cals_controller.rb b/vendor/built_in_modules/calendar/app/controllers/panel/calendar/back_end/cals_controller.rb index fdf712aa..33cb286d 100644 --- a/vendor/built_in_modules/calendar/app/controllers/panel/calendar/back_end/cals_controller.rb +++ b/vendor/built_in_modules/calendar/app/controllers/panel/calendar/back_end/cals_controller.rb @@ -39,10 +39,10 @@ class Panel::Calendar::BackEnd::CalsController < OrbitBackendController end def day_view - date = params[:date].to_i + @date = params[:date].to_i month = params[:month].to_i year = params[:year].to_i - @cur_day = getDayName(date,month,year) + " " + month.to_s + "/" + date.to_s + " - " + year.to_s + @cur_day = getDayName(@date,month,year) + " " + month.to_s + "/" + @date.to_s + " - " + year.to_s @hours = getHours(12) render :layout => false end diff --git a/vendor/built_in_modules/calendar/app/controllers/panel/calendar/back_end/events_controller.rb b/vendor/built_in_modules/calendar/app/controllers/panel/calendar/back_end/events_controller.rb index 41ffa151..4e477ded 100644 --- a/vendor/built_in_modules/calendar/app/controllers/panel/calendar/back_end/events_controller.rb +++ b/vendor/built_in_modules/calendar/app/controllers/panel/calendar/back_end/events_controller.rb @@ -8,10 +8,47 @@ class Panel::Calendar::BackEnd::EventsController < OrbitBackendController else @all_day_disabled = false end - @placeholder = params[:date]+"/"+params[:month]+"/"+params[:year] + @hours = getHoursForForm + if params[:time] + + @hours.each_with_index do |h,i| + if h['val'].to_s == params[:time].to_s + @sindex = i + @eindex = i + 2 + break + end + end + else + @sindex = 16 + @eindex = 18 + end + @ampm = Array.new + @ampm << "AM" + @ampm << "PM" + if params[:ses] + @sampm = params[:ses] + @eampm = params[:ses] + if @eindex >= 22 + @eampm = "PM" + end + end + @placeholder = params[:month]+"/"+params[:date]+"/"+params[:year] render :layout => false end - + def edit + @calendars = Cal.all + @event = Event.find(params[:id]) + if @event.all_day + @all_day_disabled = true + else + @all_day_disabled = false + end + @hours = getHoursForForm + @ampm = Array.new + @ampm << "AM" + @ampm << "PM" + render :layout => false + end def create title = params[:event][:title] note = params[:event][:note] @@ -21,14 +58,14 @@ class Panel::Calendar::BackEnd::EventsController < OrbitBackendController $endtime = params[:end_time] temp = $start.split("/") - start_date = temp[0] - start_month = temp[1] + start_month = temp[0] + start_date = temp[1] start_year = temp[2] @m = start_month @y = start_year temp = $end.split("/") - end_date = temp[0] - end_month = temp[1] + end_month = temp[0] + end_date = temp[1] end_year = temp[2] start_am_pm = params[:start_am_pm] @@ -81,6 +118,78 @@ class Panel::Calendar::BackEnd::EventsController < OrbitBackendController h.js end end + + def update + + title = params[:event][:title] + note = params[:event][:note] + $start = params[:start_date] + $end = params[:end_date] + $starttime = params[:start_time] + $endtime = params[:end_time] + + temp = $start.split("/") + start_month = temp[0] + start_date = temp[1] + start_year = temp[2] + @m = start_month + @y = start_year + temp = $end.split("/") + end_month = temp[0] + end_date = temp[1] + end_year = temp[2] + + start_am_pm = params[:start_am_pm] + end_am_pm = params[:end_am_pm] + + cal_id = params[:event][:cal_id] + + # if start_am_pm == "PM" + # temp_start_time = $starttime + 12 + # end + # if end_am_pm == "PM" + # temp_end_time = $endtime + 12 + # end + if params[:all_day] + all_day = true + $starttime = 0 + $endtime = 0 + else + all_day = false + end + + final_start_time = Date.new(start_year.to_i,start_month.to_i,start_date.to_i) + final_end_time = Date.new(end_year.to_i,end_month.to_i,end_date.to_i) + start_week = final_start_time.strftime("%U") + end_week = final_end_time.strftime("%U") + total_days = final_end_time - final_start_time + @event = Event.find(params[:id]) + @event.title = title + @event.note = note + @event.start_year = start_year + @event.end_year = end_year + @event.start_month = start_month + @event.end_month = end_month + @event.start_date = start_date + @event.end_date = end_date + @event.start_time = $starttime + @event.start_am_pm = start_am_pm + @event.end_time = $endtime + @event.end_am_pm = end_am_pm + @event.cal_id = cal_id + @event.final_start_time = final_start_time + @event.final_end_time = final_end_time + @event.total_days = total_days + @event.start_week = start_week + @event.end_week = end_week + @event.all_day = all_day + @event.save! + + respond_to do |h| + h.js + end + end + def show @event = Event.find(params[:id]) @start_month_name = Date::ABBR_MONTHNAMES[@event.start_month] diff --git a/vendor/built_in_modules/calendar/app/helpers/panel/calendar/back_end/cals_helper.rb b/vendor/built_in_modules/calendar/app/helpers/panel/calendar/back_end/cals_helper.rb index fc349ecd..6377debb 100644 --- a/vendor/built_in_modules/calendar/app/helpers/panel/calendar/back_end/cals_helper.rb +++ b/vendor/built_in_modules/calendar/app/helpers/panel/calendar/back_end/cals_helper.rb @@ -180,6 +180,15 @@ module Panel::Calendar::BackEnd::CalsHelper end hours end + + def getHoursForForm + hours = Array.new + for i in 1..12 + hours << {"val"=>i,"title"=>i.to_s+":00"} + hours << {"val"=>i+0.5,"title"=>i.to_s+":30"} + end + hours + end end diff --git a/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/day_view.html.erb b/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/day_view.html.erb index 709437c7..2edd9e7c 100644 --- a/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/day_view.html.erb +++ b/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/day_view.html.erb @@ -28,11 +28,13 @@
<% @hours.each do |hour| %> -
-
+
" ref="add-btn" link="<%= new_panel_calendar_back_end_event_path %>" date="<%= @date.to_s %>" ses="AM"> +
-
-
+ <% end %> + <% @hours.each do |hour| %> +
" ref="add-btn" link="<%= new_panel_calendar_back_end_event_path %>" date="<%= @date.to_s %>" ses="PM"> +
<% end %>
diff --git a/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/index.html.erb b/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/index.html.erb index 791cfe19..3e9c36d7 100644 --- a/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/index.html.erb +++ b/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/index.html.erb @@ -1,10 +1,8 @@ <%= stylesheet_link_tag "font-awesome" %> <%= stylesheet_link_tag "calendar" %> <%= stylesheet_link_tag "bootstrap-responsive" %> -<% content_for :page_specific_javascript do %> - <%= javascript_include_tag "calendarAPI" %> -<% end %> - +<%= javascript_include_tag "cals" %> +
+
+ +
+
diff --git a/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/week_view.html.erb b/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/week_view.html.erb index 62b28113..a7287ba5 100644 --- a/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/week_view.html.erb +++ b/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/week_view.html.erb @@ -62,13 +62,15 @@
<% @hours.each do |hour| %> -
-
-
-
-
-
- <% end %> +
" ref="add-btn" link="<%= new_panel_calendar_back_end_event_path %>" date="<%= @date.to_s %>" ses="AM"> +
+
+ <% end %> + <% @hours.each do |hour| %> +
" ref="add-btn" link="<%= new_panel_calendar_back_end_event_path %>" date="<%= @date.to_s %>" ses="PM"> +
+
+ <% end %>
diff --git a/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/events/create.js.erb b/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/events/create.js.erb index 98703270..a07068ca 100644 --- a/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/events/create.js.erb +++ b/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/events/create.js.erb @@ -1,4 +1,14 @@ $("#event_create").empty().hide(); $("#create_event_btn").removeClass("active"); -$("#calendar_month tr.event_row").remove(); -calendar.getEventsForMonth(<%= @m %>,<%= @y %>); \ No newline at end of file +$(".destroy").remove(); +switch (c.view){ + case "week": + c.loadWeekView(c.cur_week,c.cur_year); + break; + case "month": + c.loadMonthView(c.cur_month,c.cur_year); + break; + case "day": + c.loadDayView(c.cur_date,c.cur_month,c.cur_year); + break; +} diff --git a/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/events/edit.html.erb b/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/events/edit.html.erb new file mode 100644 index 00000000..3db09901 --- /dev/null +++ b/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/events/edit.html.erb @@ -0,0 +1,133 @@ + \ No newline at end of file diff --git a/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/events/new.html.erb b/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/events/new.html.erb index 5fd5870e..df23e2bf 100644 --- a/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/events/new.html.erb +++ b/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/events/new.html.erb @@ -22,72 +22,48 @@
- +
- +
diff --git a/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/events/show.html.erb b/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/events/show.html.erb index 6f731784..a52b9f35 100644 --- a/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/events/show.html.erb +++ b/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/events/show.html.erb @@ -13,6 +13,6 @@
diff --git a/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/events/update.js.erb b/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/events/update.js.erb new file mode 100644 index 00000000..8875d214 --- /dev/null +++ b/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/events/update.js.erb @@ -0,0 +1,15 @@ +$("#event_create").empty().hide(); +$("#create_event_btn").removeClass("active"); +$(".destroy").remove(); +$("#create_event_btn").show(); +switch (c.view){ + case "week": + c.loadWeekView(c.cur_week,c.cur_year); + break; + case "month": + c.loadMonthView(c.cur_month,c.cur_year); + break; + case "day": + c.loadDayView(c.cur_date,c.cur_month,c.cur_year); + break; +} From 12b7618cc7ca7d0e50179769cceef665c0d601f1 Mon Sep 17 00:00:00 2001 From: devin Date: Sat, 27 Oct 2012 00:11:26 +0800 Subject: [PATCH 02/30] calendar agenda view update --- .../app/assets/stylesheets/calendar.css | 29 ++ .../back_end/cals/agenda_view.html.erb | 488 ++++++++---------- .../calendar/back_end/cals/index.html.erb | 2 +- .../assets/images/personal_patent/.gitkeep | 0 .../javascripts/personal_patent/.gitkeep | 0 .../stylesheets/personal_patent/.gitkeep | 0 .../app - %BDƻs/controllers/.gitkeep | 0 .../controllers/application_controller.rb | 23 - .../back_end/tags_controller.rb | 8 - .../writing_patent_categorys_controller.rb | 119 ----- .../back_end/writing_patents_controller.00.rb | 244 --------- .../back_end/writing_patents_controller.rb | 244 --------- .../plugin/writing_patents_controller.rb | 181 ------- .../app - %BDƻs/helpers/.gitkeep | 0 .../app - %BDƻs/mailers/.gitkeep | 0 .../app - %BDƻs/models/.gitkeep | 0 .../app - %BDƻs/models/personal_patent_tag.rb | 9 - .../app - %BDƻs/models/writing_patent.rb | 108 ---- .../models/writing_patent_category.rb | 28 - .../app - %BDƻs/models/writing_patent_file.rb | 14 - .../app - %BDƻs/views/.gitkeep | 0 .../writing_patent_categorys/_form.html.erb | 30 -- .../_writing_patent_category.html.erb | 16 - .../writing_patent_categorys/create.js.erb | 2 - .../writing_patent_categorys/destroy.js.erb | 1 - .../writing_patent_categorys/edit.js.erb | 1 - .../writing_patent_categorys/index.html.erb | 23 - .../writing_patent_categorys/new.js.erb | 1 - .../writing_patent_categorys/update.js.erb | 4 - .../back_end/writing_patents/_filter.html.erb | 11 - .../back_end/writing_patents/_form.html.erb | 209 -------- .../writing_patents/_form_file.html.erb | 50 -- .../_list_writing_patent_category.html.erb | 11 - .../writing_patents/_sort_headers.html.erb | 8 - .../writing_patents/_writing_patent.html.erb | 25 - .../_writing_patent_category_qe.html.erb | 34 -- .../create_writing_patent_setting.js.erb | 5 - .../back_end/writing_patents/destroy.js.erb | 1 - .../back_end/writing_patents/edit.html.erb | 5 - .../back_end/writing_patents/index.html.erb | 22 - .../back_end/writing_patents/index.js.erb | 3 - .../back_end/writing_patents/new.html.erb | 10 - .../back_end/writing_patents/show.html.erb | 0 .../writing_patents/toggle_enable.js.erb | 3 - .../update_writing_patent_setting.js.erb | 5 - .../writing_patent_category_quick_add.js.erb | 1 - .../writing_patent_category_quick_edit.js.erb | 1 - .../writing_patent_setting.html.erb | 113 ---- .../plugin/writing_patents/_filter.html.erb | 11 - .../plugin/writing_patents/_form.html.erb | 209 -------- .../plugin/writing_patents/_form_file.html.erb | 50 -- .../writing_patents/_sort_headers.html.erb | 7 - .../writing_patents/_writing_patent.html.erb | 24 - .../plugin/writing_patents/destroy.js.erb | 1 - .../plugin/writing_patents/edit.html.erb | 5 - .../plugin/writing_patents/index.html.erb | 22 - .../plugin/writing_patents/index.js.erb | 3 - .../plugin/writing_patents/new.html.erb | 10 - .../plugin/writing_patents/show.html.erb | 0 .../writing_patents/toggle_enable.js.erb | 3 - 60 files changed, 253 insertions(+), 2184 deletions(-) delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/assets/images/personal_patent/.gitkeep delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/assets/javascripts/personal_patent/.gitkeep delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/assets/stylesheets/personal_patent/.gitkeep delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/controllers/.gitkeep delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/controllers/application_controller.rb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/controllers/panel/personal_patent/back_end/tags_controller.rb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/controllers/panel/personal_patent/back_end/writing_patent_categorys_controller.rb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/controllers/panel/personal_patent/back_end/writing_patents_controller.00.rb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/controllers/panel/personal_patent/back_end/writing_patents_controller.rb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/controllers/panel/personal_patent/plugin/writing_patents_controller.rb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/helpers/.gitkeep delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/mailers/.gitkeep delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/models/.gitkeep delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/models/personal_patent_tag.rb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/models/writing_patent.rb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/models/writing_patent_category.rb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/models/writing_patent_file.rb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/.gitkeep delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/_form.html.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/_writing_patent_category.html.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/create.js.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/destroy.js.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/edit.js.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/index.html.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/new.js.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/update.js.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_filter.html.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_form.html.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_form_file.html.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_list_writing_patent_category.html.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_sort_headers.html.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_writing_patent.html.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_writing_patent_category_qe.html.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/create_writing_patent_setting.js.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/destroy.js.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/edit.html.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/index.html.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/index.js.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/new.html.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/show.html.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/toggle_enable.js.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/update_writing_patent_setting.js.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/writing_patent_category_quick_add.js.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/writing_patent_category_quick_edit.js.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/writing_patent_setting.html.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/plugin/writing_patents/_filter.html.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/plugin/writing_patents/_form.html.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/plugin/writing_patents/_form_file.html.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/plugin/writing_patents/_sort_headers.html.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/plugin/writing_patents/_writing_patent.html.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/plugin/writing_patents/destroy.js.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/plugin/writing_patents/edit.html.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/plugin/writing_patents/index.html.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/plugin/writing_patents/index.js.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/plugin/writing_patents/new.html.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/plugin/writing_patents/show.html.erb delete mode 100644 vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/plugin/writing_patents/toggle_enable.js.erb 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 874904a5..686cd600 100644 --- a/vendor/built_in_modules/calendar/app/assets/stylesheets/calendar.css +++ b/vendor/built_in_modules/calendar/app/assets/stylesheets/calendar.css @@ -169,14 +169,43 @@ #calendar_agenda .table { margin-bottom: 0; } +#calendar_agenda .tiny_calendar { + border: solid 1px #eee; +} +#calendar_agenda .tiny_calendar .table th { + border-top: 0; +} +#calendar_agenda .tiny_calendar .table td { + text-align: center; +} #calendar_agenda .event { -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } +#calendar_agenda .row-fluid { + margin-top: 20px; + padding-top: 20px; + border-top: dashed 1px #ddd; +} +#calendar_agenda .row-fluid:first-child { + border-top: 0; + padding-top: 0; + margin-top: 0; +} +#calendar_agenda .table.event_list .span2, #calendar_agenda .table.event_list thead th { + min-height: 0 !important; + height: 0 !important; + line-height: 0; + padding: 0; +} .event_time { font-family: Tahoma, sans-serif; } +.has_event { + background-color: #08c; + color: #fff; +} /* day view */ #calendar_day .header { 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 57bb1bf9..8d217587 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 @@ -1,267 +1,225 @@
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Thu, Sep 69:00am - 9:30am -
Commuting time, from home to RD
-
9:30am - 12:00am -
Work on Thu project, and ask ika for help if possible
-
13:30pm - 18:00pm -
Template design, at least finish 2 template
-
Fri, Sep 79:00am - 18:00pm -
Take a day off
-
Sat, Sep 87:00am - 7:50pm -
Work out with Joseph
-
-
- \ No newline at end of file +
+
+

October

+
+ tiny calendar goes here +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Thu, Sep 69:00am - 9:30am +
Commuting time, from home to RD
+
9:30am - 12:00am +
Work on Thu project, and ask ika for help if possible
+
13:30pm - 18:00pm +
Template design, at least finish 2 template
+
Fri, Sep 79:00am - 18:00pm +
Take a day off
+
Sat, Sep 87:00am - 7:50pm +
Work out with Joseph
+
+
+
+
+
+

November

+
+ tiny calendar goes here +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Thu, Sep 69:00am - 9:30am +
Commuting time, from home to RD
+
9:30am - 12:00am +
Work on Thu project, and ask ika for help if possible
+
13:30pm - 18:00pm +
Template design, at least finish 2 template
+
Fri, Sep 79:00am - 18:00pm +
Take a day off
+
Sat, Sep 87:00am - 7:50pm +
Work out with Joseph
+
+
+
+
\ No newline at end of file diff --git a/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/index.html.erb b/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/index.html.erb index 791cfe19..7c708f81 100644 --- a/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/index.html.erb +++ b/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/index.html.erb @@ -1,6 +1,6 @@ <%= stylesheet_link_tag "font-awesome" %> -<%= stylesheet_link_tag "calendar" %> <%= stylesheet_link_tag "bootstrap-responsive" %> +<%= stylesheet_link_tag "calendar" %> <% content_for :page_specific_javascript do %> <%= javascript_include_tag "calendarAPI" %> <% end %> diff --git a/vendor/built_in_modules/personal_patent/app - %BDƻs/assets/images/personal_patent/.gitkeep b/vendor/built_in_modules/personal_patent/app - %BDƻs/assets/images/personal_patent/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/vendor/built_in_modules/personal_patent/app - %BDƻs/assets/javascripts/personal_patent/.gitkeep b/vendor/built_in_modules/personal_patent/app - %BDƻs/assets/javascripts/personal_patent/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/vendor/built_in_modules/personal_patent/app - %BDƻs/assets/stylesheets/personal_patent/.gitkeep b/vendor/built_in_modules/personal_patent/app - %BDƻs/assets/stylesheets/personal_patent/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/vendor/built_in_modules/personal_patent/app - %BDƻs/controllers/.gitkeep b/vendor/built_in_modules/personal_patent/app - %BDƻs/controllers/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/vendor/built_in_modules/personal_patent/app - %BDƻs/controllers/application_controller.rb b/vendor/built_in_modules/personal_patent/app - %BDƻs/controllers/application_controller.rb deleted file mode 100644 index 307a4acd..00000000 --- a/vendor/built_in_modules/personal_patent/app - %BDƻs/controllers/application_controller.rb +++ /dev/null @@ -1,23 +0,0 @@ -class ApplicationController < ActionController::Base - protect_from_forgery - before_filter :set_locale - - # Set I18n.locale - def set_locale - # update session if passed - session[:locale] = params[:locale] if params[:locale] - - # set locale based on session or default - begin - # check if locale is valid for non site pages - if !VALID_LOCALES.include?(session[:locale]) - I18n.locale = I18n.default_locale - else - I18n.locale = session[:locale] - end - rescue - I18n.locale = I18n.default_locale - end - end - -end diff --git a/vendor/built_in_modules/personal_patent/app - %BDƻs/controllers/panel/personal_patent/back_end/tags_controller.rb b/vendor/built_in_modules/personal_patent/app - %BDƻs/controllers/panel/personal_patent/back_end/tags_controller.rb deleted file mode 100644 index b7479e8c..00000000 --- a/vendor/built_in_modules/personal_patent/app - %BDƻs/controllers/panel/personal_patent/back_end/tags_controller.rb +++ /dev/null @@ -1,8 +0,0 @@ -class Panel::PersonalPatent::BackEnd::TagsController < Admin::TagsController - - def initialize - super - @app_title = 'personal_patent' - end - -end diff --git a/vendor/built_in_modules/personal_patent/app - %BDƻs/controllers/panel/personal_patent/back_end/writing_patent_categorys_controller.rb b/vendor/built_in_modules/personal_patent/app - %BDƻs/controllers/panel/personal_patent/back_end/writing_patent_categorys_controller.rb deleted file mode 100644 index fe7bc853..00000000 --- a/vendor/built_in_modules/personal_patent/app - %BDƻs/controllers/panel/personal_patent/back_end/writing_patent_categorys_controller.rb +++ /dev/null @@ -1,119 +0,0 @@ -class Panel::PersonalPatent::BackEnd::WritingPatentCategorysController < OrbitBackendController - include OrbitControllerLib::DivisionForDisable - - before_filter :force_order_for_visitor,:only=>[:index,:show] - before_filter :force_order_for_user,:except => [:index,:show] - before_filter :for_app_manager,:except => [:index] - - def index - - @writing_patent_categorys = WritingPatentCategory.all - @writing_patent_category = WritingPatentCategory.new(:display => 'List') - - @url = panel_personal_patent_back_end_writing_patent_categorys_path - - respond_to do |format| - format.html # index.html.erb - format.js - end - end - - # GET /projects/1 - # GET /projects/1.xml - def show - - @writing_patent_category = WritingPatentCategory.find(params[:id]) - - respond_to do |format| - format.html # show.html.erb - format.js - end - end - - # GET /projects/new - # GET /projects/new.xml - def new - - @writing_patent_category = WritingPatentCategory.new(:display => 'List') - - @verb = :post - - respond_to do |format| - format.html # new.html.erb - format.js - end - end - - # GET /projects/1/edit - def edit - - @writing_patent_category = WritingPatentCategory.find(params[:id]) - - @url = panel_personal_patent_back_end_writing_patent_category_path(@writing_patent_category) - - @verb = :put - - respond_to do |format| - format.html - format.js - end - end - - # POST /projects - # POST /projects.xml - def create - - @writing_patent_category = WritingPatentCategory.new(params[:writing_patent_category]) - - respond_to do |format| - if @writing_patent_category.save - format.html { redirect_to(panel_personal_patent_back_end_writing_patent_categorys_url, :notice => t('writing_patent_category.create_writing_patent_category_success')) } - format.js - else - format.html { render :action => "new" } - format.js { render action: "new" } - end - end - end - - # PUT /projects/1 - # PUT /projects/1.xml - def update - - @writing_patent_category = WritingPatentCategory.find(params[:id]) - # debugger - @url = panel_personal_patent_back_end_writing_patent_category_path(@writing_patent_category) - - respond_to do |format| - if @writing_patent_category.update_attributes(params[:writing_patent_category]) - format.html { redirect_to(panel_personal_patent_back_end_writing_patent_categorys_url, :notice => t('writing_patent_category.update_writing_patent_category_success')) } - # format.xml { head :ok } - format.js - else - format.html { render :action => "edit" } - format.js { render :action => "edit" } - end - end - end - - # DELETE /projects/1 - # DELETE /projects/1.xml - def destroy - - @writing_patent_category = WritingPatentCategory.find(params[:id]) - @writing_patent_category.disable = @writing_patent_category.disable ? false : true - - if @writing_patent_category.save! - respond_to do |format| - format.html { redirect_to(panel_personal_patent_back_end_writing_patent_categorys_url) } - # format.xml { head :ok } - format.js - end - else - flash[:error] = t("writing_patent_category.update_failed") - format.html { render :action => "index" } - end - - end - -end diff --git a/vendor/built_in_modules/personal_patent/app - %BDƻs/controllers/panel/personal_patent/back_end/writing_patents_controller.00.rb b/vendor/built_in_modules/personal_patent/app - %BDƻs/controllers/panel/personal_patent/back_end/writing_patents_controller.00.rb deleted file mode 100644 index d038e1b8..00000000 --- a/vendor/built_in_modules/personal_patent/app - %BDƻs/controllers/panel/personal_patent/back_end/writing_patents_controller.00.rb +++ /dev/null @@ -1,244 +0,0 @@ -class Panel::PersonalPatent::BackEnd::WritingPatentsController < OrbitBackendController - include AdminHelper - include OrbitControllerLib::DivisionForDisable - - before_filter :authenticate_user! - before_filter :force_order_for_visitor,:only=>[:index,:show] - before_filter :force_order_for_user,:except => [:index,:show] - # before_filter :for_app_manager,:except => [:index,:show] - before_filter :only => [ :new,:create,:edit,:update,:create] do |controller| - controller.get_categorys('WritingPatentCategory') - end - - def index - - get_categorys("WritingPatentCategory",params[:writing_patent_category_id]) - @filter = params[:filter] - new_filter = params[:new_filter] - - if @filter && params[:clear] - @filter.delete(params[:type]) - elsif @filter && new_filter - if @filter.has_key?(new_filter[:type]) && @filter[new_filter[:type]].include?(new_filter[:id].to_s) - @filter[new_filter[:type]].delete(new_filter[:id].to_s) - elsif @filter.has_key?(new_filter[:type]) - @filter[new_filter[:type]] << new_filter[:id].to_s - else - @filter.merge!({new_filter[:type] => [new_filter[:id].to_s]}) - end - elsif new_filter - @filter = {new_filter[:type] => [new_filter[:id].to_s]} - end - - - @writing_patent_categorys = get_categories_for_index("WritingPatentCategory") - @writing_patent_category_ids = @writing_patent_categorys.collect{|t| t.id.to_s} + [nil] - - @writing_patents = (params[:sort] || @filter) ? get_sorted_and_filtered("writing_patent",:writing_patent_category_id.in => @writing_patent_category_ids) : get_viewable("writing_patent",:writing_patent_category_id.in => @writing_patent_category_ids) - - get_tags - - respond_to do |format| - format.html # index.html.erb - format.xml { render :xml => @writing_patents } - format.js - end - end - - def writing_patent_setting - - @writing_patent_categorys = WritingPatentCategory.all - - get_tags - - @set_writing_patent_category = WritingPatentCategory.new(:display => 'List') - @writing_patent_category_url = panel_personal_patent_back_end_writing_patents_path - - - end - - def writing_patent_category_quick_add - @set_writing_patent_category = WritingPatentCategory.new(:display => 'List') - @writing_patent_category_url = panel_personal_patent_back_end_writing_patents_path - @set_writing_patent_category.id = params[:id] - - respond_to do |format| - format.js - end - - end - - def writing_patent_category_quick_edit - - @set_writing_patent_category = WritingPatentCategory.find(params[:writing_patent_id]) - @writing_patent_category_url = panel_personal_patent_back_end_writing_patent_path(@set_writing_patent_category) - - respond_to do |format| - format.js - end - end - - # GET /writing_patents/1 - # GET /writing_patents/1.xml - def show - @writing_patent = WritingPatent.find(params[:id]) - respond_to do |format| - format.html # show.html.erb - format.xml { render :xml => @writing_patent } - end - end - - # GET /writing_patents/new - # GET /writing_patents/new.xml - def new - - @writing_patent = WritingPatent.new - debugger - @writing_patent_categorys = WritingPatentCategory.all - - get_tags - - respond_to do |format| - format.html # new.html.erb - format.xml { render :xml => @writing_patent } - end - end - - # GET /writing_patents/1/edit - def edit - @writing_patent = WritingPatent.find(params[:id]) - - @writing_patent_categorys = WritingPatentCategory.all - - get_tags - end - - # POST /writing_patents - # POST /writing_patents.xml - def create - - if params[:writing_patent_category] - - @writing_patent_category = WritingPatentCategory.new(params[:writing_patent_category]) - - respond_to do |format| - if @writing_patent_category.save - format.js { render 'create_writing_patent_setting' } - end - end - - else - - - @writing_patent_categorys = WritingPatentCategory.all - get_tags - - @writing_patent = WritingPatent.new(params[:writing_patent]) - - @writing_patent.create_user_id = current_user.id - @writing_patent.update_user_id = current_user.id - - respond_to do |format| - if @writing_patent.save - format.html { redirect_to(panel_personal_patent_back_end_writing_patents_url) } - format.xml { render :xml => @writing_patent, :status => :created, :location => @writing_patent } - else - format.html { render :action => "new" } - format.xml { render :xml => @writing_patent.errors, :status => :unprocessable_entity } - end - end - end - - end - - # PUT /writing_patents/1 - # PUT /writing_patents/1.xml - def update - - if params[:writing_patent_category] - - @writing_patent_category = WritingPatentCategory.find(params[:id]) - - respond_to do |format| - - if @writing_patent_category.update_attributes(params[:writing_patent_category]) - # format.html { redirect_to(panel_announcement_back_end_bulletins_url) } - format.js { render 'update_writing_patent_setting' } - end - end - - else - - @writing_patent = WritingPatent.find(params[:id]) - - @writing_patent.update_user_id = current_user.id - - params[:writing_patent][:tag_ids] ||=[] - - respond_to do |format| - if @writing_patent.update_attributes(params[:writing_patent]) - format.html { redirect_to(panel_personal_patent_back_end_writing_patents_url) } - # format.js { render 'toggle_enable' } - format.xml { head :ok } - else - format.html { render :action => "edit" } - format.xml { render :xml => @writing_patent.errors, :status => :unprocessable_entity } - end - end - end - - end - - # DELETE /writing_patents/1 - # DELETE /writing_patents/1.xml - def destroy - @writing_patent = WritingPatent.find(params[:id]) - @writing_patent.destroy - - respond_to do |format| - format.html { redirect_to(panel_personal_patent_back_end_writing_patents_url) } - # format.xml { head :ok } - format.js - end - end - - def delete - if params[:ids] - writing_patents = WritingPatent.any_in(:_id => params[:ids]).delete_all - end - redirect_to panel_personal_patent_back_end_writing_patents_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]) - end - - protected - - - # def get_index_categories(id = nil) - # @bulletin_categorys = [] - # if(is_manager? || is_admin?) - # @bulletin_categorys = (id ? BulletinCategory.admin_manager_all.find(id).to_a : BulletinCategory.admin_manager_all) - # elsif is_sub_manager? - # @bulletin_categorys = BulletinCategory.all - # end - # @bulletin_categorys - # end - - - # def get_categorys(id = nil) - # @writing_patent_categorys = [] - # if(is_manager? || is_admin?) - # @writing_patent_categorys = (id ? WritingPatent.admin_manager_all.find(id).to_a : WritingPatent.admin_manager_all)) - # elsif is_sub_manager? - # @writing_patent_categorys = WritingPatent.all.authed_for_user(current_user,'edit') - # end - # if @writing_patent_categorys.empty? && params[:action] != "index" - # flash[:alert] = t("announcement.error.no_avilb_cate_for_posting") - # redirect_to :action => :index - # end - # end - - def get_tags - module_app = ModuleApp.first(:conditions => {:key => 'personal_patent'}) - @tags = Tag.all(:conditions => {:module_app_id => module_app.id}) - end - -end diff --git a/vendor/built_in_modules/personal_patent/app - %BDƻs/controllers/panel/personal_patent/back_end/writing_patents_controller.rb b/vendor/built_in_modules/personal_patent/app - %BDƻs/controllers/panel/personal_patent/back_end/writing_patents_controller.rb deleted file mode 100644 index a0bec01b..00000000 --- a/vendor/built_in_modules/personal_patent/app - %BDƻs/controllers/panel/personal_patent/back_end/writing_patents_controller.rb +++ /dev/null @@ -1,244 +0,0 @@ -class Panel::PersonalPatent::BackEnd::WritingPatentsController < OrbitBackendController - include AdminHelper - include OrbitControllerLib::DivisionForDisable - - before_filter :authenticate_user! - before_filter :force_order_for_visitor,:only=>[:index,:show] - before_filter :force_order_for_user,:except => [:index,:show] - # before_filter :for_app_manager,:except => [:index,:show] - before_filter :only => [ :new,:create,:edit,:update,:create] do |controller| - controller.get_categorys('WritingPatentCategory') - end - - def index - - get_categorys("WritingPatentCategory",params[:writing_patent_writing_patent_category_id]) - @filter = params[:filter] - new_filter = params[:new_filter] - - if @filter && params[:clear] - @filter.delete(params[:type]) - elsif @filter && new_filter - if @filter.has_key?(new_filter[:type]) && @filter[new_filter[:type]].include?(new_filter[:id].to_s) - @filter[new_filter[:type]].delete(new_filter[:id].to_s) - elsif @filter.has_key?(new_filter[:type]) - @filter[new_filter[:type]] << new_filter[:id].to_s - else - @filter.merge!({new_filter[:type] => [new_filter[:id].to_s]}) - end - elsif new_filter - @filter = {new_filter[:type] => [new_filter[:id].to_s]} - end - - - @writing_patent_categorys = get_categories_for_index("WritingPatentCategory") - @writing_patent_category_ids = @writing_patent_categorys.collect{|t| t.id.to_s} + [nil] - - @writing_patents = (params[:sort] || @filter) ? get_sorted_and_filtered("writing_patent",:writing_patent_category_id.in => @writing_patent_category_ids) : get_viewable("writing_patent",:writing_patent_category_id.in => @writing_patent_category_ids) - - get_tags - - respond_to do |format| - format.html # index.html.erb - format.xml { render :xml => @writing_patents } - format.js - end - end - - def writing_patent_setting - - @writing_patent_categorys = WritingPatentCategory.all - - get_tags - - @set_writing_patent_category = WritingPatentCategory.new(:display => 'List') - @writing_patent_category_url = panel_personal_patent_back_end_writing_patents_path - - - end - - def writing_patent_category_quick_add - @set_writing_patent_category = WritingPatentCategory.new(:display => 'List') - @writing_patent_category_url = panel_personal_patent_back_end_writing_patents_path - @set_writing_patent_category.id = params[:id] - - respond_to do |format| - format.js - end - - end - - def writing_patent_category_quick_edit - - @set_writing_patent_category = WritingPatentCategory.find(params[:writing_patent_id]) - @writing_patent_category_url = panel_personal_patent_back_end_writing_patent_path(@set_writing_patent_category) - - respond_to do |format| - format.js - end - end - - # GET /writing_patents/1 - # GET /writing_patents/1.xml - def show - @writing_patent = Project.find(params[:id]) - respond_to do |format| - format.html # show.html.erb - format.xml { render :xml => @writing_patent } - end - end - - # GET /writing_patents/new - # GET /writing_patents/new.xml - def new - - @writing_patent = Project.new - - @writing_patent_categorys = WritingPatentCategory.all - - get_tags - - respond_to do |format| - format.html # new.html.erb - format.xml { render :xml => @writing_patent } - end - end - - # GET /writing_patents/1/edit - def edit - @writing_patent = Project.find(params[:id]) - - @writing_patent_categorys = WritingPatentCategory.all - - get_tags - end - - # POST /writing_patents - # POST /writing_patents.xml - def create - - if params[:writing_patent_category] - - @writing_patent_category = WritingPatentCategory.new(params[:writing_patent_category]) - - respond_to do |format| - if @writing_patent_category.save - format.js { render 'create_writing_patent_setting' } - end - end - - else - - - @writing_patent_categorys = WritingPatentCategory.all - get_tags - - @writing_patent = Project.new(params[:writing_patent]) - - @writing_patent.create_user_id = current_user.id - @writing_patent.update_user_id = current_user.id - - respond_to do |format| - if @writing_patent.save - format.html { redirect_to(panel_personal_patent_back_end_writing_patents_url) } - format.xml { render :xml => @writing_patent, :status => :created, :location => @writing_patent } - else - format.html { render :action => "new" } - format.xml { render :xml => @writing_patent.errors, :status => :unprocessable_entity } - end - end - end - - end - - # PUT /writing_patents/1 - # PUT /writing_patents/1.xml - def update - - if params[:writing_patent_category] - - @writing_patent_category = WritingPatentCategory.find(params[:id]) - - respond_to do |format| - - if @writing_patent_category.update_attributes(params[:writing_patent_category]) - # format.html { redirect_to(panel_announcement_back_end_bulletins_url) } - format.js { render 'update_writing_patent_setting' } - end - end - - else - - @writing_patent = Project.find(params[:id]) - - @writing_patent.update_user_id = current_user.id - - params[:writing_patent][:tag_ids] ||=[] - - respond_to do |format| - if @writing_patent.update_attributes(params[:writing_patent]) - format.html { redirect_to(panel_personal_patent_back_end_writing_patents_url) } - # format.js { render 'toggle_enable' } - format.xml { head :ok } - else - format.html { render :action => "edit" } - format.xml { render :xml => @writing_patent.errors, :status => :unprocessable_entity } - end - end - end - - end - - # DELETE /writing_patents/1 - # DELETE /writing_patents/1.xml - def destroy - @writing_patent = Project.find(params[:id]) - @writing_patent.destroy - - respond_to do |format| - format.html { redirect_to(panel_personal_patent_back_end_writing_patents_url) } - # format.xml { head :ok } - format.js - end - end - - def delete - if params[:ids] - writing_patents = Project.any_in(:_id => params[:ids]).delete_all - end - redirect_to panel_personal_patent_back_end_writing_patents_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]) - end - - protected - - - # def get_index_categories(id = nil) - # @bulletin_categorys = [] - # if(is_manager? || is_admin?) - # @bulletin_categorys = (id ? BulletinCategory.admin_manager_all.find(id).to_a : BulletinCategory.admin_manager_all) - # elsif is_sub_manager? - # @bulletin_categorys = BulletinCategory.all - # end - # @bulletin_categorys - # end - - - # def get_categorys(id = nil) - # @writing_patent_categorys = [] - # if(is_manager? || is_admin?) - # @writing_patent_categorys = (id ? Project.admin_manager_all.find(id).to_a : Project.admin_manager_all)) - # elsif is_sub_manager? - # @writing_patent_categorys = Project.all.authed_for_user(current_user,'edit') - # end - # if @writing_patent_categorys.empty? && params[:action] != "index" - # flash[:alert] = t("announcement.error.no_avilb_cate_for_posting") - # redirect_to :action => :index - # end - # end - - def get_tags - module_app = ModuleApp.first(:conditions => {:key => 'personal_patent'}) - @tags = Tag.all(:conditions => {:module_app_id => module_app.id}) - end - -end diff --git a/vendor/built_in_modules/personal_patent/app - %BDƻs/controllers/panel/personal_patent/plugin/writing_patents_controller.rb b/vendor/built_in_modules/personal_patent/app - %BDƻs/controllers/panel/personal_patent/plugin/writing_patents_controller.rb deleted file mode 100644 index 1acab41d..00000000 --- a/vendor/built_in_modules/personal_patent/app - %BDƻs/controllers/panel/personal_patent/plugin/writing_patents_controller.rb +++ /dev/null @@ -1,181 +0,0 @@ -class Panel::PersonalPatent::Plugin::WritingPatentsController < OrbitBackendController - include AdminHelper - include OrbitControllerLib::DivisionForDisable - - before_filter :authenticate_user! - before_filter :force_order_for_visitor,:only=>[:index,:show] - before_filter :force_order_for_user,:except => [:index,:show] - # before_filter :for_app_manager,:except => [:index,:show] - before_filter :only => [ :new,:create,:edit,:update,:create] do |controller| - controller.get_categorys('WritingPatentCategory') - end - - def index - - get_categorys("WritingPatentCategory",params[:writing_patent_writing_patent_category_id]) - @filter = params[:filter] - new_filter = params[:new_filter] - - if @filter && params[:clear] - @filter.delete(params[:type]) - elsif @filter && new_filter - if @filter.has_key?(new_filter[:type]) && @filter[new_filter[:type]].include?(new_filter[:id].to_s) - @filter[new_filter[:type]].delete(new_filter[:id].to_s) - elsif @filter.has_key?(new_filter[:type]) - @filter[new_filter[:type]] << new_filter[:id].to_s - else - @filter.merge!({new_filter[:type] => [new_filter[:id].to_s]}) - end - elsif new_filter - @filter = {new_filter[:type] => [new_filter[:id].to_s]} - end - - - @writing_patent_categorys = get_categories_for_index("WritingPatentCategory") - @writing_patent_category_ids = @writing_patent_categories.collect{|t| t.id.to_s} + [nil] - - @writing_patents = (params[:sort] || @filter) ? get_sorted_and_filtered("writing_patent",:create_user_id => current_user.id) : get_viewable("writing_patent", :create_user_id => current_user.id) - - get_tags - - respond_to do |format| - format.html # index.html.erb - format.xml { render :xml => @writing_patents } - format.js - end - end - - # GET /writing_patents/1 - # GET /writing_patents/1.xml - def show - @writing_patent = Project.find(params[:id]) - respond_to do |format| - format.html # show.html.erb - format.xml { render :xml => @writing_patent } - end - end - - # GET /writing_patents/new - # GET /writing_patents/new.xml - def new - - @writing_patent = Project.new - - @writing_patent_categorys = WritingPatentCategory.all - - get_tags - - respond_to do |format| - format.html # new.html.erb - format.xml { render :xml => @writing_patent } - end - end - - # GET /writing_patents/1/edit - def edit - @writing_patent = Project.find(params[:id]) - - @writing_patent_categorys = WritingPatentCategory.all - - get_tags - end - - # POST /writing_patents - # POST /writing_patents.xml - def create - - @writing_patent_categorys = WritingPatentCategory.all - get_tags - - @writing_patent = Project.new(params[:writing_patent]) - - @writing_patent.create_user_id = current_user.id - @writing_patent.update_user_id = current_user.id - - respond_to do |format| - if @writing_patent.save - format.html { redirect_to(panel_personal_writing_patent_plugin_writing_patents_url) } - format.xml { render :xml => @writing_patent, :status => :created, :location => @writing_patent } - else - format.html { render :action => "new" } - format.xml { render :xml => @writing_patent.errors, :status => :unprocessable_entity } - end - end - end - - - # PUT /writing_patents/1 - # PUT /writing_patents/1.xml - def update - - @writing_patent = Project.find(params[:id]) - - @writing_patent.update_user_id = current_user.id - - params[:writing_patent][:tag_ids] ||=[] - - respond_to do |format| - if @writing_patent.update_attributes(params[:writing_patent]) - format.html { redirect_to(panel_personal_writing_patent_plugin_writing_patents_url) } - # format.js { render 'toggle_enable' } - format.xml { head :ok } - else - format.html { render :action => "edit" } - format.xml { render :xml => @writing_patent.errors, :status => :unprocessable_entity } - end - end - end - - # DELETE /writing_patents/1 - # DELETE /writing_patents/1.xml - def destroy - @writing_patent = Project.find(params[:id]) - @writing_patent.destroy - - respond_to do |format| - format.html { redirect_to(panel_personal_writing_patent_plugin_writing_patents_url) } - # format.xml { head :ok } - format.js - end - end - - def delete - if params[:ids] - writing_patents = Project.any_in(:_id => params[:ids]).delete_all - end - redirect_to panel_personal_writing_patent_plugin_writing_patents_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]) - end - - protected - - - # def get_index_categories(id = nil) - # @bulletin_categorys = [] - # if(is_manager? || is_admin?) - # @bulletin_categorys = (id ? BulletinCategory.admin_manager_all.find(id).to_a : BulletinCategory.admin_manager_all) - # elsif is_sub_manager? - # @bulletin_categorys = BulletinCategory.all - # end - # @bulletin_categorys - # end - - - # def get_categorys(id = nil) - # @writing_patent_categorys = [] - # if(is_manager? || is_admin?) - # @writing_patent_categorys = (id ? Project.admin_manager_all.find(id).to_a : Project.admin_manager_all)) - # elsif is_sub_manager? - # @writing_patent_categorys = Project.all.authed_for_user(current_user,'edit') - # end - # if @writing_patent_categorys.empty? && params[:action] != "index" - # flash[:alert] = t("announcement.error.no_avilb_cate_for_posting") - # redirect_to :action => :index - # end - # end - - def get_tags - module_app = ModuleApp.first(:conditions => {:key => 'personal_patent'}) - @tags = Tag.all(:conditions => {:module_app_id => module_app.id}) - end - -end diff --git a/vendor/built_in_modules/personal_patent/app - %BDƻs/helpers/.gitkeep b/vendor/built_in_modules/personal_patent/app - %BDƻs/helpers/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/vendor/built_in_modules/personal_patent/app - %BDƻs/mailers/.gitkeep b/vendor/built_in_modules/personal_patent/app - %BDƻs/mailers/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/vendor/built_in_modules/personal_patent/app - %BDƻs/models/.gitkeep b/vendor/built_in_modules/personal_patent/app - %BDƻs/models/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/vendor/built_in_modules/personal_patent/app - %BDƻs/models/personal_patent_tag.rb b/vendor/built_in_modules/personal_patent/app - %BDƻs/models/personal_patent_tag.rb deleted file mode 100644 index 752e62e6..00000000 --- a/vendor/built_in_modules/personal_patent/app - %BDƻs/models/personal_patent_tag.rb +++ /dev/null @@ -1,9 +0,0 @@ -class PersonalPatentTag < Tag - - has_and_belongs_to_many :writing_patents - - def get_visible_links(sort = :title) - self.writing_patents.where(:is_hidden => false).desc(:is_top, sort) - end - -end \ No newline at end of file diff --git a/vendor/built_in_modules/personal_patent/app - %BDƻs/models/writing_patent.rb b/vendor/built_in_modules/personal_patent/app - %BDƻs/models/writing_patent.rb deleted file mode 100644 index 75bc5054..00000000 --- a/vendor/built_in_modules/personal_patent/app - %BDƻs/models/writing_patent.rb +++ /dev/null @@ -1,108 +0,0 @@ -# encoding: utf-8 - -class WritingPatent - include Mongoid::Document - include Mongoid::Timestamps - include Mongoid::MultiParameterAttributes - - # scope :available_for_lang, ->(locale){ where("available_for_#{locale}".to_sym => true) } - - LANGUAGE_TYPES = [ "English", "Chinese" ] - - - field :patent_title, localize: true - field :authors, localize: true - - has_and_belongs_to_many :tags, :class_name => "PersonalPatentTag" - - belongs_to :writing_patent_category - - field :year - field :language - field :keywords - field :patent_no - field :patent_country - field :publish_date , :type => Date - field :url - field :note - field :create_user_id - field :update_user_id - - # field :is_top, :type => Boolean, :default => false - # field :is_hot, :type => Boolean, :default => false - # field :is_hidden, :type => Boolean, :default => false - - has_many :writing_patent_files, :autosave => true, :dependent => :destroy - - accepts_nested_attributes_for :writing_patent_files, :allow_destroy => true - - # before_save :update_avliable_language, :clean_checkboxs - - validates :writing_patent_title, :at_least_one => true - - before_validation :add_http - - after_save :save_writing_patent_files - - validates :url, :format => /^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$/ix, :unless => Proc.new{self.url.blank?} - - def self.search( category_id = nil ) - - if category_id.to_s.size > 0 - - find(:all, :conditions => {writing_patent_category_id: category_id}).desc( :is_top, :title ) - - else - - find(:all).desc( :is_top, :title) - - end - - end - - - def self.widget_datas - - where( :is_hidden => false ).desc(:is_top, :created_at) - - end - - def is_top? - self.is_top - end - - def sorted_tags - tags.order_by(I18n.locale, :asc) - end - - def update_avliable_language - VALID_LOCALES.each do |locale| - if (title_translations[locale].blank? rescue true) - self["available_for_#{locale}".to_sym] = false - else - self["available_for_#{locale}".to_sym] = true - end - end - end - - def save_writing_patent_files - self.writing_patent_files.each do |t| - if t.should_destroy - t.destroy - end - end - end - - protected - - def add_http - unless self.url.blank? || self.url[/^http:\/\//] || self.url[/^https:\/\//] - self.url = 'http://' + self.url - end - end - - def clean_checkboxs - self.tag_ids.delete('') - end - -end \ No newline at end of file diff --git a/vendor/built_in_modules/personal_patent/app - %BDƻs/models/writing_patent_category.rb b/vendor/built_in_modules/personal_patent/app - %BDƻs/models/writing_patent_category.rb deleted file mode 100644 index e1dfcab0..00000000 --- a/vendor/built_in_modules/personal_patent/app - %BDƻs/models/writing_patent_category.rb +++ /dev/null @@ -1,28 +0,0 @@ -# encoding: utf-8 - -class WritingPatentCategory - include Mongoid::Document - include Mongoid::Timestamps - include OrbitCoreLib::ObjectAuthable - include OrbitCoreLib::ObjectDisable - # include Mongoid::MultiParameterAttributes - AfterObjectAuthUrl = '/panel/personal_patent/back_end/writing_patent_categorys' - APP_NAME = 'project' - # ObjectAuthTitlesOptions = %W{edit} - ObjectAuthTitlesOptions = %W{submit_new fact_check} - - field :key - - field :title, localize: true - - has_many :writing_patents - - def pp_object - title - end - - def self.from_id(id) - WritingPatentCategory.find(id) rescue nil - end - -end \ No newline at end of file diff --git a/vendor/built_in_modules/personal_patent/app - %BDƻs/models/writing_patent_file.rb b/vendor/built_in_modules/personal_patent/app - %BDƻs/models/writing_patent_file.rb deleted file mode 100644 index df7c5b45..00000000 --- a/vendor/built_in_modules/personal_patent/app - %BDƻs/models/writing_patent_file.rb +++ /dev/null @@ -1,14 +0,0 @@ -class WritingPatentFile - - include Mongoid::Document - include Mongoid::Timestamps - - mount_uploader :file, AssetUploader - - # field :description, localize: true - field :should_destroy, :type => Boolean - field :title, localize: true - - belongs_to :writing_patent - -end diff --git a/vendor/built_in_modules/personal_patent/app - %BDƻs/views/.gitkeep b/vendor/built_in_modules/personal_patent/app - %BDƻs/views/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/_form.html.erb b/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/_form.html.erb deleted file mode 100644 index c3542e8b..00000000 --- a/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/_form.html.erb +++ /dev/null @@ -1,30 +0,0 @@ -<% # encoding: utf-8 %> - -<%= form_for(@writing_patent_category, :remote => true, :url => @url) do |f| %> - -

<%= (@writing_patent_category.new_record? ? 'Add' : 'Edit') %>

- -
- <%= f.label :key %> - <%= f.text_field :key %> -
- -
- <%= f.fields_for :title_translations do |f| %> - <% @site_valid_locales.each do |locale| %> -
- <%= label_tag "name-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %> -
- <%= f.text_field locale, :class => 'input-xxlarge', :value => (@web_link_category.title_translations[locale] rescue nil) %> -
-
- <% end %> - <% end %> -
- -
- <%= f.submit 'Submit/送出', :class=>'btn btn-primary' %> -
- -<% end %> - \ No newline at end of file diff --git a/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/_writing_patent_category.html.erb b/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/_writing_patent_category.html.erb deleted file mode 100644 index 08396d9b..00000000 --- a/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/_writing_patent_category.html.erb +++ /dev/null @@ -1,16 +0,0 @@ - - - - - <%= writing_patent_category.key %> -
- -
- - <% @site_valid_locales.each do |locale| %> - <%= writing_patent_category.title_translations[locale] %> - <% end %> - \ No newline at end of file diff --git a/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/create.js.erb b/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/create.js.erb deleted file mode 100644 index 9a4eb545..00000000 --- a/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/create.js.erb +++ /dev/null @@ -1,2 +0,0 @@ -$('<%= j render :partial => 'writing_patent_category', :collection => [@writing_patent_category] %>').appendTo('#writing_patent_categorys').hide().fadeIn(); -$("#new_writing_patent_category")[0].reset(); \ No newline at end of file diff --git a/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/destroy.js.erb b/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/destroy.js.erb deleted file mode 100644 index 8bd6da01..00000000 --- a/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/destroy.js.erb +++ /dev/null @@ -1 +0,0 @@ -$("#<%= dom_id @writing_patent_category %>").remove(); \ No newline at end of file diff --git a/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/edit.js.erb b/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/edit.js.erb deleted file mode 100644 index eaff01fa..00000000 --- a/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/edit.js.erb +++ /dev/null @@ -1 +0,0 @@ -$("#form > form").replaceWith("<%= j render "form" %>"); \ No newline at end of file diff --git a/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/index.html.erb b/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/index.html.erb deleted file mode 100644 index 41adf614..00000000 --- a/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/index.html.erb +++ /dev/null @@ -1,23 +0,0 @@ - - -<%= flash_messages %> - - - - - - <% @site_valid_locales.each do |locale| %> - - <% end %> - - - - - <%= render :partial => 'writing_patent_category', :collection => @writing_patent_categorys %> - - -
<%= t('writing_patent_category.key') %><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %>
- -
<%= render :partial => "form" %>
- - diff --git a/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/new.js.erb b/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/new.js.erb deleted file mode 100644 index 40061b9f..00000000 --- a/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/new.js.erb +++ /dev/null @@ -1 +0,0 @@ -$("#form > form").replaceWith("<%= j render "form" %>"); diff --git a/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/update.js.erb b/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/update.js.erb deleted file mode 100644 index 299b38a7..00000000 --- a/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/update.js.erb +++ /dev/null @@ -1,4 +0,0 @@ -$("#<%= dom_id @writing_patent_category %>").replaceWith("<%= j render :partial => 'link_category', :collection => [@writing_patent_category] %>"); -<% @writing_patent_category = ProjectCategory.new(:display => 'List') # reset for new form %> -$(".edit_writing_patent_category").replaceWith("<%= j render "form" %>") -$(".new_writing_patent_category")[0].reset(); \ No newline at end of file diff --git a/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_filter.html.erb b/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_filter.html.erb deleted file mode 100644 index 63882b8f..00000000 --- a/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_filter.html.erb +++ /dev/null @@ -1,11 +0,0 @@ - - -<% content_for :page_specific_javascript do %> - <%= javascript_include_tag "sort_header" %> -<% end %> \ No newline at end of file diff --git a/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_form.html.erb b/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_form.html.erb deleted file mode 100644 index 22022c21..00000000 --- a/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_form.html.erb +++ /dev/null @@ -1,209 +0,0 @@ -<% # encoding: utf-8 %> - - <%= f.error_messages %> - - - -
- -
-
- -
-

Tags

-
- <% @tags.each do |tag| %> - <%= content_tag :label,:class => "checkbox inline" do -%> - <%= check_box_tag 'writing_patent[tag_ids][]', tag.id, @writing_patent.tag_ids.include?(tag.id)%> - <%= tag[I18n.locale] %> - <%= hidden_field_tag 'writing_patent[tag_ids][]', '' %> - <% end %> - <% end %> -
-
- -
- - - - - -
-
- -
- <%= f.label :year ,t("personal_patent.year")%> - <%= select_year((@writing_patent.year ? @writing_patent.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'writing_patent[year]'} ) %> -
- -
- <%= f.label :writing_patent_category ,t("personal_patent.writing_patent_category")%> - <%= f.select :writing_patent_category_id, @writing_patent_categorys.collect {|t| [ t.title, t.id ]} %> -
- -
- <%= f.label :period_start_date ,t("personal_patent.period_start_date")%> - <%= f.date_select :period_start_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1890, :order => [:year, :month], :discard_day => true }, {:class => 'span1'} %> -
- -
- <%= f.label :period_end_date ,t("personal_patent.period_end_date")%> - <%= f.date_select :period_end_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1890, :order => [:year, :month], :discard_day => true }, {:class => 'span1'} %> -
- - - -
- - <% @site_valid_locales.each_with_index do |locale, i| %> - -
"> - -
- <%= f.label :writing_patent_title ,t("personal_patent.writing_patent_title")%> - <%= f.fields_for :writing_patent_title_translations do |f| %> - <%= I18nVariable.from_locale(locale) %> - <%= f.text_field locale, :class=>'post-title', :value => (@writing_patent.writing_patent_title_translations[locale] rescue nil) %> - <% end %> -
- -
- <%= f.label :job_title ,t("personal_patent.job_title")%> - <%= f.fields_for :job_title_translations do |f| %> - <%= I18nVariable.from_locale(locale) %> - <%= f.text_field locale, :class=>'post-title', :value => (@writing_patent.job_title_translations[locale] rescue nil) %> - <% end %> -
- -
- <%= f.label :participator ,t("personal_patent.participator")%> - <%= f.fields_for :participator_translations do |f| %> - <%= I18nVariable.from_locale(locale) %> - <%= f.text_field locale, :class=>'post-title', :value => (@writing_patent.participator_translations[locale] rescue nil) %> - <% end %> -
- -
- <%= f.label :unit ,t("personal_patent.unit")%> - <%= f.fields_for :unit_translations do |f| %> - <%= I18nVariable.from_locale(locale) %> - <%= f.text_field locale, :class=>'post-title', :value => (@writing_patent.unit_translations[locale] rescue nil) %> - <% end %> -
- -
- - <% end %> - -
- -
- <%= f.label :url, t("personal_patent.url") %> - <%= f.text_field :url %> -
- -
- <%= f.label :keywords, t("personal_patent.keywords") %> - <%= f.text_field :keywords %> -
- -
- <%= f.label :abstract, t("personal_patent.abstract") %> - <%= f.text_field :abstract %> -
- -
- <%= f.label :language, t("personal_patent.language") %> - <%= f.radio_button :language, "Chinese" %> <%= t("personal_patent.Chinese") %> - <%= f.radio_button :language, "English" %> <%= t("personal_patent.English") %> -
- -
- <%= f.label :note, t("personal_patent.note") %> - <%= f.text_area :note, :size => "60x3" %> -
- -
- - - - - -
- -
- - - - - - - - - - - - - - - - - - <% @writing_patent.writing_patent_files.each_with_index do |writing_patent_file, i| %> - <%= f.fields_for :writing_patent_files, writing_patent_file do |f| %> - <%= render :partial => 'form_file', :object => writing_patent_file, :locals => {:f => f, :i => i} %> - <% end %> - <% end %> - -
FileFile Name
-
- <%= hidden_field_tag 'plugin_file_field_count', @writing_patent.writing_patent_files.count %> - ADD/新增 -
-
- -
- -
- - - - - - -
- - - - -
- <%= f.submit t('submit'), :class=>'btn btn-primary' %> - <%= link_to t('cancel'), get_go_back, :class=>"btn" %> -
- - -<% content_for :page_specific_javascript do %> - <%= javascript_include_tag "archive_plugin_form" %> - -<% end %> \ No newline at end of file diff --git a/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_form_file.html.erb b/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_form_file.html.erb deleted file mode 100644 index a91d6a85..00000000 --- a/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_form_file.html.erb +++ /dev/null @@ -1,50 +0,0 @@ -<% # encoding: utf-8 %> - - " class='list_item'> - -
-
- <%= f.file_field :file %> - <%= form_file.file.file ? ( link_to t(:view), form_file.file.url, {:class => 'btn', :target => '_blank', :title => t(:view)} ) : '' %> -
-
- - - -
- - <% @site_valid_locales.each_with_index do |locale, i| %> - -
"> - <%#= f.fields_for :i18n_variable, (form_file.new_record? ? form_file.build_i18n_variable : form_file.i18n_variable ) do |f| %> - <%= f.fields_for :file_title_translations do |f| %> -
- -
- <%= f.text_field locale, :class=>'post-file_title', :value => (form_file.file_title_translations[locale] rescue nil) %> -
-
- <% end %> - -
- - <% end %> - -
- - - - - - <% if form_file.new_record? %> - - <% else %> - <%= f.hidden_field :id %> - - <%= f.hidden_field :should_destroy, :value => nil, :class => 'should_destroy' %> - <% end %> - - - - - diff --git a/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_list_writing_patent_category.html.erb b/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_list_writing_patent_category.html.erb deleted file mode 100644 index 97db4523..00000000 --- a/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_list_writing_patent_category.html.erb +++ /dev/null @@ -1,11 +0,0 @@ -<% # encoding: utf-8 %> - - - <%= list_writing_patent_category.title %> - - - <%= t('edit')%> - <%= link_to show_toggle_archive_btn(list_writing_patent_category), - polymorphic_path([:panel, :personal_patent, :back_end, list_writing_patent_category]), :confirm => t('announcement.sure?'), :method => :delete, :remote => true,:class=>"archive_toggle action" %> - - \ No newline at end of file diff --git a/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_sort_headers.html.erb b/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_sort_headers.html.erb deleted file mode 100644 index a6dad620..00000000 --- a/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_sort_headers.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -<%= render_sort_bar(true, delete_panel_personal_patent_back_end_writing_patents_path(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]), - ['publish_date', 'publish_date', 'span1', 'writing_patent.publish_date'], - ['patent_title', 'patent_title','span3', 'writing_patent.patent_title'], - ['patent_no', 'patent_no','span3', 'writing_patent.patent_no'], - ['patent_country', 'patent_country','span3', 'writing_patent.patent_country'], - ['authors', 'authors','span3', 'writing_patent.authors'], - ['url', 'url','span3', 'writing_patent.url'], - ['create_modified', 'create_user_id','span1-3', 'writing_patent.create_modified']).html_safe %> \ No newline at end of file diff --git a/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_writing_patent.html.erb b/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_writing_patent.html.erb deleted file mode 100644 index f0257dd6..00000000 --- a/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_writing_patent.html.erb +++ /dev/null @@ -1,25 +0,0 @@ - - - <% if (writing_patent.create_user_id == current_user.id) || is_manager? %> - <%= check_box_tag 'to_delete[]', writing_patent.id, false, :class => "checkbox_in_list" %> - <% end -%> - - <%= writing_patent.publish_date.strftime("%Y.%m") %> - - <%= link_to writing_patent.patent_title, panel_personal_patent_front_end_writing_patent_path(writing_patent) %> -
- -
- - <%= writing_patent.patent_no %> - <%= writing_patent.patent_country %> - <%= writing_patent.authors %> - <%= writing_patent.url %> - <%= User.from_id(writing_patent.create_user_id).name rescue ''%> - - diff --git a/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_writing_patent_category_qe.html.erb b/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_writing_patent_category_qe.html.erb deleted file mode 100644 index f16154c3..00000000 --- a/vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_writing_patent_category_qe.html.erb +++ /dev/null @@ -1,34 +0,0 @@ -<% # encoding: utf-8 %> - -<%= form_for(@set_writing_patent_category, :remote => true, :url => @writing_patent_category_url ) do |f| %> - - -