Cypress OVA导入后个性定制

记录Cypress OVA导入后的个性定制

配置SMTP,网站名称,域名等

1.修改json文件
cd /edx/app/edxapp

#修改lms.env.json
sudo vi lms.env.json
修改以下内容:
“BULK_EMAIL_DEFAULT_FROM_EMAIL”: “your email”, #设置成你的smtp邮箱 :11

"DEFAULT_FROM_EMAIL": "your email",     #设置成你的smtp邮箱:98

"EMAIL_BACKEND": "django.core.mail.backends.smtp.EmailBackend",
"EMAIL_HOST": "smtp.qq.com",  #内容修改成你的smtp主机,比如你的邮箱设置的QQ邮箱则是smtp.qq.com :106
"EMAIL_PORT": 25,
"EMAIL_USE_TLS": false,

"LMS_BASE": "x.edustack.org",    #你的平台域名,域名要解析到ip上,不然没用:154

"PLATFORM_NAME": "eduStack-X",   #内容修改成你的edX平台名字 :183

"SITE_NAME": "localhost",        #域名或ip,激活邮箱时调用:209

sudo vi cms.env.json
修改以下内容:
“BULK_EMAIL_DEFAULT_FROM_EMAIL”: “your email”, #设置成你的smtp邮箱 :7

"DEFAULT_FROM_EMAIL": "your email",     #设置成你的smtp邮箱:83

"EMAIL_BACKEND": "django.core.mail.backends.smtp.EmailBackend",
"EMAIL_HOST": "smtp.qq.com",   #内容修改成你的smtp主机,比如你的邮箱设置的QQ邮箱则是smtp.qq.com :89
"EMAIL_PORT": 25,
"EMAIL_USE_TLS": false,

"LMS_BASE": "x.edustack.org",    #你的平台域名,域名要解析到ip上,不然没用

"SITE_NAME": "localhost",        #域名,没有域名可用ip,激活邮箱时调用

sudo vi lms.auth.json
修改以下内容:
“EMAIL_HOST_PASSWORD”: “password”, #smtp邮箱密码:92
"EMAIL_HOST_USER": “email”, #邮箱:93

sudo vi cms.auth.json
修改以下内容:
“EMAIL_HOST_PASSWORD”: “password”, #smtp邮箱密码:75
"EMAIL_HOST_USER": “email”, #邮箱:76

重启: sudo /edx/bin/supervisorctl restart edxapp:

修改完这些现在可以注册了,点击注册注册下试试。

  **lms,cms前端的定制**



1.更换logo文件

我用的是xshell连接的Ubuntu服务器,可以使用lrzsz代替ftp上传和下载文件。
sudo apt-get install lrzsz     #安装lrzsz
cd  ~                          #回到用户目录下,其他目录会提示权限不够

把新的logo图标拖到xhell界面里,正常情况下会提示传输完毕。现在ls 一下就能查看到logo.png文件。

cd /edx/app/edxapp/edx-platform/lms/static/images/default-theme  #进入logo图标所在位置
sudo rm logo.png        #删除原logo文件
sudo cp ~/logo.png .    #将logo文件移动到当前目录

此时我们查看首页还是原来的logo,需要更新assets.
使用下面的命令:
sudo -H -u edxapp bash 
source /edx/app/edxapp/edxapp_env 
cd /edx/app/edxapp/edx-platform 
paver update_assets lms --settings=aws

退出edxapp账户并重启edxapp:
exit
sudo /edx/bin/supervisorctl restart edxapp:



1.1 也可以通过修改navigation.html的url修改logo

将logo.png上传到用户目录下
cd /edx/app/edxapp/edx-platform/lms/static/images 
sudo mv ~/logo .     #将logo图标移动到当前文件夹

修改navigation.html:
cd  /edx/app/edxapp/edx-platform/lms/templates
sudo cp navigation.html navigation.html.bak  #修改前先备份
sudo vi  navigation.html
找到
`<img src="${static.url(branding.get_logo_url())}"alt="${platform_name()}"/>`   这行代码(tips:vi编辑器键入 /内容 可以查找要查找的内容)
将其修改成`<img src="/static/images/default-theme/logo.png" alt="${platform_name()}"/>`
更新assets后也能修改logo




2.删除lms底部open edX logo和edX版权声明

sudo vi /edx/app/edxapp/edx-platform/lms/templates/footer.html

删除以下内容:
    % if not hide_openedx_link:
    <div class="footer-about-openedx">
      <p>
        <a href="${footer['openedx_link']['url']}">
          <img src="${footer['openedx_link']['image']}" alt="${footer['openedx_link']['title']}" width="140" />
        </a>
      </p>
    </div>
    % endif
(ps.你也可以把这个logo和链接换成你自己的,不要使用open edx的就行)

底部logo在:
<img alt="organization logo" src="static/images/default-theme/es-logo-small.png">  (40行)可更换图片或者修改url文件更换

删除 OpenedX-OVA-Cypress is maintained by edustack.org & easiedu.com  (41行)

保存退出并重启edxapp生效:



3.添加更换lms首页背景图
sudo vi /edx/app/edxapp/edx-platform/lms/templates/index.html
找到  <header>   (21行)
修改为<header style="background:url('/static/images/default-theme/background.jpg');background-size:cover"
(背景图片放在:/edx/app/edxapp/edx-platform/lms/å/images/default-theme下面)



4.添加查找课程界面背景图
sudo vi /edx/app/edxapp/edx-platform/lms/templates/courseware/courses.html 
找到<header class="search">
修改为:<header class="search" style="background:url('/static/images/default-theme/background1.jpg');background-size:cover">
背景图可以是和首页图片一样也可以是另外一张图



5.修改cms logo
sudo vi /edx/app/edxapp/edx-platform/cms/templates/widgets/header.html
修改
       % if settings.FEATURES.get('IS_EDX_DOMAIN', False):
        <img src="${static.url("images/edx-theme/edx-studio-logo.png")}" alt="${settings.STUDIO_NAME}" />
      % else:
        <img src="${static.url("images/default-theme/logo.png")}" alt="${settings.STUDIO_NAME}" />
      % endif
为
    <div class="wrapper wrapper-l">
      <h1 class="branding"><a href="/">
      % if settings.FEATURES.get('IS_EDX_DOMAIN', False):
        <img src="/static/images/default-theme/logo.png" alt="${settings.STUDIO_NAME}" />
      % else:
        <img src="/static/images/default-theme/logo.png" alt="${settings.STUDIO_NAME}" />
      % endif
(图片上传到edx/app/edxapp/edx-platform/cms/static/images/default-theme/logo.png目录下)



6.删除底部Open edX图标和版权说明
sudo vi /edx/app/edxapp/edx-platform/cms/templates/widgets/footer.html
删除
    <div class="footer-content-secondary" aria-label="{_('Legal')}">
      <div class="footer-about-copyright">
        ## Site operators: Please do not remove this paragraph! This attributes back to edX and makes your acknowledgement of edX's trademarks clear.
        <p>
          ## Translators: 'EdX', 'edX', 'Studio', and 'Open edX' are trademarks of 'edX Inc.'. Please do not translate any of these trademarks and company names.
          ${_("EdX, Open edX, Studio, and the edX and Open edX logos are registered trademarks or trademarks of {link_start}edX Inc.{link_end}").format(
            link_start=u"<a data-rel='edx.org' href='https://www.edx.org/'>",
            link_end=u"</a>"
          )}
        </p>
      </div>

      <div class="footer-about-openedx">
        <a href="http://open.edx.org" title="${_("Powered by Open edX")}">
          <img alt="${_("Powered by Open edX")}" src="https://files.edx.org/openedx-logos/edx-openedx-logo-tag.png">
        </a>
      </div>
    </div>
(31-48行)

更新cms assets生效
sudo -H -u edxapp bash 
source /edx/app/edxapp/edxapp_env 
cd /edx/app/edxapp/edx-platform 
paver update_assets cms --settings=aws
退出edxapp账户并重启
exit
退出edxapp账户并重启edxapp:

Powered by eduStack & ifLab