Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jcorex-100:Most read and most cited #68

Open
wants to merge 8 commits into
base: 8.x-1.x-dev
Choose a base branch
from
Open

Conversation

clal23
Copy link

@clal23 clal23 commented Sep 8, 2023

Jcorex-100:Most read and most cited

Copy link
Contributor

@RahulSatija49 RahulSatija49 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check all points

$alias = \Drupal::service('path_alias.manager')->getAliasByPath('/node/'.$nid);
$total_record[$alias] = $title;
}
$num_per_page = 3;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know use of this variable? this is hardcoded by value 3.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently there is no configuration is created for details page how many records we have to show on one page so hardcoded for now. In future we can create configuration page.

{{row.journal_title}} {{row.date_epub}} {{row.volume}}({{row.issue}}): {{ row.fpage }}-{{ row.lpage }}; DOI: https://doi.org/{{ row.doi}}
</p>
{% endfor %}
</ul>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check alignment

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

</ul>
<div class="text-center altmetrics-pager">{{ pager }}</a> </div>
</div>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove extra lines end of this file

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

<li><a href="{{key}}">{{ title }}</a></br><hr></li>
{% endfor %}
</ul>
<a href="/content/{{corpus}}/most-read" class="nav-toggle">Read More</a>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check alignment for a tag

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

];
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove extra line

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

padding-left:0px;
}
#mostcited ul li {
padding-left:0px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space issue
padding-left: 0px;

list-style-type: none;
}
#mostread .journals-articles-top ul>li:before, .page-node-type-page .block-region-right ul>li:before, .tab-content ul>li:before, ul.unorder-listing>li:before {
content: " " !important;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check important here in all place of css

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whenever possible I have removed the important from css this place require important
#mostread .journals-articles-top ul>li:before, .page-node-type-page .block-region-right ul>li:before, .tab-content ul>li:before, ul.unorder-listing>li:before {
content: " " !important;
width: 0px !important;
}

$alias = \Drupal::service('path_alias.manager')->getAliasByPath('/node/'.$nid);
$most_cited[$alias] = $title;
}
$build = [];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any use of this variable?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have removed this variable

$node = $rows['#node'];
$title = $node->get('title')->value;
$nid = $node->get('nid')->value;
$alias = \Drupal::service('path_alias.manager')->getAliasByPath('/node/'.$nid);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space issue in the end '/node/'. $nid

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

$mostCited = $block_manager->createInstance('most_read_cited_block', [
'read_cited' => $tab,
'view_mode' => 'default',
'limit' => 3,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again hardcoded limit value

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved the issue

Copy link
Contributor

@RahulSatija49 RahulSatija49 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few points added

@@ -83,8 +83,7 @@ function getData ($corpus,$tab) {
foreach ($authors as $key => $value) {
$author_names[$key] = $value['value'];
}
$authors_name = $author_names;
$authors=implode(' ',$authors_name);
$authors = implode(' ',$author_names);
$alias = \Drupal::service('path_alias.manager')->getAliasByPath('/node/'.$nid);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space issue . getAliasByPath('/node/'. $nid);

@@ -83,8 +83,7 @@ function getData ($corpus,$tab) {
foreach ($authors as $key => $value) {
$author_names[$key] = $value['value'];
}
$authors_name = $author_names;
$authors=implode(' ',$authors_name);
$authors = implode(' ',$author_names);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space issue $authors = implode(' ', $author_names);

@@ -3,9 +3,11 @@
<div id="mostread">
<ul>
{% for key, title in most_read %}
<li><a href="{{key}}">{{ title }}</a></br><hr></li>
<li>
<a href="{{key}}">{{ title }} </a>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra space after title : {{ title }}

@@ -28,8 +29,7 @@
{% endif %}
<hr>
{% endfor %}
</ul>
</ul>

<div class="text-center altmetrics-pager">{{ pager }}</a> </div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems wrong tag added by you .

{{ pager }}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is variable is used for pagination

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants