Skip to content

Commit

Permalink
latest updates, some filters & changes in API
Browse files Browse the repository at this point in the history
  • Loading branch information
jjnf committed Apr 8, 2017
1 parent 1251382 commit d6c93e2
Show file tree
Hide file tree
Showing 127 changed files with 25,985 additions and 122 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ function markaspot_logic_form_report_node_form_alter(&$form, &$form_state, $form
$form['field_e_mail'][LANGUAGE_NONE][0]['value']['#default_value'] = $user->mail;
}
$form['#validate'][] = 'markaspot_logic_validate';
$form['revision_information']['#access'] = FALSE;
}

/**
Expand Down
14 changes: 9 additions & 5 deletions profiles/markaspot/themes/ntxuva/js/ntxuva.js
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,10 @@ var lang_pt = {

$('.node-report-form #edit-submit').html(Drupal.t('Next'));

if (window.location.pathname.substr(window.location.pathname.length - 4) == 'edit') {
$('.node-report-form #edit-submit').html(Drupal.t('Save'));
}

var currentHash = document.location.hash.replace(/^#/, '');
if (currentHash) {
$('.nav-tabs a[href=#' + currentHash + ']').tab('show');
Expand All @@ -852,7 +856,7 @@ var lang_pt = {
}
);

if (linkHash.indexOf('4--') > -1 || linkHash.indexOf('---foto') > -1)  {
if (linkHash.indexOf('4--') > -1 || linkHash.indexOf('---foto') > -1 || window.location.pathname.substr(window.location.pathname.length - 4) == 'edit')  {
$('.node-report-form #edit-submit').html(Drupal.t('Save'));
}
else {
Expand All @@ -865,8 +869,8 @@ var lang_pt = {
currentHash = document.location.hash.replace(/^#/, '');
e.preventDefault();

if (!currentHash || currentHash.indexOf('1--') > -1 || currentHash.indexOf('---local') > -1) {
$('a:contains(2.)').tab('show');
if ((!currentHash || currentHash.indexOf('1--') > -1 || currentHash.indexOf('---local') > -1) && !(window.location.pathname.substr(window.location.pathname.length - 4) == 'edit')) {
$('a:contains(2.)').tab('show');
var hash = $('a:contains(2.)').attr('href');
// animate
$('html, body').animate({
Expand All @@ -887,7 +891,7 @@ var lang_pt = {
});
document.getElementById("edit-field-geo-und-0-address-field").disabled = false;
}
else if (currentHash.indexOf('3--') > -1 || currentHash.indexOf('---contacto') > -1) {
else if (currentHash.indexOf('3--') > -1 || currentHash.indexOf('---contacto') > -1) {
$('a:contains(4.)').tab('show');

var hash = $('a:contains(4.)').attr('href');
Expand All @@ -901,7 +905,7 @@ var lang_pt = {
$('#edit-submit').html(Drupal.t('Save'));
}

else if (currentHash.indexOf('4--') > -1 || currentHash.indexOf('---foto') > -1) {
else if (currentHash.indexOf('4--') > -1 || currentHash.indexOf('---foto') > -1 || window.location.pathname.substr(window.location.pathname.length - 4) == 'edit' ) {
$('form').unbind('submit').submit();
}
});
Expand Down
1 change: 0 additions & 1 deletion profiles/markaspot/themes/ntxuva/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ function ntxuva_preprocess_html(&$variables) {
);
drupal_add_html_head($ie_render_engine, 'meta_ie_render_engine');


}


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?php
/**
* @file
* Node template for reports
*/
?>
<article id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>>

<?php
// taxonomy_term_load($node->field_category[LANGUAGE_NONE][0]['taxonomy_term']['tid']);
$cat_tid = $node->field_category[LANGUAGE_NONE][0]['tid'];
$status_tid = $node->field_status[LANGUAGE_NONE][0]['tid'];
$category = taxonomy_term_load($cat_tid);
$status = taxonomy_term_load($status_tid);
?>
<div class="row">
<div class="col-md-6">
<header>
<?php print render($title_prefix); ?>
<?php if (!$page && $title): ?>
<h2<?php print $title_attributes; ?>><a href="<?php print $node_url; ?>"><?php print $title; ?></a></h2>
<?php endif; ?>
<?php print render($title_suffix); ?>
<?php if ($display_submitted): ?>
<span class="submitted">
<?php print $user_picture; ?>
<?php print $submitted; ?>
</span>
<?php endif; ?>
<div class="cat-stat-wrapper">
<span class="label label-default marker-category col-<?php echo $category->field_category_hex[LANGUAGE_NONE][0]['value'] ?> col-md-6"><i class="icon-li icon-<?php echo $category->field_category_icon[LANGUAGE_NONE][0]['value'] ?> "></i> <?php echo $category->name?> </span> <span class="label label-default marker-status col-<?php echo $status->field_status_hex[LANGUAGE_NONE][0]['value'] ?> col-md-6"><i class="icon-li icon-<?php echo $status->field_status_icon[LANGUAGE_NONE][0]['value'] ?>"></i> <?php echo $status->name ?></span>
<?php if (isset($node->field_address_id[LANGUAGE_NONE][0]['value'])): ?>
<span class="label label-default marker-status">Ponto:
<?php
$string = file_get_contents($GLOBALS['base_url'].'/georeport/v2/locations.json?id='.$node->field_address_id[LANGUAGE_NONE][0]['value']);
$json_a = json_decode($string, true);
if ($json_a) {
print $json_a[0]['location_name'];
}
?>
</span>
<?php endif; ?>

</div>
</header>
<?php
// Hide comments, tags, and links now so that we can render them later.
hide($content['comments']);
hide($content['links']);
hide($content['field_tags']);
print render($content['body']);
?>
<?php if (isset($content['field_address'])): ?>
<span class="label label-default marker-status col-md-6">Morada:</span>
<?php print render($content['field_address']); ?>
<?php endif; ?>
</div>
<div class="col-md-5 col-md-offset-1">
<?php print render($content['field_geo']); ?>
</div>
</div>


<?php if (!empty($content['field_tags']) || !empty($content['links'])): ?>
<footer>
<?php print render($content['field_tags']); ?>
<?php print render($content['links']); ?>
</footer>
<?php endif; ?>
<div class="row">
<div class="col-md-6">
<?php print render($content['comments']); ?>
<?php if (isset($content['field_statement'])): ?>
<?php print render($content['field_statement']); ?>
<?php endif; ?>
</div>
<div class="col-md-5 col-md-offset-1 ">
<?php if (!empty($content['field_image'])): ?>
<div class="node-gallery">
<?php print render($content['field_image']); ?>
</div>
<?php endif; ?>
</div>
</div>
</article> <!-- /.node -->

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?php
/**
* @file
* Node template for reports
*/
?>
<article id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>>

<?php
// taxonomy_term_load($node->field_category[LANGUAGE_NONE][0]['taxonomy_term']['tid']);
$cat_tid = $node->field_category[LANGUAGE_NONE][0]['tid'];
$status_tid = $node->field_status[LANGUAGE_NONE][0]['tid'];
$category = taxonomy_term_load($cat_tid);
$status = taxonomy_term_load($status_tid);
?>
<div class="row">
<div class="col-md-6">
<header>
<?php print render($title_prefix); ?>
<?php if (!$page && $title): ?>
<h2<?php print $title_attributes; ?>><a href="<?php print $node_url; ?>"><?php print $title; ?></a></h2>
<?php endif; ?>
<?php print render($title_suffix); ?>
<?php if ($display_submitted): ?>
<span class="submitted">
<?php print $user_picture; ?>
<?php print $submitted; ?>
</span>
<?php endif; ?>
<div class="cat-stat-wrapper">
<span class="label label-default marker-category col-<?php echo $category->field_category_hex[LANGUAGE_NONE][0]['value'] ?> col-md-6"><i class="icon-li icon-<?php echo $category->field_category_icon[LANGUAGE_NONE][0]['value'] ?> "></i> <?php echo $category->name?> </span> <span class="label label-default marker-status col-<?php echo $status->field_status_hex[LANGUAGE_NONE][0]['value'] ?> col-md-6"><i class="icon-li icon-<?php echo $status->field_status_icon[LANGUAGE_NONE][0]['value'] ?>"></i> <?php echo $status->name ?></span>
<?php if (isset($node->field_address_id[LANGUAGE_NONE][0]['value'])): ?>
<span class="label label-default marker-status">Ponto:
<?php
$string = file_get_contents($GLOBALS['base_url'].'/georeport/v2/locations.json?id='.$node->field_address_id[LANGUAGE_NONE][0]['value']);
$json_a = json_decode($string, true);
if ($json_a) {
print $json_a[0]['location_name'];
}
?>
</span>
<?php endif; ?>

</div>
</header>
<?php
// Hide comments, tags, and links now so that we can render them later.
hide($content['comments']);
hide($content['links']);
hide($content['field_tags']);
print render($content['body']);
?>
<?php if (isset($content['field_address'])): ?>
<span class="label label-default marker-status col-md-6">Morada:</span>
<?php print render($content['field_address']); ?>
<?php endif; ?>
</div>
<div class="col-md-5 col-md-offset-1">
<?php print render($content['field_geo']); ?>
</div>
</div>


<?php if (!empty($content['field_tags']) || !empty($content['links'])): ?>
<footer>
<?php print render($content['field_tags']); ?>
<?php print render($content['links']); ?>
</footer>
<?php endif; ?>
<div class="row">
<div class="col-md-6">
<?php print render($content['comments']); ?>
<?php if (isset($content['field_statement'])): ?>
<?php print render($content['field_statement']); ?>
<?php endif; ?>
</div>
<div class="col-md-5 col-md-offset-1 ">
<?php if (!empty($content['field_image'])): ?>
<div class="node-gallery">
<?php print render($content['field_image']); ?>
</div>
<?php endif; ?>
</div>
</div>
</article> <!-- /.node -->
Loading

0 comments on commit d6c93e2

Please sign in to comment.