Article previous html

From Redazione
Jump to navigation Jump to search
Line 290: Line 290:
 
  var month = $(this).find('[name="Form article[month]"]').val();
 
  var month = $(this).find('[name="Form article[month]"]').val();
 
  var year = $(this).find('[name="Form article[year]"]').val();
 
  var year = $(this).find('[name="Form article[year]"]').val();
 +
var day = $(this).find('[name="Form article[day]"]').val();
 +
 +
var required = {
 +
  article: ['Title,'Authors'],
 +
  post: ['Title,'month','year'],
 +
  news: ['Title,'day', 'month','year']
 +
}
 +
 +
if(required.hasOwnProperty(type))) {
 +
  for(var i in required[type])) {
 +
  if(!$(this).find('[name="Form article[' + required[type][i] + ']"]').val()) {
 +
    alert('Please enter ' + type + ' ' + required[type][i]);
 +
    return false;
 +
  }
 +
  }
 +
}
  
 
  var obj_months = {
 
  var obj_months = {
Line 318: Line 334:
 
// && will not work correctly !
 
// && will not work correctly !
 
//  if(month && year)
 
//  if(month && year)
 
+
alert(month)
 
   var month_year = false;
 
   var month_year = false;
   if( month ) {
+
   if(month) {
 
     if(year) {
 
     if(year) {
 
     month_year = true;
 
     month_year = true;
 
     }
 
     }
 
   }
 
   }
 
+
alert(month_year)
 
   if(month_year) {
 
   if(month_year) {
 
     pagename += obj_months[month] + ' ' + year + ' - ' + title;
 
     pagename += obj_months[month] + ' ' + year + ' - ' + title;

Revision as of 08:28, 12 March 2020

Different kind of articles might be published in different categories.
Please enter first and last name of authors separated by comma.
The day is optional, and specifically for kind of ‘post” and ‘article” might be omitted.
(Optionally), insert one significant thread representing the article. It might be used as a preview of it.
(Optionally), enter or more tags relevant to this article: they might be used to insert it under one or more corresponding categories.