File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
<%--
게시글 등록/수정 화면 공통 : 공지 여부 + 공지 기간 입력 행
- 게시판 설정의 공지기능(noticeYn)이 'Y' 인 경우에만 노출
- 저장 시 fn_egov_regist_notice() 에서 ntceBgnde / ntceEndde (yyyyMMddHHmm) hidden 값으로 변환
--%>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<c:if test="${bdMstr.noticeYn == 'Y'}">
<c:set var="_bg" value="${board.ntceBgnde}"/>
<c:set var="_ed" value="${board.ntceEndde}"/>
<jsp:useBean id="_now" class="java.util.Date"/>
<fmt:formatDate var="_today" value="${_now}" pattern="yyyy-MM-dd"/>
<c:set var="_bgDate" value="${fn:length(_bg) ge 8 ? fn:substring(_bg,0,4).concat('-').concat(fn:substring(_bg,4,6)).concat('-').concat(fn:substring(_bg,6,8)) : _today}"/>
<c:set var="_edDate" value="${fn:length(_ed) ge 8 ? fn:substring(_ed,0,4).concat('-').concat(fn:substring(_ed,4,6)).concat('-').concat(fn:substring(_ed,6,8)) : ''}"/>
<c:set var="_bgHH" value="${fn:length(_bg) ge 10 ? fn:substring(_bg,8,10) : '00'}"/>
<c:set var="_bgMM" value="${fn:length(_bg) ge 12 ? fn:substring(_bg,10,12) : '00'}"/>
<c:set var="_edHH" value="${fn:length(_ed) ge 10 ? fn:substring(_ed,8,10) : '23'}"/>
<c:set var="_edMM" value="${fn:length(_ed) ge 12 ? fn:substring(_ed,10,12) : '59'}"/>
<%-- 기한 없음 : 기본값. 기존 공지글은 종료일이 9999년이거나 기간이 없으면 기한 없음으로 표시 --%>
<c:set var="_unlimited" value="${board.noticeAt ne 'Y' or fn:length(_ed) lt 8 or fn:startsWith(_ed, '9999')}"/>
<c:if test="${_unlimited}">
<c:set var="_bgDate" value="${_today}"/><c:set var="_bgHH" value="00"/><c:set var="_bgMM" value="00"/>
<c:set var="_edDate" value=""/><c:set var="_edHH" value="23"/><c:set var="_edMM" value="59"/>
</c:if>
<tr>
<th>공지여부</th>
<td>
<label style="margin-right:20px;">
<input type="checkbox" name="noticeAt" id="noticeAt" value="Y" style="margin-right:5px;" <c:if test="${board.noticeAt eq 'Y'}">checked="checked"</c:if> />공지로 등록
</label>
<span class="notice_unlimited_wrap" style="margin-right:20px;">
<label style="margin-right:12px;">
<input type="radio" name="ntcePeriodType" id="ntceUnlimited" value="N" style="margin-right:5px;" <c:if test="${_unlimited}">checked="checked"</c:if> />기한 없음
</label>
<label>
<input type="radio" name="ntcePeriodType" id="ntcePeriodSet" value="P" style="margin-right:5px;" <c:if test="${not _unlimited}">checked="checked"</c:if> />기간 지정
</label>
</span>
<span class="notice_period">
<input type="date" id="ntceBgndeYYYMMDD" class="input" style="width:auto;" value="${_bgDate}" />
<select id="ntceBgndeHH" class="sel" style="width:auto;">
<c:forEach var="t" items="${ntceBgndeHH}"><c:if test="${t.code ne '24'}"><option value="${t.code}" <c:if test="${t.code eq _bgHH}">selected="selected"</c:if>>${t.codeNm}</option></c:if></c:forEach>
</select>시
<select id="ntceBgndeMM" class="sel" style="width:auto;">
<c:forEach var="t" items="${ntceBgndeMM}"><c:if test="${t.code ne '60'}"><option value="${t.code}" <c:if test="${t.code eq _bgMM}">selected="selected"</c:if>>${t.codeNm}</option></c:if></c:forEach>
</select>분
~
<input type="date" id="ntceEnddeYYYMMDD" class="input" style="width:auto;" value="${_edDate}" />
<select id="ntceEnddeHH" class="sel" style="width:auto;">
<c:forEach var="t" items="${ntceEnddeHH}"><c:if test="${t.code ne '24'}"><option value="${t.code}" <c:if test="${t.code eq _edHH}">selected="selected"</c:if>>${t.codeNm}</option></c:if></c:forEach>
</select>시
<select id="ntceEnddeMM" class="sel" style="width:auto;">
<c:forEach var="t" items="${ntceEnddeMM}"><c:if test="${t.code ne '60'}"><option value="${t.code}" <c:if test="${t.code eq _edMM}">selected="selected"</c:if>>${t.codeNm}</option></c:if></c:forEach>
</select>분
</span>
<p style="margin-top:6px;color:#888;font-size:13px;">공지로 등록하면 사용자 게시판 목록 맨 위에 '공지'로 고정됩니다. 기간을 지정하면 종료 시각 이후 일반 글로 돌아갑니다.</p>
<script type="text/javascript">
$(function(){
// 공지 체크 시 [기한 없음 / 기간 지정] 노출, 기간 지정 선택 시에만 기간 입력 노출
function fn_toggle_notice_period(){
var isNotice = $('#noticeAt').is(':checked');
var isUnlimited = $('#ntceUnlimited').is(':checked');
$('.notice_unlimited_wrap').toggle(isNotice);
$('.notice_period').toggle(isNotice && !isUnlimited);
}
$('#noticeAt, input[name=ntcePeriodType]').on('change', fn_toggle_notice_period);
fn_toggle_notice_period();
});
</script>
</td>
</tr>
</c:if>