Skip to content

Commit

Permalink
change machine link plugin name
Browse files Browse the repository at this point in the history
  • Loading branch information
Pooya-Oladazimi committed Jun 8, 2023
1 parent 881b817 commit 6ccd256
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions ckanext/crc1153/controllers/crcSpecificMetadataController.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ def save_metadata():
# raise
return toolkit.abort(500, "")

if Commons.check_plugin_enabled("semantic_media_wiki"):
return redirect(h.url_for('semantic_media_wiki.machines_view', id=str(package_name) , _external=True))
if Commons.check_plugin_enabled("machine_link"):
return redirect(h.url_for('machine_link.machines_view', id=str(package_name) , _external=True))

return redirect(h.url_for('dataset.read', id=str(package_name) , _external=True))

Expand Down
6 changes: 3 additions & 3 deletions ckanext/crc1153/controllers/systemStatsController.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from sqlalchemy.sql.expression import false
from ckan.model import Package, Group, User

if Commons.check_plugin_enabled("semantic_media_wiki"):
if Commons.check_plugin_enabled("machine_link"):
from ckanext.semantic_media_wiki.libs.media_wiki import Helper as machineHelper

if Commons.check_plugin_enabled("sample_link"):
Expand Down Expand Up @@ -82,7 +82,7 @@ def get_user_count():

@staticmethod
def get_linked_machines_count():
if not Commons.check_plugin_enabled("semantic_media_wiki"):
if not Commons.check_plugin_enabled("machine_link"):
return [0, 0]
count = 0
dataset_count = 0
Expand Down Expand Up @@ -213,7 +213,7 @@ def get_dataset_with_publication():

@staticmethod
def get_dataset_with_machines():
if not Commons.check_plugin_enabled("semantic_media_wiki"):
if not Commons.check_plugin_enabled("machine_link"):
return []
result_datasets = []
dataset_found = False
Expand Down
2 changes: 1 addition & 1 deletion ckanext/crc1153/libs/crc_layout/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Helper():

@staticmethod
def stages_count():
plugins_with_stages = ['crc1153_specific_metadata', 'organization_group', 'semantic_media_wiki', 'sample_link']
plugins_with_stages = ['crc1153_specific_metadata', 'organization_group', 'machine_link', 'sample_link']
enabled_plugins = toolkit.config.get("ckan.plugins")
count = 0
for pl in plugins_with_stages:
Expand Down
4 changes: 2 additions & 2 deletions ckanext/crc1153/libs/crc_profile/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

if Commons.check_plugin_enabled("dataset_reference"):
from ckanext.dataset_reference.models.package_reference_link import PackageReferenceLink
if Commons.check_plugin_enabled("semantic_media_wiki"):
if Commons.check_plugin_enabled("machine_link"):
from ckanext.semantic_media_wiki.libs.media_wiki import Helper as mediaWikiHelper
if Commons.check_plugin_enabled("sample_link"):
from ckanext.semantic_media_wiki.libs.sample_link import SampleLinkHelper
Expand Down Expand Up @@ -50,7 +50,7 @@ def get_linked_publication(dataset_name):

@staticmethod
def get_linked_machines(resource_id):
if not Commons.check_plugin_enabled("semantic_media_wiki"):
if not Commons.check_plugin_enabled("machine_link"):
return {}
# a dict of machines [machine_name:machine_link]
return mediaWikiHelper.get_machine_link(resource_id)
Expand Down
4 changes: 2 additions & 2 deletions ckanext/crc1153/templates/package/resource_read.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@
{% endif %}
</tr>
{# machine links #}
{% if h.is_plugin_enabled("semantic_media_wiki") %}
{% if h.is_plugin_enabled("machine_link") %}
{% asset 'ckanext-semantic-media-wiki/resource-machine-js' %}
<tr>
{% set resource_id = resource['id'] %}
{% set dest_url = h.url_for('semantic_media_wiki.get_resource_machine', id=resource_id, _external=True) %}
{% set dest_url = h.url_for('machine_link.get_resource_machine', id=resource_id, _external=True) %}
<input type="hidden" id="get_link_url" value='{{dest_url}}'>
<th scope="row">{{ _('Linked Equipment') }}</th>
<td><div id="equipment_list"></div></td>
Expand Down

0 comments on commit 6ccd256

Please sign in to comment.