mods by joshua for groups and calendar and etc sdk

This commit is contained in:
rulingcom 2015-06-01 16:15:07 +08:00
parent 822a6932cd
commit a3033c548b
14 changed files with 281 additions and 23 deletions

View File

@ -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});

View File

@ -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 {

View File

@ -250,6 +250,39 @@
}
}
// 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;

View File

@ -172,11 +172,26 @@ body {
}
.group-admin-edit-image-wrap {
margin-bottom: 16px;
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;
@ -189,12 +204,11 @@ body {
}
.group-admin-edit-image-item-inner {
padding: 16px 0.625rem;
margin-right: 1rem;
background: $white;
border-radius: $general;
}
.group-admin-edit-file-wrap {
margin-bottom: 16px;
margin-bottom: 10px;
}
.group-admin-edit-file-item {
padding: 10px 16px;

View File

@ -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;

View File

@ -0,0 +1,50 @@
@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;
}
}
.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;
}
}

View File

@ -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";

View File

@ -0,0 +1,130 @@
<div class="w-calendar widget-calendar-1">
<div class='month_template'>
<h4 class="widget-title"></h4>
<div class="w-calendar-nav">
<a href="#" class="w-calendar-nav-prev">
<i class="fa fa-chevron-left"></i>
<span class="w-calendar-nav-prev-text hide">Prev</span>
</a>
<a href="#" class="w-calendar-nav-next">
<i class="fa fa-chevron-right"></i>
<span class="w-calendar-nav-next-text hide">Next</span>
</a>
</div>
<table class="table table-condensed w-calendar-table">
<thead>
<tr>
<th>Sun</th>
<th>Mon</th>
<th>Tue</th>
<th>Wed</th>
<th>Thu</th>
<th>Fri</th>
<th>Sat</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
<script>
if(typeof CalendarModuleMonth == "undefined"){
var CalendarModuleMonth = function(month,year,month_template){
_this = this;
this.monthDom = $("<div data-year='"+year+"' data-month='"+month+"'></div>");
var template = month_template,
monthNames = ['January','February','March','April','May','June','July','August','September','October','November','December'],
firstDay = new Date(year,month,1),
lastDay = new Date(year,month+1,0),
last_inserted_date = 1;
var renderMonth = function(){
var num_of_rows = getNumberOfRows(year,month)
for(var i = 0; i < num_of_rows; i++){
var tr = null;
if(i == 0){
tr = makeRow("first");
}else if(i == (num_of_rows - 1)){
tr = makeRow("last");
}else{
tr = makeRow("middle");
}
if(tr == null){
break;
}
template.find("table.table tbody").append(tr);
template.find("h4").text(monthNames[firstDay.getMonth()] + " " + firstDay.getFullYear());
}
_this.monthDom.append(template);
return _this.monthDom;
}
function getNumberOfRows(year, month) {
var day = 1,
sat_counter = 0,
sunday_counter = 0,
date = new Date(year, month, day);
while(date.getMonth() === month) {
if(date.getDay() === 0) {
sunday_counter++;
}else if(date.getDay() === 6) {
sat_counter++;
}
day++;
date = new Date(year, month, day);
}
return (sunday_counter == 5 && sat_counter == 5 ? 6 : 5);
}
var makeRow = function(position){
if(last_inserted_date <= lastDay.getDate()){
var row = $("<tr></tr>");
switch (position){
case "first":
for(var i = 0;i < 7;i++){
var td = $("<td></td>");
if(i >= firstDay.getDay()){
td.text(last_inserted_date);
td.attr("data-date-node",last_inserted_date+"-"+firstDay.getMonth()+"-"+firstDay.getFullYear());
last_inserted_date++;
}
row.append(td);
}
break;
case "middle":
for(var i = 0;i < 7;i++){
var td = $("<td></td>");
td.text(last_inserted_date);
td.attr("data-date-node",last_inserted_date+"-"+firstDay.getMonth()+"-"+firstDay.getFullYear());
last_inserted_date++;
row.append(td);
}
break;
case "last":
for(var i = 0;i < 7;i++){
var td = $("<td></td>");
if(i <= lastDay.getDay()){
td.text(last_inserted_date);
td.attr("data-date-node",last_inserted_date+"-"+firstDay.getMonth()+"-"+firstDay.getFullYear());
last_inserted_date++;
}
row.append(td);
}
break;
}
}else{
var row = null;
}
return row;
}
return renderMonth();
}
}
var date = new Date();
$(".w-calendar[data-subpart-id={{subpart-id}}]").html(new CalendarModuleMonth(date.getMonth(),date.getFullYear(),$(".w-calendar[data-subpart-id={{subpart-id}}] .month_template")));
</script>

View File

@ -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"
}
]
}

View File

@ -13,7 +13,7 @@
data-cycle-log="false"
data-cycle-carousel-fluid="true">
<a class="widget-pic" href="{{link_to_show}}" target="_blank">
<img src="{{thumb-src}}" alt="">
<img src="{{thumb-src}}" alt="{{alt_title}}">
</a>
</div>
</div>

View File

@ -4,7 +4,7 @@
</h3>
<div class="row widget-content" data-level="0" data-list="images">
<a class="widget-pic col-xs-4" href="{{link_to_show}}" target="_blank">
<img src="{{thumb-src}}" alt="">
<img src="{{thumb-src}}" alt="{{alt_title}}">
</a>
</div>
</div>

View File

@ -6,7 +6,7 @@
<div class="index-content col-xs-4 col-sm-3">
<div class="index-content-inner">
<div class="index-pic">
<img class="img-thumbnail" src="{{thumb-src}}" alt="">
<img class="img-thumbnail" src="{{thumb-src}}" alt="{{alt_title}}">
</div>
<section class="index-part">
<h4 class="index-content-title">

View File

@ -7,7 +7,7 @@
<div class="show-content-inner">
<div class="show-pic">
<a href="{{link_to_show}}">
<img class="img" src="{{thumb-src}}" alt="">
<img class="img" src="{{thumb-src}}" alt="{{alt_title}}">
</a>
</div>
</div>

View File

@ -36,15 +36,17 @@
<% if params[:action] == "editpost" %>
<div class="group-admin-edit-image-wrap clearfix">
<% @grouppost.group_post_images.each do |gpi| %>
<div class="group-admin-edit-image-item">
<div class="group-admin-edit-image-item card clearfix">
<div class="group-admin-edit-image-item-inner">
<div class="group-admin-edit-image-wrap">
<div class="group-admin-edit-image-container">
<img src="<%= gpi.image.thumb.url %>">
</div>
<div class="group-admin-edit-checkbox-wrap">
<input class="group-admin-edit-image-checkbox" type="checkbox" name="images_to_destroy[]" value="<%= gpi.id.to_s %>" />
<label class="group-admin-edit-image-label">Delete Image</label>
</div>
</div>
</div>
<% end %>
</div>
<% end %>