diff --git a/app/assets/javascripts/admin/store_manager.js b/app/assets/javascripts/admin/store_manager.js index 42a2292..c92a3b6 100644 --- a/app/assets/javascripts/admin/store_manager.js +++ b/app/assets/javascripts/admin/store_manager.js @@ -138,7 +138,7 @@ var StoreManager = function(section){ "url" : "/admin/store/check_credentials" }).done(function(status){ if(status.success == true){ - resendEmail(); + authorizeAllModules(); }else if(status.success == false){ waitForStoreResponseCount++; if(waitForStoreResponseCount > 5){ @@ -152,6 +152,22 @@ var StoreManager = function(section){ }).fail(showError); } + var authorizeAllModules = function(){ + loadingAreaStatus.text("Authorizing default modules."); + $.ajax({ + "type" : "post", + "dataType" : "json", + "url" : "/admin/store/authorize_default_modules" + }).done(function(status){ + if(status.success == true){ + resendEmail(); + }else if(status.success == false){ + loadingArea.find("img").hide(); + loadingAreaStatus.text(data.message); + } + }).fail(showError); + } + var resendEmail = function(){ loadingArea.find("img").show(); loadingAreaStatus.text("Sending verification email."); diff --git a/app/assets/javascripts/basic/orbit_js_1.0.1.js b/app/assets/javascripts/basic/orbit_js_1.0.1.js index c5925cd..69a026a 100755 --- a/app/assets/javascripts/basic/orbit_js_1.0.1.js +++ b/app/assets/javascripts/basic/orbit_js_1.0.1.js @@ -291,6 +291,7 @@ if($.support.touch) { $el.find('a').removeAttr('href'); }; $el.on(mouseenterEvent, function(e) { + $sidebar.addClass('on') $block.siblings().removeClass('show').end().eq($(this).index()).addClass('show'); $arrow.stop(true, false).animate({ top: ($(this).position().top+$(this).height()/2)-$arrowHeightFormat+$('.scroller').position().top, @@ -346,6 +347,7 @@ if($.support.touch) { $el.eq($blockIndex).hasClass('active') ? '':$el.eq($blockIndex).children('span').addClass('hover'); }, mouseleave: function() { + $sidebar.removeClass('on'); $block.removeClass('show'); if(!$sidebarState || !$el.hasClass('active')) { $blockList.css({'width': 0}); diff --git a/app/assets/stylesheets/basic/global.css b/app/assets/stylesheets/basic/global.css index c22a181..0ef6f12 100644 --- a/app/assets/stylesheets/basic/global.css +++ b/app/assets/stylesheets/basic/global.css @@ -49,7 +49,7 @@ input:focus::-webkit-input-placeholder { color: transparent; } body { - background-color: #F3F3F3; + background-color: #f3f3f3; font-family: 'Chivo'; } body.modalBlur > nav, @@ -319,6 +319,18 @@ legend { background-color: rgba(0, 136, 204, .6); } +/* sidebar on */ +#sidebar.on ~ #main-wrap .fc-border-separate { + table-layout: fixed; +} + +#sidebar.on ~ #main-wrap .fc-view-month .fc-day-header { + width: auto !important; +} + +#sidebar.on ~ #main-wrap .fc-view-agendaWeek .fc-widget-header.fc-last { + width: 15px !important; +} /* Main Wrap */ #main-wrap { diff --git a/app/assets/stylesheets/lib/group/_group-classes.scss b/app/assets/stylesheets/lib/group/_group-classes.scss index c5966fb..095c33d 100644 --- a/app/assets/stylesheets/lib/group/_group-classes.scss +++ b/app/assets/stylesheets/lib/group/_group-classes.scss @@ -41,6 +41,15 @@ color: $white; background-color: $blue; } + + &.gray { + color: $dark-gray; + border: 2px solid $dark-gray; + &:hover { + color: $white; + background-color: $dark-gray; + } + } } .button-activated { @@ -241,10 +250,44 @@ } } +// responsive grid +.square { + float: left; + position: relative; + width: 20%; + padding-bottom: 20%; + margin: 1%; + background-color: $white; + overflow: hidden; + .content { + position: absolute; + height: 90%; + width: 90%; + padding: 5%; + .rs { + width: auto; + height: auto; + max-height: 90%; + max-width: 100%; + } + } + .table { + display: table; + width: 100%; + height: 100%; + } + .table-cell { + display: table-cell; + vertical-align: middle; + } + +} + // avatar .admin-avatar { width: 60px; height: 60px; + max-width: none; border-radius: $round; } diff --git a/app/assets/stylesheets/lib/group/_group-post.scss b/app/assets/stylesheets/lib/group/_group-post.scss index fc5dd26..96b9943 100644 --- a/app/assets/stylesheets/lib/group/_group-post.scss +++ b/app/assets/stylesheets/lib/group/_group-post.scss @@ -32,6 +32,12 @@ width: auto; max-width: 100%; height: auto; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + margin: auto; } .group-post-bar { @@ -121,7 +127,8 @@ text-align: justify; } -.group-post-member-count { +.group-post-member-count, +.group-post-no-member { background: $blue; color: $white; padding: 6px 0.625rem; diff --git a/app/assets/stylesheets/lib/group/_group-show-post.scss b/app/assets/stylesheets/lib/group/_group-show-post.scss index 24f1c05..cf14b35 100644 --- a/app/assets/stylesheets/lib/group/_group-show-post.scss +++ b/app/assets/stylesheets/lib/group/_group-show-post.scss @@ -58,6 +58,7 @@ .group-show-post-image-wrap { position: relative; background: $black; + overflow: hidden; &:hover { .cycle-nav { opacity: 1; diff --git a/app/assets/stylesheets/lib/group/group-admin.scss b/app/assets/stylesheets/lib/group/group-admin.scss index 7892700..67cc02c 100644 --- a/app/assets/stylesheets/lib/group/group-admin.scss +++ b/app/assets/stylesheets/lib/group/group-admin.scss @@ -119,6 +119,21 @@ body { // members page +.existing-phone-avatar { + vertical-align: top; + margin: 0 0.5rem 0.5rem 0; +} +.existing-member-count { + width: 60px; + height: 60px; + display: inline-block; + box-sizing: border-box; + line-height: 40px; + text-align: center; + white-space: nowrap; + padding: 8px 0.45rem; + font-size: 0.8125rem; +} .group-edit-button { box-sizing: border-box; vertical-align: top; @@ -128,4 +143,87 @@ body { display: inline-block; text-align: center; font-size: 0.8125rem; +} + +.group-edit-avatar { + width: 60; +} + +.group-member-edit-table { + width: 100%; + tr { + border-bottom: 1px solid $gray; + } + td { + padding: 8px 0.75rem; + &:first-child { + width: 60px; + } + } + .make-admin-checkbox { + display: inline-block; + vertical-align: top; + margin-right: 0.3125rem; + } + .group-member-permission { + display: inline-block; + vertical-align: text-top; + } + +} +.group-admin-edit-image-wrap { + margin: 0 24px 1rem 0; +} +.group-admin-edit-image-item { + margin-bottom: 16px; + padding: 16px 0.5rem; +} +.group-admin-edit-image-container { + float: left; + width: 15%; + min-width: 150px; + margin: 0 1rem 16px 0; +} + +.group-admin-edit-checkbox-wrap { + color: $white; + font-size: 0.8125rem; + background: $blue; + padding: 2px 0.625rem; + border-radius: $general; + float: left; +} +.group-admin-edit-image-checkbox { + display: inline-block; + vertical-align: top; +} +.group-admin-edit-image-label { + display: inline-block; + vertical-align: text-top; + font-size: 0.75rem; +} +.group-admin-edit-image-item-inner { + padding: 16px 0.625rem; + background: $white; + border-radius: $general; +} +.group-admin-edit-file-wrap { + margin-bottom: 10px; +} +.group-admin-edit-file-item { + padding: 10px 16px; + float: left; + margin: 0 8px 0.5rem 0; + font-size: 0.8125rem; + .group-admin-edit-file-checkbox { + margin: 0; + } +} +.group-admin-edit-filename { + margin-right: 0.3125rem; +} +.group-admin-edit-file-delete { + padding-bottom: 4px; + border-bottom: 1px dotted $red; + vertical-align: top; } \ No newline at end of file diff --git a/app/controllers/admin/groups_controller.rb b/app/controllers/admin/groups_controller.rb index 8d7dfdd..9f7fd6a 100644 --- a/app/controllers/admin/groups_controller.rb +++ b/app/controllers/admin/groups_controller.rb @@ -76,6 +76,20 @@ class Admin::GroupsController < OrbitGroupController def members render_401 and return if !user_can_read? + @group_members = [] + @group.users.each do |user| + mp = user.member_profile rescue nil + if !mp.nil? + avatar = (mp.avatar.thumb.url == "thumb_person.png" ? "/assets/thumb_person.png" : mp.avatar.thumb.url rescue "/assets/thumb_person.png") + @group_members << { + "id" => user.id.to_s, + "user_name" => (user.user_name rescue ""), + "avatar" => avatar, + "name" => (mp.name_translations rescue {"en" => "","zh_tw" => ""}), + "admin" => @group.admins.include?(user.id.to_s) + } + end + end end def create_category diff --git a/app/controllers/admin/store_controller.rb b/app/controllers/admin/store_controller.rb index 80632ba..e8198ab 100644 --- a/app/controllers/admin/store_controller.rb +++ b/app/controllers/admin/store_controller.rb @@ -37,6 +37,33 @@ class Admin::StoreController < OrbitAdminController render :json => data.to_json end + def authorize_default_modules + modules = ModuleApp.all + ids = modules.collect{|ma| ma.key} + store_token = Site.first.store_token rescue nil + if !store_token.nil? + module_apps = ModuleApp.all + params_to_send = {'store_token' => store_token, "apps" => ids} + uri = URI.parse(OrbitStore::URL) + http = Net::HTTP.new(uri.host,uri.port) + request = Net::HTTP::Post.new("/store/register_old_sites_modules") + request.body = params_to_send.to_query + response = http.request(request) rescue nil + if response.nil? + render :json => {"success" => false, "message" => "Could not connect to the store."}.to_json + else + data = JSON.parse(response.body) + if data["success"] + render :json => {"success" => true}.to_json + elsif !data["success"] + render :json => {"success" => false, "message" => data["message"]}.to_json + end + end + else + render :json => {"success" => false, "message" => "Cannot register modules, site is not registered with store."}.to_json + end + end + def check_permissions params_to_send = {'store_token' => current_site.store_token} uri = URI.parse(@store_url) diff --git a/app/templates/orbit_bootstrap/assets/stylesheets/template/base/_variables.scss b/app/templates/orbit_bootstrap/assets/stylesheets/template/base/_variables.scss index 7e86c90..f872d5a 100644 --- a/app/templates/orbit_bootstrap/assets/stylesheets/template/base/_variables.scss +++ b/app/templates/orbit_bootstrap/assets/stylesheets/template/base/_variables.scss @@ -2,6 +2,7 @@ // Base Color $theme-gray: #495054; +$theme-gray-subtle: #ddd; $theme-gray-light: #cecece; $theme-gray-lighter: #f3f3f3; $theme-gray-dark: #363636; diff --git a/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/calendar.scss b/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/calendar.scss new file mode 100644 index 0000000..1d83c9f --- /dev/null +++ b/app/templates/orbit_bootstrap/assets/stylesheets/template/modules/calendar.scss @@ -0,0 +1,66 @@ +@charset "utf-8"; + +.w-calendar { + width: 100%; + position: relative; + + .widget-title { + text-align: center; + border: 1px solid $theme-gray-subtle; + margin: 0; + padding: 8px 0; + } + + th { + background: $theme-color-main; + color: $theme-white; + text-align: center; + font-size: 0.8125rem; + } + + td { + border: 1px solid $theme-gray-subtle; + text-align: center; + font-size: 0.8125rem; + } + .loading { + &:after { + content: '\f1ce'; + font-family: FontAwesome; + animation: 2s linear 0s normal none infinite running fa-spin; + } + } +} +.w-calendar-table { + margin-bottom: 0; + .w-calendar-today { + background: $theme-color-main; + color: $theme-white; + } + .w-calendar-event { + background: $theme-color-third; + color: $theme-white; + } + +} + +.w-calendar-nav { + a { + position: absolute; + top: 8px; + left: 10px; + color: $theme-color-main; + } + .w-calendar-nav-next { + left: auto; + right: 10px; + } +} +@keyframes fa-spin { +0% { + transform: rotate(0deg); +} +100% { + transform: rotate(359deg); +} +} \ No newline at end of file diff --git a/app/templates/orbit_bootstrap/assets/stylesheets/template/template.scss b/app/templates/orbit_bootstrap/assets/stylesheets/template/template.scss index ef7c34f..24d175f 100644 --- a/app/templates/orbit_bootstrap/assets/stylesheets/template/template.scss +++ b/app/templates/orbit_bootstrap/assets/stylesheets/template/template.scss @@ -12,15 +12,7 @@ @import "layout/footer"; // Modules -@import "modules/menu"; -@import "modules/ad_banner"; -@import "modules/announcement"; -@import "modules/faq"; -@import "modules/web_resource"; -@import "modules/gallery"; -@import "modules/archives"; -@import "modules/member"; -@import "modules/personal_plugin"; +@import "modules/*"; // Widget @import "widget/breadcrumb"; diff --git a/app/templates/orbit_bootstrap/modules/calendar/_calendar_widget1.html.erb b/app/templates/orbit_bootstrap/modules/calendar/_calendar_widget1.html.erb new file mode 100644 index 0000000..c3aa11c --- /dev/null +++ b/app/templates/orbit_bootstrap/modules/calendar/_calendar_widget1.html.erb @@ -0,0 +1,58 @@ +
+
+

+ + +

+ + + + + + + + + + + + + + +
SunMonTueWedThuFriSat
+
+
+ + \ No newline at end of file diff --git a/app/templates/orbit_bootstrap/modules/calendar/info.json b/app/templates/orbit_bootstrap/modules/calendar/info.json new file mode 100644 index 0000000..02d8167 --- /dev/null +++ b/app/templates/orbit_bootstrap/modules/calendar/info.json @@ -0,0 +1,22 @@ +{ + "frontend": [ + { + "filename" : "index", + "name" : { + "zh_tw" : "1. 行事曆", + "en" : "1. Calendar" + }, + "thumbnail" : "thumb.png" + } + ], + "widgets" : [ + { + "filename" : "calendar_widget1", + "name" : { + "zh_tw" : "1. 行事曆", + "en" : "1. Calendar" + }, + "thumbnail" : "thumb.png" + } + ] +} \ No newline at end of file diff --git a/app/templates/orbit_bootstrap/modules/calendar/thumbs/thumb.png b/app/templates/orbit_bootstrap/modules/calendar/thumbs/thumb.png new file mode 100644 index 0000000..266af56 Binary files /dev/null and b/app/templates/orbit_bootstrap/modules/calendar/thumbs/thumb.png differ diff --git a/app/templates/orbit_bootstrap/modules/gallery/_gallery_widget1.html.erb b/app/templates/orbit_bootstrap/modules/gallery/_gallery_widget1.html.erb index 948a079..9c43572 100644 --- a/app/templates/orbit_bootstrap/modules/gallery/_gallery_widget1.html.erb +++ b/app/templates/orbit_bootstrap/modules/gallery/_gallery_widget1.html.erb @@ -13,7 +13,7 @@ data-cycle-log="false" data-cycle-carousel-fluid="true"> - + {{alt_title}} diff --git a/app/templates/orbit_bootstrap/modules/gallery/_gallery_widget2.html.erb b/app/templates/orbit_bootstrap/modules/gallery/_gallery_widget2.html.erb index 564938a..c697c16 100644 --- a/app/templates/orbit_bootstrap/modules/gallery/_gallery_widget2.html.erb +++ b/app/templates/orbit_bootstrap/modules/gallery/_gallery_widget2.html.erb @@ -4,7 +4,7 @@
- + {{alt_title}}
\ No newline at end of file diff --git a/app/templates/orbit_bootstrap/modules/gallery/gallery_index1.html.erb b/app/templates/orbit_bootstrap/modules/gallery/gallery_index1.html.erb index 43e8abd..8652575 100644 --- a/app/templates/orbit_bootstrap/modules/gallery/gallery_index1.html.erb +++ b/app/templates/orbit_bootstrap/modules/gallery/gallery_index1.html.erb @@ -6,7 +6,7 @@
- + {{alt_title}}

diff --git a/app/templates/orbit_bootstrap/modules/gallery/show.html.erb b/app/templates/orbit_bootstrap/modules/gallery/show.html.erb index ff95b43..e9b373b 100644 --- a/app/templates/orbit_bootstrap/modules/gallery/show.html.erb +++ b/app/templates/orbit_bootstrap/modules/gallery/show.html.erb @@ -7,7 +7,7 @@ diff --git a/app/views/admin/groups/_group_existing_member.html.erb b/app/views/admin/groups/_group_existing_member.html.erb index 97932ff..f326cf4 100644 --- a/app/views/admin/groups/_group_existing_member.html.erb +++ b/app/views/admin/groups/_group_existing_member.html.erb @@ -7,7 +7,7 @@ " class="existing-phone-avatar admin-avatar" src="<%= em["avatar"] %>" /> <% end %> <% if i == existing_members_limit %> - … <%= (@existing_members.count - existing_members_limit).to_s %> more. + <%= (@existing_members.count - existing_members_limit).to_s %> more <% break end %> <% end %> diff --git a/app/views/admin/groups/_group_form.html.erb b/app/views/admin/groups/_group_form.html.erb index cb3d71f..a65361d 100644 --- a/app/views/admin/groups/_group_form.html.erb +++ b/app/views/admin/groups/_group_form.html.erb @@ -95,7 +95,7 @@ name = member["name"][I18n.locale.to_s] == "" ? member["name"]["zh_tw"] : member["name"][I18n.locale.to_s] name = "" if name.nil? user_name = "(#{member["user_name"]})" - text = "#{name} #{user_name}" + text = " #{name} #{user_name}" %> <% end %> diff --git a/app/views/admin/groups/_post.html.erb b/app/views/admin/groups/_post.html.erb index 22cb99e..e04f562 100644 --- a/app/views/admin/groups/_post.html.erb +++ b/app/views/admin/groups/_post.html.erb @@ -1,15 +1,14 @@
- -
- -
    +
      <% if post.author.to_s != current_user.id.to_s %>
    • - - Flag inappropriate + + Flag inappropriate
    • <% else %> @@ -31,40 +30,15 @@
+ <% if !post.group_post_images.blank? %> <%= post.title %> <% else %> Post image <% end %> +
-<<<<<<< Updated upstream -

- <%= post.title %> -

-
- <% content = strip_tags post.content %> - <%= content[0..250] %> - <%= "..." if content.length > 350 %> -
- -=======

<%= post.title %> @@ -92,6 +66,5 @@

->>>>>>> Stashed changes

diff --git a/app/views/admin/groups/_post_form.html.erb b/app/views/admin/groups/_post_form.html.erb index 768be7a..cc22fb9 100644 --- a/app/views/admin/groups/_post_form.html.erb +++ b/app/views/admin/groups/_post_form.html.erb @@ -34,12 +34,19 @@
<% if params[:action] == "editpost" %> -
+
<% @grouppost.group_post_images.each do |gpi| %> - - - Delete Image - +
+
+
+ +
+
+ + +
+
+
<% end %>
<% end %> @@ -82,12 +89,17 @@
<% if params[:action] == "editpost" %> -
+
<% @grouppost.group_post_files.each do |gpf| %> - - <%= File.basename(gpf.file.path) %> - Delete File - +
+ + <%= File.basename(gpf.file.path) %> + + + + Delete File + +
<% end %>
<% end %> @@ -100,7 +112,6 @@
-
diff --git a/app/views/admin/groups/edit.html.erb b/app/views/admin/groups/edit.html.erb index e299ffe..187a33c 100644 --- a/app/views/admin/groups/edit.html.erb +++ b/app/views/admin/groups/edit.html.erb @@ -1,5 +1,6 @@ <% content_for :page_specific_css do -%> <%= stylesheet_link_tag "//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" %> + <%= stylesheet_link_tag "lib/group/group-admin" %> <% end -%> <%= form_for @group, :url => admin_group_path(@group.id), :html => { :multipart => true , :class=>"form-horizontal main-forms"} do |f| %> @@ -16,14 +17,17 @@